From bff0844513f46e97e3cffa7b137c2eeb263810a6 Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Mon, 1 Oct 2012 17:59:32 -0600 Subject: [PATCH 01/17] 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(+) diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c index d94872fed8c0..ecbb26f438ea 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 2c6c218fb79e..906c22eca4e9 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. From 72052fcc10263817031dd96ea438c1f49eb39dd3 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Wed, 17 Oct 2012 12:09:03 +0200 Subject: [PATCH 02/17] leds: leds-ns2: add device tree binding Signed-off-by: Simon Guinot Reviewed-by: Andrew Lunn Signed-off-by: Jason Cooper --- .../devicetree/bindings/gpio/leds-ns2.txt | 26 +++++++ drivers/leds/leds-ns2.c | 78 ++++++++++++++++++- 2 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/leds-ns2.txt diff --git a/Documentation/devicetree/bindings/gpio/leds-ns2.txt b/Documentation/devicetree/bindings/gpio/leds-ns2.txt new file mode 100644 index 000000000000..aef3aca34d2d --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/leds-ns2.txt @@ -0,0 +1,26 @@ +Binding for dual-GPIO LED found on Network Space v2 (and parents). + +Required properties: +- compatible: "lacie,ns2-leds". + +Each LED is represented as a sub-node of the ns2-leds device. + +Required sub-node properties: +- cmd-gpio: Command LED GPIO. See OF device-tree GPIO specification. +- slow-gpio: Slow LED GPIO. See OF device-tree GPIO specification. + +Optional sub-node properties: +- label: Name for this LED. If omitted, the label is taken from the node name. +- linux,default-trigger: Trigger assigned to the LED. + +Example: + +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/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index d176ec83f5d9..d64cc2227fd9 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c @@ -30,6 +30,7 @@ #include #include #include +#include /* * The Network Space v2 dual-GPIO LED is wired to a CPLD and can blink in @@ -263,6 +264,62 @@ static void delete_ns2_led(struct ns2_led_data *led_dat) gpio_free(led_dat->slow); } +#ifdef CONFIG_OF_GPIO +/* + * Translate OpenFirmware node properties into platform_data. + */ +static int __devinit +ns2_leds_get_of_pdata(struct device *dev, struct ns2_led_platform_data *pdata) +{ + struct device_node *np = dev->of_node; + struct device_node *child; + struct ns2_led *leds; + int num_leds = 0; + int i = 0; + + num_leds = of_get_child_count(np); + if (!num_leds) + return -ENODEV; + + leds = devm_kzalloc(dev, num_leds * sizeof(struct ns2_led), + GFP_KERNEL); + if (!leds) + return -ENOMEM; + + for_each_child_of_node(np, child) { + const char *string; + int ret; + + ret = of_get_named_gpio(child, "cmd-gpio", 0); + if (ret < 0) + return ret; + leds[i].cmd = ret; + ret = of_get_named_gpio(child, "slow-gpio", 0); + if (ret < 0) + return ret; + leds[i].slow = ret; + ret = of_property_read_string(child, "label", &string); + leds[i].name = (ret == 0) ? string : child->name; + ret = of_property_read_string(child, "linux,default-trigger", + &string); + if (ret == 0) + leds[i].default_trigger = string; + + i++; + } + + pdata->leds = leds; + pdata->num_leds = num_leds; + + return 0; +} + +static const struct of_device_id of_ns2_leds_match[] = { + { .compatible = "lacie,ns2-leds", }, + {}, +}; +#endif /* CONFIG_OF_GPIO */ + static int __devinit ns2_led_probe(struct platform_device *pdev) { struct ns2_led_platform_data *pdata = pdev->dev.platform_data; @@ -270,11 +327,25 @@ static int __devinit ns2_led_probe(struct platform_device *pdev) int i; int ret; +#ifdef CONFIG_OF_GPIO + if (!pdata) { + pdata = devm_kzalloc(&pdev->dev, + sizeof(struct ns2_led_platform_data), + GFP_KERNEL); + if (!pdata) + return -ENOMEM; + + ret = ns2_leds_get_of_pdata(&pdev->dev, pdata); + if (ret) + return ret; + } +#else if (!pdata) return -EINVAL; +#endif /* CONFIG_OF_GPIO */ leds_data = devm_kzalloc(&pdev->dev, sizeof(struct ns2_led_data) * - pdata->num_leds, GFP_KERNEL); + pdata->num_leds, GFP_KERNEL); if (!leds_data) return -ENOMEM; @@ -312,8 +383,9 @@ static struct platform_driver ns2_led_driver = { .probe = ns2_led_probe, .remove = __devexit_p(ns2_led_remove), .driver = { - .name = "leds-ns2", - .owner = THIS_MODULE, + .name = "leds-ns2", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(of_ns2_leds_match), }, }; From ecee1e47ab42ba3907d6bde7b2981e1006382071 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Wed, 17 Oct 2012 12:09:04 +0200 Subject: [PATCH 03/17] 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 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index f37cf9fa5fa0..e566943cc5d8 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 000000000000..0bdce0ad7277 --- /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 000000000000..9bc6785ad228 --- /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 000000000000..f2d36ecf36d8 --- /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 000000000000..bcec4d6cada7 --- /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 50bca5032b7e..847e0c2bf672 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 294779f892d9..1f63d804b494 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 ecbb26f438ea..0270a145716f 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 000000000000..b36c55cba78b --- /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 bcffd7ca1ca2..2f75f3f7c858 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 f508defc0d96..e455c0869378 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 From ca7d94524ab3554b08f13de91674d570cb4a09b6 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Wed, 17 Oct 2012 12:09:05 +0200 Subject: [PATCH 04/17] 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 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index e566943cc5d8..74fca59370c3 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 000000000000..b02eb4ea1bb4 --- /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 847e0c2bf672..83df331fce28 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 1f63d804b494..4d4b7d4fbcf5 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 0270a145716f..b76ef75f533f 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 b36c55cba78b..da8c4c5bf4f6 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 2f75f3f7c858..6949d8198de1 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) {}; From 7f9871d9d30f25891e0c4da4c6284d9e66e702f5 Mon Sep 17 00:00:00 2001 From: Simon Guinot Date: Wed, 17 Oct 2012 12:09:06 +0200 Subject: [PATCH 05/17] 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 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 74fca59370c3..77fce3f63946 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 000000000000..b79f5eb25589 --- /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 83df331fce28..757bdb39bc08 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 4d4b7d4fbcf5..3ff4aa1030c5 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 b76ef75f533f..571b0198e4d5 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 da8c4c5bf4f6..78596c4f76d2 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 6949d8198de1..95eb69b7b46c 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 e455c0869378..b58bc8a14b9c 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 From 1136b9d124bea6d978be66337b5786e6df825a6e Mon Sep 17 00:00:00 2001 From: Jason Cooper Date: Sun, 21 Oct 2012 00:57:16 +0000 Subject: [PATCH 06/17] ARM: Kirkwood: add Netspace boards to defconfig Signed-off-by: Jason Cooper --- arch/arm/configs/kirkwood_defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 74eee0c78f28..66f7ae76f0d5 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig @@ -27,6 +27,11 @@ CONFIG_MACH_GOFLEXNET_DT=y CONFIG_MACH_LSXL_DT=y CONFIG_MACH_IOMEGA_IX2_200_DT=y CONFIG_MACH_KM_KIRKWOOD_DT=y +CONFIG_MACH_INETSPACE_V2_DT=y +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_TS219=y CONFIG_MACH_TS41X=y CONFIG_MACH_DOCKSTAR=y From b046f560d76a22589a849964145e4e60d7a160d2 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Sun, 21 Oct 2012 01:34:54 +0200 Subject: [PATCH 07/17] 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(-) diff --git a/arch/arm/boot/dts/kirkwood-lsxl.dtsi b/arch/arm/boot/dts/kirkwood-lsxl.dtsi index 8fea375c734d..798e60eeedf3 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 83d8975592f8..a29b8bff103d 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; From 767fc1ea92f70b5a97d43b79c146c2bee3eb6e83 Mon Sep 17 00:00:00 2001 From: Jason Cooper Date: Mon, 22 Oct 2012 02:15:35 +0000 Subject: [PATCH 08/17] 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 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 77fce3f63946..df3a8ae9224f 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 000000000000..c0de5a7f660d --- /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 66f7ae76f0d5..006b7b95caca 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 757bdb39bc08..1d5283fad014 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 3ff4aa1030c5..d867b36a39f8 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 571b0198e4d5..e0bb9ca59245 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 000000000000..e2ec9d891fe3 --- /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 95eb69b7b46c..276fc01dd6d7 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); From afcad884252b171ff6f2ac78eb43c2f5db612dd0 Mon Sep 17 00:00:00 2001 From: Tero Jaasko Date: Fri, 26 Oct 2012 18:56:16 +0300 Subject: [PATCH 09/17] 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 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index df3a8ae9224f..c5eb41c4b767 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 000000000000..5509f9659546 --- /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 1d5283fad014..a5b766e13304 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 d867b36a39f8..8f7a34040af3 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 e0bb9ca59245..87c53d175d35 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 000000000000..027ce83f3fe5 --- /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 276fc01dd6d7..652a7282cdb3 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 From 5492a1108bbd40e14a895c07b6a4952022e82f7c Mon Sep 17 00:00:00 2001 From: Stefan Peter Date: Sun, 18 Nov 2012 16:46:16 +0100 Subject: [PATCH 10/17] 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 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index c5eb41c4b767..eef6545f65ee 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 000000000000..ac3c080bed21 --- /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 006b7b95caca..2fd4d259d866 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 a5b766e13304..141b105ce8d9 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 8f7a34040af3..b5bc33467590 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 87c53d175d35..33c0bc1e2f3a 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 000000000000..e78a227468e6 --- /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 652a7282cdb3..f86fcced0bb1 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) || \ From 9973978614f6cdec2ba52ce161a4bd084b252267 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 16 Nov 2012 16:39:44 +0100 Subject: [PATCH 11/17] arm: orion5x: mechanical defconfig update This commit is a simple mechanical update of the orion5x_defconfig file to the current kernel (i.e, just 'make orion5x_defconfig; make savedefconfig'). Doing this update allows to more easily separate DT-related configuration changes in the following patches. Signed-off-by: Thomas Petazzoni Tested by: Maxime Hadjinlian Acked-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/configs/orion5x_defconfig | 32 ++++++++---------------------- 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig index cd5e6ba9a54d..d0875ceb0cee 100644 --- a/arch/arm/configs/orion5x_defconfig +++ b/arch/arm/configs/orion5x_defconfig @@ -1,7 +1,8 @@ CONFIG_EXPERIMENTAL=y CONFIG_SYSVIPC=y +CONFIG_NO_HZ=y +CONFIG_HIGH_RES_TIMERS=y CONFIG_LOG_BUF_SHIFT=14 -CONFIG_SYSFS_DEPRECATED_V2=y CONFIG_EXPERT=y # CONFIG_SLUB_DEBUG is not set CONFIG_PROFILING=y @@ -10,6 +11,8 @@ CONFIG_KPROBES=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +CONFIG_PARTITION_ADVANCED=y +CONFIG_BSD_DISKLABEL=y CONFIG_ARCH_ORION5X=y CONFIG_MACH_DB88F5281=y CONFIG_MACH_RD88F5182=y @@ -33,17 +36,12 @@ CONFIG_MACH_WNR854T=y CONFIG_MACH_RD88F5181L_GE=y CONFIG_MACH_RD88F5181L_FXO=y CONFIG_MACH_RD88F6183AP_GE=y -CONFIG_NO_HZ=y -CONFIG_HIGH_RES_TIMERS=y CONFIG_PREEMPT=y CONFIG_AEABI=y -CONFIG_LEDS=y -CONFIG_LEDS_CPU=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_FPE_NWFPE=y CONFIG_VFP=y -# CONFIG_SUSPEND is not set CONFIG_NET=y CONFIG_PACKET=y CONFIG_UNIX=y @@ -54,13 +52,10 @@ CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_BOOTP=y # CONFIG_IPV6 is not set CONFIG_NET_DSA=y -CONFIG_NET_DSA_MV88E6131=y -CONFIG_NET_DSA_MV88E6123_61_65=y CONFIG_NET_PKTGEN=m CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" # CONFIG_FIRMWARE_IN_KERNEL is not set CONFIG_MTD=y -CONFIG_MTD_PARTITIONS=y CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_CHAR=y CONFIG_MTD_BLOCK=y @@ -82,12 +77,11 @@ CONFIG_CHR_DEV_SG=m CONFIG_ATA=y CONFIG_SATA_MV=y CONFIG_NETDEVICES=y -CONFIG_MARVELL_PHY=y -CONFIG_NET_ETHERNET=y CONFIG_MII=y -CONFIG_NET_PCI=y +CONFIG_NET_DSA_MV88E6131=y +CONFIG_NET_DSA_MV88E6123_61_65=y CONFIG_MV643XX_ETH=y -# CONFIG_NETDEV_10000 is not set +CONFIG_MARVELL_PHY=y # CONFIG_INPUT_MOUSEDEV is not set CONFIG_INPUT_EVDEV=y # CONFIG_KEYBOARD_ATKBD is not set @@ -95,11 +89,11 @@ CONFIG_KEYBOARD_GPIO=y # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set # CONFIG_VT is not set +CONFIG_LEGACY_PTY_COUNT=16 CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y # CONFIG_SERIAL_8250_PCI is not set CONFIG_SERIAL_8250_RUNTIME_UARTS=2 -CONFIG_LEGACY_PTY_COUNT=16 CONFIG_HW_RANDOM_TIMERIOMEM=m CONFIG_I2C=y # CONFIG_I2C_COMPAT is not set @@ -109,10 +103,8 @@ CONFIG_GPIO_SYSFS=y CONFIG_SENSORS_LM75=y # CONFIG_VGA_ARB is not set CONFIG_USB=y -CONFIG_USB_DEVICEFS=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_TT_NEWSCHED=y CONFIG_USB_PRINTER=y CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_DATAFAB=y @@ -140,7 +132,6 @@ CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y # CONFIG_EXT3_FS_XATTR is not set CONFIG_EXT4_FS=m -CONFIG_INOTIFY=y CONFIG_ISO9660_FS=m CONFIG_JOLIET=y CONFIG_UDF_FS=m @@ -150,25 +141,18 @@ CONFIG_TMPFS=y CONFIG_JFFS2_FS=y CONFIG_CRAMFS=y CONFIG_NFS_FS=y -CONFIG_NFS_V3=y CONFIG_ROOT_NFS=y -CONFIG_PARTITION_ADVANCED=y -CONFIG_BSD_DISKLABEL=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_CODEPAGE_850=y CONFIG_NLS_ISO8859_1=y CONFIG_NLS_ISO8859_2=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_FS=y -CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_BUGVERBOSE is not set CONFIG_DEBUG_INFO=y -# CONFIG_RCU_CPU_STALL_DETECTOR is not set CONFIG_LATENCYTOP=y -CONFIG_SYSCTL_SYSCALL_CHECK=y # CONFIG_FTRACE is not set CONFIG_DEBUG_USER=y -CONFIG_DEBUG_ERRORS=y CONFIG_DEBUG_LL=y CONFIG_CRYPTO_CBC=m CONFIG_CRYPTO_ECB=m From 1bffb4a8729838f5ee27364803406416459c3252 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 16 Nov 2012 16:39:45 +0100 Subject: [PATCH 12/17] arm: orion5x: basic Device Tree support This commit adds basic DT support for the Orion5x SoC family. It adds an orion5x.dtsi description of the Orion5x SoC as well as the needed DT_MACHINE structure to support boards converted to DT in the future. So far, the Device Tree contains the interrupt controller, the GPIO bank, the UART controllers, the SPI controller, the watchdog, the SATA controller, the I2C controller and the cryptographic engine. Signed-off-by: Thomas Petazzoni Tested by: Maxime Hadjinlian Acked-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/boot/dts/orion5x.dtsi | 98 ++++++++++++++++++++++++++++++++ arch/arm/mach-orion5x/Kconfig | 7 +++ arch/arm/mach-orion5x/Makefile | 2 + arch/arm/mach-orion5x/board-dt.c | 76 +++++++++++++++++++++++++ arch/arm/mach-orion5x/common.c | 4 +- arch/arm/mach-orion5x/common.h | 2 + 6 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 arch/arm/boot/dts/orion5x.dtsi create mode 100644 arch/arm/mach-orion5x/board-dt.c diff --git a/arch/arm/boot/dts/orion5x.dtsi b/arch/arm/boot/dts/orion5x.dtsi new file mode 100644 index 000000000000..8aad00f81ed9 --- /dev/null +++ b/arch/arm/boot/dts/orion5x.dtsi @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2012 Thomas Petazzoni + * + * 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/ "skeleton.dtsi" + +/ { + model = "Marvell Orion5x SoC"; + compatible = "marvell,orion5x"; + interrupt-parent = <&intc>; + + intc: interrupt-controller { + compatible = "marvell,orion-intc", "marvell,intc"; + interrupt-controller; + #interrupt-cells = <1>; + reg = <0xf1020204 0x04>; + }; + + ocp@f1000000 { + compatible = "simple-bus"; + ranges = <0x00000000 0xf1000000 0x4000000 + 0xf2200000 0xf2200000 0x0000800>; + #address-cells = <1>; + #size-cells = <1>; + + gpio0: gpio@10100 { + compatible = "marvell,orion-gpio"; + #gpio-cells = <2>; + gpio-controller; + reg = <0x10100 0x40>; + ngpio = <32>; + interrupts = <6>, <7>, <8>, <9>; + }; + + serial@12000 { + compatible = "ns16550a"; + reg = <0x12000 0x100>; + reg-shift = <2>; + interrupts = <3>; + /* set clock-frequency in board dts */ + status = "disabled"; + }; + + serial@12100 { + compatible = "ns16550a"; + reg = <0x12100 0x100>; + reg-shift = <2>; + interrupts = <4>; + /* set clock-frequency in board dts */ + status = "disabled"; + }; + + spi@10600 { + compatible = "marvell,orion-spi"; + #address-cells = <1>; + #size-cells = <0>; + cell-index = <0>; + reg = <0x10600 0x28>; + status = "disabled"; + }; + + wdt@20300 { + compatible = "marvell,orion-wdt"; + reg = <0x20300 0x28>; + status = "okay"; + }; + + sata@80000 { + compatible = "marvell,orion-sata"; + reg = <0x80000 0x5000>; + interrupts = <29>; + status = "disabled"; + }; + + i2c@11000 { + compatible = "marvell,mv64xxx-i2c"; + reg = <0x11000 0x20>; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <5>; + clock-frequency = <100000>; + status = "disabled"; + }; + + crypto@90000 { + compatible = "marvell,orion-crypto"; + reg = <0x90000 0x10000>, + <0xf2200000 0x800>; + reg-names = "regs", "sram"; + interrupts = <22>; + status = "okay"; + }; + }; +}; diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig index 0673f0c10432..0910c3bd0c99 100644 --- a/arch/arm/mach-orion5x/Kconfig +++ b/arch/arm/mach-orion5x/Kconfig @@ -2,6 +2,13 @@ if ARCH_ORION5X menu "Orion Implementations" +config ARCH_ORION5X_DT + bool "Marvell Orion5x Flattened Device Tree" + select USE_OF + help + Say 'Y' here if you want your kernel to support the + Marvell Orion5x using flattened device tree. + config MACH_DB88F5281 bool "Marvell Orion-2 Development Board" select I2C_BOARDINFO diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile index 7f18cdacd487..843e6deb66d0 100644 --- a/arch/arm/mach-orion5x/Makefile +++ b/arch/arm/mach-orion5x/Makefile @@ -22,3 +22,5 @@ obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o + +obj-$(CONFIG_ARCH_ORION5X_DT) += board-dt.o diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c new file mode 100644 index 000000000000..a26397f58f1f --- /dev/null +++ b/arch/arm/mach-orion5x/board-dt.c @@ -0,0 +1,76 @@ +/* + * Copyright 2012 (C), Thomas Petazzoni + * + * arch/arm/mach-orion5x/board-dt.c + * + * Flattened Device Tree board initialization + * + * 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 +#include "common.h" + +struct of_dev_auxdata orion5x_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,orion-wdt", 0xf1020300, "orion_wdt", NULL), + OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), + OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1090000, "mv_crypto", NULL), + {}, +}; + +static void __init orion5x_dt_init(void) +{ + char *dev_name; + u32 dev, rev; + + orion5x_id(&dev, &rev, &dev_name); + printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, orion5x_tclk); + + /* + * Setup Orion address map + */ + orion5x_setup_cpu_mbus_bridge(); + + /* Setup root of clk tree */ + clk_init(); + + /* + * Don't issue "Wait for Interrupt" instruction if we are + * running on D0 5281 silicon. + */ + if (dev == MV88F5281_DEV_ID && rev == MV88F5281_REV_D0) { + printk(KERN_INFO "Orion: Applying 5281 D0 WFI workaround.\n"); + disable_hlt(); + } + + of_platform_populate(NULL, of_default_bus_match_table, + orion5x_auxdata_lookup, NULL); +} + +static const char *orion5x_dt_compat[] = { + "marvell,orion5x", + NULL, +}; + +DT_MACHINE_START(ORION5X_DT, "Marvell Orion5x (Flattened Device Tree)") + /* Maintainer: Thomas Petazzoni */ + .map_io = orion5x_map_io, + .init_early = orion5x_init_early, + .init_irq = orion_dt_init_irq, + .timer = &orion5x_timer, + .init_machine = orion5x_dt_init, + .restart = orion5x_restart, + .dt_compat = orion5x_dt_compat, +MACHINE_END diff --git a/arch/arm/mach-orion5x/common.c b/arch/arm/mach-orion5x/common.c index b3eb3da01160..550f92320afb 100644 --- a/arch/arm/mach-orion5x/common.c +++ b/arch/arm/mach-orion5x/common.c @@ -65,7 +65,7 @@ void __init orion5x_map_io(void) ****************************************************************************/ static struct clk *tclk; -static void __init clk_init(void) +void __init clk_init(void) { tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT, orion5x_tclk); @@ -236,7 +236,7 @@ struct sys_timer orion5x_timer = { /* * Identify device ID and rev from PCIe configuration header space '0'. */ -static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name) +void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name) { orion5x_pcie_id(dev, rev); diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index 31bab92ce038..2033b79089a7 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h @@ -12,6 +12,8 @@ void orion5x_map_io(void); void orion5x_init_early(void); void orion5x_init_irq(void); void orion5x_init(void); +void orion5x_id(u32 *dev, u32 *rev, char **dev_name); +void clk_init(void); extern int orion5x_tclk; extern struct sys_timer orion5x_timer; From 07f645df9ff2550749b806af626576d5ad418215 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 16 Nov 2012 16:39:46 +0100 Subject: [PATCH 13/17] arm: orion5x: convert 'LaCie Ethernet Disk mini v2' to Device Tree This commit converts the 'LaCie Ethernet Disk mini v2' board to the Device Tree. All devices that have existing Device Tree bindings are converted over to the Device Tree, the other devices remain instantiated in the old way, until the respective drivers get the needed Device Tree bindings. Signed-off-by: Thomas Petazzoni Tested by: Maxime Hadjinlian Acked-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/boot/dts/Makefile | 1 + .../orion5x-lacie-ethernet-disk-mini-v2.dts | 55 ++++++++++++ arch/arm/mach-orion5x/Kconfig | 7 +- arch/arm/mach-orion5x/Makefile | 2 +- arch/arm/mach-orion5x/board-dt.c | 3 + arch/arm/mach-orion5x/common.h | 7 ++ arch/arm/mach-orion5x/edmini_v2-setup.c | 88 +------------------ 7 files changed, 72 insertions(+), 91 deletions(-) create mode 100644 arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index eef6545f65ee..f1ba69c2496a 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -81,6 +81,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ omap5-evm.dtb \ am335x-evm.dtb \ am335x-bone.dtb +dtb-$(CONFIG_ARCH_ORION5X) += orion5x-lacie-ethernet-disk-mini-v2.dtb dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb dtb-$(CONFIG_ARCH_U8500) += snowball.dtb dtb-$(CONFIG_ARCH_SHMOBILE) += emev2-kzm9d.dtb \ diff --git a/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts new file mode 100644 index 000000000000..5a3a58b7e18f --- /dev/null +++ b/arch/arm/boot/dts/orion5x-lacie-ethernet-disk-mini-v2.dts @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2012 Thomas Petazzoni + * + * 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. + */ + +/dts-v1/; +/include/ "orion5x.dtsi" + +/ { + model = "LaCie Ethernet Disk mini V2"; + compatible = "lacie,ethernet-disk-mini-v2", "marvell-orion5x-88f5182", "marvell,orion5x"; + + memory { + reg = <0x00000000 0x4000000>; /* 64 MB */ + }; + + chosen { + bootargs = "console=ttyS0,115200n8 earlyprintk"; + }; + + ocp@f1000000 { + serial@12000 { + clock-frequency = <166666667>; + status = "okay"; + }; + + sata@80000 { + status = "okay"; + nr-ports = <2>; + }; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + button@1 { + label = "Power-on Switch"; + linux,code = <116>; /* KEY_POWER */ + gpios = <&gpio0 18 0>; + }; + }; + + gpio_leds { + compatible = "gpio-leds"; + + led@1 { + label = "power:blue"; + gpios = <&gpio0 16 1>; + }; + }; +}; diff --git a/arch/arm/mach-orion5x/Kconfig b/arch/arm/mach-orion5x/Kconfig index 0910c3bd0c99..2cb2f06c20f5 100644 --- a/arch/arm/mach-orion5x/Kconfig +++ b/arch/arm/mach-orion5x/Kconfig @@ -103,12 +103,13 @@ config MACH_MV2120 Say 'Y' here if you want your kernel to support the HP Media Vault mv2120 or mv5100. -config MACH_EDMINI_V2 - bool "LaCie Ethernet Disk mini V2" +config MACH_EDMINI_V2_DT + bool "LaCie Ethernet Disk mini V2 (Flattened Device Tree)" select I2C_BOARDINFO + select ARCH_ORION5X_DT help Say 'Y' here if you want your kernel to support the - LaCie Ethernet Disk mini V2. + LaCie Ethernet Disk mini V2 (Flattened Device Tree). config MACH_D2NET bool "LaCie d2 Network" diff --git a/arch/arm/mach-orion5x/Makefile b/arch/arm/mach-orion5x/Makefile index 843e6deb66d0..9e809a7c05c0 100644 --- a/arch/arm/mach-orion5x/Makefile +++ b/arch/arm/mach-orion5x/Makefile @@ -12,7 +12,6 @@ obj-$(CONFIG_MACH_TS409) += ts409-setup.o tsx09-common.o obj-$(CONFIG_MACH_WRT350N_V2) += wrt350n-v2-setup.o obj-$(CONFIG_MACH_TS78XX) += ts78xx-setup.o obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o -obj-$(CONFIG_MACH_EDMINI_V2) += edmini_v2-setup.o obj-$(CONFIG_MACH_D2NET) += d2net-setup.o obj-$(CONFIG_MACH_BIGDISK) += d2net-setup.o obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o @@ -24,3 +23,4 @@ obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o obj-$(CONFIG_MACH_LINKSTATION_LSCHL) += ls-chl-setup.o obj-$(CONFIG_ARCH_ORION5X_DT) += board-dt.o +obj-$(CONFIG_MACH_EDMINI_V2_DT) += edmini_v2-setup.o diff --git a/arch/arm/mach-orion5x/board-dt.c b/arch/arm/mach-orion5x/board-dt.c index a26397f58f1f..32e5c211a89b 100644 --- a/arch/arm/mach-orion5x/board-dt.c +++ b/arch/arm/mach-orion5x/board-dt.c @@ -55,6 +55,9 @@ static void __init orion5x_dt_init(void) disable_hlt(); } + if (of_machine_is_compatible("lacie,ethernet-disk-mini-v2")) + edmini_v2_init(); + of_platform_populate(NULL, of_default_bus_match_table, orion5x_auxdata_lookup, NULL); } diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index 2033b79089a7..7db5cdd9c4b7 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h @@ -56,6 +56,13 @@ int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys); struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys); int orion5x_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); +/* board init functions for boards not fully converted to fdt */ +#ifdef CONFIG_MACH_EDMINI_V2_DT +void edmini_v2_init(void); +#else +static inline void edmini_v2_init(void) {}; +#endif + struct meminfo; struct tag; extern void __init tag_fixup_mem32(struct tag *, char **, struct meminfo *); diff --git a/arch/arm/mach-orion5x/edmini_v2-setup.c b/arch/arm/mach-orion5x/edmini_v2-setup.c index 355e962137c7..d675e727803d 100644 --- a/arch/arm/mach-orion5x/edmini_v2-setup.c +++ b/arch/arm/mach-orion5x/edmini_v2-setup.c @@ -114,69 +114,6 @@ static struct i2c_board_info __initdata edmini_v2_i2c_rtc = { .irq = 0, }; -/***************************************************************************** - * Sata - ****************************************************************************/ - -static struct mv_sata_platform_data edmini_v2_sata_data = { - .n_ports = 2, -}; - -/***************************************************************************** - * GPIO LED (simple - doesn't use hardware blinking support) - ****************************************************************************/ - -#define EDMINI_V2_GPIO_LED_POWER 16 - -static struct gpio_led edmini_v2_leds[] = { - { - .name = "power:blue", - .gpio = EDMINI_V2_GPIO_LED_POWER, - .active_low = 1, - }, -}; - -static struct gpio_led_platform_data edmini_v2_led_data = { - .num_leds = ARRAY_SIZE(edmini_v2_leds), - .leds = edmini_v2_leds, -}; - -static struct platform_device edmini_v2_gpio_leds = { - .name = "leds-gpio", - .id = -1, - .dev = { - .platform_data = &edmini_v2_led_data, - }, -}; - -/**************************************************************************** - * GPIO key - ****************************************************************************/ - -#define EDMINI_V2_GPIO_KEY_POWER 18 - -static struct gpio_keys_button edmini_v2_buttons[] = { - { - .code = KEY_POWER, - .gpio = EDMINI_V2_GPIO_KEY_POWER, - .desc = "Power Button", - .active_low = 0, - }, -}; - -static struct gpio_keys_platform_data edmini_v2_button_data = { - .buttons = edmini_v2_buttons, - .nbuttons = ARRAY_SIZE(edmini_v2_buttons), -}; - -static struct platform_device edmini_v2_gpio_buttons = { - .name = "gpio-keys", - .id = -1, - .dev = { - .platform_data = &edmini_v2_button_data, - }, -}; - /***************************************************************************** * General Setup ****************************************************************************/ @@ -207,13 +144,8 @@ static unsigned int edminiv2_mpp_modes[] __initdata = { 0, }; -static void __init edmini_v2_init(void) +void __init edmini_v2_init(void) { - /* - * Setup basic Orion functions. Need to be called early. - */ - orion5x_init(); - orion5x_mpp_conf(edminiv2_mpp_modes); /* @@ -221,15 +153,10 @@ static void __init edmini_v2_init(void) */ orion5x_ehci0_init(); orion5x_eth_init(&edmini_v2_eth_data); - orion5x_i2c_init(); - orion5x_sata_init(&edmini_v2_sata_data); - orion5x_uart0_init(); orion5x_setup_dev_boot_win(EDMINI_V2_NOR_BOOT_BASE, EDMINI_V2_NOR_BOOT_SIZE); platform_device_register(&edmini_v2_nor_flash); - platform_device_register(&edmini_v2_gpio_leds); - platform_device_register(&edmini_v2_gpio_buttons); pr_notice("edmini_v2: USB device port, flash write and power-off " "are not yet supported.\n"); @@ -247,16 +174,3 @@ static void __init edmini_v2_init(void) i2c_register_board_info(0, &edmini_v2_i2c_rtc, 1); } - -/* Warning: LaCie use a wrong mach-type (0x20e=526) in their bootloader. */ -MACHINE_START(EDMINI_V2, "LaCie Ethernet Disk mini V2") - /* Maintainer: Christopher Moore */ - .atag_offset = 0x100, - .init_machine = edmini_v2_init, - .map_io = orion5x_map_io, - .init_early = orion5x_init_early, - .init_irq = orion5x_init_irq, - .timer = &orion5x_timer, - .fixup = tag_fixup_mem32, - .restart = orion5x_restart, -MACHINE_END From 6431165fac43a8d48bf77a732791ac9138187a58 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Fri, 16 Nov 2012 16:39:47 +0100 Subject: [PATCH 14/17] arm: orion5x: add DT related options in defconfig Signed-off-by: Thomas Petazzoni Tested by: Maxime Hadjinlian Acked-by: Andrew Lunn Signed-off-by: Jason Cooper --- arch/arm/configs/orion5x_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/orion5x_defconfig b/arch/arm/configs/orion5x_defconfig index d0875ceb0cee..952430d9e2d9 100644 --- a/arch/arm/configs/orion5x_defconfig +++ b/arch/arm/configs/orion5x_defconfig @@ -27,7 +27,7 @@ CONFIG_MACH_TS409=y CONFIG_MACH_WRT350N_V2=y CONFIG_MACH_TS78XX=y CONFIG_MACH_MV2120=y -CONFIG_MACH_EDMINI_V2=y +CONFIG_MACH_EDMINI_V2_DT=y CONFIG_MACH_D2NET=y CONFIG_MACH_BIGDISK=y CONFIG_MACH_NET2BIG=y @@ -40,6 +40,7 @@ CONFIG_PREEMPT=y CONFIG_AEABI=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ARM_APPENDED_DTB=y CONFIG_FPE_NWFPE=y CONFIG_VFP=y CONFIG_NET=y @@ -94,6 +95,7 @@ CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y # CONFIG_SERIAL_8250_PCI is not set CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +CONFIG_SERIAL_OF_PLATFORM=y CONFIG_HW_RANDOM_TIMERIOMEM=m CONFIG_I2C=y # CONFIG_I2C_COMPAT is not set From 83a3ac3bd2b0c00591bd26e9ee7e48da3154f865 Mon Sep 17 00:00:00 2001 From: Jason Cooper Date: Mon, 19 Nov 2012 07:42:49 +0000 Subject: [PATCH 15/17] ARM: Kirkwood: update defconfig for new boards MPLCEC4_DT is relocated because it had been added manually. Signed-off-by: Jason Cooper --- arch/arm/configs/kirkwood_defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/configs/kirkwood_defconfig b/arch/arm/configs/kirkwood_defconfig index 2fd4d259d866..1128d180eec6 100644 --- a/arch/arm/configs/kirkwood_defconfig +++ b/arch/arm/configs/kirkwood_defconfig @@ -28,12 +28,12 @@ CONFIG_MACH_LSXL_DT=y CONFIG_MACH_IOMEGA_IX2_200_DT=y CONFIG_MACH_KM_KIRKWOOD_DT=y CONFIG_MACH_INETSPACE_V2_DT=y +CONFIG_MACH_MPLCEC4_DT=y 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_MPLCEC4_DT=y CONFIG_MACH_TS219=y CONFIG_MACH_TS41X=y CONFIG_MACH_DOCKSTAR=y @@ -47,6 +47,7 @@ CONFIG_MACH_D2NET_V2=y CONFIG_MACH_NET2BIG_V2=y CONFIG_MACH_NET5BIG_V2=y CONFIG_MACH_T5325=y +CONFIG_MACH_NSA310_DT=y # CONFIG_CPU_FEROCEON_OLD_ID is not set CONFIG_PREEMPT=y CONFIG_AEABI=y From 88bc4a36a985ac14bd60fdc4fee00c68874c52f1 Mon Sep 17 00:00:00 2001 From: Sebastian Hesselbarth Date: Tue, 30 Oct 2012 02:11:45 +0100 Subject: [PATCH 16/17] ARM: Dove: update defconfig It has been a while since dove_defconfig was updated to recent development. This patch adds all currently available Dove boards, including a DT-enabled machine. DT support requires to allow ATAGS passed by boot loader as most of them are not yet capable of passing DT blobs. Also OF_SERIAL is enabled to actually see the bootlog. Finally, sdhci driver for Dove, mv_cesa, GPIO LEDs, and highmem support is added. Signed-off-by: Sebastian Hesselbarth Signed-off-by: Jason Cooper --- arch/arm/configs/dove_defconfig | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/configs/dove_defconfig b/arch/arm/configs/dove_defconfig index 40db34cf2771..0b7ee92c5713 100644 --- a/arch/arm/configs/dove_defconfig +++ b/arch/arm/configs/dove_defconfig @@ -8,11 +8,19 @@ CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set CONFIG_ARCH_DOVE=y CONFIG_MACH_DOVE_DB=y +CONFIG_MACH_CM_A510=y +CONFIG_MACH_DOVE_DT=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y CONFIG_AEABI=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_HIGHMEM=y +CONFIG_USE_OF=y +CONFIG_ATAGS=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y CONFIG_VFP=y CONFIG_NET=y CONFIG_PACKET=y @@ -62,6 +70,9 @@ CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y # CONFIG_SERIAL_8250_PCI is not set CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y # CONFIG_HW_RANDOM is not set CONFIG_I2C=y CONFIG_I2C_CHARDEV=y @@ -74,6 +85,18 @@ CONFIG_USB_DEVICEFS=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_STORAGE=y +CONFIG_MMC=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_IO_ACCESSORS=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_MMC_SDHCI_DOVE=y +CONFIG_NEW_LEDS=y +CONFIG_LEDS_CLASS=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_TRIGGERS=y +CONFIG_LEDS_TRIGGER_TIMER=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_MV=y CONFIG_DMADEVICES=y @@ -122,6 +145,7 @@ CONFIG_CRYPTO_TWOFISH=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y # CONFIG_CRYPTO_ANSI_CPRNG is not set +CONFIG_CRYPTO_DEV_MV_CESA=y CONFIG_CRC_CCITT=y CONFIG_CRC16=y CONFIG_LIBCRC32C=y From f17073a3aec601cb9aba6d8c1c6dbc8c6a919c07 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Tue, 13 Nov 2012 16:43:09 +0900 Subject: [PATCH 17/17] 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 diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index f1ba69c2496a..94561b500429 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 000000000000..9a2606c8b78f --- /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 1128d180eec6..93f3794ba5cb 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 141b105ce8d9..d018ad4bcc3c 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 b5bc33467590..8d2e5a96247c 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 33c0bc1e2f3a..70eb01d96085 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 000000000000..e807e8cfdd44 --- /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 f86fcced0bb1..3e079d1d99d0 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