From bff0844513f46e97e3cffa7b137c2eeb263810a6 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Mon, 1 Oct 2012 17:59:32 -0600 Subject: ARM: Kirkwood: Enable the second I2C bus mv64xxx_of_config requires that the tclk frequency be found through the clk stuff rather than through device tree, so add another override for the 2nd controller. Signed-off-by: Jason Gunthorpe Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/board-dt.c | 2 ++ arch/arm/mach-kirkwood/common.c | 1 + 2 files changed, 3 insertions(+) (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index d94872fed8c..ecbb26f438e 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -30,6 +30,8 @@ struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = { OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", NULL), + OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011100, "mv64xxx_i2c.1", + NULL), OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL), diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index 2c6c218fb79..906c22eca4e 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c @@ -266,6 +266,7 @@ void __init kirkwood_clk_init(void) orion_clkdev_add("1", "pcie", pex1); orion_clkdev_add(NULL, "kirkwood-i2s", audio); orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit); + orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit); /* Marvell says runit is used by SPI, UART, NAND, TWSI, ..., * so should never be gated. -- cgit v1.2.3 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/Kconfig | 21 ++++++++++ arch/arm/mach-kirkwood/Makefile | 3 ++ arch/arm/mach-kirkwood/board-dt.c | 8 ++++ arch/arm/mach-kirkwood/board-ns2.c | 83 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.h | 8 ++++ 5 files changed, 123 insertions(+) create mode 100644 arch/arm/mach-kirkwood/board-ns2.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 50bca5032b7..847e0c2bf67 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -130,6 +130,27 @@ config MACH_KM_KIRKWOOD_DT Say 'Y' here if you want your kernel to support the Keymile Kirkwood Reference Desgin, using Flattened Device Tree. +config MACH_INETSPACE_V2_DT + bool "LaCie Internet Space v2 NAS (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + help + Say 'Y' here if you want your kernel to support the LaCie + Internet Space v2 NAS, using Flattened Device Tree. + +config MACH_NETSPACE_V2_DT + bool "LaCie Network Space v2 NAS (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + help + Say 'Y' here if you want your kernel to support the LaCie + Network Space v2 NAS, using Flattened Device Tree. + +config MACH_NETSPACE_MAX_V2_DT + bool "LaCie Network Space Max v2 NAS (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + help + Say 'Y' here if you want your kernel to support the LaCie + Network Space Max v2 NAS, using Flattened Device Tree. + config MACH_TS219 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" help diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 294779f892d..1f63d804b49 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -31,3 +31,6 @@ obj-$(CONFIG_MACH_GOFLEXNET_DT) += board-goflexnet.o obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o +obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o +obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o +obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index ecbb26f438e..0270a145716 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -96,6 +96,11 @@ static void __init kirkwood_dt_init(void) if (of_machine_is_compatible("keymile,km_kirkwood")) km_kirkwood_init(); + if (of_machine_is_compatible("lacie,inetspace_v2") || + of_machine_is_compatible("lacie,netspace_v2") || + of_machine_is_compatible("lacie,netspace_max_v2")) + ns2_init(); + of_platform_populate(NULL, kirkwood_dt_match_table, kirkwood_auxdata_lookup, NULL); } @@ -112,6 +117,9 @@ static const char *kirkwood_dt_board_compat[] = { "buffalo,lsxl", "iom,ix2-200", "keymile,km_kirkwood", + "lacie,inetspace_v2", + "lacie,netspace_max_v2", + "lacie,netspace_v2", NULL }; 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"); +} diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index bcffd7ca1ca..2f75f3f7c85 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -112,6 +112,14 @@ void km_kirkwood_init(void); static inline void km_kirkwood_init(void) {}; #endif +#if defined(CONFIG_MACH_INETSPACE_V2_DT) || \ + defined(CONFIG_MACH_NETSPACE_V2_DT) || \ + defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) +void ns2_init(void); +#else +static inline void ns2_init(void) {}; +#endif + /* early init functions not converted to fdt yet */ char *kirkwood_id(void); void kirkwood_l2_init(void); -- 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/Kconfig | 7 +++++++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/board-dt.c | 4 +++- arch/arm/mach-kirkwood/board-ns2.c | 3 +++ arch/arm/mach-kirkwood/common.h | 3 ++- 5 files changed, 16 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 847e0c2bf67..83df331fce2 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -151,6 +151,13 @@ config MACH_NETSPACE_MAX_V2_DT Say 'Y' here if you want your kernel to support the LaCie Network Space Max v2 NAS, using Flattened Device Tree. +config MACH_NETSPACE_LITE_V2_DT + bool "LaCie Network Space Lite v2 NAS (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + help + Say 'Y' here if you want your kernel to support the LaCie + Network Space Lite v2 NAS, using Flattened Device Tree. + config MACH_TS219 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" help diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 1f63d804b49..4d4b7d4fbcf 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -34,3 +34,4 @@ obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o +obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 0270a145716..b76ef75f533 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -98,7 +98,8 @@ static void __init kirkwood_dt_init(void) if (of_machine_is_compatible("lacie,inetspace_v2") || of_machine_is_compatible("lacie,netspace_v2") || - of_machine_is_compatible("lacie,netspace_max_v2")) + of_machine_is_compatible("lacie,netspace_max_v2") || + of_machine_is_compatible("lacie,netspace_lite_v2")) ns2_init(); of_platform_populate(NULL, kirkwood_dt_match_table, @@ -120,6 +121,7 @@ static const char *kirkwood_dt_board_compat[] = { "lacie,inetspace_v2", "lacie,netspace_max_v2", "lacie,netspace_v2", + "lacie,netspace_lite_v2", NULL }; 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 && diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 2f75f3f7c85..6949d8198de 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -114,7 +114,8 @@ static inline void km_kirkwood_init(void) {}; #if defined(CONFIG_MACH_INETSPACE_V2_DT) || \ defined(CONFIG_MACH_NETSPACE_V2_DT) || \ - defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) + defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \ + defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) void ns2_init(void); #else static inline void ns2_init(void) {}; -- 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/Kconfig | 8 ++++++++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/board-dt.c | 4 +++- arch/arm/mach-kirkwood/board-ns2.c | 3 ++- arch/arm/mach-kirkwood/common.h | 3 ++- 5 files changed, 16 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 83df331fce2..757bdb39bc0 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -158,6 +158,14 @@ config MACH_NETSPACE_LITE_V2_DT Say 'Y' here if you want your kernel to support the LaCie Network Space Lite v2 NAS, using Flattened Device Tree. +config MACH_NETSPACE_MINI_V2_DT + bool "LaCie Network Space Mini v2 NAS (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + help + Say 'Y' here if you want your kernel to support the LaCie + Network Space Mini v2 NAS (aka SafeBox), using Flattened + Device Tree. + config MACH_TS219 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" help diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 4d4b7d4fbcf..3ff4aa1030c 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -35,3 +35,4 @@ obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o +obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index b76ef75f533..571b0198e4d 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -99,7 +99,8 @@ static void __init kirkwood_dt_init(void) if (of_machine_is_compatible("lacie,inetspace_v2") || of_machine_is_compatible("lacie,netspace_v2") || of_machine_is_compatible("lacie,netspace_max_v2") || - of_machine_is_compatible("lacie,netspace_lite_v2")) + of_machine_is_compatible("lacie,netspace_lite_v2") || + of_machine_is_compatible("lacie,netspace_mini_v2")) ns2_init(); of_platform_populate(NULL, kirkwood_dt_match_table, @@ -122,6 +123,7 @@ static const char *kirkwood_dt_board_compat[] = { "lacie,netspace_max_v2", "lacie,netspace_v2", "lacie,netspace_lite_v2", + "lacie,netspace_mini_v2", NULL }; 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); diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 6949d8198de..95eb69b7b46 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -115,7 +115,8 @@ static inline void km_kirkwood_init(void) {}; #if defined(CONFIG_MACH_INETSPACE_V2_DT) || \ defined(CONFIG_MACH_NETSPACE_V2_DT) || \ defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \ - defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) + defined(CONFIG_MACH_NETSPACE_LITE_V2_DT) || \ + defined(CONFIG_MACH_NETSPACE_MINI_V2_DT) void ns2_init(void); #else static inline void ns2_init(void) {}; -- cgit v1.2.3 From b046f560d76a22589a849964145e4e60d7a160d2 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Sun, 21 Oct 2012 01:34:54 +0200 Subject: ARM: kirkwood: use gpio-fan DT binding on lsxl Remove board specific gpio-fan driver registration. Moved into device tree. Signed-off-by: Michael Walle Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/board-lsxl.c | 51 ------------------------------------- 1 file changed, 51 deletions(-) (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/board-lsxl.c b/arch/arm/mach-kirkwood/board-lsxl.c index 83d8975592f..a29b8bff103 100644 --- a/arch/arm/mach-kirkwood/board-lsxl.c +++ b/arch/arm/mach-kirkwood/board-lsxl.c @@ -20,11 +20,6 @@ #include #include #include -#include -#include -#include -#include -#include #include "common.h" #include "mpp.h" @@ -53,51 +48,6 @@ static unsigned int lsxl_mpp_config[] __initdata = { 0 }; -#define LSXL_GPIO_FAN_HIGH 18 -#define LSXL_GPIO_FAN_LOW 19 -#define LSXL_GPIO_FAN_LOCK 40 - -static struct gpio_fan_alarm lsxl_alarm = { - .gpio = LSXL_GPIO_FAN_LOCK, -}; - -static struct gpio_fan_speed lsxl_speeds[] = { - { - .rpm = 0, - .ctrl_val = 3, - }, { - .rpm = 1500, - .ctrl_val = 1, - }, { - .rpm = 3250, - .ctrl_val = 2, - }, { - .rpm = 5000, - .ctrl_val = 0, - } -}; - -static int lsxl_gpio_list[] = { - LSXL_GPIO_FAN_HIGH, LSXL_GPIO_FAN_LOW, -}; - -static struct gpio_fan_platform_data lsxl_fan_data = { - .num_ctrl = ARRAY_SIZE(lsxl_gpio_list), - .ctrl = lsxl_gpio_list, - .alarm = &lsxl_alarm, - .num_speed = ARRAY_SIZE(lsxl_speeds), - .speed = lsxl_speeds, -}; - -static struct platform_device lsxl_fan_device = { - .name = "gpio-fan", - .id = -1, - .num_resources = 0, - .dev = { - .platform_data = &lsxl_fan_data, - }, -}; - /* * On the LS-XHL/LS-CHLv2, the shutdown process is following: * - Userland monitors key events until the power switch goes to off position @@ -128,7 +78,6 @@ void __init lsxl_init(void) kirkwood_ehci_init(); kirkwood_ge00_init(&lsxl_ge00_data); kirkwood_ge01_init(&lsxl_ge01_data); - platform_device_register(&lsxl_fan_device); /* register power-off method */ pm_power_off = lsxl_power_off; -- cgit v1.2.3 From 767fc1ea92f70b5a97d43b79c146c2bee3eb6e83 Mon Sep 17 00:00:00 2001 From: Jason Cooper Date: Mon, 22 Oct 2012 02:15:35 +0000 Subject: ARM: Kirkwood: new board USI Topkick This is a new kirkwood box made by Universal Scientific Industrial, Inc. The product description is here: http://www.usish.com/english/products_topkick1281p2.php It is very similar to the dreamplug and other plug devices, with the exception that it has room for a 2.5" SATA HDD internally. Signed-off-by: Jason Cooper Acked-by: Andrew Lunn Tested-by: Sebastian Hesselbarth --- arch/arm/mach-kirkwood/Kconfig | 7 +++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/board-dt.c | 4 ++ arch/arm/mach-kirkwood/board-usi_topkick.c | 82 ++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.h | 6 +++ 5 files changed, 100 insertions(+) create mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 757bdb39bc0..1d5283fad01 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -166,6 +166,13 @@ config MACH_NETSPACE_MINI_V2_DT Network Space Mini v2 NAS (aka SafeBox), using Flattened Device Tree. +config MACH_TOPKICK_DT + bool "USI Topkick (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + help + Say 'Y' here if you want your kernel to support the + USI Topkick, using Flattened Device Tree + config MACH_TS219 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" help diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 3ff4aa1030c..d867b36a39f 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -36,3 +36,4 @@ obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o +obj-$(CONFIG_MACH_TOPKICK_DT) += board-usi_topkick.o diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 571b0198e4d..e0bb9ca5924 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -103,6 +103,9 @@ static void __init kirkwood_dt_init(void) of_machine_is_compatible("lacie,netspace_mini_v2")) ns2_init(); + if (of_machine_is_compatible("usi,topkick")) + usi_topkick_init(); + of_platform_populate(NULL, kirkwood_dt_match_table, kirkwood_auxdata_lookup, NULL); } @@ -124,6 +127,7 @@ static const char *kirkwood_dt_board_compat[] = { "lacie,netspace_v2", "lacie,netspace_lite_v2", "lacie,netspace_mini_v2", + "usi,topkick", NULL }; diff --git a/arch/arm/mach-kirkwood/board-usi_topkick.c b/arch/arm/mach-kirkwood/board-usi_topkick.c new file mode 100644 index 00000000000..e2ec9d891fe --- /dev/null +++ b/arch/arm/mach-kirkwood/board-usi_topkick.c @@ -0,0 +1,82 @@ +/* + * Copyright 2012 (C), Jason Cooper + * + * arch/arm/mach-kirkwood/board-usi_topkick.c + * + * USI Topkick Init 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 topkick_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(0), +}; + +static struct mvsdio_platform_data topkick_mvsdio_data = { + /* unfortunately the CD signal has not been connected */ +}; + +/* + * GPIO LED layout + * + * /-SYS_LED(2) + * | + * | /-DISK_LED + * | | + * | | /-WLAN_LED(2) + * | | | + * [SW] [*] [*] [*] + */ + +/* + * Switch positions + * + * /-SW_LEFT + * | + * | /-SW_IDLE + * | | + * | | /-SW_RIGHT + * | | | + * PS [L] [I] [R] LEDS + */ + +static unsigned int topkick_mpp_config[] __initdata = { + MPP21_GPIO, /* DISK_LED (low active) - yellow */ + MPP36_GPIO, /* SATA0 power enable (high active) */ + MPP37_GPIO, /* SYS_LED2 (low active) - red */ + MPP38_GPIO, /* SYS_LED (low active) - blue */ + MPP39_GPIO, /* WLAN_LED (low active) - green */ + MPP43_GPIO, /* SW_LEFT (low active) */ + MPP44_GPIO, /* SW_RIGHT (low active) */ + MPP45_GPIO, /* SW_IDLE (low active) */ + MPP46_GPIO, /* SW_LEFT (low active) */ + MPP48_GPIO, /* WLAN_LED2 (low active) - yellow */ + 0 +}; + +#define TOPKICK_SATA0_PWR_ENABLE 36 + +void __init usi_topkick_init(void) +{ + /* + * Basic setup. Needs to be called early. + */ + kirkwood_mpp_conf(topkick_mpp_config); + + /* SATA0 power enable */ + gpio_set_value(TOPKICK_SATA0_PWR_ENABLE, 1); + + kirkwood_ehci_init(); + kirkwood_ge00_init(&topkick_ge00_data); + kirkwood_sdio_init(&topkick_mvsdio_data); +} diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 95eb69b7b46..276fc01dd6d 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -122,6 +122,12 @@ void ns2_init(void); static inline void ns2_init(void) {}; #endif +#ifdef CONFIG_MACH_TOPKICK_DT +void usi_topkick_init(void); +#else +static inline void usi_topkick_init(void) {}; +#endif + /* early init functions not converted to fdt yet */ char *kirkwood_id(void); void kirkwood_l2_init(void); -- cgit v1.2.3 From afcad884252b171ff6f2ac78eb43c2f5db612dd0 Mon Sep 17 00:00:00 2001 From: Tero Jaasko Date: Fri, 26 Oct 2012 18:56:16 +0300 Subject: arm: kirkwood: add support for ZyXEL NSA310 Hello, Andrew > > +#define NSA310_GPIO_LED_ESATA_GREEN 12 > > <..> > > +#define NSA310_GPIO_POWER_OFF 48 > > It looks like most of these are not used. Please remove them. True. Fixed. > > +static struct mtd_partition nsa310_mtd_parts[] = { > > + { > > + .name = "uboot", > > + .offset = 0, > > + .size = 0x100000, > > + .mask_flags = MTD_WRITEABLE, > > + }, { > > <..> > You should be able to put all that into DT. Take a look at Correct. I did the conversion and tested that the partitions can be read with dd and produce exactly the same data before and after conversion. So, the partition offsets at least should be fine. > > +static struct i2c_board_info __initdata nsa310_i2c_info[] = { > > + { I2C_BOARD_INFO("adt7476", 0x2e) }, > > +}; > > You can also do this in DT as well. kirkwood-ts219.dtsi has > > i2c@11000 { > status = "okay"; > clock-frequency = <400000>; Ok, I did convert the i2c definition to use the devicetree. The adt7476 device itself is not at reach of device tree, AFAIK and requires more work at there? Thanks for your valuable comments. Following is a new patch that should address the problems and mistakes you pointed and also some of the pointed by Jason Cooper. The nand and i2c are now defined at DT and I also removed the pointless defines and ARM_APPENDED_DTB. It is based against the Linus' official 3.6 version. Best regards, Tero Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/Kconfig | 8 +++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/board-dt.c | 4 ++ arch/arm/mach-kirkwood/board-nsa310.c | 105 ++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.h | 6 ++ 5 files changed, 124 insertions(+) create mode 100644 arch/arm/mach-kirkwood/board-nsa310.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 1d5283fad01..a5b766e1330 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -259,6 +259,14 @@ config MACH_T5325 Say 'Y' here if you want your kernel to support the HP t5325 Thin Client. +config MACH_NSA310_DT + bool "ZyXEL NSA-310 (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + select ARM_ATAG_DTB_COMPAT + help + Say 'Y' here if you want your kernel to support the + ZyXEL NSA-310 board (Flattened Device Tree). + endmenu endif diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index d867b36a39f..8f7a34040af 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -36,4 +36,5 @@ obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o +obj-$(CONFIG_MACH_NSA310_DT) += board-nsa310.o obj-$(CONFIG_MACH_TOPKICK_DT) += board-usi_topkick.o diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index e0bb9ca5924..87c53d175d3 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -106,6 +106,9 @@ static void __init kirkwood_dt_init(void) if (of_machine_is_compatible("usi,topkick")) usi_topkick_init(); + if (of_machine_is_compatible("zyxel,nsa310")) + nsa310_init(); + of_platform_populate(NULL, kirkwood_dt_match_table, kirkwood_auxdata_lookup, NULL); } @@ -128,6 +131,7 @@ static const char *kirkwood_dt_board_compat[] = { "lacie,netspace_lite_v2", "lacie,netspace_mini_v2", "usi,topkick", + "zyxel,nsa310", NULL }; diff --git a/arch/arm/mach-kirkwood/board-nsa310.c b/arch/arm/mach-kirkwood/board-nsa310.c new file mode 100644 index 00000000000..027ce83f3fe --- /dev/null +++ b/arch/arm/mach-kirkwood/board-nsa310.c @@ -0,0 +1,105 @@ +/* + * arch/arm/mach-kirkwood/nsa-310-setup.c + * + * ZyXEL NSA-310 Setup + * + * 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 +#include +#include "common.h" +#include "mpp.h" + +#define NSA310_GPIO_USB_POWER_OFF 21 +#define NSA310_GPIO_POWER_OFF 48 + +static unsigned int nsa310_mpp_config[] __initdata = { + MPP12_GPIO, /* led esata green */ + MPP13_GPIO, /* led esata red */ + MPP15_GPIO, /* led usb green */ + MPP16_GPIO, /* led usb red */ + MPP21_GPIO, /* control usb power off */ + MPP28_GPIO, /* led sys green */ + MPP29_GPIO, /* led sys red */ + MPP36_GPIO, /* key reset */ + MPP37_GPIO, /* key copy */ + MPP39_GPIO, /* led copy green */ + MPP40_GPIO, /* led copy red */ + MPP41_GPIO, /* led hdd green */ + MPP42_GPIO, /* led hdd red */ + MPP44_GPIO, /* ?? */ + MPP46_GPIO, /* key power */ + MPP48_GPIO, /* control power off */ + 0 +}; + +static struct i2c_board_info __initdata nsa310_i2c_info[] = { + { I2C_BOARD_INFO("adt7476", 0x2e) }, +}; + +static void nsa310_power_off(void) +{ + gpio_set_value(NSA310_GPIO_POWER_OFF, 1); +} + +static int __init nsa310_gpio_request(unsigned int gpio, unsigned long flags, + const char *label) +{ + int err; + + err = gpio_request_one(gpio, flags, label); + if (err) + pr_err("NSA-310: can't setup GPIO%u (%s), err=%d\n", + gpio, label, err); + + return err; +} + +static void __init nsa310_gpio_init(void) +{ + int err; + + err = nsa310_gpio_request(NSA310_GPIO_POWER_OFF, GPIOF_OUT_INIT_LOW, + "Power Off"); + if (!err) + pm_power_off = nsa310_power_off; + + nsa310_gpio_request(NSA310_GPIO_USB_POWER_OFF, GPIOF_OUT_INIT_LOW, + "USB Power Off"); +} + +void __init nsa310_init(void) +{ + u32 dev, rev; + + kirkwood_mpp_conf(nsa310_mpp_config); + + nsa310_gpio_init(); + + /* this can be removed once the mainline kirkwood.dtsi gets + * the ehci configuration by default */ + kirkwood_ehci_init(); + + kirkwood_pcie_id(&dev, &rev); + + i2c_register_board_info(0, ARRAY_AND_SIZE(nsa310_i2c_info)); +} + +static int __init nsa310_pci_init(void) +{ + if (of_machine_is_compatible("zyxel,nsa310")) + kirkwood_pcie_init(KW_PCIE0); + + return 0; +} + +subsys_initcall(nsa310_pci_init); diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 276fc01dd6d..652a7282cdb 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -122,6 +122,12 @@ void ns2_init(void); static inline void ns2_init(void) {}; #endif +#ifdef CONFIG_MACH_NSA310_DT +void nsa310_init(void); +#else +static inline void nsa310_init(void) {}; +#endif + #ifdef CONFIG_MACH_TOPKICK_DT void usi_topkick_init(void); #else -- cgit v1.2.3 From 5492a1108bbd40e14a895c07b6a4952022e82f7c Mon Sep 17 00:00:00 2001 From: Stefan Peter Date: Sun, 18 Nov 2012 16:46:16 +0100 Subject: ARM: kirkwood: Add support for the MPL CEC4 Signed-off-by: Stefan Peter Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/Kconfig | 7 +++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/board-dt.c | 4 ++ arch/arm/mach-kirkwood/board-mplcec4.c | 80 ++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.h | 6 +++ 5 files changed, 98 insertions(+) create mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index a5b766e1330..141b105ce8d 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -137,6 +137,13 @@ config MACH_INETSPACE_V2_DT Say 'Y' here if you want your kernel to support the LaCie Internet Space v2 NAS, using Flattened Device Tree. +config MACH_MPLCEC4_DT + bool "MPL CEC4 (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + help + Say 'Y' here if you want your kernel to support the + MPL CEC4 (Flattened Device Tree). + config MACH_NETSPACE_V2_DT bool "LaCie Network Space v2 NAS (Flattened Device Tree)" select ARCH_KIRKWOOD_DT diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index 8f7a34040af..b5bc3346759 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -32,6 +32,7 @@ obj-$(CONFIG_MACH_LSXL_DT) += board-lsxl.o obj-$(CONFIG_MACH_IOMEGA_IX2_200_DT) += board-iomega_ix2_200.o obj-$(CONFIG_MACH_KM_KIRKWOOD_DT) += board-km_kirkwood.o obj-$(CONFIG_MACH_INETSPACE_V2_DT) += board-ns2.o +obj-$(CONFIG_MACH_MPLCEC4_DT) += board-mplcec4.o obj-$(CONFIG_MACH_NETSPACE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 87c53d175d3..33c0bc1e2f3 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -103,6 +103,9 @@ static void __init kirkwood_dt_init(void) of_machine_is_compatible("lacie,netspace_mini_v2")) ns2_init(); + if (of_machine_is_compatible("mpl,cec4")) + mplcec4_init(); + if (of_machine_is_compatible("usi,topkick")) usi_topkick_init(); @@ -130,6 +133,7 @@ static const char *kirkwood_dt_board_compat[] = { "lacie,netspace_v2", "lacie,netspace_lite_v2", "lacie,netspace_mini_v2", + "mpl,cec4", "usi,topkick", "zyxel,nsa310", NULL diff --git a/arch/arm/mach-kirkwood/board-mplcec4.c b/arch/arm/mach-kirkwood/board-mplcec4.c new file mode 100644 index 00000000000..e78a227468e --- /dev/null +++ b/arch/arm/mach-kirkwood/board-mplcec4.c @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2012 MPL AG, Switzerland + * Stefan Peter + * + * arch/arm/mach-kirkwood/board-mplcec4.c + * + * 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 "common.h" +#include "mpp.h" + +static struct mv643xx_eth_platform_data mplcec4_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(1), +}; + +static struct mv643xx_eth_platform_data mplcec4_ge01_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(2), +}; + +static unsigned int mplcec4_mpp_config[] __initdata = { + MPP0_NF_IO2, + MPP1_NF_IO3, + MPP2_NF_IO4, + MPP3_NF_IO5, + MPP4_NF_IO6, + MPP5_NF_IO7, + MPP6_SYSRST_OUTn, + MPP7_GPO, /* Status LED Green High Active */ + MPP10_UART0_TXD, + MPP11_UART0_RXD, + MPP12_SD_CLK, + MPP13_SD_CMD, /* Alt UART1_TXD */ + MPP14_SD_D0, /* Alt UART1_RXD */ + MPP15_SD_D1, + MPP16_SD_D2, + MPP17_SD_D3, + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP28_GPIO, /* Input SYS_POR_DET (active High) */ + MPP29_GPIO, /* Input SYS_RTC_INT (active High) */ + MPP34_SATA1_ACTn, + MPP35_SATA0_ACTn, + MPP40_GPIO, /* LED User1 orange */ + MPP41_GPIO, /* LED User1 green */ + MPP44_GPIO, /* LED User0 orange */ + MPP45_GPIO, /* LED User0 green */ + MPP46_GPIO, /* Status LED Yellow High Active */ + MPP47_GPIO, /* SD_CD# (in/IRQ)*/ + 0 +}; + + +static struct mvsdio_platform_data mplcec4_mvsdio_data = { + .gpio_card_detect = 47, /* MPP47 used as SD card detect */ +}; + + + +void __init mplcec4_init(void) +{ + /* + * Basic setup. Needs to be called early. + */ + kirkwood_mpp_conf(mplcec4_mpp_config); + kirkwood_ehci_init(); + kirkwood_ge00_init(&mplcec4_ge00_data); + kirkwood_ge01_init(&mplcec4_ge01_data); + kirkwood_sdio_init(&mplcec4_mvsdio_data); + kirkwood_pcie_init(KW_PCIE0); +} + + + diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index 652a7282cdb..f86fcced0bb 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -112,6 +112,12 @@ void km_kirkwood_init(void); static inline void km_kirkwood_init(void) {}; #endif +#ifdef CONFIG_MACH_MPLCEC4_DT +void mplcec4_init(void); +#else +static inline void mplcec4_init(void) {}; +#endif + #if defined(CONFIG_MACH_INETSPACE_V2_DT) || \ defined(CONFIG_MACH_NETSPACE_V2_DT) || \ defined(CONFIG_MACH_NETSPACE_MAX_V2_DT) || \ -- cgit v1.2.3 From f17073a3aec601cb9aba6d8c1c6dbc8c6a919c07 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Tue, 13 Nov 2012 16:43:09 +0900 Subject: ARM: kirkwood: Add Plat'Home OpenBlocks A6 support Add support for Plat'Home OpenBlocks A6 using the device tree where possible. This commit supports SATA, USB, ether and serial console. Signed-off-by: Nobuhiro Iwamatsu Signed-off-by: Jason Cooper --- arch/arm/mach-kirkwood/Kconfig | 7 +++ arch/arm/mach-kirkwood/Makefile | 1 + arch/arm/mach-kirkwood/board-dt.c | 4 ++ arch/arm/mach-kirkwood/board-openblocks_a6.c | 71 ++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/common.h | 6 +++ 5 files changed, 89 insertions(+) create mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 141b105ce8d..d018ad4bcc3 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig @@ -173,6 +173,13 @@ config MACH_NETSPACE_MINI_V2_DT Network Space Mini v2 NAS (aka SafeBox), using Flattened Device Tree. +config MACH_OPENBLOCKS_A6_DT + bool "Plat'Home OpenBlocks A6 (Flattened Device Tree)" + select ARCH_KIRKWOOD_DT + help + Say 'Y' here if you want your kernel to support the + Plat'Home OpenBlocks A6 (Flattened Device Tree). + config MACH_TOPKICK_DT bool "USI Topkick (Flattened Device Tree)" select ARCH_KIRKWOOD_DT diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile index b5bc3346759..8d2e5a96247 100644 --- a/arch/arm/mach-kirkwood/Makefile +++ b/arch/arm/mach-kirkwood/Makefile @@ -38,4 +38,5 @@ obj-$(CONFIG_MACH_NETSPACE_MAX_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_LITE_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NETSPACE_MINI_V2_DT) += board-ns2.o obj-$(CONFIG_MACH_NSA310_DT) += board-nsa310.o +obj-$(CONFIG_MACH_OPENBLOCKS_A6_DT) += board-openblocks_a6.o obj-$(CONFIG_MACH_TOPKICK_DT) += board-usi_topkick.o diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index 33c0bc1e2f3..70eb01d9608 100644 --- a/arch/arm/mach-kirkwood/board-dt.c +++ b/arch/arm/mach-kirkwood/board-dt.c @@ -106,6 +106,9 @@ static void __init kirkwood_dt_init(void) if (of_machine_is_compatible("mpl,cec4")) mplcec4_init(); + if (of_machine_is_compatible("plathome,openblocks-a6")) + openblocks_a6_init(); + if (of_machine_is_compatible("usi,topkick")) usi_topkick_init(); @@ -134,6 +137,7 @@ static const char *kirkwood_dt_board_compat[] = { "lacie,netspace_lite_v2", "lacie,netspace_mini_v2", "mpl,cec4", + "plathome,openblocks-a6", "usi,topkick", "zyxel,nsa310", NULL diff --git a/arch/arm/mach-kirkwood/board-openblocks_a6.c b/arch/arm/mach-kirkwood/board-openblocks_a6.c new file mode 100644 index 00000000000..e807e8cfdd4 --- /dev/null +++ b/arch/arm/mach-kirkwood/board-openblocks_a6.c @@ -0,0 +1,71 @@ +/* + * Copyright 2012 Nobuhiro Iwamatsu + * + * arch/arm/mach-kirkwood/board-openblocks_a6.c + * + * 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 openblocks_ge00_data = { + .phy_addr = MV643XX_ETH_PHY_ADDR(0), +}; + +static unsigned int openblocks_a6_mpp_config[] __initdata = { + MPP0_NF_IO2, + MPP1_NF_IO3, + MPP2_NF_IO4, + MPP3_NF_IO5, + MPP4_NF_IO6, + MPP5_NF_IO7, + MPP6_SYSRST_OUTn, + MPP8_UART1_RTS, + MPP9_UART1_CTS, + MPP10_UART0_TXD, + MPP11_UART0_RXD, + MPP13_UART1_TXD, + MPP14_UART1_RXD, + MPP15_UART0_RTS, + MPP16_UART0_CTS, + MPP18_NF_IO0, + MPP19_NF_IO1, + MPP20_GPIO, /* DIP SW0 */ + MPP21_GPIO, /* DIP SW1 */ + MPP22_GPIO, /* DIP SW2 */ + MPP23_GPIO, /* DIP SW3 */ + MPP24_GPIO, /* GPIO 0 */ + MPP25_GPIO, /* GPIO 1 */ + MPP26_GPIO, /* GPIO 2 */ + MPP27_GPIO, /* GPIO 3 */ + MPP28_GPIO, /* GPIO 4 */ + MPP29_GPIO, /* GPIO 5 */ + MPP30_GPIO, /* GPIO 6 */ + MPP31_GPIO, /* GPIO 7 */ + MPP36_TW1_SDA, + MPP37_TW1_SCK, + MPP38_GPIO, /* INIT */ + MPP39_GPIO, /* USB OC */ + MPP41_GPIO, /* LED: Red */ + MPP42_GPIO, /* LED: Yellow */ + MPP43_GPIO, /* LED: Green */ + 0, +}; + +void __init openblocks_a6_init(void) +{ + /* + * Basic setup. Needs to be called early. + */ + kirkwood_mpp_conf(openblocks_a6_mpp_config); + kirkwood_ehci_init(); + kirkwood_ge00_init(&openblocks_ge00_data); +} diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h index f86fcced0bb..3e079d1d99d 100644 --- a/arch/arm/mach-kirkwood/common.h +++ b/arch/arm/mach-kirkwood/common.h @@ -134,6 +134,12 @@ void nsa310_init(void); static inline void nsa310_init(void) {}; #endif +#ifdef CONFIG_MACH_OPENBLOCKS_A6_DT +void openblocks_a6_init(void); +#else +static inline void openblocks_a6_init(void) {}; +#endif + #ifdef CONFIG_MACH_TOPKICK_DT void usi_topkick_init(void); #else -- cgit v1.2.3