From ecee1e47ab42ba3907d6bde7b2981e1006382071 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Wed, 17 Oct 2012 12:09:04 +0200 Subject: ARM: kirkwood: DT board setup for Network Space v2 and parents This patch adds DT board setup for LaCie Network Space v2 and parents, based on the Marvell Kirkwood 6281 SoC. This includes Network Space v2 (Max) and Internet Space v2. Signed-off-by: Simon Guinot Reviewed-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/board-ns2.c | 83 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 arch/arm/mach-kirkwood/board-ns2.c (limited to 'arch/arm/mach-kirkwood/board-ns2.c') diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c new file mode 100644 index 00000000000..b36c55cba78 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-ns2.c @@ -0,0 +1,83 @@ +/* + * Copyright 2012 (C), Simon Guinot + * + * arch/arm/mach-kirkwood/board-ns2.c + * + * LaCie Network Space v2 board (and parents) initialization for drivers + * not converted to flattened device tree yet. + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include "common.h" +#include "mpp.h" + +static struct mv643xx_eth_platform_data ns2_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(8), +}; + +static unsigned int ns2_mpp_config[] __initdata = { + MPP0_SPI_SCn, + MPP1_SPI_MOSI, + MPP2_SPI_SCK, + MPP3_SPI_MISO, + MPP4_NF_IO6, + MPP5_NF_IO7, + MPP6_SYSRST_OUTn, + MPP7_GPO, /* Fan speed (bit 1) */ + MPP8_TW0_SDA, + MPP9_TW0_SCK, + MPP10_UART0_TXD, + MPP11_UART0_RXD, + MPP12_GPO, /* Red led */ + MPP14_GPIO, /* USB fuse */ + MPP16_GPIO, /* SATA 0 power */ + MPP17_GPIO, /* SATA 1 power */ + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP20_SATA1_ACTn, + MPP21_SATA0_ACTn, + MPP22_GPIO, /* Fan speed (bit 0) */ + MPP23_GPIO, /* Fan power */ + MPP24_GPIO, /* USB mode select */ + MPP25_GPIO, /* Fan rotation fail */ + MPP26_GPIO, /* USB device vbus */ + MPP28_GPIO, /* USB enable host vbus */ + MPP29_GPIO, /* Blue led (slow register) */ + MPP30_GPIO, /* Blue led (command register) */ + MPP31_GPIO, /* Board power off */ + MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */ + MPP33_GPO, /* Fan speed (bit 2) */ + 0 +}; + +#define NS2_GPIO_POWER_OFF 31 + +static void ns2_power_off(void) +{ + gpio_set_value(NS2_GPIO_POWER_OFF, 1); +} + +void __init ns2_init(void) +{ + /* + * Basic setup. Needs to be called early. + */ + kirkwood_mpp_conf(ns2_mpp_config); + + kirkwood_ehci_init(); + kirkwood_ge00_init(&ns2_ge00_data); + + if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 && + gpio_direction_output(NS2_GPIO_POWER_OFF, 0) == 0) + pm_power_off = ns2_power_off; + else + pr_err("ns2: failed to configure power-off GPIO\n"); +} -- cgit v1.2.3 From ca7d94524ab3554b08f13de91674d570cb4a09b6 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Wed, 17 Oct 2012 12:09:05 +0200 Subject: ARM: kirkwood: DT board setup for Network Space Lite v2 This patch adds DT board setup for the LaCie NAS Network Space Lite v2. This board is derived from the Network Space v2 and a lot of hardware characteristics are shared. - CPU: Marvell 88F6192 800Mhz - SDRAM memory: 128MB DDR2 200Mhz - 1 SATA port: internal - Gigabit ethernet: PHY Marvell 88E1318 - Flash memory: SPI NOR 512KB (Macronix MX25L4005A) - i2c EEPROM: 512 bytes (24C04 type) - 2 USB2 ports: host and host/device - 1 push button - 1 SATA LED (bi-color, blue and red) Note that the SATA LED is not compatible with the driver leds-ns2. The LED behaviour ("on", "off" or "SATA activity blink") is controlled via a single MPP (21). Signed-off-by: Simon Guinot Reviewed-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/board-ns2.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm/mach-kirkwood/board-ns2.c') diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c index b36c55cba78..da8c4c5bf4f 100644 --- a/arch/arm/mach-kirkwood/board-ns2.c +++ b/arch/arm/mach-kirkwood/board-ns2.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "common.h" #include "mpp.h" @@ -73,6 +74,8 @@ void __init ns2_init(void) kirkwood_mpp_conf(ns2_mpp_config); kirkwood_ehci_init(); + if (of_machine_is_compatible("lacie,netspace_lite_v2")) + ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); kirkwood_ge00_init(&ns2_ge00_data); if (gpio_request(NS2_GPIO_POWER_OFF, "power-off") == 0 && -- cgit v1.2.3 From 7f9871d9d30f25891e0c4da4c6284d9e66e702f5 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Wed, 17 Oct 2012 12:09:06 +0200 Subject: ARM: kirkwood: DT board setup for Network Space Mini v2 This patch adds DT board setup for the LaCie NAS Network Space Mini v2 (aka SafeBox). The hardware characteristics are very close to those of the Network Space Lite v2. The main difference are: - A GPIO fan which is only available on the NS2 Mini. - A single USB host port is wired on the NS2 Mini. The NS2 Lite provides an additional dual-mode USB port (host/device). Signed-off-by: Simon Guinot Reviewed-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/board-ns2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-kirkwood/board-ns2.c') diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c index da8c4c5bf4f..78596c4f76d 100644 --- a/arch/arm/mach-kirkwood/board-ns2.c +++ b/arch/arm/mach-kirkwood/board-ns2.c @@ -74,7 +74,8 @@ void __init ns2_init(void) kirkwood_mpp_conf(ns2_mpp_config); kirkwood_ehci_init(); - if (of_machine_is_compatible("lacie,netspace_lite_v2")) + if (of_machine_is_compatible("lacie,netspace_lite_v2") || + of_machine_is_compatible("lacie,netspace_mini_v2")) ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); kirkwood_ge00_init(&ns2_ge00_data); -- cgit v1.2.3 From 2a18588c0ce336933be3c99c91e74e21db56a0fe Mon Sep 17 00:00:00 2001 From: Jason Cooper Date: Sat, 24 Nov 2012 03:58:12 +0000 Subject: ARM: Kirkwood: remove kirkwood_ehci_init() from new boards ehci-orion initialization moved to DT. New boards don't need to call kirkwood_ehci_init(). Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/board-ns2.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-kirkwood/board-ns2.c') diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c index 78596c4f76d..8821720ab5a 100644 --- a/arch/arm/mach-kirkwood/board-ns2.c +++ b/arch/arm/mach-kirkwood/board-ns2.c @@ -73,7 +73,6 @@ void __init ns2_init(void) */ kirkwood_mpp_conf(ns2_mpp_config); - kirkwood_ehci_init(); if (of_machine_is_compatible("lacie,netspace_lite_v2") || of_machine_is_compatible("lacie,netspace_mini_v2")) ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); -- cgit v1.2.3 From 4ea931e07d7708bdf42cff31e27dcc5d307ab6f7 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Tue, 8 Jan 2013 15:36:18 +0100 Subject: ARM: Kirkwood: fix ns2 gpios by converting to pinctrl Note that the pinctrl conversion also fixes GPIO support for ns2 boards. Since commit f9e75922: "ARM: Kirkwood: Make use of mvebu pincltl and gpio", the mvbu_gpio driver is used for DT boards. As mvbu_gpio relies on the pinctrl driver, then a pinctrl definition must be given to allow the GPIO configuration. Signed-off-by: Simon Guinot Acked-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/board-ns2.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'arch/arm/mach-kirkwood/board-ns2.c') diff --git a/arch/arm/mach-kirkwood/board-ns2.c b/arch/arm/mach-kirkwood/board-ns2.c index 8821720ab5a..f4632a809f6 100644 --- a/arch/arm/mach-kirkwood/board-ns2.c +++ b/arch/arm/mach-kirkwood/board-ns2.c @@ -18,47 +18,11 @@ #include #include #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data ns2_ge00_data = { .phy_addr = MV643XX_ETH_PHY_ADDR(8), }; -static unsigned int ns2_mpp_config[] __initdata = { - MPP0_SPI_SCn, - MPP1_SPI_MOSI, - MPP2_SPI_SCK, - MPP3_SPI_MISO, - MPP4_NF_IO6, - MPP5_NF_IO7, - MPP6_SYSRST_OUTn, - MPP7_GPO, /* Fan speed (bit 1) */ - MPP8_TW0_SDA, - MPP9_TW0_SCK, - MPP10_UART0_TXD, - MPP11_UART0_RXD, - MPP12_GPO, /* Red led */ - MPP14_GPIO, /* USB fuse */ - MPP16_GPIO, /* SATA 0 power */ - MPP17_GPIO, /* SATA 1 power */ - MPP18_NF_IO0, - MPP19_NF_IO1, - MPP20_SATA1_ACTn, - MPP21_SATA0_ACTn, - MPP22_GPIO, /* Fan speed (bit 0) */ - MPP23_GPIO, /* Fan power */ - MPP24_GPIO, /* USB mode select */ - MPP25_GPIO, /* Fan rotation fail */ - MPP26_GPIO, /* USB device vbus */ - MPP28_GPIO, /* USB enable host vbus */ - MPP29_GPIO, /* Blue led (slow register) */ - MPP30_GPIO, /* Blue led (command register) */ - MPP31_GPIO, /* Board power off */ - MPP32_GPIO, /* Power button (0 = Released, 1 = Pushed) */ - MPP33_GPO, /* Fan speed (bit 2) */ - 0 -}; - #define NS2_GPIO_POWER_OFF 31 static void ns2_power_off(void) @@ -71,8 +35,6 @@ void __init ns2_init(void) /* * Basic setup. Needs to be called early. */ - kirkwood_mpp_conf(ns2_mpp_config); - if (of_machine_is_compatible("lacie,netspace_lite_v2") || of_machine_is_compatible("lacie,netspace_mini_v2")) ns2_ge00_data.phy_addr = MV643XX_ETH_PHY_ADDR(0); -- cgit v1.2.3