]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'mvebu/fixes' into mvebu/for-next
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Wed, 8 Apr 2015 14:41:07 +0000 (16:41 +0200)
committerGregory CLEMENT <gregory.clement@free-electrons.com>
Wed, 8 Apr 2015 14:41:07 +0000 (16:41 +0200)
64 files changed:
Documentation/arm/Marvell/README
Documentation/devicetree/bindings/arm/armada-39x.txt [new file with mode: 0644]
Documentation/devicetree/bindings/arm/cpus.txt
Documentation/devicetree/bindings/arm/marvell,kirkwood.txt
Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt [new file with mode: 0644]
Documentation/devicetree/bindings/leds/leds-netxbig.txt [new file with mode: 0644]
Documentation/devicetree/bindings/leds/leds-ns2.txt
arch/arm/boot/dts/Makefile
arch/arm/boot/dts/armada-370-db.dts
arch/arm/boot/dts/armada-370-mirabox.dts
arch/arm/boot/dts/armada-370-netgear-rn102.dts
arch/arm/boot/dts/armada-370-netgear-rn104.dts
arch/arm/boot/dts/armada-370-rd.dts
arch/arm/boot/dts/armada-370-synology-ds213j.dts
arch/arm/boot/dts/armada-370-xp.dtsi
arch/arm/boot/dts/armada-370.dtsi
arch/arm/boot/dts/armada-375-db.dts
arch/arm/boot/dts/armada-375.dtsi
arch/arm/boot/dts/armada-385-db-ap.dts
arch/arm/boot/dts/armada-388-db.dts
arch/arm/boot/dts/armada-388-gp.dts
arch/arm/boot/dts/armada-388-rd.dts
arch/arm/boot/dts/armada-38x.dtsi
arch/arm/boot/dts/armada-390.dtsi [new file with mode: 0644]
arch/arm/boot/dts/armada-398-db.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-398.dtsi [new file with mode: 0644]
arch/arm/boot/dts/armada-39x.dtsi [new file with mode: 0644]
arch/arm/boot/dts/armada-xp-axpwifiap.dts
arch/arm/boot/dts/armada-xp-db.dts
arch/arm/boot/dts/armada-xp-gp.dts
arch/arm/boot/dts/armada-xp-lenovo-ix4-300d.dts
arch/arm/boot/dts/armada-xp-linksys-mamba.dts [new file with mode: 0644]
arch/arm/boot/dts/armada-xp-matrix.dts
arch/arm/boot/dts/armada-xp-mv78260.dtsi
arch/arm/boot/dts/armada-xp-mv78460.dtsi
arch/arm/boot/dts/armada-xp-netgear-rn2120.dts
arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts
arch/arm/boot/dts/armada-xp-synology-ds414.dts
arch/arm/boot/dts/armada-xp.dtsi
arch/arm/boot/dts/dove.dtsi
arch/arm/boot/dts/kirkwood-d2net.dts
arch/arm/boot/dts/kirkwood-is2.dts
arch/arm/boot/dts/kirkwood-nas2big.dts [new file with mode: 0644]
arch/arm/boot/dts/kirkwood-net2big.dts
arch/arm/boot/dts/kirkwood-net5big.dts
arch/arm/boot/dts/kirkwood-netxbig.dtsi
arch/arm/boot/dts/kirkwood-ns2.dts
arch/arm/boot/dts/kirkwood-ns2max.dts
arch/arm/boot/dts/kirkwood-ns2mini.dts
arch/arm/configs/mvebu_v7_defconfig
arch/arm/mach-mvebu/Kconfig
arch/arm/mach-mvebu/Makefile
arch/arm/mach-mvebu/board-v7.c
arch/arm/mach-mvebu/board.h [deleted file]
arch/arm/mach-mvebu/dove.c
arch/arm/mach-mvebu/kirkwood.c
arch/arm/mach-mvebu/netxbig.c [deleted file]
arch/arm/mach-mvebu/platsmp-a9.c
drivers/leds/Kconfig
drivers/leds/leds-netxbig.c
drivers/leds/leds-ns2.c
include/dt-bindings/leds/leds-netxbig.h [new file with mode: 0644]
include/dt-bindings/leds/leds-ns2.h [new file with mode: 0644]
include/linux/platform_data/leds-kirkwood-ns2.h

index 17453794fca5d518be980b1350784a9e3a11ecd2..18a775d101723be46320bbf475f04c066b4c3ea2 100644 (file)
@@ -96,6 +96,11 @@ EBU Armada family
        88F6820
        88F6828
 
+  Armada 390/398 Flavors:
+       88F6920
+       88F6928
+    Product infos: http://www.marvell.com/embedded-processors/armada-39x/
+
   Armada XP Flavors:
         MV78230
         MV78260
diff --git a/Documentation/devicetree/bindings/arm/armada-39x.txt b/Documentation/devicetree/bindings/arm/armada-39x.txt
new file mode 100644 (file)
index 0000000..53d4ff9
--- /dev/null
@@ -0,0 +1,20 @@
+Marvell Armada 39x Platforms Device Tree Bindings
+-------------------------------------------------
+
+Boards with a SoC of the Marvell Armada 39x family shall have the
+following property:
+
+Required root node property:
+
+ - compatible: must contain "marvell,armada390"
+
+In addition, boards using the Marvell Armada 398 SoC shall have the
+following property before the previous one:
+
+Required root node property:
+
+compatible: must contain "marvell,armada398"
+
+Example:
+
+compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada390";
index 8b9e0a95de317e5369932d612ac131be8ac0a641..6aa331d11c5e3e042ff2e0ec495d39e26fe0681c 100644 (file)
@@ -192,6 +192,7 @@ nodes to be present and contain the properties described below.
                            "brcm,brahma-b15"
                            "marvell,armada-375-smp"
                            "marvell,armada-380-smp"
+                           "marvell,armada-390-smp"
                            "marvell,armada-xp-smp"
                            "qcom,gcc-msm8660"
                            "qcom,kpss-acc-v1"
index 925ecbf6e7b7af23681aca4a413553265b41fb0e..4f40ff3fee4b102aa6b4ec460a2b7e0e4bc1a09f 100644 (file)
@@ -42,6 +42,7 @@ board. Currently known boards are:
 "lacie,cloudbox"
 "lacie,inetspace_v2"
 "lacie,laplug"
+"lacie,nas2big"
 "lacie,netspace_lite_v2"
 "lacie,netspace_max_v2"
 "lacie,netspace_mini_v2"
diff --git a/Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt b/Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt
new file mode 100644 (file)
index 0000000..e4fb2fe
--- /dev/null
@@ -0,0 +1,22 @@
+Binding for the GPIO extension bus found on some LaCie/Seagate boards
+(Example: 2Big/5Big Network v2, 2Big NAS).
+
+Required properties:
+- compatible: "lacie,netxbig-gpio-ext".
+- addr-gpios: GPIOs representing the address register.
+- data-gpios: GPIOs representing the data register.
+- enable-gpio: GPIO used to enable the new configuration (address, data).
+
+Example:
+
+netxbig_gpio_ext: netxbig-gpio-ext {
+       compatible = "lacie,netxbig-gpio-ext";
+
+       addr-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH
+                     &gpio1 16 GPIO_ACTIVE_HIGH
+                     &gpio1 17 GPIO_ACTIVE_HIGH>;
+       data-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH
+                     &gpio1 13 GPIO_ACTIVE_HIGH
+                     &gpio1 14 GPIO_ACTIVE_HIGH>;
+       enable-gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>;
+};
diff --git a/Documentation/devicetree/bindings/leds/leds-netxbig.txt b/Documentation/devicetree/bindings/leds/leds-netxbig.txt
new file mode 100644 (file)
index 0000000..a4e64c6
--- /dev/null
@@ -0,0 +1,90 @@
+Binding for the CPLD LEDs (GPIO extension bus) found on some LaCie/Seagate
+boards (Example: 2Big/5Big Network v2, 2Big NAS).
+
+Required properties:
+- compatible: "lacie,netxbig-leds".
+- gpio-ext: Phandle for the gpio-ext bus.
+- timers: Timer array. Each timer entry is represented by three integers:
+  Mode (gpio-ext bus), delay_on and delay_off.
+
+Each LED is represented as a sub-node of the netxbig-leds device.
+
+Required sub-node properties:
+- mode-addr: Mode register address on gpio-ext bus.
+- mode-val: Mode to value mapping. Each entry is represented by two integers:
+  A mode and the corresponding value on the gpio-ext bus.
+- bright-addr: Brightness register address on gpio-ext bus.
+- bright-max: Maximum brightness value.
+
+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:
+
+netxbig-leds {
+       compatible = "lacie,netxbig-leds";
+
+       gpio-ext = &gpio_ext;
+
+       timers = <NETXBIG_LED_TIMER1 500 500
+                 NETXBIG_LED_TIMER2 500 1000>;
+
+       blue-power {
+               label = "netxbig:blue:power";
+               mode-addr = <0>;
+               mode-val = <NETXBIG_LED_OFF 0
+                           NETXBIG_LED_ON 1
+                           NETXBIG_LED_TIMER1 3
+                           NETXBIG_LED_TIMER2 7>;
+               bright-addr = <1>;
+               bright-max = <7>;
+       };
+       red-power {
+               label = "netxbig:red:power";
+               mode-addr = <0>;
+               mode-val = <NETXBIG_LED_OFF 0
+                           NETXBIG_LED_ON 2
+                           NETXBIG_LED_TIMER1 4>;
+               bright-addr = <1>;
+               bright-max = <7>;
+       };
+       blue-sata0 {
+               label = "netxbig:blue:sata0";
+               mode-addr = <3>;
+               mode-val = <NETXBIG_LED_OFF 0
+                           NETXBIG_LED_ON 7
+                           NETXBIG_LED_SATA 1
+                           NETXBIG_LED_TIMER1 3>;
+               bright-addr = <2>;
+               bright-max = <7>;
+       };
+       red-sata0 {
+               label = "netxbig:red:sata0";
+               mode-addr = <3>;
+               mode-val = <NETXBIG_LED_OFF 0
+                           NETXBIG_LED_ON 2
+                           NETXBIG_LED_TIMER1 4>;
+               bright-addr = <2>;
+               bright-max = <7>;
+       };
+       blue-sata1 {
+               label = "netxbig:blue:sata1";
+               mode-addr = <4>;
+               mode-val = <NETXBIG_LED_OFF 0
+                           NETXBIG_LED_ON 7
+                           NETXBIG_LED_SATA 1
+                           NETXBIG_LED_TIMER1 3>;
+               bright-addr = <2>;
+               bright-max = <7>;
+       };
+       red-sata1 {
+               label = "netxbig:red:sata1";
+               mode-addr = <4>;
+               mode-val = <NETXBIG_LED_OFF 0
+                           NETXBIG_LED_ON 2
+                           NETXBIG_LED_TIMER1 4>;
+               bright-addr = <2>;
+               bright-max = <7>;
+       };
+};
index aef3aca34d2d4272dbf49440bd32712a87e38c29..9f81258a5b6e9035835c0cb230559a5a6e7a68f0 100644 (file)
@@ -8,6 +8,9 @@ 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.
+- modes-map: A mapping between LED modes (off, on or SATA activity blinking) and
+  the corresponding cmd-gpio/slow-gpio values. All the GPIO values combinations
+  should be given in order to avoid having an unknown mode at driver probe time.
 
 Optional sub-node properties:
 - label: Name for this LED. If omitted, the label is taken from the node name.
@@ -15,6 +18,8 @@ Optional sub-node properties:
 
 Example:
 
+#include <dt-bindings/leds/leds-ns2.h>
+
 ns2-leds {
        compatible = "lacie,ns2-leds";
 
@@ -22,5 +27,9 @@ ns2-leds {
                label = "ns2:blue:sata";
                slow-gpio = <&gpio0 29 0>;
                cmd-gpio = <&gpio0 30 0>;
+               modes-map = <NS_V2_LED_OFF  0 1
+                            NS_V2_LED_ON   1 0
+                            NS_V2_LED_ON   0 0
+                            NS_V2_LED_SATA 1 1>;
        };
 };
index a1c776b8dcec51554879d1e001f7f96bd653efd8..b2e51fe3da52be0394e242046eb6ab6ce0fa9153 100644 (file)
@@ -165,6 +165,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
        kirkwood-lsxhl.dtb \
        kirkwood-mplcec4.dtb \
        kirkwood-mv88f6281gtw-ge.dtb \
+       kirkwood-nas2big.dtb \
        kirkwood-net2big.dtb \
        kirkwood-net5big.dtb \
        kirkwood-netgear_readynas_duo_v2.dtb \
@@ -624,11 +625,14 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \
        armada-388-db.dtb \
        armada-388-gp.dtb \
        armada-388-rd.dtb
+dtb-$(CONFIG_MACH_ARMADA_39X) += \
+       armada-398-db.dtb
 dtb-$(CONFIG_MACH_ARMADA_XP) += \
        armada-xp-axpwifiap.dtb \
        armada-xp-db.dtb \
        armada-xp-gp.dtb \
        armada-xp-lenovo-ix4-300d.dtb \
+       armada-xp-linksys-mamba.dtb \
        armada-xp-matrix.dtb \
        armada-xp-netgear-rn2120.dtb \
        armada-xp-openblocks-ax3-4.dtb \
index dede3e737a4530f9f97446fb4519b9cd174ae4b3..19f3bf271915fc1dd843a7d10d50df353b4b52d2 100644 (file)
@@ -64,7 +64,7 @@
        compatible = "marvell,a370-db", "marvell,armada370", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index b10ceb488efe5d5aec3b8e91241ae6172e206564..0f40d5da28c3c30ec83a27bacbf9332d9ad23c41 100644 (file)
