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-70-g09d2 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/boot/dts/Makefile | 3 ++ arch/arm/boot/dts/kirkwood-is2.dts | 30 +++++++++++ arch/arm/boot/dts/kirkwood-ns2-common.dtsi | 63 +++++++++++++++++++++++ arch/arm/boot/dts/kirkwood-ns2.dts | 30 +++++++++++ arch/arm/boot/dts/kirkwood-ns2max.dts | 49 ++++++++++++++++++ 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 +++ drivers/leds/Kconfig | 4 +- 11 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/kirkwood-is2.dts create mode 100644 arch/arm/boot/dts/kirkwood-ns2-common.dtsi create mode 100644 arch/arm/boot/dts/kirkwood-ns2.dts create mode 100644 arch/arm/boot/dts/kirkwood-ns2max.dts create mode 100644 arch/arm/mach-kirkwood/board-ns2.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index f37cf9fa5fa..e566943cc5d 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -36,9 +36,12 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ kirkwood-ib62x0.dtb \ kirkwood-iconnect.dtb \ kirkwood-iomega_ix2_200.dtb \ + kirkwood-is2.dtb \ kirkwood-km_kirkwood.dtb \ kirkwood-lschlv2.dtb \ kirkwood-lsxhl.dtb \ + kirkwood-ns2.dtb \ + kirkwood-ns2max.dtb \ kirkwood-ts219-6281.dtb \ kirkwood-ts219-6282.dtb dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ diff --git a/arch/arm/boot/dts/kirkwood-is2.dts b/arch/arm/boot/dts/kirkwood-is2.dts new file mode 100644 index 00000000000..0bdce0ad727 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-is2.dts @@ -0,0 +1,30 @@ +/dts-v1/; + +/include/ "kirkwood-ns2-common.dtsi" + +/ { + model = "LaCie Internet Space v2"; + compatible = "lacie,inetspace_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x8000000>; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <1>; + }; + }; + + ns2-leds { + compatible = "lacie,ns2-leds"; + + blue-sata { + label = "ns2:blue:sata"; + slow-gpio = <&gpio0 29 0>; + cmd-gpio = <&gpio0 30 0>; + }; + }; +}; diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi new file mode 100644 index 00000000000..9bc6785ad22 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi @@ -0,0 +1,63 @@ +/include/ "kirkwood.dtsi" + +/ { + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + ocp@f1000000 { + serial@12000 { + clock-frequency = <166666667>; + status = "okay"; + }; + + spi@10600 { + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "mx25l4005a"; + reg = <0>; + spi-max-frequency = <20000000>; + mode = <0>; + + partition@0 { + reg = <0x0 0x80000>; + label = "u-boot"; + }; + }; + }; + + i2c@11000 { + status = "okay"; + + eeprom@50 { + compatible = "at,24c04"; + pagesize = <16>; + reg = <0x50>; + }; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + button@1 { + label = "Power push button"; + linux,code = <116>; + gpios = <&gpio1 0 0>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + red-fail { + label = "ns2:red:fail"; + gpios = <&gpio0 12 0>; + }; + }; +}; diff --git a/arch/arm/boot/dts/kirkwood-ns2.dts b/arch/arm/boot/dts/kirkwood-ns2.dts new file mode 100644 index 00000000000..f2d36ecf36d --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2.dts @@ -0,0 +1,30 @@ +/dts-v1/; + +/include/ "kirkwood-ns2-common.dtsi" + +/ { + model = "LaCie Network Space v2"; + compatible = "lacie,netspace_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <1>; + }; + }; + + ns2-leds { + compatible = "lacie,ns2-leds"; + + blue-sata { + label = "ns2:blue:sata"; + slow-gpio = <&gpio0 29 0>; + cmd-gpio = <&gpio0 30 0>; + }; + }; +}; diff --git a/arch/arm/boot/dts/kirkwood-ns2max.dts b/arch/arm/boot/dts/kirkwood-ns2max.dts new file mode 100644 index 00000000000..bcec4d6cada --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2max.dts @@ -0,0 +1,49 @@ +/dts-v1/; + +/include/ "kirkwood-ns2-common.dtsi" + +/ { + model = "LaCie Network Space Max v2"; + compatible = "lacie,netspace_max_v2", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + }; + + gpio_fan { + compatible = "gpio-fan"; + gpios = <&gpio0 22 1 + &gpio0 7 1 + &gpio1 1 1 + &gpio0 23 1>; + gpio-fan,speed-map = + < 0 0 + 1500 15 + 1700 14 + 1800 13 + 2100 12 + 3100 11 + 3300 10 + 4300 9 + 5500 8>; + alarm-gpios = <&gpio0 25 1>; + }; + + ns2-leds { + compatible = "lacie,ns2-leds"; + + blue-sata { + label = "ns2:blue:sata"; + slow-gpio = <&gpio0 29 0>; + cmd-gpio = <&gpio0 30 0>; + }; + }; +}; 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); diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index f508defc0d9..e455c086937 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -379,7 +379,9 @@ config LEDS_NS2 tristate "LED support for Network Space v2 GPIO LEDs" depends on LEDS_CLASS depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || \ - MACH_NETSPACE_MAX_V2 || MACH_D2NET_V2 + MACH_NETSPACE_MAX_V2 || MACH_D2NET_V2 || \ + MACH_NETSPACE_V2_DT || MACH_INETSPACE_V2_DT || \ + MACH_NETSPACE_MAX_V2_DT default y help This option enable support for the dual-GPIO LED found on the -- cgit v1.2.3-70-g09d2 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/boot/dts/Makefile | 1 + arch/arm/boot/dts/kirkwood-ns2lite.dts | 30 ++++++++++++++++++++++++++++++ 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 ++- 7 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 arch/arm/boot/dts/kirkwood-ns2lite.dts (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index e566943cc5d..74fca59370c 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -41,6 +41,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ kirkwood-lschlv2.dtb \ kirkwood-lsxhl.dtb \ kirkwood-ns2.dtb \ + kirkwood-ns2lite.dtb \ kirkwood-ns2max.dtb \ kirkwood-ts219-6281.dtb \ kirkwood-ts219-6282.dtb diff --git a/arch/arm/boot/dts/kirkwood-ns2lite.dts b/arch/arm/boot/dts/kirkwood-ns2lite.dts new file mode 100644 index 00000000000..b02eb4ea1bb --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2lite.dts @@ -0,0 +1,30 @@ +/dts-v1/; + +/include/ "kirkwood-ns2-common.dtsi" + +/ { + model = "LaCie Network Space Lite v2"; + compatible = "lacie,netspace_lite_v2", "marvell,kirkwood-88f6192", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x8000000>; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <1>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + blue-sata { + label = "ns2:blue:sata"; + gpios = <&gpio0 30 1>; + linux,default-trigger = "default-on"; + }; + }; +}; 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-70-g09d2 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/boot/dts/Makefile | 1 + arch/arm/boot/dts/kirkwood-ns2mini.dts | 49 ++++++++++++++++++++++++++++++++++ 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 ++- drivers/leds/Kconfig | 2 +- 8 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 arch/arm/boot/dts/kirkwood-ns2mini.dts (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 74fca59370c..77fce3f6394 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -43,6 +43,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ kirkwood-ns2.dtb \ kirkwood-ns2lite.dtb \ kirkwood-ns2max.dtb \ + kirkwood-ns2mini.dtb \ kirkwood-ts219-6281.dtb \ kirkwood-ts219-6282.dtb dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ diff --git a/arch/arm/boot/dts/kirkwood-ns2mini.dts b/arch/arm/boot/dts/kirkwood-ns2mini.dts new file mode 100644 index 00000000000..b79f5eb2558 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-ns2mini.dts @@ -0,0 +1,49 @@ +/dts-v1/; + +/include/ "kirkwood-ns2-common.dtsi" + +/ { + model = "LaCie Network Space Mini v2"; + compatible = "lacie,netspace_mini_v2", "marvell,kirkwood-88f6192", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x8000000>; + }; + + ocp@f1000000 { + sata@80000 { + status = "okay"; + nr-ports = <1>; + }; + }; + + gpio_fan { + compatible = "gpio-fan"; + gpios = <&gpio0 22 1 + &gpio0 7 1 + &gpio1 1 1 + &gpio0 23 1>; + gpio-fan,speed-map = + < 0 0 + 3000 15 + 3180 14 + 4140 13 + 4570 12 + 6760 11 + 7140 10 + 7980 9 + 9200 8>; + alarm-gpios = <&gpio0 25 1>; + }; + + ns2-leds { + compatible = "lacie,ns2-leds"; + + blue-sata { + label = "ns2:blue:sata"; + slow-gpio = <&gpio0 29 0>; + cmd-gpio = <&gpio0 30 0>; + }; + }; +}; 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) {}; diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index e455c086937..b58bc8a14b9 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -381,7 +381,7 @@ config LEDS_NS2 depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || \ MACH_NETSPACE_MAX_V2 || MACH_D2NET_V2 || \ MACH_NETSPACE_V2_DT || MACH_INETSPACE_V2_DT || \ - MACH_NETSPACE_MAX_V2_DT + MACH_NETSPACE_MAX_V2_DT || MACH_NETSPACE_MINI_V2_DT default y help This option enable support for the dual-GPIO LED found on the -- cgit v1.2.3-70-g09d2 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/boot/dts/kirkwood-lsxl.dtsi | 11 ++++++++ arch/arm/mach-kirkwood/board-lsxl.c | 51 ------------------------------------ 2 files changed, 11 insertions(+), 51 deletions(-) (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/boot/dts/kirkwood-lsxl.dtsi b/arch/arm/boot/dts/kirkwood-lsxl.dtsi index 8fea375c734..798e60eeedf 100644 --- a/arch/arm/boot/dts/kirkwood-lsxl.dtsi +++ b/arch/arm/boot/dts/kirkwood-lsxl.dtsi @@ -94,4 +94,15 @@ gpios = <&gpio1 16 1>; }; }; + + gpio_fan { + compatible = "gpio-fan"; + gpios = <&gpio0 19 1 + &gpio0 18 1>; + gpio-fan,speed-map = <0 3 + 1500 2 + 3250 1 + 5000 0>; + alarm-gpios = <&gpio1 8 0>; + }; }; 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-70-g09d2 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/boot/dts/Makefile | 1 + arch/arm/boot/dts/kirkwood-topkick.dts | 85 ++++++++++++++++++++++++++++++ arch/arm/configs/kirkwood_defconfig | 1 + 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 +++ 8 files changed, 187 insertions(+) create mode 100644 arch/arm/boot/dts/kirkwood-topkick.dts create mode 100644 arch/arm/mach-kirkwood/board-usi_topkick.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 77fce3f6394..df3a8ae9224 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -44,6 +44,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ kirkwood-ns2lite.dtb \ kirkwood-ns2max.dtb \ kirkwood-ns2mini.dtb \ + kirkwood-topkick.dtb \ kirkwood-ts219-6281.dtb \ kirkwood-ts219-6282.dtb dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ diff --git a/arch/arm/boot/dts/kirkwood-topkick.dts b/arch/arm/boot/dts/kirkwood-topkick.dts new file mode 100644 index 00000000000..c0de5a7f660 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-topkick.dts @@ -0,0 +1,85 @@ +/dts-v1/; + +/include/ "kirkwood.dtsi" + +/ { + model = "Univeral Scientific Industrial Co. Topkick-1281P2"; + compatible = "usi,topkick-1281P2", "usi,topkick", "marvell,kirkwood-88f6282", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + }; + + ocp@f1000000 { + serial@12000 { + clock-frequency = <200000000>; + status = "ok"; + }; + + nand@3000000 { + status = "okay"; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x180000>; + }; + + partition@180000 { + label = "u-boot env"; + reg = <0x0180000 0x20000>; + }; + + partition@200000 { + label = "uImage"; + reg = <0x0200000 0x600000>; + }; + + partition@800000 { + label = "uInitrd"; + reg = <0x0800000 0x1000000>; + }; + + partition@1800000 { + label = "rootfs"; + reg = <0x1800000 0xe800000>; + }; + }; + + sata@80000 { + status = "okay"; + nr-ports = <1>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + disk { + label = "topkick:yellow:disk"; + gpios = <&gpio0 21 1>; + linux,default-trigger = "ide-disk"; + }; + system2 { + label = "topkick:red:system"; + gpios = <&gpio1 5 1>; + }; + system { + label = "topkick:blue:system"; + gpios = <&gpio1 6 1>; + default-state = "on"; + }; + wifi { + label = "topkick:green:wifi"; + gpios = <&gpio1 7 1>; + }; + wifi2 { + label = "topkick:yellow:wifi"; + gpios = <&gpio1 16 1>; + }; + }; +}; diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 66f7ae76f0d..006b7b95cac 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig @@ -32,6 +32,7 @@ CONFIG_MACH_NETSPACE_V2_DT=y CONFIG_MACH_NETSPACE_MAX_V2_DT=y CONFIG_MACH_NETSPACE_LITE_V2_DT=y CONFIG_MACH_NETSPACE_MINI_V2_DT=y +CONFIG_MACH_TOPKICK_DT=y CONFIG_MACH_TS219=y CONFIG_MACH_TS41X=y CONFIG_MACH_DOCKSTAR=y 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-70-g09d2 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/boot/dts/Makefile | 1 + arch/arm/boot/dts/kirkwood-nsa310.dts | 144 ++++++++++++++++++++++++++++++++++ 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 ++ 7 files changed, 269 insertions(+) create mode 100644 arch/arm/boot/dts/kirkwood-nsa310.dts create mode 100644 arch/arm/mach-kirkwood/board-nsa310.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index df3a8ae9224..c5eb41c4b76 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -44,6 +44,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ kirkwood-ns2lite.dtb \ kirkwood-ns2max.dtb \ kirkwood-ns2mini.dtb \ + kirkwood-nsa310.dtb \ kirkwood-topkick.dtb \ kirkwood-ts219-6281.dtb \ kirkwood-ts219-6282.dtb diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts new file mode 100644 index 00000000000..5509f965954 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-nsa310.dts @@ -0,0 +1,144 @@ +/dts-v1/; + +/include/ "kirkwood.dtsi" + +/ { + model = "ZyXEL NSA310"; + compatible = "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x10000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + ocp@f1000000 { + + serial@12000 { + clock-frequency = <200000000>; + status = "ok"; + }; + + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + + i2c@11000 { + status = "okay"; + }; + + nand@3000000 { + status = "okay"; + chip-delay = <35>; + + partition@0 { + label = "uboot"; + reg = <0x0000000 0x0100000>; + read-only; + }; + partition@100000 { + label = "uboot_env"; + reg = <0x0100000 0x0080000>; + }; + partition@180000 { + label = "key_store"; + reg = <0x0180000 0x0080000>; + }; + partition@200000 { + label = "info"; + reg = <0x0200000 0x0080000>; + }; + partition@280000 { + label = "etc"; + reg = <0x0280000 0x0a00000>; + }; + partition@c80000 { + label = "kernel_1"; + reg = <0x0c80000 0x0a00000>; + }; + partition@1680000 { + label = "rootfs1"; + reg = <0x1680000 0x2fc0000>; + }; + partition@4640000 { + label = "kernel_2"; + reg = <0x4640000 0x0a00000>; + }; + partition@5040000 { + label = "rootfs2"; + reg = <0x5040000 0x2fc0000>; + }; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + button@1 { + label = "Power Button"; + linux,code = <116>; + gpios = <&gpio1 14 0>; + }; + button@2 { + label = "Copy Button"; + linux,code = <133>; + gpios = <&gpio1 5 1>; + }; + button@3 { + label = "Reset Button"; + linux,code = <0x198>; + gpios = <&gpio1 4 1>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + green-sys { + label = "nsa310:green:sys"; + gpios = <&gpio0 28 0>; + }; + red-sys { + label = "nsa310:red:sys"; + gpios = <&gpio0 29 0>; + }; + green-hdd { + label = "nsa310:green:hdd"; + gpios = <&gpio1 9 0>; + }; + red-hdd { + label = "nsa310:red:hdd"; + gpios = <&gpio1 10 0>; + }; + green-esata { + label = "nsa310:green:esata"; + gpios = <&gpio0 12 0>; + }; + red-esata { + label = "nsa310:red:esata"; + gpios = <&gpio0 13 0>; + }; + green-usb { + label = "nsa310:green:usb"; + gpios = <&gpio0 15 0>; + }; + red-usb { + label = "nsa310:red:usb"; + gpios = <&gpio0 16 0>; + }; + green-copy { + label = "nsa310:green:copy"; + gpios = <&gpio1 7 0>; + }; + red-copy { + label = "nsa310:red:copy"; + gpios = <&gpio1 8 0>; + }; + }; +}; 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-70-g09d2 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/boot/dts/Makefile | 1 + arch/arm/boot/dts/kirkwood-mplcec4.dts | 119 +++++++++++++++++++++++++++++++++ arch/arm/configs/kirkwood_defconfig | 1 + 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 ++ 8 files changed, 219 insertions(+) create mode 100644 arch/arm/boot/dts/kirkwood-mplcec4.dts create mode 100644 arch/arm/mach-kirkwood/board-mplcec4.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index c5eb41c4b76..eef6545f65e 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -40,6 +40,7 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ kirkwood-km_kirkwood.dtb \ kirkwood-lschlv2.dtb \ kirkwood-lsxhl.dtb \ + kirkwood-mplcec4.dtb \ kirkwood-ns2.dtb \ kirkwood-ns2lite.dtb \ kirkwood-ns2max.dtb \ diff --git a/arch/arm/boot/dts/kirkwood-mplcec4.dts b/arch/arm/boot/dts/kirkwood-mplcec4.dts new file mode 100644 index 00000000000..ac3c080bed2 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-mplcec4.dts @@ -0,0 +1,119 @@ +/dts-v1/; + +/include/ "kirkwood.dtsi" + +/ { + model = "MPL CEC4"; + compatible = "mpl,cec4-10", "mpl,cec4", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x20000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + }; + + ocp@f1000000 { + i2c@11000 { + status = "okay"; + + rtc@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; + + eeprom@57 { + compatible = "atmel,24c02"; + reg = <0x57>; + }; + + }; + + serial@12000 { + clock-frequency = <200000000>; + status = "ok"; + }; + + nand@3000000 { + status = "okay"; + + partition@0 { + label = "uboot"; + reg = <0x0000000 0x100000>; + }; + + partition@100000 { + label = "env"; + reg = <0x100000 0x80000>; + }; + + partition@180000 { + label = "fdt"; + reg = <0x180000 0x80000>; + }; + + partition@200000 { + label = "kernel"; + reg = <0x200000 0x400000>; + }; + + partition@600000 { + label = "rootfs"; + reg = <0x600000 0x1fa00000>; + }; + }; + + rtc@10300 { + status = "disabled"; + }; + + sata@80000 { + nr-ports = <2>; + status = "okay"; + + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + health { + label = "status:green:health"; + gpios = <&gpio0 7 1>; + }; + + user1o { + label = "user1:orange"; + gpios = <&gpio1 8 1>; + default-state = "on"; + }; + + user1g { + label = "user1:green"; + gpios = <&gpio1 9 1>; + default-state = "on"; + }; + + user0o { + label = "user0:orange"; + gpios = <&gpio1 12 1>; + default-state = "on"; + }; + + user0g { + label = "user0:green"; + gpios = <&gpio1 13 1>; + default-state = "on"; + }; + + misc { + label = "status:orange:misc"; + gpios = <&gpio1 14 1>; + default-state = "on"; + }; + + }; +}; + diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 006b7b95cac..2fd4d259d86 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig @@ -33,6 +33,7 @@ CONFIG_MACH_NETSPACE_MAX_V2_DT=y CONFIG_MACH_NETSPACE_LITE_V2_DT=y CONFIG_MACH_NETSPACE_MINI_V2_DT=y CONFIG_MACH_TOPKICK_DT=y +CONFIG_MACH_MPLCEC4_DT=y CONFIG_MACH_TS219=y CONFIG_MACH_TS41X=y CONFIG_MACH_DOCKSTAR=y 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-70-g09d2 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/boot/dts/Makefile | 3 +- arch/arm/boot/dts/kirkwood-openblocks_a6.dts | 39 +++++++++++++++ arch/arm/configs/kirkwood_defconfig | 1 + 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 +++ 8 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/kirkwood-openblocks_a6.dts create mode 100644 arch/arm/mach-kirkwood/board-openblocks_a6.c (limited to 'arch/arm/mach-kirkwood') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index f1ba69c2496..94561b50042 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -48,7 +48,8 @@ dtb-$(CONFIG_ARCH_KIRKWOOD) += kirkwood-dns320.dtb \ kirkwood-nsa310.dtb \ kirkwood-topkick.dtb \ kirkwood-ts219-6281.dtb \ - kirkwood-ts219-6282.dtb + kirkwood-ts219-6282.dtb \ + kirkwood-openblocks_a6.dtb dtb-$(CONFIG_ARCH_MSM) += msm8660-surf.dtb \ msm8960-cdp.dtb dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts new file mode 100644 index 00000000000..9a2606c8b78 --- /dev/null +++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts @@ -0,0 +1,39 @@ +/dts-v1/; + +/include/ "kirkwood.dtsi" + +/ { + model = "Plat'Home OpenBlocksA6"; + compatible = "plathome,openblocks-a6", "marvell,kirkwood-88f6283", "marvell,kirkwood"; + + memory { + device_type = "memory"; + reg = <0x00000000 0x20000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + }; + + ocp@f1000000 { + serial@12000 { + clock-frequency = <200000000>; + status = "ok"; + }; + + serial@12100 { + clock-frequency = <200000000>; + status = "ok"; + }; + + nand@3000000 { + chip-delay = <25>; + status = "okay"; + }; + + sata@80000 { + nr-ports = <1>; + status = "okay"; + }; + }; +}; diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 1128d180eec..93f3794ba5c 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig @@ -33,6 +33,7 @@ CONFIG_MACH_NETSPACE_V2_DT=y CONFIG_MACH_NETSPACE_MAX_V2_DT=y CONFIG_MACH_NETSPACE_LITE_V2_DT=y CONFIG_MACH_NETSPACE_MINI_V2_DT=y +CONFIG_MACH_OPENBLOCKS_A6_DT=y CONFIG_MACH_TOPKICK_DT=y CONFIG_MACH_TS219=y CONFIG_MACH_TS41X=y 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-70-g09d2