@@ -51,7 +51,7 @@
        compatible = "globalscale,mirabox", "marvell,armada370", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 3f8cc3845a5e9423f0536ee3c201af4a1b8c5e51..a31207860f34ea385cee3d241c1c902a48d7d6a2 100644 (file)
@@ -53,7 +53,7 @@
        compatible = "netgear,readynas-102", "marvell,armada370", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 99eb8a014ac631df0a26b992f571be829c467411..00540f292979c57e4107ca4b4b9ef51c89e28009 100644 (file)
@@ -53,7 +53,7 @@
        compatible = "netgear,readynas-104", "marvell,armada370", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 6ae36a38beb25b8b1f9930f74dcb250173c627e7..19475e68b8e9246ef5220e0ec3857e5bee4b2192 100644 (file)
@@ -64,7 +64,7 @@
        compatible = "marvell,a370-rd", "marvell,armada370", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 59f74e66963f164b7949f41dc6a520077e2d7fd8..b42b767763aaa41c5a96420e4415efc7683adb16 100644 (file)
@@ -67,8 +67,7 @@
                     "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
-               stdout-path = &uart0;
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 8a322ad57e5fbb0bd0ef15ca19f4387169abeb03..ec96f0b3634653a5976739688eca9fd791eaba0b 100644 (file)
@@ -59,8 +59,8 @@
        compatible = "marvell,armada-370-xp";
 
        aliases {
-               eth0 = &eth0;
-               eth1 = &eth1;
+               serial0 = &uart0;
+               serial1 = &uart1;
        };
 
        cpus {
                };
        };
 
+       pmu {
+               compatible = "arm,cortex-a9-pmu";
+               interrupts-extended = <&mpic 3>;
+       };
+
        soc {
                #address-cells = <2>;
                #size-cells = <1>;
                                      <0x20250 0x8>;
                        };
 
-                       mpic: interrupt-controller@20000 {
+                       mpic: interrupt-controller@20a00 {
                                compatible = "marvell,mpic";
                                #interrupt-cells = <1>;
                                #size-cells = <1>;
index 27397f151def76d9560a6855c87f2ea7afc052bd..00b50db57c9c0f7ab4111bbdba06d3fd0bdc93ad 100644 (file)
                                compatible = "marvell,aurora-outer-cache";
                                reg = <0x08000 0x1000>;
                                cache-id-part = <0x100>;
+                               cache-level = <2>;
                                cache-unified;
                                wt-override;
                        };
                                reg = <0x18330 0x4>;
                        };
 
-                       interrupt-controller@20000 {
+                       interrupt-controller@20a00 {
                                reg = <0x20a00 0x1d0>, <0x21870 0x58>;
                        };
 
index 0440891425c0408723c6ea75db1518105328f2db..4eabc9c21f8dc1e84f399edb6e56a2bdf992a7ed 100644 (file)
@@ -55,7 +55,7 @@
        compatible = "marvell,a375-db", "marvell,armada375";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index ba3c57e0af72ac577d2e82fa3d9536569dd98e24..c675257f2377f8797565871e38e77ba50fe7678b 100644 (file)
@@ -60,8 +60,8 @@
                gpio0 = &gpio0;
                gpio1 = &gpio1;
                gpio2 = &gpio2;
-               ethernet0 = &eth0;
-               ethernet1 = &eth1;
+               serial0 = &uart0;
+               serial1 = &uart1;
        };
 
        clocks {
                };
        };
 
+       pmu {
+               compatible = "arm,cortex-a9-pmu";
+               interrupts-extended = <&mpic 3>;
+       };
+
        soc {
                compatible = "marvell,armada375-mbus", "simple-bus";
                #address-cells = <2>;
                                status = "disabled";
                        };
 
-                       serial@12000 {
+                       uart0: serial@12000 {
                                compatible = "snps,dw-apb-uart";
                                reg = <0x12000 0x100>;
                                reg-shift = <2>;
                                status = "disabled";
                        };
 
-                       serial@12100 {
+                       uart1: serial@12100 {
                                compatible = "snps,dw-apb-uart";
                                reg = <0x12100 0x100>;
                                reg-shift = <2>;
                                reg = <0x20000 0x100>, <0x20180 0x20>;
                        };
 
-                       mpic: interrupt-controller@20000 {
+                       mpic: interrupt-controller@20a00 {
                                compatible = "marvell,mpic";
                                reg = <0x20a00 0x2d0>, <0x21070 0x58>;
                                #interrupt-cells = <1>;
index 57b9119fb3e05e974ee8931286d2635ab57110fe..7219ac3a3d900743114fd7d9001748118695515e 100644 (file)
@@ -49,8 +49,7 @@
        compatible = "marvell,a385-db-ap", "marvell,armada385", "marvell,armada38x";
 
        chosen {
-               bootargs = "console=ttyS0,115200";
-               stdout-path = &uart1;
+               stdout-path = "serial1:115200n8";
        };
 
        memory {
                                status = "okay";
                        };
 
+                       pinctrl@18000 {
+                               xhci0_vbus_pins: xhci0-vbus-pins {
+                                       marvell,pins = "mpp44";
+                                       marvell,function = "gpio";
+                               };
+                       };
+
                        ethernet@30000 {
                                status = "okay";
                                phy = <&phy2>;
                                phy = <&phy0>;
                                phy-mode = "rgmii-id";
                        };
+
+                       nfc: flash@d0000 {
+                               status = "okay";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               num-cs = <1>;
+                               nand-ecc-strength = <4>;
+                               nand-ecc-step-size = <512>;
+                               marvell,nand-keep-config;
+                               marvell,nand-enable-arbiter;
+                               nand-on-flash-bbt;
+                       };
+
+                       usb3@f0000 {
+                               status = "okay";
+                               usb-phy = <&usb3_phy>;
+                       };
                };
 
                pcie-controller {
                        };
                };
        };
+
+       usb3_phy: usb3_phy {
+               compatible = "usb-nop-xceiv";
+               vcc-supply = <&reg_xhci0_vbus>;
+       };
+
+       reg_xhci0_vbus: xhci0-vbus {
+               compatible = "regulator-fixed";
+               pinctrl-names = "default";
+               pinctrl-0 = <&xhci0_vbus_pins>;
+               regulator-name = "xhci0-vbus";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               enable-active-high;
+               gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
+       };
 };
index 16512efcd32c091702a9a99c6ea93139598b8a5f..51d1623de53e6967750b6c602ccaeef40359a535 100644 (file)
@@ -54,7 +54,7 @@
                "marvell,armada385", "marvell,armada380";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
@@ -99,7 +99,7 @@
                                phy-mode = "rgmii-id";
                        };
 
-                       usb@50000 {
+                       usb@58000 {
                                status = "ok";
                        };
 
index 590b383db323a75a1041080951d32dbf27e3e9fa..78514ab0b47ace058f49b0da052d131374a8f5d2 100644 (file)
@@ -48,8 +48,7 @@
        compatible = "marvell,a385-gp", "marvell,armada388", "marvell,armada380";
 
        chosen {
-               bootargs = "console=ttyS0,115200";
-               stdout-path = &uart0;
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
                        };
 
                        /* CON4 */
-                       usb@50000 {
+                       usb@58000 {
                                vcc-supply = <&reg_usb2_0_vbus>;
                                status = "okay";
                        };
index d99baac72081b6873532bec2d2587c769a581040..1dc6e2341cc2853829abb077441b27f2cfe4456e 100644 (file)
@@ -55,7 +55,7 @@
                "marvell,armada385","marvell,armada380";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
                                clock-frequency = <100000>;
                        };
 
+                       sdhci@d8000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&sdhci_pins>;
+                               broken-cd;
+                               no-1-8-v;
+                               wp-inverted;
+                               bus-width = <8>;
+                               status = "okay";
+                       };
+
                        serial@12000 {
                                status = "okay";
                        };
index 1dff30a81e247a12ecd88f1c37b2b8dd6a55d2c1..ed2dd8ba4080df7a7f85db89068de44cd693446b 100644 (file)
        aliases {
                gpio0 = &gpio0;
                gpio1 = &gpio1;
-               ethernet0 = &eth0;
-               ethernet1 = &eth1;
-               ethernet2 = &eth2;
+               serial0 = &uart0;
+               serial1 = &uart1;
+       };
+
+       pmu {
+               compatible = "arm,cortex-a9-pmu";
+               interrupts-extended = <&mpic 3>;
        };
 
        soc {
                                status = "disabled";
                        };
 
-                       serial@12100 {
+                       uart1: serial@12100 {
                                compatible = "snps,dw-apb-uart";
                                reg = <0x12100 0x100>;
                                reg-shift = <2>;
                                reg = <0x20000 0x100>, <0x20180 0x20>;
                        };
 
-                       mpic: interrupt-controller@20000 {
+                       mpic: interrupt-controller@20a00 {
                                compatible = "marvell,mpic";
                                reg = <0x20a00 0x2d0>, <0x21070 0x58>;
                                #interrupt-cells = <1>;
                                status = "disabled";
                        };
 
-                       usb@50000 {
+                       usb@58000 {
                                compatible = "marvell,orion-ehci";
                                reg = <0x58000 0x500>;
                                interrupts = <GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>;
 
                        sdhci@d8000 {
                                compatible = "marvell,armada-380-sdhci";
-                               reg = <0xd8000 0x1000>, <0xdc000 0x100>;
-                               interrupts = <0 25 0x4>;
+                               reg-names = "sdhci", "mbus", "conf-sdio3";
+                               reg = <0xd8000 0x1000>,
+                                       <0xdc000 0x100>,
+                                       <0x18454 0x4>;
+                               interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
                                clocks = <&gateclk 17>;
                                mrvl,clk-delay-cycles = <0x1F>;
                                status = "disabled";
diff --git a/arch/arm/boot/dts/armada-390.dtsi b/arch/arm/boot/dts/armada-390.dtsi
new file mode 100644 (file)
index 0000000..094e39c
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Device Tree Include file for Marvell Armada 390 SoC.
+ *
+ * Copyright (C) 2015 Marvell
+ *
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "armada-39x.dtsi"
+
+/ {
+       soc {
+               internal-regs {
+                       pinctrl@18000 {
+                               compatible = "marvell,mv88f6920-pinctrl";
+                               reg = <0x18000 0x20>;
+                       };
+               };
+};
diff --git a/arch/arm/boot/dts/armada-398-db.dts b/arch/arm/boot/dts/armada-398-db.dts
new file mode 100644 (file)
index 0000000..bbf8375
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Device Tree Include file for Marvell Armada 398 Development Board
+ *
+ * Copyright (C) 2015 Marvell
+ *
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "armada-398.dtsi"
+
+/ {
+       model = "Marvell Armada 398 Development Board";
+       compatible = "marvell,a398-db", "marvell,armada398", "marvell,armada390";
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x80000000>; /* 2 GB */
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000
+                         MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000>;
+
+               internal-regs {
+                       spi@10680 {
+                               status = "okay";
+                               pinctrl-0 = <&spi1_pins>;
+                               pinctrl-names = "default";
+
+                               spi-flash@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       compatible = "n25q128a13";
+                                       reg = <0>;
+                                       spi-max-frequency = <108000000>;
+
+                                       partition@0 {
+                                               label = "U-Boot";
+                                               reg = <0 0x400000>;
+                                       };
+
+                                       partition@400000 {
+                                               label = "Filesystem";
+                                               reg = <0x400000 0x1000000>;
+                                       };
+                               };
+                       };
+
+                       i2c@11000 {
+                               pinctrl-0 = <&i2c0_pins>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                               clock-frequency = <100000>;
+                       };
+
+                       serial@12000 {
+                               pinctrl-0 = <&uart0_pins>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                       };
+
+                       serial@12100 {
+                               pinctrl-0 = <&uart1_pins>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                       };
+
+                       flash@d0000 {
+                               status = "okay";
+                               pinctrl-0 = <&nand_pins>;
+                               pinctrl-names = "default";
+                               num-cs = <1>;
+                               marvell,nand-keep-config;
+                               marvell,nand-enable-arbiter;
+                               nand-on-flash-bbt;
+                               nand-ecc-strength = <8>;
+                               nand-ecc-step-size = <512>;
+
+                               partition@0 {
+                                       label = "U-Boot";
+                                       reg = <0 0x800000>;
+                               };
+                               partition@800000 {
+                                       label = "Linux";
+                                       reg = <0x800000 0x800000>;
+                               };
+                               partition@1000000 {
+                                       label = "Filesystem";
+                                       reg = <0x1000000 0x3f000000>;
+                               };
+                       };
+               };
+
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+
+                       pcie@2,0 {
+                               status = "okay";
+                       };
+
+                       pcie@3,0 {
+                               status = "okay";
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/armada-398.dtsi b/arch/arm/boot/dts/armada-398.dtsi
new file mode 100644 (file)
index 0000000..fdc2591
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Device Tree Include file for Marvell Armada 398 SoC.
+ *
+ * Copyright (C) 2015 Marvell
+ *
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "armada-39x.dtsi"
+
+/ {
+       compatible = "marvell,armada398", "marvell,armada390";
+
+       soc {
+               internal-regs {
+                       pinctrl@18000 {
+                               compatible = "marvell,mv88f6928-pinctrl";
+                               reg = <0x18000 0x20>;
+                       };
+               };
+       };
+};
diff --git a/arch/arm/boot/dts/armada-39x.dtsi b/arch/arm/boot/dts/armada-39x.dtsi
new file mode 100644 (file)
index 0000000..0e85fc1
--- /dev/null
@@ -0,0 +1,508 @@
+/*
+ * Device Tree Include file for Marvell Armada 39x family of SoCs.
+ *
+ * Copyright (C) 2015 Marvell
+ *
+ * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include "skeleton.dtsi"
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+#define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
+
+/ {
+       model = "Marvell Armada 39x family SoC";
+       compatible = "marvell,armada390";
+
+       aliases {
+               serial0 = &uart0;
+               serial1 = &uart1;
+               serial2 = &uart2;
+               serial3 = &uart3;
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               enable-method = "marvell,armada-390-smp";
+
+               cpu@0 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <0>;
+               };
+               cpu@1 {
+                       device_type = "cpu";
+                       compatible = "arm,cortex-a9";
+                       reg = <1>;
+               };
+       };
+
+       soc {
+               compatible = "marvell,armada390-mbus", "marvell,armadaxp-mbus",
+                            "simple-bus";
+               #address-cells = <2>;
+               #size-cells = <1>;
+               controller = <&mbusc>;
+               interrupt-parent = <&gic>;
+               pcie-mem-aperture = <0xe0000000 0x8000000>;
+               pcie-io-aperture  = <0xe8000000 0x100000>;
+
+               bootrom {
+                       compatible = "marvell,bootrom";
+                       reg = <MBUS_ID(0x01, 0x1d) 0 0x200000>;
+               };
+
+               internal-regs {
+                       compatible = "simple-bus";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 MBUS_ID(0xf0, 0x01) 0 0x100000>;
+
+                       L2: cache-controller@8000 {
+                               compatible = "arm,pl310-cache";
+                               reg = <0x8000 0x1000>;
+                               cache-unified;
+                               cache-level = <2>;
+                       };
+
+                       scu@c000 {
+                               compatible = "arm,cortex-a9-scu";
+                               reg = <0xc000 0x100>;
+                       };
+
+                       timer@c600 {
+                               compatible = "arm,cortex-a9-twd-timer";
+                               reg = <0xc600 0x20>;
+                               interrupts = <GIC_PPI 13 (IRQ_TYPE_EDGE_RISING | GIC_CPU_MASK_SIMPLE(2))>;
+                               clocks = <&coreclk 2>;
+                       };
+
+                       gic: interrupt-controller@d000 {
+                               compatible = "arm,cortex-a9-gic";
+                               #interrupt-cells = <3>;
+                               #size-cells = <0>;
+                               interrupt-controller;
+                               reg = <0xd000 0x1000>,
+                                     <0xc100 0x100>;
+                       };
+
+                       spi0: spi@10600 {
+                               compatible = "marvell,orion-spi";
+                               reg = <0x10600 0x50>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               cell-index = <0>;
+                               interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       spi1: spi@10680 {
+                               compatible = "marvell,orion-spi";
+                               reg = <0x10680 0x50>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               cell-index = <1>;
+                               interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       i2c0: i2c@11000 {
+                               compatible = "marvell,mv64xxx-i2c";
+                               reg = <0x11000 0x20>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
+                               timeout-ms = <1000>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       i2c1: i2c@11100 {
+                               compatible = "marvell,mv64xxx-i2c";
+                               reg = <0x11100 0x20>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
+                               timeout-ms = <1000>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       i2c2: i2c@11200 {
+                               compatible = "marvell,mv64xxx-i2c";
+                               reg = <0x11200 0x20>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+                               timeout-ms = <1000>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       i2c3: i2c@11300 {
+                               compatible = "marvell,mv64xxx-i2c";
+                               reg = <0x11300 0x20>;
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+                               interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+                               timeout-ms = <1000>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       uart0: serial@12000 {
+                               compatible = "snps,dw-apb-uart";
+                               reg = <0x12000 0x100>;
+                               reg-shift = <2>;
+                               interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       uart1: serial@12100 {
+                               compatible = "snps,dw-apb-uart";
+                               reg = <0x12100 0x100>;
+                               reg-shift = <2>;
+                               interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       uart2: serial@12200 {
+                               compatible = "snps,dw-apb-uart";
+                               reg = <0x12200 0x100>;
+                               reg-shift = <2>;
+                               interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       uart3: serial@12300 {
+                               compatible = "snps,dw-apb-uart";
+                               reg = <0x12300 0x100>;
+                               reg-shift = <2>;
+                               interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
+                               reg-io-width = <1>;
+                               clocks = <&coreclk 0>;
+                               status = "disabled";
+                       };
+
+                       pinctrl@18000 {
+                               i2c0_pins: i2c0-pins {
+                                       marvell,pins = "mpp2", "mpp3";
+                                       marvell,function = "i2c0";
+                               };
+
+                               uart0_pins: uart0-pins {
+                                       marvell,pins = "mpp0", "mpp1";
+                                       marvell,function = "ua0";
+                               };
+
+                               uart1_pins: uart1-pins {
+                                       marvell,pins = "mpp19", "mpp20";
+                                       marvell,function = "ua1";
+                               };
+
+                               spi1_pins: spi1-pins {
+                                       marvell,pins = "mpp56", "mpp57", "mpp58", "mpp59";
+                                       marvell,function = "spi1";
+                               };
+
+                               nand_pins: nand-pins {
+                                       marvell,pins = "mpp22", "mpp34", "mpp23", "mpp33",
+                                                      "mpp38", "mpp28", "mpp40", "mpp42",
+                                                      "mpp35", "mpp36", "mpp25", "mpp30",
+                                                      "mpp32";
+                                       marvell,function = "dev";
+                               };
+                       };
+
+                       system-controller@18200 {
+                               compatible = "marvell,armada-390-system-controller",
+                                            "marvell,armada-370-xp-system-controller";
+                               reg = <0x18200 0x100>;
+                       };
+
+                       gateclk: clock-gating-control@18220 {
+                               compatible = "marvell,armada-390-gating-clock";
+                               reg = <0x18220 0x4>;
+                               clocks = <&coreclk 0>;
+                               #clock-cells = <1>;
+                       };
+
+                       coreclk: mvebu-sar@18600 {
+                               compatible = "marvell,armada-390-core-clock";
+                               reg = <0x18600 0x04>;
+                               #clock-cells = <1>;
+                       };
+
+                       mbusc: mbus-controller@20000 {
+                               compatible = "marvell,mbus-controller";
+                               reg = <0x20000 0x100>, <0x20180 0x20>, <0x20250 0x8>;
+                       };
+
+                       mpic: interrupt-controller@20a00 {
+                               compatible = "marvell,mpic";
+                               reg = <0x20a00 0x2d0>, <0x21070 0x58>;
+                               #interrupt-cells = <1>;
+                               #size-cells = <1>;
+                               interrupt-controller;
+                               msi-controller;
+                               interrupts = <GIC_PPI 15 IRQ_TYPE_LEVEL_HIGH>;
+                       };
+
+                       timer@20300 {
+                               compatible = "marvell,armada-380-timer",
+                                            "marvell,armada-xp-timer";
+                               reg = <0x20300 0x30>, <0x21040 0x30>;
+                               interrupts-extended = <&gic  GIC_SPI  8 IRQ_TYPE_LEVEL_HIGH>,
+                                                     <&gic  GIC_SPI  9 IRQ_TYPE_LEVEL_HIGH>,
+                                                     <&gic  GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>,
+                                                     <&gic  GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
+                                                     <&mpic 5>,
+                                                     <&mpic 6>;
+                               clocks = <&coreclk 2>, <&coreclk 5>;
+                               clock-names = "nbclk", "fixed";
+                       };
+
+                       cpurst@20800 {
+                               compatible = "marvell,armada-370-cpu-reset";
+                               reg = <0x20800 0x10>;
+                       };
+
+                       pmsu@22000 {
+                               compatible = "marvell,armada-390-pmsu",
+                                            "marvell,armada-380-pmsu";
+                               reg = <0x22000 0x1000>;
+                       };
+
+                       xor@60800 {
+                               compatible = "marvell,orion-xor";
+                               reg = <0x60800 0x100
+                                      0x60a00 0x100>;
+                               clocks = <&gateclk 22>;
+                               status = "okay";
+
+                               xor00 {
+                                       interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmacap,memcpy;
+                                       dmacap,xor;
+                               };
+                               xor01 {
+                                       interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmacap,memcpy;
+                                       dmacap,xor;
+                                       dmacap,memset;
+                               };
+                       };
+
+                       xor@60900 {
+                               compatible = "marvell,orion-xor";
+                               reg = <0x60900 0x100
+                                      0x60b00 0x100>;
+                               clocks = <&gateclk 28>;
+                               status = "okay";
+
+                               xor10 {
+                                       interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmacap,memcpy;
+                                       dmacap,xor;
+                               };
+                               xor11 {
+                                       interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
+                                       dmacap,memcpy;
+                                       dmacap,xor;
+                                       dmacap,memset;
+                               };
+                       };
+
+                       flash@d0000 {
+                               compatible = "marvell,armada370-nand";
+                               reg = <0xd0000 0x54>;
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&coredivclk 0>;
+                               status = "disabled";
+                       };
+
+                       sdhci@d8000 {
+                               compatible = "marvell,armada-380-sdhci";
+                               reg = <0xd8000 0x1000>, <0xdc000 0x100>;
+                               interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
+                               clocks = <&gateclk 17>;
+                               mrvl,clk-delay-cycles = <0x1F>;
+                               status = "disabled";
+                       };
+
+                       coredivclk: clock@e4250 {
+                               compatible = "marvell,armada-390-corediv-clock",
+                                            "marvell,armada-380-corediv-clock";
+                               reg = <0xe4250 0xc>;
+                               #clock-cells = <1>;
+                               clocks = <&mainpll>;
+                               clock-output-names = "nand";
+                       };
+               };
+
+               pcie-controller {
+                       compatible = "marvell,armada-370-pcie";
+                       status = "disabled";
+                       device_type = "pci";
+
+                       #address-cells = <3>;
+                       #size-cells = <2>;
+
+                       msi-parent = <&mpic>;
+                       bus-range = <0x00 0xff>;
+
+                       ranges =
+                              <0x82000000 0 0x80000 MBUS_ID(0xf0, 0x01) 0x80000 0 0x00002000
+                               0x82000000 0 0x40000 MBUS_ID(0xf0, 0x01) 0x40000 0 0x00002000
+                               0x82000000 0 0x44000 MBUS_ID(0xf0, 0x01) 0x44000 0 0x00002000
+                               0x82000000 0 0x48000 MBUS_ID(0xf0, 0x01) 0x48000 0 0x00002000
+                               0x82000000 0x1 0     MBUS_ID(0x08, 0xe8) 0 1 0 /* Port 0 MEM */
+                               0x81000000 0x1 0     MBUS_ID(0x08, 0xe0) 0 1 0 /* Port 0 IO  */
+                               0x82000000 0x2 0     MBUS_ID(0x04, 0xe8) 0 1 0 /* Port 1 MEM */
+                               0x81000000 0x2 0     MBUS_ID(0x04, 0xe0) 0 1 0 /* Port 1 IO  */
+                               0x82000000 0x3 0     MBUS_ID(0x04, 0xd8) 0 1 0 /* Port 2 MEM */
+                               0x81000000 0x3 0     MBUS_ID(0x04, 0xd0) 0 1 0 /* Port 2 IO  */
+                               0x82000000 0x4 0     MBUS_ID(0x04, 0xb8) 0 1 0 /* Port 3 MEM */
+                               0x81000000 0x4 0     MBUS_ID(0x04, 0xb0) 0 1 0 /* Port 3 IO  */>;
+
+                       /*
+                        * This port can be either x4 or x1. When
+                        * configured in x4 by the bootloader, then
+                        * pcie@4,0 is not available.
+                        */
+                       pcie@1,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x80000 0 0x2000>;
+                               reg = <0x0800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x1 0 1 0
+                                         0x81000000 0 0 0x81000000 0x1 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+                               marvell,pcie-port = <0>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 8>;
+                               status = "disabled";
+                       };
+
+                       /* x1 port */
+                       pcie@2,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
+                               reg = <0x1000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x2 0 1 0
+                                         0x81000000 0 0 0x81000000 0x2 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+                               marvell,pcie-port = <1>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 5>;
+                               status = "disabled";
+                       };
+
+                       /* x1 port */
+                       pcie@3,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x44000 0 0x2000>;
+                               reg = <0x1800 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x3 0 1 0
+                                         0x81000000 0 0 0x81000000 0x3 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &gic GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>;
+                               marvell,pcie-port = <2>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 6>;
+                               status = "disabled";
+                       };
+
+                       /*
+                        * x1 port only available when pcie@1,0 is
+                        * configured as a x1 port
+                        */
+                       pcie@4,0 {
+                               device_type = "pci";
+                               assigned-addresses = <0x82000800 0 0x48000 0 0x2000>;
+                               reg = <0x2000 0 0 0 0>;
+                               #address-cells = <3>;
+                               #size-cells = <2>;
+                               #interrupt-cells = <1>;
+                               ranges = <0x82000000 0 0 0x82000000 0x4 0 1 0
+                                         0x81000000 0 0 0x81000000 0x4 0 1 0>;
+                               interrupt-map-mask = <0 0 0 0>;
+                               interrupt-map = <0 0 0 0 &gic GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                               marvell,pcie-port = <3>;
+                               marvell,pcie-lane = <0>;
+                               clocks = <&gateclk 7>;
+                               status = "disabled";
+                       };
+               };
+       };
+
+       clocks {
+               /* 2 GHz fixed main PLL */
+               mainpll: mainpll {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency = <2000000000>;
+               };
+       };
+};
index c1fbab2436095e28a72542abbe3111e1609e573d..dfd782b44e506b6fd34a8efbade76b9f94c001c6 100644 (file)
@@ -59,7 +59,7 @@
        compatible = "marvell,rd-axpwifiap", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 48bdafe17526ab7fa6960281cc2a7cdfdf2ee82e..1037824076189db621c58809ba539693be09e3e0 100644 (file)
@@ -64,7 +64,7 @@
        compatible = "marvell,axp-db", "marvell,armadaxp-mv78460", "marvell,armadaxp", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 206aebba01beea82a820163778bd4dc793cea05d..565227eacf06092d518d87cc2255a6e65093abaf 100644 (file)
@@ -65,7 +65,7 @@
        compatible = "marvell,axp-gp", "marvell,armadaxp-mv78460", "marvell,armadaxp", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 5fb3c8b687cfad7100f7a1827197cb7811dca39e..06a6a6c1fdf709446ed713fd189a1471e6509fd3 100644 (file)
@@ -54,8 +54,7 @@
                     "marvell,armadaxp", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
-               stdout-path = &uart0;
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
diff --git a/arch/arm/boot/dts/armada-xp-linksys-mamba.dts b/arch/arm/boot/dts/armada-xp-linksys-mamba.dts
new file mode 100644 (file)
index 0000000..a2cf215
--- /dev/null
@@ -0,0 +1,393 @@
+/*
+ * Device Tree file for the Linksys WRT1900AC (Mamba).
+ *
+ * Note: this board is shipped with a new generation boot loader that
+ * remaps internal registers at 0xf1000000. Therefore, if earlyprintk
+ * is used, the CONFIG_DEBUG_MVEBU_UART0_ALTERNATE option should be
+ * used.
+ *
+ * Copyright (C) 2014 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * Based on armada-xp-axpwifiap.dts:
+ *
+ *     Copyright (C) 2013 Marvell
+ *
+ *     Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) 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.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include "armada-xp-mv78230.dtsi"
+
+/ {
+       model = "Linksys WRT1900AC";
+       compatible = "linksys,mamba", "marvell,armadaxp-mv78230",
+                    "marvell,armadaxp", "marvell,armada-370-xp";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+               stdout-path = &uart0;
+       };
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x00000000 0x00000000 0x10000000>; /* 256MB */
+       };
+
+       soc {
+               ranges = <MBUS_ID(0xf0, 0x01) 0 0 0xf1000000 0x100000
+                         MBUS_ID(0x01, 0x1d) 0 0 0xfff00000 0x100000>;
+
+               pcie-controller {
+                       status = "okay";
+
+                       /* Etron EJ168 USB 3.0 controller */
+                       pcie@1,0 {
+                               /* Port 0, Lane 0 */
+                               status = "okay";
+                       };
+
+                       /* First mini-PCIe port */
+                       pcie@2,0 {
+                               /* Port 0, Lane 1 */
+                               status = "okay";
+                       };
+
+                       /* Second mini-PCIe port */
+                       pcie@3,0 {
+                               /* Port 0, Lane 3 */
+                               status = "okay";
+                       };
+               };
+
+               internal-regs {
+
+                       /* J10: VCC, NC, RX, NC, TX, GND  */
+                       serial@12000 {
+                               status = "okay";
+                       };
+
+                       sata@a0000 {
+                               nr-ports = <1>;
+                               status = "okay";
+                       };
+
+                       ethernet@70000 {
+                               pinctrl-0 = <&ge0_rgmii_pins>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                               phy-mode = "rgmii-id";
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       ethernet@74000 {
+                               pinctrl-0 = <&ge1_rgmii_pins>;
+                               pinctrl-names = "default";
+                               status = "okay";
+                               phy-mode = "rgmii-id";
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       /* USB part of the eSATA/USB 2.0 port */
+                       usb@50000 {
+                               status = "okay";
+                       };
+
+                       i2c@11000 {
+                               status = "okay";
+                               clock-frequency = <100000>;
+
+                               tmp421@4c {
+                                       compatible = "ti,tmp421";
+                                       reg = <0x4c>;
+                               };
+
+                               tlc59116@68 {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       #gpio-cells = <2>;
+                                       compatible = "ti,tlc59116";
+                                       reg = <0x68>;
+
+                                       wan_amber@0 {
+                                               label = "mamba:amber:wan";
+                                               reg = <0x0>;
+                                       };
+
+                                       wan_white@1 {
+                                               label = "mamba:white:wan";
+                                               reg = <0x1>;
+                                       };
+
+                                       wlan_2g@2 {
+                                               label = "mamba:white:wlan_2g";
+                                               reg = <0x2>;
+                                       };
+
+                                       wlan_5g@3 {
+                                               label = "mamba:white:wlan_5g";
+                                               reg = <0x3>;
+                                       };
+
+                                       esata@4 {
+                                               label = "mamba:white:esata";
+                                               reg = <0x4>;
+                                       };
+
+                                       usb2@5 {
+                                               label = "mamba:white:usb2";
+                                               reg = <0x5>;
+                                       };
+
+                                       usb3_1@6 {
+                                               label = "mamba:white:usb3_1";
+                                               reg = <0x6>;
+                                       };
+
+                                       usb3_2@7 {
+                                               label = "mamba:white:usb3_2";
+                                               reg = <0x7>;
+                                       };
+
+                                       wps_white@8 {
+                                               label = "mamba:white:wps";
+                                               reg = <0x8>;
+                                       };
+
+                                       wps_amber@9 {
+                                               label = "mamba:amber:wps";
+                                               reg = <0x9>;
+                                       };
+                               };
+                       };
+
+                       nand@d0000 {
+                               status = "okay";
+                               num-cs = <1>;
+                               marvell,nand-keep-config;
+                               marvell,nand-enable-arbiter;
+                               nand-on-flash-bbt;
+                               nand-ecc-strength = <4>;
+                               nand-ecc-step-size = <512>;
+
+                               partition@0 {
+                                       label = "u-boot";
+                                       reg = <0x0000000 0x100000>;  /* 1MB */
+                                       read-only;
+                               };
+
+                               partition@100000 {
+                                       label = "u_env";
+                                       reg = <0x100000 0x40000>;    /* 256KB */
+                               };
+
+                               partition@140000 {
+                                       label = "s_env";
+                                       reg = <0x140000 0x40000>;    /* 256KB */
+                               };
+
+                               partition@900000 {
+                                       label = "devinfo";
+                                       reg = <0x900000 0x100000>;   /* 1MB */
+                                       read-only;
+                               };
+
+                               /* kernel1 overlaps with rootfs1 by design */
+                               partition@a00000 {
+                                       label = "kernel1";
+                                       reg = <0xa00000 0x2800000>;  /* 40MB */
+                               };
+
+                               partition@d00000 {
+                                       label = "rootfs1";
+                                       reg = <0xd00000 0x2500000>;  /* 37MB */
+                               };
+
+                               /* kernel2 overlaps with rootfs2 by design */
+                               partition@3200000 {
+                                       label = "kernel2";
+                                       reg = <0x3200000 0x2800000>; /* 40MB */
+                               };
+
+                               partition@3500000 {
+                                       label = "rootfs2";
+                                       reg = <0x3500000 0x2500000>; /* 37MB */
+                               };
+
+                               /*
+                                * 38MB, last MB is for the BBT, not writable
+                                */
+                               partition@5a00000 {
+                                       label = "syscfg";
+                                       reg = <0x5a00000 0x2600000>;
+                               };
+
+                               /*
+                                * Unused area between "s_env" and "devinfo".
+                                * Moved here because otherwise the renumbered
+                                * partitions would break the bootloader
+                                * supplied bootargs
+                                */
+                               partition@180000 {
+                                       label = "unused_area";
+                                       reg = <0x180000 0x780000>;   /* 7.5MB */
+                               };
+                       };
+
+                       spi0: spi@10600 {
+                               status = "okay";
+
+                               spi-flash@0 {
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+                                       compatible = "everspin,mr25h256";
+                                       reg = <0>; /* Chip select 0 */
+                                       spi-max-frequency = <40000000>;
+                               };
+                       };
+               };
+       };
+
+       gpio_keys {
+               compatible = "gpio-keys";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-0 = <&keys_pin>;
+               pinctrl-names = "default";
+
+               button@1 {
+                       label = "WPS";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
+               };
+
+               button@2 {
+                       label = "Factory Reset Button";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+               pinctrl-0 = <&power_led_pin>;
+               pinctrl-names = "default";
+
+               power {
+                       label = "mamba:white:power";
+                       gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
+                       default-state = "on";
+               };
+       };
+
+       gpio_fan {
+               /* SUNON HA4010V4-0000-C99 */
+               compatible = "gpio-fan";
+               gpios = <&gpio0 24 0>;
+
+               gpio-fan,speed-map = <0    0
+                                     4500 1>;
+       };
+
+       dsa@0 {
+               compatible = "marvell,dsa";
+               #address-cells = <2>;
+               #size-cells = <0>;
+
+               dsa,ethernet = <&eth0>;
+               dsa,mii-bus = <&mdio>;
+
+               switch@0 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x0 0>;  /* MDIO address 0, switch 0 in tree */
+
+                       port@0 {
+                               reg = <0>;
+                               label = "lan4";
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan3";
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan1";
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "internet";
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "cpu";
+                       };
+               };
+       };
+};
+
+&pinctrl {
+
+       keys_pin: keys-pin {
+               marvell,pins = "mpp32", "mpp33";
+               marvell,function = "gpio";
+       };
+
+       power_led_pin: power-led-pin {
+               marvell,pins = "mpp40";
+               marvell,function = "gpio";
+       };
+
+       gpio_fan_pin: gpio-fan-pin {
+               marvell,pins = "mpp24";
+               marvell,function = "gpio";
+       };
+};
index 56f958eb1ede07fb379f051ef12385ed5d1164d9..f894bc83e957554a55a8a155cc0cdb0c1d1d0d0e 100644 (file)
@@ -52,7 +52,7 @@
        compatible = "marvell,axp-matrix", "marvell,armadaxp-mv78460", "marvell,armadaxp", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 4a7cbed79b0736f9c42670a6316bb4fadb37d398..8479fdc9e9c2468e072c3592528a263610c2acc1 100644 (file)
@@ -57,7 +57,6 @@
                gpio0 = &gpio0;
                gpio1 = &gpio1;
                gpio2 = &gpio2;
-               eth3 = &eth3;
        };
 
        cpus {
index 36ce63a96cc9007bf18de678d117bbd99a78b739..661d54c815802d1bb1d2e1fa31cb255d90caf12e 100644 (file)
@@ -57,7 +57,6 @@
                gpio0 = &gpio0;
                gpio1 = &gpio1;
                gpio2 = &gpio2;
-               eth3 = &eth3;
        };
 
 
index 99cb9a8401b40737287ae15dbe7e67c0ffb2619d..1516fc2627f99f0d068fbc2d96c897c9112dc0e7 100644 (file)
@@ -53,7 +53,7 @@
        compatible = "netgear,readynas-2120", "marvell,armadaxp-mv78230", "marvell,armadaxp", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 0c76d9f05fd0c2e006df84f3fe7671a8ed29b52b..e3b08fb959e5f8ffc27977fa85d05c70a4d60792 100644 (file)
@@ -54,7 +54,7 @@
        compatible = "plathome,openblocks-ax3-4", "marvell,armadaxp-mv78260", "marvell,armadaxp", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index e9fb225169aaa7338e532006b7986779537da7ef..6063428fa6a0a8ca378d1a9f00b5689544947758 100644 (file)
@@ -67,8 +67,7 @@
                     "marvell,armadaxp", "marvell,armada-370-xp";
 
        chosen {
-               bootargs = "console=ttyS0,115200 earlyprintk";
-               stdout-path = &uart0;
+               stdout-path = "serial0:115200n8";
        };
 
        memory {
index 82917236a2fbfe99426b5a70127255848a917d6a..013d63f69e361e60bbe96466bec1883388155889 100644 (file)
@@ -57,7 +57,8 @@
        compatible = "marvell,armadaxp", "marvell,armada-370-xp";
 
        aliases {
-               eth2 = &eth2;
+               serial2 = &uart2;
+               serial3 = &uart3;
        };
 
        soc {
@@ -78,6 +79,7 @@
                                compatible = "marvell,aurora-system-cache";
                                reg = <0x08000 0x1000>;
                                cache-id-part = <0x100>;
+                               cache-level = <2>;
                                cache-unified;
                                wt-override;
                        };
                        cpuclk: clock-complex@18700 {
                                #clock-cells = <1>;
                                compatible = "marvell,armada-xp-cpu-clock";
-                               reg = <0x18700 0xA0>, <0x1c054 0x10>;
+                               reg = <0x18700 0x24>, <0x1c054 0x10>;
                                clocks = <&coreclk 1>;
                        };
 
-                       interrupt-controller@20000 {
+                       interrupt-controller@20a00 {
                              reg = <0x20a00 0x2d0>, <0x21070 0x58>;
                        };
 
index a5441d5482a63a0a9203f3333b96c87ec1912b11..9ad829523a1350d59bcc795286459d8dfc6c133e 100644 (file)
@@ -1,5 +1,8 @@
 /include/ "skeleton.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
 #define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
 
 / {
@@ -61,7 +64,7 @@
                                  0x82000000 0x2 0x0 MBUS_ID(0x08, 0xe8) 0 1 0   /* Port 1.0 Mem */
                                  0x81000000 0x2 0x0 MBUS_ID(0x08, 0xe0) 0 1 0>; /* Port 1.0 I/O */
 
-                       pcie-port@0 {
+                       pcie0: pcie-port@0 {
                                device_type = "pci";
                                status = "disabled";
                                assigned-addresses = <0x82000800 0 0x40000 0 0x2000>;
@@ -79,7 +82,7 @@
                                interrupt-map = <0 0 0 0 &intc 16>;
                        };
 
-                       pcie-port@1 {
+                       pcie1: pcie-port@1 {
                                device_type = "pci";
                                status = "disabled";
                                assigned-addresses = <0x82002800 0 0x80000 0 0x2000>;
 
                        uart2: serial@12200 {
                                compatible = "ns16550a";
-                               reg = <0x12000 0x100>;
+                               reg = <0x12200 0x100>;
                                reg-shift = <2>;
                                interrupts = <9>;
                                clocks = <&core_clk 0>;
 
                        uart3: serial@12300 {
                                compatible = "ns16550a";
-                               reg = <0x12100 0x100>;
+                               reg = <0x12300 0x100>;
                                reg-shift = <2>;
                                interrupts = <10>;
                                clocks = <&core_clk 0>;
                                        marvell,function = "gpio";
                                };
 
+                               pmx_pcie1_clkreq: pmx-pcie1-clkreq {
+                                       marvell,pins = "mpp9";
+                                       marvell,function = "pex1";
+                               };
+
                                pmx_gpio_10: pmx-gpio-10 {
                                        marvell,pins = "mpp10";
                                        marvell,function = "gpio";
                                        marvell,function = "gpio";
                                };
 
+                               pmx_pcie0_clkreq: pmx-pcie0-clkreq {
+                                       marvell,pins = "mpp11";
+                                       marvell,function = "pex0";
+                               };
+
                                pmx_gpio_12: pmx-gpio-12 {
                                        marvell,pins = "mpp12";
                                        marvell,function = "gpio";
                                        marvell,function = "gpio";
                                };
 
+                               pmx_spi1_4_7: pmx-spi1-4-7 {
+                                       marvell,pins = "mpp4", "mpp5",
+                                               "mpp6", "mpp7";
+                                       marvell,function = "spi1";
+                               };
+
+                               pmx_spi1_20_23: pmx-spi1-20-23 {
+                                       marvell,pins = "mpp20", "mpp21",
+                                               "mpp22", "mpp23";
+                                       marvell,function = "spi1";
+                               };
+
                                pmx_uart1: pmx-uart1 {
                                        marvell,pins = "mpp_uart1";
                                        marvell,function = "uart1";
                                        marvell,pins = "mpp_nand";
                                        marvell,function = "gpo";
                                };
+
+                               pmx_i2c1: pmx-i2c1 {
+                                       marvell,pins = "mpp17", "mpp19";
+                                       marvell,function = "twsi";
+                               };
+
+                               pmx_i2c2: pmx-i2c2 {
+                                       marvell,pins = "mpp_audio1";
+                                       marvell,function = "twsi";
+                               };
+
+                               pmx_ssp_i2c2: pmx-ssp-i2c2 {
+                                       marvell,pins = "mpp_audio1";
+                                       marvell,function = "ssp/twsi";
+                               };
+
+                               pmx_i2cmux_0: pmx-i2cmux-0 {
+                                       marvell,pins = "twsi";
+                                       marvell,function = "twsi-opt1";
+                               };
+
+                               pmx_i2cmux_1: pmx-i2cmux-1 {
+                                       marvell,pins = "twsi";
+                                       marvell,function = "twsi-opt2";
+                               };
+
+                               pmx_i2cmux_2: pmx-i2cmux-2 {
+                                       marvell,pins = "twsi";
+                                       marvell,function = "twsi-opt3";
+                               };
                        };
 
                        core_clk: core-clocks@d0214 {
index 6b7856025001b376d575d133ace4e040a59ebddc..e1c25c35e9ce86a381558ba7cd610f81458697ef 100644 (file)
@@ -10,6 +10,7 @@
 
 /dts-v1/;
 
+#include <dt-bindings/leds/leds-ns2.h>
 #include "kirkwood-netxbig.dtsi"
 
 / {
                        label = "d2net_v2:blue:sata";
                        slow-gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>;
                        cmd-gpio = <&gpio0 30 GPIO_ACTIVE_HIGH>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
                };
        };
 
index da674bbd49a8642524f89995102b86c7ec9f7bc0..4121674abd1c35fbca7212def1e08af3061317e2 100644 (file)
@@ -1,5 +1,6 @@
 /dts-v1/;
 
+#include <dt-bindings/leds/leds-ns2.h>
 #include "kirkwood-ns2-common.dtsi"
 
 / {
                        label = "ns2:blue:sata";
                        slow-gpio = <&gpio0 29 0>;
                        cmd-gpio = <&gpio0 30 0>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
                };
        };
 };
diff --git a/arch/arm/boot/dts/kirkwood-nas2big.dts b/arch/arm/boot/dts/kirkwood-nas2big.dts
new file mode 100644 (file)
index 0000000..7427ec5
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+ * Device Tree file for LaCie 2Big NAS
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Simon Guinot <simon.guinot@sequanux.org>
+ *
+ * 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 "kirkwood-netxbig.dtsi"
+
+/ {
+       model = "LaCie 2Big NAS";
+       compatible = "lacie,nas2big", "lacie,netxbig", "marvell,kirkwood-88f6282", "marvell,kirkwood";
+
+       memory {
+               device_type = "memory";
+               reg = <0x00000000 0x10000000>;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200n8";
+               stdout-path = &uart0;
+       };
+
+       mbus {
+               pcie-controller {
+                       status = "okay";
+
+                       pcie@1,0 {
+                               status = "okay";
+                       };
+               };
+       };
+
+       ocp@f1000000 {
+               rtc@10300 {
+                       /* The on-chip RTC is not powered (no supercap). */
+                       status = "disabled";
+               };
+               spi@10600 {
+                       /*
+                        * A NAND flash is used instead of an SPI flash for
+                        * the other netxbig-compatible boards.
+                        */
+                       status = "disabled";
+               };
+       };
+
+       fan {
+               /*
+                * An I2C fan controller (GMT G762) is used but alarm is
+                * wired to a separate GPIO.
+                */
+               compatible = "gpio-fan";
+               alarm-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
+       };
+
+       regulators: regulators {
+               status = "okay";
+               compatible = "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               pinctrl-names = "default";
+
+               regulator@2 {
+                       compatible = "regulator-fixed";
+                       reg = <2>;
+                       regulator-name = "hdd1power";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       enable-active-high;
+                       regulator-always-on;
+                       regulator-boot-on;
+                       gpio = <&gpio0 17 GPIO_ACTIVE_HIGH>;
+               };
+               clocks {
+                       g762_clk: g762-oscillator {
+                               compatible = "fixed-clock";
+                               #clock-cells = <0>;
+                               clock-frequency = <32768>;
+                       };
+               };
+       };
+};
+
+&mdio {
+       status = "okay";
+
+       ethphy0: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
+
+&i2c0 {
+       status = "okay";
+
+       /*
+        * An external I2C RTC (Dallas DS1337S+) is used. This allows
+        * to power-up the board on an RTC alarm. The external RTC can
+        * be kept powered, even when the SoC is off.
+        */
+       rtc@68 {
+               compatible = "dallas,ds1307";
+               reg = <0x68>;
+               interrupts = <43>;
+       };
+       g762@3e {
+               compatible = "gmt,g762";
+               reg = <0x3e>;
+               clocks = <&g762_clk>;
+       };
+};
+
+&nand {
+       chip-delay = <50>;
+       status = "okay";
+
+       partition@0 {
+               label = "U-Boot";
+               reg = <0x0 0x100000>;
+       };
+
+       partition@100000 {
+               label = "uImage";
+               reg = <0x100000 0x1000000>;
+       };
+
+       partition@1100000 {
+               label = "root";
+               reg = <0x1100000 0x8000000>;
+       };
+
+       partition@9100000 {
+               label = "unused";
+               reg = <0x9100000 0x6f00000>;
+       };
+};
index 53dc37a3b6875dd10fcbe9babee959de4f5a95bd..13a44773b6dfa39fe02d4ce86f3344808e498d1b 100644 (file)
                device_type = "memory";
                reg = <0x00000000 0x10000000>;
        };
+
+       fan {
+               compatible = "gpio-fan";
+               alarm-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
+       };
 };
 
 &regulators {
index 36155b749d9fcbbf2bb579e0af5cccd066234867..3cc5e469df063016ce9e0b117691b348f2e5e8ce 100644 (file)
                         clock-frequency = <32768>;
               };
        };
+
+       netxbig-leds {
+               blue-sata2 {
+                       label = "netxbig:blue:sata2";
+                       mode-addr = <5>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 7
+                                   NETXBIG_LED_SATA 1
+                                   NETXBIG_LED_TIMER1 3>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+               red-sata2 {
+                       label = "netxbig:red:sata2";
+                       mode-addr = <5>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 2
+                                   NETXBIG_LED_TIMER1 4>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+               blue-sata3 {
+                       label = "netxbig:blue:sata3";
+                       mode-addr = <6>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 7
+                                   NETXBIG_LED_SATA 1
+                                   NETXBIG_LED_TIMER1 3>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+               red-sata3 {
+                       label = "netxbig:red:sata3";
+                       mode-addr = <6>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 2
+                                   NETXBIG_LED_TIMER1 4>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+               blue-sata4 {
+                       label = "netxbig:blue:sata4";
+                       mode-addr = <7>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 7
+                                   NETXBIG_LED_SATA 1
+                                   NETXBIG_LED_TIMER1 3>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+               red-sata4 {
+                       label = "netxbig:red:sata4";
+                       mode-addr = <7>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 2
+                                   NETXBIG_LED_TIMER1 4>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+       };
 };
 
 &mdio {
index b0cfb7cd30b9653155f29fb9c279308e698d1a35..5e7ed1c7e1b28e5cc09d170e8b0c61561b36ed8f 100644 (file)
@@ -13,6 +13,7 @@
  * warranty of any kind, whether express or implied.
 */
 
+#include <dt-bindings/leds/leds-netxbig.h>
 #include "kirkwood.dtsi"
 #include "kirkwood-6281.dtsi"
 
                        gpio = <&gpio0 16 GPIO_ACTIVE_HIGH>;
                };
        };
+
+       netxbig_gpio_ext: netxbig-gpio-ext {
+               compatible = "lacie,netxbig-gpio-ext";
+
+               addr-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH
+                             &gpio1 16 GPIO_ACTIVE_HIGH
+                             &gpio1 17 GPIO_ACTIVE_HIGH>;
+               data-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH
+                             &gpio1 13 GPIO_ACTIVE_HIGH
+                             &gpio1 14 GPIO_ACTIVE_HIGH>;
+               enable-gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>;
+       };
+
+       netxbig-leds {
+               compatible = "lacie,netxbig-leds";
+
+               gpio-ext = <&netxbig_gpio_ext>;
+
+               timers = <NETXBIG_LED_TIMER1 500 500
+                         NETXBIG_LED_TIMER2 500 1000>;
+
+               blue-power {
+                       label = "netxbig:blue:power";
+                       mode-addr = <0>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 1
+                                   NETXBIG_LED_TIMER1 3
+                                   NETXBIG_LED_TIMER2 7>;
+                       bright-addr = <1>;
+                       bright-max = <7>;
+               };
+               red-power {
+                       label = "netxbig:red:power";
+                       mode-addr = <0>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 2
+                                   NETXBIG_LED_TIMER1 4>;
+                       bright-addr = <1>;
+                       bright-max = <7>;
+               };
+               blue-sata0 {
+                       label = "netxbig:blue:sata0";
+                       mode-addr = <3>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 7
+                                   NETXBIG_LED_SATA 1
+                                   NETXBIG_LED_TIMER1 3>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+               red-sata0 {
+                       label = "netxbig:red:sata0";
+                       mode-addr = <3>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 2
+                                   NETXBIG_LED_TIMER1 4>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+               blue-sata1 {
+                       label = "netxbig:blue:sata1";
+                       mode-addr = <4>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 7
+                                   NETXBIG_LED_SATA 1
+                                   NETXBIG_LED_TIMER1 3>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+               red-sata1 {
+                       label = "netxbig:red:sata1";
+                       mode-addr = <4>;
+                       mode-val = <NETXBIG_LED_OFF 0
+                                   NETXBIG_LED_ON 2
+                                   NETXBIG_LED_TIMER1 4>;
+                       bright-addr = <2>;
+                       bright-max = <7>;
+               };
+       };
 };
 
 &mdio {
index 53368d1022ccd6fbffc2ad86037a73f870f694bb..190189d235e60151bfd46b7835cce645a9c951d4 100644 (file)
@@ -1,5 +1,6 @@
 /dts-v1/;
 
+#include <dt-bindings/leds/leds-ns2.h>
 #include "kirkwood-ns2-common.dtsi"
 
 / {
                        label = "ns2:blue:sata";
                        slow-gpio = <&gpio0 29 0>;
                        cmd-gpio = <&gpio0 30 0>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
                };
        };
 };
index 72c78d0b1116112cb224676073c57d534359a6b5..55cc41d9c80c2184d2580e43b5075b05113a8480 100644 (file)
@@ -1,5 +1,6 @@
 /dts-v1/;
 
+#include <dt-bindings/leds/leds-ns2.h>
 #include "kirkwood-ns2-common.dtsi"
 
 / {
                        label = "ns2:blue:sata";
                        slow-gpio = <&gpio0 29 0>;
                        cmd-gpio = <&gpio0 30 0>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
                };
        };
 };
index c441bf62c09fcfa9cab080b00eeb0e76129c31d0..9935f3ec29b4f6b026e580a3ce7cb9d3ac181115 100644 (file)
@@ -1,5 +1,6 @@
 /dts-v1/;
 
+#include <dt-bindings/leds/leds-ns2.h>
 #include "kirkwood-ns2-common.dtsi"
 
 / {
                        label = "ns2:blue:sata";
                        slow-gpio = <&gpio0 29 0>;
                        cmd-gpio = <&gpio0 30 0>;
+                       modes-map = <NS_V2_LED_OFF  1 0
+                                    NS_V2_LED_ON   0 1
+                                    NS_V2_LED_ON   1 1
+                                    NS_V2_LED_SATA 0 0>;
                };
        };
 };
index 73673e95f23c6351982ec081533f92acd72fd52f..cacc9f4055a72945aab6dba3909b0409c6cf9abc 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_HIGH_RES_TIMERS=y
 CONFIG_LOG_BUF_SHIFT=14
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_EXPERT=y
+CONFIG_PERF_EVENTS=y
 CONFIG_SLAB=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
@@ -12,6 +13,7 @@ CONFIG_ARCH_MVEBU=y
 CONFIG_MACH_ARMADA_370=y
 CONFIG_MACH_ARMADA_375=y
 CONFIG_MACH_ARMADA_38X=y
+CONFIG_MACH_ARMADA_39X=y
 CONFIG_MACH_ARMADA_XP=y
 CONFIG_MACH_DOVE=y
 CONFIG_PCI=y
index c1e4567a5ab3ed8cfc10da7340beb624a7e0713c..5453f901099bf8d68810256caf500380554790a7 100644 (file)
@@ -64,6 +64,20 @@ config MACH_ARMADA_38X
          Say 'Y' here if you want your kernel to support boards based
          on the Marvell Armada 380/385 SoC with device tree.
 
+config MACH_ARMADA_39X
+       bool "Marvell Armada 39x boards" if ARCH_MULTI_V7
+       select ARM_GIC
+       select ARMADA_39X_CLK
+       select CACHE_L2X0
+       select HAVE_ARM_SCU
+       select HAVE_ARM_TWD if SMP
+       select HAVE_SMP
+       select MACH_MVEBU_V7
+       select PINCTRL_ARMADA_39X
+       help
+         Say 'Y' here if you want your kernel to support boards based
+         on the Marvell Armada 39x SoC with device tree.
+
 config MACH_ARMADA_XP
        bool "Marvell Armada XP boards" if ARCH_MULTI_V7
        select ARMADA_XP_CLK
@@ -102,11 +116,4 @@ config MACH_KIRKWOOD
          Say 'Y' here if you want your kernel to support boards based
          on the Marvell Kirkwood device tree.
 
-config MACH_NETXBIG
-       bool "LaCie 2Big and 5Big Network v2"
-       depends on MACH_KIRKWOOD
-       help
-         Say 'Y' here if you want your kernel to support the
-         LaCie 2Big and 5Big Network v2
-
 endif
index b4f01497ce0bba1db1bf865b8a850714feca3082..ecf9e0c3b107808752fe49af062b8758e1784986 100644 (file)
@@ -13,4 +13,3 @@ endif
 
 obj-$(CONFIG_MACH_DOVE)                 += dove.o
 obj-$(CONFIG_MACH_KIRKWOOD)     += kirkwood.o kirkwood-pm.o
-obj-$(CONFIG_MACH_NETXBIG)      += netxbig.o
index 89a139ed7d5bd3969f04d651d3cb29b122afb3e3..afee9083ad92bc6d16bb7b29ef5f86f811351847 100644 (file)
@@ -184,7 +184,7 @@ static void __init mvebu_dt_init(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static const char * const armada_370_xp_dt_compat[] = {
+static const char * const armada_370_xp_dt_compat[] __initconst = {
        "marvell,armada-370-xp",
        NULL,
 };
@@ -205,7 +205,7 @@ DT_MACHINE_START(ARMADA_370_XP_DT, "Marvell Armada 370/XP (Device Tree)")
        .dt_compat      = armada_370_xp_dt_compat,
 MACHINE_END
 
-static const char * const armada_375_dt_compat[] = {
+static const char * const armada_375_dt_compat[] __initconst = {
        "marvell,armada375",
        NULL,
 };
@@ -219,7 +219,7 @@ DT_MACHINE_START(ARMADA_375_DT, "Marvell Armada 375 (Device Tree)")
        .dt_compat      = armada_375_dt_compat,
 MACHINE_END
 
-static const char * const armada_38x_dt_compat[] = {
+static const char * const armada_38x_dt_compat[] __initconst = {
        "marvell,armada380",
        "marvell,armada385",
        NULL,
@@ -232,3 +232,17 @@ DT_MACHINE_START(ARMADA_38X_DT, "Marvell Armada 380/385 (Device Tree)")
        .restart        = mvebu_restart,
        .dt_compat      = armada_38x_dt_compat,
 MACHINE_END
+
+static const char * const armada_39x_dt_compat[] __initconst = {
+       "marvell,armada390",
+       "marvell,armada398",
+       NULL,
+};
+
+DT_MACHINE_START(ARMADA_39X_DT, "Marvell Armada 39x (Device Tree)")
+       .l2c_aux_val    = 0,
+       .l2c_aux_mask   = ~0,
+       .init_irq       = mvebu_init_irq,
+       .restart        = mvebu_restart,
+       .dt_compat      = armada_39x_dt_compat,
+MACHINE_END
diff --git a/arch/arm/mach-mvebu/board.h b/arch/arm/mach-mvebu/board.h
deleted file mode 100644 (file)
index 98e32cc..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Board functions for Marvell System On Chip
- *
- * Copyright (C) 2014
- *
- * Andrew Lunn <andrew@lunn.ch>
- *
- * 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.
- */
-
-#ifndef __ARCH_MVEBU_BOARD_H
-#define __ARCH_MVEBU_BOARD_H
-
-#ifdef CONFIG_MACH_NETXBIG
-void netxbig_init(void);
-#else
-static inline void netxbig_init(void) {};
-#endif
-#endif
index b50464ec1130ff0b5961990d2684953c582d44cc..5a1741500a3000d6778fe5fb4d93cf26a2af11a2 100644 (file)
@@ -27,7 +27,7 @@ static void __init dove_init(void)
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
-static const char * const dove_dt_compat[] = {
+static const char * const dove_dt_compat[] __initconst = {
        "marvell,dove",
        NULL
 };
index 6b5310828eb2e7fa95fda207492ff0cc014803ab..f9d8e1ea7183a510cb3920056d990407d3ffb0ac 100644 (file)
@@ -25,7 +25,6 @@
 #include "kirkwood.h"
 #include "kirkwood-pm.h"
 #include "common.h"
-#include "board.h"
 
 static struct resource kirkwood_cpufreq_resources[] = {
        [0] = {
@@ -180,13 +179,10 @@ static void __init kirkwood_dt_init(void)
        kirkwood_pm_init();
        kirkwood_dt_eth_fixup();
 
-       if (of_machine_is_compatible("lacie,netxbig"))
-               netxbig_init();
-
        of_platform_populate(NULL, of_default_bus_match_table, auxdata, NULL);
 }
 
-static const char * const kirkwood_dt_board_compat[] = {
+static const char * const kirkwood_dt_board_compat[] __initconst = {
        "marvell,kirkwood",
        NULL
 };
diff --git a/arch/arm/mach-mvebu/netxbig.c b/arch/arm/mach-mvebu/netxbig.c
deleted file mode 100644 (file)
index 94b11b6..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * arch/arm/mach-mvbu/board-netxbig.c
- *
- * LaCie 2Big and 5Big Network v2 board setup
- *
- * Copyright (C) 2010 Simon Guinot <sguinot@lacie.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <linux/kernel.h>
-#include <linux/of.h>
-#include <linux/platform_device.h>
-#include <linux/platform_data/leds-kirkwood-netxbig.h>
-#include "common.h"
-
-/*****************************************************************************
- * GPIO extension LEDs
- ****************************************************************************/
-
-/*
- * The LEDs are controlled by a CPLD and can be configured through a GPIO
- * extension bus:
- *
- * - address register : bit [0-2] -> GPIO [47-49]
- * - data register    : bit [0-2] -> GPIO [44-46]
- * - enable register  : GPIO 29
- */
-
-static int netxbig_v2_gpio_ext_addr[] = { 47, 48, 49 };
-static int netxbig_v2_gpio_ext_data[] = { 44, 45, 46 };
-
-static struct netxbig_gpio_ext netxbig_v2_gpio_ext = {
-       .addr           = netxbig_v2_gpio_ext_addr,
-       .num_addr       = ARRAY_SIZE(netxbig_v2_gpio_ext_addr),
-       .data           = netxbig_v2_gpio_ext_data,
-       .num_data       = ARRAY_SIZE(netxbig_v2_gpio_ext_data),
-       .enable         = 29,
-};
-
-/*
- * Address register selection:
- *
- * addr | register
- * ----------------------------
- *   0  | front LED
- *   1  | front LED brightness
- *   2  | SATA LED brightness
- *   3  | SATA0 LED
- *   4  | SATA1 LED
- *   5  | SATA2 LED
- *   6  | SATA3 LED
- *   7  | SATA4 LED
- *
- * Data register configuration:
- *
- * data | LED brightness
- * -------------------------------------------------
- *   0  | min (off)
- *   -  | -
- *   7  | max
- *
- * data | front LED mode
- * -------------------------------------------------
- *   0  | fix off
- *   1  | fix blue on
- *   2  | fix red on
- *   3  | blink blue on=1 sec and blue off=1 sec
- *   4  | blink red on=1 sec and red off=1 sec
- *   5  | blink blue on=2.5 sec and red on=0.5 sec
- *   6  | blink blue on=1 sec and red on=1 sec
- *   7  | blink blue on=0.5 sec and blue off=2.5 sec
- *
- * data | SATA LED mode
- * -------------------------------------------------
- *   0  | fix off
- *   1  | SATA activity blink
- *   2  | fix red on
- *   3  | blink blue on=1 sec and blue off=1 sec
- *   4  | blink red on=1 sec and red off=1 sec
- *   5  | blink blue on=2.5 sec and red on=0.5 sec
- *   6  | blink blue on=1 sec and red on=1 sec
- *   7  | fix blue on
- */
-
-static int netxbig_v2_red_mled[NETXBIG_LED_MODE_NUM] = {
-       [NETXBIG_LED_OFF]       = 0,
-       [NETXBIG_LED_ON]        = 2,
-       [NETXBIG_LED_SATA]      = NETXBIG_LED_INVALID_MODE,
-       [NETXBIG_LED_TIMER1]    = 4,
-       [NETXBIG_LED_TIMER2]    = NETXBIG_LED_INVALID_MODE,
-};
-
-static int netxbig_v2_blue_pwr_mled[NETXBIG_LED_MODE_NUM] = {
-       [NETXBIG_LED_OFF]       = 0,
-       [NETXBIG_LED_ON]        = 1,
-       [NETXBIG_LED_SATA]      = NETXBIG_LED_INVALID_MODE,
-       [NETXBIG_LED_TIMER1]    = 3,
-       [NETXBIG_LED_TIMER2]    = 7,
-};
-
-static int netxbig_v2_blue_sata_mled[NETXBIG_LED_MODE_NUM] = {
-       [NETXBIG_LED_OFF]       = 0,
-       [NETXBIG_LED_ON]        = 7,
-       [NETXBIG_LED_SATA]      = 1,
-       [NETXBIG_LED_TIMER1]    = 3,
-       [NETXBIG_LED_TIMER2]    = NETXBIG_LED_INVALID_MODE,
-};
-
-static struct netxbig_led_timer netxbig_v2_led_timer[] = {
-       [0] = {
-               .delay_on       = 500,
-               .delay_off      = 500,
-               .mode           = NETXBIG_LED_TIMER1,
-       },
-       [1] = {
-               .delay_on       = 500,
-               .delay_off      = 1000,
-               .mode           = NETXBIG_LED_TIMER2,
-       },
-};
-
-#define NETXBIG_LED(_name, maddr, mval, baddr)                 \
-       { .name         = _name,                                \
-         .mode_addr    = maddr,                                \
-         .mode_val     = mval,                                 \
-         .bright_addr  = baddr }
-
-static struct netxbig_led net2big_v2_leds_ctrl[] = {
-       NETXBIG_LED("net2big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled,  1),
-       NETXBIG_LED("net2big-v2:red:power",  0, netxbig_v2_red_mled,       1),
-       NETXBIG_LED("net2big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
-       NETXBIG_LED("net2big-v2:red:sata0",  3, netxbig_v2_red_mled,       2),
-       NETXBIG_LED("net2big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
-       NETXBIG_LED("net2big-v2:red:sata1",  4, netxbig_v2_red_mled,       2),
-};
-
-static struct netxbig_led_platform_data net2big_v2_leds_data = {
-       .gpio_ext       = &netxbig_v2_gpio_ext,
-       .timer          = netxbig_v2_led_timer,
-       .num_timer      = ARRAY_SIZE(netxbig_v2_led_timer),
-       .leds           = net2big_v2_leds_ctrl,
-       .num_leds       = ARRAY_SIZE(net2big_v2_leds_ctrl),
-};
-
-static struct netxbig_led net5big_v2_leds_ctrl[] = {
-       NETXBIG_LED("net5big-v2:blue:power", 0, netxbig_v2_blue_pwr_mled,  1),
-       NETXBIG_LED("net5big-v2:red:power",  0, netxbig_v2_red_mled,       1),
-       NETXBIG_LED("net5big-v2:blue:sata0", 3, netxbig_v2_blue_sata_mled, 2),
-       NETXBIG_LED("net5big-v2:red:sata0",  3, netxbig_v2_red_mled,       2),
-       NETXBIG_LED("net5big-v2:blue:sata1", 4, netxbig_v2_blue_sata_mled, 2),
-       NETXBIG_LED("net5big-v2:red:sata1",  4, netxbig_v2_red_mled,       2),
-       NETXBIG_LED("net5big-v2:blue:sata2", 5, netxbig_v2_blue_sata_mled, 2),
-       NETXBIG_LED("net5big-v2:red:sata2",  5, netxbig_v2_red_mled,       2),
-       NETXBIG_LED("net5big-v2:blue:sata3", 6, netxbig_v2_blue_sata_mled, 2),
-       NETXBIG_LED("net5big-v2:red:sata3",  6, netxbig_v2_red_mled,       2),
-       NETXBIG_LED("net5big-v2:blue:sata4", 7, netxbig_v2_blue_sata_mled, 2),
-       NETXBIG_LED("net5big-v2:red:sata4",  7, netxbig_v2_red_mled,       2),
-};
-
-static struct netxbig_led_platform_data net5big_v2_leds_data = {
-       .gpio_ext       = &netxbig_v2_gpio_ext,
-       .timer          = netxbig_v2_led_timer,
-       .num_timer      = ARRAY_SIZE(netxbig_v2_led_timer),
-       .leds           = net5big_v2_leds_ctrl,
-       .num_leds       = ARRAY_SIZE(net5big_v2_leds_ctrl),
-};
-
-static struct platform_device netxbig_v2_leds = {
-       .name           = "leds-netxbig",
-       .id             = -1,
-       .dev            = {
-               .platform_data  = &net2big_v2_leds_data,
-       },
-};
-
-void __init netxbig_init(void)
-{
-
-       if (of_machine_is_compatible("lacie,net5big_v2"))
-               netxbig_v2_leds.dev.platform_data = &net5big_v2_leds_data;
-       platform_device_register(&netxbig_v2_leds);
-}
index 2ec1a42b432152dafadd1bedf793b17f036037d2..df0a9cc5da59ad2ce7a95e7d13dc8e2a82937069 100644 (file)
@@ -110,3 +110,5 @@ CPU_METHOD_OF_DECLARE(mvebu_armada_375_smp, "marvell,armada-375-smp",
                      &mvebu_cortex_a9_smp_ops);
 CPU_METHOD_OF_DECLARE(mvebu_armada_380_smp, "marvell,armada-380-smp",
                      &armada_38x_smp_ops);
+CPU_METHOD_OF_DECLARE(mvebu_armada_390_smp, "marvell,armada-390-smp",
+                     &armada_38x_smp_ops);
index 25b320d64e2609cfa1380e316ae7fee74f1e9cbd..5bdeb6e41b2e229ec4850e2c3a83c879a97286db 100644 (file)
@@ -431,12 +431,16 @@ config LEDS_MC13783
 config LEDS_NS2
        tristate "LED support for Network Space v2 GPIO LEDs"
        depends on LEDS_CLASS
-       depends on MACH_KIRKWOOD
+       depends on MACH_KIRKWOOD || MACH_ARMADA_370
        default y
        help
-         This option enable support for the dual-GPIO LED found on the
-         Network Space v2 board (and parents). This include Internet Space v2,
-         Network Space (Max) v2 and d2 Network v2 boards.
+         This option enables support for the dual-GPIO LEDs found on the
+         following LaCie/Seagate boards:
+
+               Network Space v2 (and parents: Max, Mini)
+               Internet Space v2
+               d2 Network v2
+               n090401 (Seagate NAS 4-Bay)
 
 config LEDS_NETXBIG
        tristate "LED support for Big Network series LEDs"
index 25e419752a7b7c5719baa69bd114d57720a62f92..028686f2b1e8430ed6042db354f7a898a14ebb5c 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/spinlock.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/of_gpio.h>
 #include <linux/leds.h>
 #include <linux/platform_data/leds-kirkwood-netxbig.h>
 
@@ -140,6 +141,11 @@ struct netxbig_led_data {
        spinlock_t              lock;
 };
 
+struct netxbig_led_priv {
+       struct netxbig_led_platform_data *pdata;
+       struct netxbig_led_data leds_data[];
+};
+
 static int netxbig_led_get_timer_mode(enum netxbig_led_mode *mode,
                                      unsigned long delay_on,
                                      unsigned long delay_off,
@@ -304,12 +310,12 @@ static void delete_netxbig_led(struct netxbig_led_data *led_dat)
        led_classdev_unregister(&led_dat->cdev);
 }
 
-static int
-create_netxbig_led(struct platform_device *pdev,
-                  struct netxbig_led_data *led_dat,
-                  const struct netxbig_led *template)
+static int create_netxbig_led(struct platform_device *pdev, int led,
+                             struct netxbig_led_priv *priv)
 {
-       struct netxbig_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
+       struct netxbig_led_platform_data *pdata = priv->pdata;
+       struct netxbig_led_data *led_dat = &priv->leds_data[led];
+       const struct netxbig_led *template = &priv->pdata->leds[led];
 
        spin_lock_init(&led_dat->lock);
        led_dat->gpio_ext = pdata->gpio_ext;
@@ -346,38 +352,235 @@ create_netxbig_led(struct platform_device *pdev,
        return led_classdev_register(&pdev->dev, &led_dat->cdev);
 }
 
+#ifdef CONFIG_OF_GPIO
+static int gpio_ext_get_of_pdata(struct device *dev, struct device_node *np,
+                                struct netxbig_gpio_ext *gpio_ext)
+{
+       int *addr, *data;
+       int num_addr, num_data;
+       int ret;
+       int i;
+
+       ret = of_gpio_named_count(np, "addr-gpios");
+       if (ret < 0)
+               return ret;
+       num_addr = ret;
+       addr = devm_kzalloc(dev, num_addr * sizeof(unsigned int), GFP_KERNEL);
+       if (!addr)
+               return -ENOMEM;
+
+       for (i = 0; i < num_addr; i++) {
+               ret = of_get_named_gpio(np, "addr-gpios", i);
+               if (ret < 0)
+                       return ret;
+               addr[i] = ret;
+       }
+       gpio_ext->addr = addr;
+       gpio_ext->num_addr = num_addr;
+
+       ret = of_gpio_named_count(np, "data-gpios");
+       if (ret < 0)
+               return ret;
+       num_data = ret;
+       data = devm_kzalloc(dev, num_data * sizeof(unsigned int), GFP_KERNEL);
+       if (!data)
+               return -ENOMEM;
+
+       for (i = 0; i < num_data; i++) {
+               ret = of_get_named_gpio(np, "data-gpios", i);
+               if (ret < 0)
+                       return ret;
+               data[i] = ret;
+       }
+       gpio_ext->data = data;
+       gpio_ext->num_data = num_data;
+
+       ret = of_get_named_gpio(np, "enable-gpio", 0);
+       if (ret < 0)
+               return ret;
+       gpio_ext->enable = ret;
+
+       return 0;
+}
+
+static int netxbig_leds_get_of_pdata(struct device *dev,
+                                    struct netxbig_led_platform_data *pdata)
+{
+       struct device_node *np = dev->of_node;
+       struct device_node *gpio_ext_np;
+       struct device_node *child;
+       struct netxbig_gpio_ext *gpio_ext;
+       struct netxbig_led_timer *timers;
+       struct netxbig_led *leds, *led;
+       int num_timers;
+       int num_leds = 0;
+       int ret;
+       int i;
+
+       /* GPIO extension */
+       gpio_ext_np = of_parse_phandle(np, "gpio-ext", 0);
+       if (!gpio_ext_np)
+               return -EINVAL;
+
+       gpio_ext = devm_kzalloc(dev, sizeof(struct netxbig_gpio_ext),
+                               GFP_KERNEL);
+       if (!gpio_ext)
+               return -ENOMEM;
+       ret = gpio_ext_get_of_pdata(dev, gpio_ext_np, gpio_ext);
+       if (ret)
+               return ret;
+       of_node_put(gpio_ext_np);
+       pdata->gpio_ext = gpio_ext;
+
+       /* Timers (optional) */
+       ret = of_property_count_u32_elems(np, "timers");
+       if (ret > 0) {
+               if (ret % 3)
+                       return -EINVAL;
+               num_timers = ret / 3;
+               timers = devm_kzalloc(dev,
+                               num_timers * sizeof(struct netxbig_led_timer),
+                               GFP_KERNEL);
+               if (!timers)
+                       return -ENOMEM;
+               for (i = 0; i < num_timers; i++) {
+                       of_property_read_u32_index(np, "timers", 3 * i,
+                                               &timers[i].mode);
+                       of_property_read_u32_index(np, "timers", 3 * i + 1,
+                                               (u32 *) &timers[i].delay_on);
+                       of_property_read_u32_index(np, "timers", 3 * i + 2,
+                                               (u32 *) &timers[i].delay_off);
+               }
+               pdata->timer = timers;
+               pdata->num_timer = num_timers;
+       }
+
+       /* LEDs */
+       num_leds = of_get_child_count(np);
+       if (!num_leds)
+               return -ENODEV;
+
+       leds = devm_kzalloc(dev, num_leds * sizeof(struct netxbig_led),
+                           GFP_KERNEL);
+       if (!leds)
+               return -ENOMEM;
+
+       led = leds;
+       for_each_child_of_node(np, child) {
+               const char *string;
+               int *mode_val;
+               int num_modes;
+
+               if (!of_property_read_string(child, "label", &string))
+                       led->name = string;
+               else
+                       led->name = child->name;
+
+               if (!of_property_read_string(child,
+                                            "linux,default-trigger", &string))
+                       led->default_trigger = string;
+
+               if (of_property_read_u32(child, "mode-addr",
+                                        &led->mode_addr))
+                       return -EINVAL;
+
+               if (of_property_read_u32(child, "bright-addr",
+                                        &led->bright_addr))
+                       return -EINVAL;
+
+               mode_val = devm_kzalloc(dev,
+                                       NETXBIG_LED_MODE_NUM * sizeof(int),
+                                       GFP_KERNEL);
+               if (!mode_val)
+                       return -ENOMEM;
+
+               for (i = 0; i < NETXBIG_LED_MODE_NUM; i++)
+                       mode_val[i] = NETXBIG_LED_INVALID_MODE;
+
+               ret = of_property_count_u32_elems(child, "mode-val");
+               if (ret < 0 || ret % 2)
+                       return -EINVAL;
+               num_modes = ret / 2;
+               if (num_modes > NETXBIG_LED_MODE_NUM)
+                       return -EINVAL;
+
+               for (i = 0; i < num_modes; i++) {
+                       int mode;
+                       int val;
+
+                       of_property_read_u32_index(child,
+                                                  "mode-val", 2 * i, &mode);
+                       of_property_read_u32_index(child,
+                                                  "mode-val", 2 * i + 1, &val);
+                       if (mode > NETXBIG_LED_MODE_NUM)
+                               return -EINVAL;
+                       mode_val[mode] = val;
+               }
+               led->mode_val = mode_val;
+
+               led++;
+       }
+
+       pdata->leds = leds;
+       pdata->num_leds = num_leds;
+
+       return 0;
+}
+
+static const struct of_device_id of_netxbig_leds_match[] = {
+       { .compatible = "lacie,netxbig-leds", },
+       {},
+};
+#else
+static int netxbig_leds_get_of_pdata(struct device *dev,
+                                    struct netxbig_led_platform_data *pdata)
+{
+       return -ENODEV;
+}
+#endif /* CONFIG_OF_GPIO */
+
 static int netxbig_led_probe(struct platform_device *pdev)
 {
        struct netxbig_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
-       struct netxbig_led_data *leds_data;
+       struct netxbig_led_priv *priv;
        int i;
        int ret;
 
-       if (!pdata)
-               return -EINVAL;
+       if (!pdata) {
+               pdata = devm_kzalloc(&pdev->dev,
+                                    sizeof(struct netxbig_led_platform_data),
+                                    GFP_KERNEL);
+               if (!pdata)
+                       return -ENOMEM;
+               ret = netxbig_leds_get_of_pdata(&pdev->dev, pdata);
+               if (ret)
+                       return ret;
+       }
 
-       leds_data = devm_kzalloc(&pdev->dev,
-               sizeof(struct netxbig_led_data) * pdata->num_leds, GFP_KERNEL);
-       if (!leds_data)
+       priv = devm_kzalloc(&pdev->dev,
+                           sizeof(struct netxbig_led_priv) +
+                           pdata->num_leds * sizeof(struct netxbig_led_data),
+                           GFP_KERNEL);
+       if (!priv)
                return -ENOMEM;
+       priv->pdata = pdata;
 
        ret = gpio_ext_init(pdata->gpio_ext);
        if (ret < 0)
                return ret;
 
        for (i = 0; i < pdata->num_leds; i++) {
-               ret = create_netxbig_led(pdev, &leds_data[i], &pdata->leds[i]);
+               ret = create_netxbig_led(pdev, i, priv);
                if (ret < 0)
                        goto err_free_leds;
        }
-
-       platform_set_drvdata(pdev, leds_data);
+       platform_set_drvdata(pdev, priv);
 
        return 0;
 
 err_free_leds:
        for (i = i - 1; i >= 0; i--)
-               delete_netxbig_led(&leds_data[i]);
+               delete_netxbig_led(&priv->leds_data[i]);
 
        gpio_ext_free(pdata->gpio_ext);
        return ret;
@@ -385,14 +588,12 @@ err_free_leds:
 
 static int netxbig_led_remove(struct platform_device *pdev)
 {
-       struct netxbig_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
-       struct netxbig_led_data *leds_data;
+       struct netxbig_led_priv *priv = platform_get_drvdata(pdev);
+       struct netxbig_led_platform_data *pdata = priv->pdata;
        int i;
 
-       leds_data = platform_get_drvdata(pdev);
-
        for (i = 0; i < pdata->num_leds; i++)
-               delete_netxbig_led(&leds_data[i]);
+               delete_netxbig_led(&priv->leds_data[i]);
 
        gpio_ext_free(pdata->gpio_ext);
 
@@ -403,7 +604,8 @@ static struct platform_driver netxbig_led_driver = {
        .probe          = netxbig_led_probe,
        .remove         = netxbig_led_remove,
        .driver         = {
-               .name   = "leds-netxbig",
+               .name           = "leds-netxbig",
+               .of_match_table = of_match_ptr(of_netxbig_leds_match),
        },
 };
 
index 1fd6adbb43b7937637fe0a048a37e1bac8c669b0..ea1542db9ba46a3a1dba4428518d261692e4b481 100644 (file)
 #include <linux/platform_data/leds-kirkwood-ns2.h>
 #include <linux/of.h>
 #include <linux/of_gpio.h>
+#include "leds.h"
 
 /*
- * The Network Space v2 dual-GPIO LED is wired to a CPLD and can blink in
- * relation with the SATA activity. This capability is exposed through the
- * "sata" sysfs attribute.
- *
- * The following array detail the different LED registers and the combination
- * of their possible values:
- *
- *  cmd_led   |  slow_led  | /SATA active | LED state
- *            |            |              |
- *     1      |     0      |      x       |  off
- *     -      |     1      |      x       |  on
- *     0      |     0      |      1       |  on
- *     0      |     0      |      0       |  blink (rate 300ms)
+ * The Network Space v2 dual-GPIO LED is wired to a CPLD. Three different LED
+ * modes are available: off, on and SATA activity blinking. The LED modes are
+ * controlled through two GPIOs (command and slow): each combination of values
+ * for the command/slow GPIOs corresponds to a LED mode.
  */
 
-enum ns2_led_modes {
-       NS_V2_LED_OFF,
-       NS_V2_LED_ON,
-       NS_V2_LED_SATA,
-};
-
-struct ns2_led_mode_value {
-       enum ns2_led_modes      mode;
-       int                     cmd_level;
-       int                     slow_level;
-};
-
-static struct ns2_led_mode_value ns2_led_modval[] = {
-       { NS_V2_LED_OFF , 1, 0 },
-       { NS_V2_LED_ON  , 0, 1 },
-       { NS_V2_LED_ON  , 1, 1 },
-       { NS_V2_LED_SATA, 0, 0 },
-};
-
 struct ns2_led_data {
        struct led_classdev     cdev;
        unsigned                cmd;
        unsigned                slow;
+       bool                    can_sleep;
+       int                     new_mode_index;
        unsigned char           sata; /* True when SATA mode active. */
        rwlock_t                rw_lock; /* Lock GPIOs. */
+       struct work_struct      work;
+       int                     num_modes;
+       struct ns2_led_modval   *modval;
 };
 
+static void ns2_led_work(struct work_struct *work)
+{
+       struct ns2_led_data *led_dat =
+               container_of(work, struct ns2_led_data, work);
+       int i = led_dat->new_mode_index;
+
+       write_lock(&led_dat->rw_lock);
+
+       gpio_set_value_cansleep(led_dat->cmd, led_dat->modval[i].cmd_level);
+       gpio_set_value_cansleep(led_dat->slow, led_dat->modval[i].slow_level);
+
+       write_unlock(&led_dat->rw_lock);
+}
+
 static int ns2_led_get_mode(struct ns2_led_data *led_dat,
                            enum ns2_led_modes *mode)
 {
@@ -85,13 +77,13 @@ static int ns2_led_get_mode(struct ns2_led_data *led_dat,
 
        read_lock_irq(&led_dat->rw_lock);
 
-       cmd_level = gpio_get_value(led_dat->cmd);
-       slow_level = gpio_get_value(led_dat->slow);
+       cmd_level = gpio_get_value_cansleep(led_dat->cmd);
+       slow_level = gpio_get_value_cansleep(led_dat->slow);
 
-       for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) {
-               if (cmd_level == ns2_led_modval[i].cmd_level &&
-                   slow_level == ns2_led_modval[i].slow_level) {
-                       *mode = ns2_led_modval[i].mode;
+       for (i = 0; i < led_dat->num_modes; i++) {
+               if (cmd_level == led_dat->modval[i].cmd_level &&
+                   slow_level == led_dat->modval[i].slow_level) {
+                       *mode = led_dat->modval[i].mode;
                        ret = 0;
                        break;
                }
@@ -110,12 +102,18 @@ static void ns2_led_set_mode(struct ns2_led_data *led_dat,
 
        write_lock_irqsave(&led_dat->rw_lock, flags);
 
-       for (i = 0; i < ARRAY_SIZE(ns2_led_modval); i++) {
-               if (mode == ns2_led_modval[i].mode) {
+       for (i = 0; i < led_dat->num_modes; i++) {
+               if (mode != led_dat->modval[i].mode)
+                       continue;
+
+               if (led_dat->can_sleep) {
+                       led_dat->new_mode_index = i;
+                       schedule_work(&led_dat->work);
+               } else {
                        gpio_set_value(led_dat->cmd,
-                                      ns2_led_modval[i].cmd_level);
+                                      led_dat->modval[i].cmd_level);
                        gpio_set_value(led_dat->slow,
-                                      ns2_led_modval[i].slow_level);
+                                      led_dat->modval[i].slow_level);
                }
        }
 
@@ -148,7 +146,6 @@ static ssize_t ns2_led_sata_store(struct device *dev,
                container_of(led_cdev, struct ns2_led_data, cdev);
        int ret;
        unsigned long enable;
-       enum ns2_led_modes mode;
 
        ret = kstrtoul(buff, 10, &enable);
        if (ret < 0)
@@ -157,19 +154,19 @@ static ssize_t ns2_led_sata_store(struct device *dev,
        enable = !!enable;
 
        if (led_dat->sata == enable)
-               return count;
+               goto exit;
 
-       ret = ns2_led_get_mode(led_dat, &mode);
-       if (ret < 0)
-               return ret;
+       led_dat->sata = enable;
 
-       if (enable && mode == NS_V2_LED_ON)
+       if (!led_get_brightness(led_cdev))
+               goto exit;
+
+       if (enable)
                ns2_led_set_mode(led_dat, NS_V2_LED_SATA);
-       if (!enable && mode == NS_V2_LED_SATA)
+       else
                ns2_led_set_mode(led_dat, NS_V2_LED_ON);
 
-       led_dat->sata = enable;
-
+exit:
        return count;
 }
 
@@ -199,7 +196,7 @@ create_ns2_led(struct platform_device *pdev, struct ns2_led_data *led_dat,
        enum ns2_led_modes mode;
 
        ret = devm_gpio_request_one(&pdev->dev, template->cmd,
-                       gpio_get_value(template->cmd) ?
+                       gpio_get_value_cansleep(template->cmd) ?
                        GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
                        template->name);
        if (ret) {
@@ -209,7 +206,7 @@ create_ns2_led(struct platform_device *pdev, struct ns2_led_data *led_dat,
        }
 
        ret = devm_gpio_request_one(&pdev->dev, template->slow,
-                       gpio_get_value(template->slow) ?
+                       gpio_get_value_cansleep(template->slow) ?
                        GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW,
                        template->name);
        if (ret) {
@@ -228,6 +225,10 @@ create_ns2_led(struct platform_device *pdev, struct ns2_led_data *led_dat,
        led_dat->cdev.groups = ns2_led_groups;
        led_dat->cmd = template->cmd;
        led_dat->slow = template->slow;
+       led_dat->can_sleep = gpio_cansleep(led_dat->cmd) |
+                               gpio_cansleep(led_dat->slow);
+       led_dat->modval = template->modval;
+       led_dat->num_modes = template->num_modes;
 
        ret = ns2_led_get_mode(led_dat, &mode);
        if (ret < 0)
@@ -238,6 +239,8 @@ create_ns2_led(struct platform_device *pdev, struct ns2_led_data *led_dat,
        led_dat->cdev.brightness =
                (mode == NS_V2_LED_OFF) ? LED_OFF : LED_FULL;
 
+       INIT_WORK(&led_dat->work, ns2_led_work);
+
        ret = led_classdev_register(&pdev->dev, &led_dat->cdev);
        if (ret < 0)
                return ret;
@@ -248,6 +251,7 @@ create_ns2_led(struct platform_device *pdev, struct ns2_led_data *led_dat,
 static void delete_ns2_led(struct ns2_led_data *led_dat)
 {
        led_classdev_unregister(&led_dat->cdev);
+       cancel_work_sync(&led_dat->work);
 }
 
 #ifdef CONFIG_OF_GPIO
@@ -259,9 +263,8 @@ 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;
+       struct ns2_led *led, *leds;
        int num_leds = 0;
-       int i = 0;
 
        num_leds = of_get_child_count(np);
        if (!num_leds)
@@ -272,26 +275,57 @@ ns2_leds_get_of_pdata(struct device *dev, struct ns2_led_platform_data *pdata)
        if (!leds)
                return -ENOMEM;
 
+       led = leds;
        for_each_child_of_node(np, child) {
                const char *string;
-               int ret;
+               int ret, i, num_modes;
+               struct ns2_led_modval *modval;
 
                ret = of_get_named_gpio(child, "cmd-gpio", 0);
                if (ret < 0)
                        return ret;
-               leds[i].cmd = ret;
+               led->cmd = ret;
                ret = of_get_named_gpio(child, "slow-gpio", 0);
                if (ret < 0)
                        return ret;
-               leds[i].slow = ret;
+               led->slow = ret;
                ret = of_property_read_string(child, "label", &string);
-               leds[i].name = (ret == 0) ? string : child->name;
+               led->name = (ret == 0) ? string : child->name;
                ret = of_property_read_string(child, "linux,default-trigger",
                                              &string);
                if (ret == 0)
-                       leds[i].default_trigger = string;
+                       led->default_trigger = string;
+
+               ret = of_property_count_u32_elems(child, "modes-map");
+               if (ret < 0 || ret % 3) {
+                       dev_err(dev,
+                               "Missing or malformed modes-map property\n");
+                       return -EINVAL;
+               }
+
+               num_modes = ret / 3;
+               modval = devm_kzalloc(dev,
+                                     num_modes * sizeof(struct ns2_led_modval),
+                                     GFP_KERNEL);
+               if (!modval)
+                       return -ENOMEM;
+
+               for (i = 0; i < num_modes; i++) {
+                       of_property_read_u32_index(child,
+                                               "modes-map", 3 * i,
+                                               (u32 *) &modval[i].mode);
+                       of_property_read_u32_index(child,
+                                               "modes-map", 3 * i + 1,
+                                               (u32 *) &modval[i].cmd_level);
+                       of_property_read_u32_index(child,
+                                               "modes-map", 3 * i + 2,
+                                               (u32 *) &modval[i].slow_level);
+               }
+
+               led->num_modes = num_modes;
+               led->modval = modval;
 
-               i++;
+               led++;
        }
 
        pdata->leds = leds;
diff --git a/include/dt-bindings/leds/leds-netxbig.h b/include/dt-bindings/leds/leds-netxbig.h
new file mode 100644 (file)
index 0000000..92658b0
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * This header provides constants for netxbig LED bindings.
+ *
+ * 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.
+ */
+
+#ifndef _DT_BINDINGS_LEDS_NETXBIG_H
+#define _DT_BINDINGS_LEDS_NETXBIG_H
+
+#define NETXBIG_LED_OFF                0
+#define NETXBIG_LED_ON         1
+#define NETXBIG_LED_SATA       2
+#define NETXBIG_LED_TIMER1     3
+#define NETXBIG_LED_TIMER2     4
+
+#endif /* _DT_BINDINGS_LEDS_NETXBIG_H */
diff --git a/include/dt-bindings/leds/leds-ns2.h b/include/dt-bindings/leds/leds-ns2.h
new file mode 100644 (file)
index 0000000..491c5f9
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _DT_BINDINGS_LEDS_NS2_H
+#define _DT_BINDINGS_LEDS_NS2_H
+
+#define NS_V2_LED_OFF  0
+#define NS_V2_LED_ON   1
+#define NS_V2_LED_SATA 2
+
+#endif
index 6a9fed57f34620c20a931f317150e5a381058e8f..eb8a6860e81691085e1735ce565a37a28bbfd7d3 100644 (file)
@@ -9,11 +9,25 @@
 #ifndef __LEDS_KIRKWOOD_NS2_H
 #define __LEDS_KIRKWOOD_NS2_H
 
+enum ns2_led_modes {
+       NS_V2_LED_OFF,
+       NS_V2_LED_ON,
+       NS_V2_LED_SATA,
+};
+
+struct ns2_led_modval {
+       enum ns2_led_modes      mode;
+       int                     cmd_level;
+       int                     slow_level;
+};
+
 struct ns2_led {
        const char      *name;
        const char      *default_trigger;
        unsigned        cmd;
        unsigned        slow;
+       int             num_modes;
+       struct ns2_led_modval *modval;
 };
 
 struct ns2_led_platform_data {