arm64: dts: marvell: add gpio support for Armada 7K/8K
authorGregory CLEMENT <gregory.clement@free-electrons.com>
Mon, 12 Jun 2017 15:35:00 +0000 (17:35 +0200)
committerGregory CLEMENT <gregory.clement@free-electrons.com>
Tue, 20 Jun 2017 14:34:18 +0000 (16:34 +0200)
Enable gpio support for CP and AP on the Marvell Armada 7K/8K SoCs.

The Armada 8K has two CP110 blocks, each having two GPIO controllers.
However, in each CP110 block, one of the GPIO controller cannot be
used: in the master CP110, only the second GPIO controller can be used,
while on the slave CP110, only the first GPIO controller can be used.

On the other side, the Armada 7K has only one CP110, but both its GPIO
controllers can be used.

For this reason, the GPIO controllers are marked as "disabled" in the
armada-cp110-master.dtsi and armada-cp110-slave.dtsi files, and only
enabled in the per-SoC dtsi files.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
arch/arm64/boot/dts/marvell/armada-70x0.dtsi
arch/arm64/boot/dts/marvell/armada-80x0.dtsi
arch/arm64/boot/dts/marvell/armada-ap806.dtsi
arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi

index f6c22665d0915f87762953bd213aa7d2bc59edc2..860b6ae9dcc519eccf14070e0ed65f4a8b2a7596 100644 (file)
 
 #include "armada-cp110-master.dtsi"
 
+/ {
+       aliases {
+               gpio1 = &cpm_gpio1;
+               gpio2 = &cpm_gpio2;
+       };
+};
+
+&cpm_gpio1 {
+       status = "okay";
+};
+
+&cpm_gpio2 {
+       status = "okay";
+};
+
 &cpm_syscon0 {
        cpm_pinctrl: pinctrl {
                compatible = "marvell,armada-7k-pinctrl";
index 93d1de03b39a404e4c512f133d9b329da1759066..666ebe96ba0da10c69f2cb8dc6e397a0660589d6 100644 (file)
 #include "armada-cp110-master.dtsi"
 #include "armada-cp110-slave.dtsi"
 
+/ {
+       aliases {
+               gpio1 = &cps_gpio1;
+               gpio2 = &cpm_gpio2;
+       };
+};
+
+/* The 80x0 has two CP blocks, but uses only one block from each. */
+&cps_gpio1 {
+       status = "okay";
+};
+
+&cpm_gpio2 {
+       status = "okay";
+};
+
 &cpm_syscon0 {
        cpm_pinctrl: pinctrl {
                compatible = "marvell,armada-8k-cpm-pinctrl";
index b9b984e3fd557a65b3f569ae42a676ce9ccc7f97..2557d69fefc8b0557563d9802e0a420eaeb961ba 100644 (file)
@@ -57,6 +57,7 @@
        aliases {
                serial0 = &uart0;
                serial1 = &uart1;
+               gpio0 = &ap_gpio;
        };
 
        psci {
                                ap_pinctrl: pinctrl {
                                        compatible = "marvell,ap806-pinctrl";
                                };
+
+                               ap_gpio: gpio {
+                                       compatible = "marvell,armada-8k-gpio";
+                                       offset = <0x1040>;
+                                       ngpios = <19>;
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       gpio-ranges = <&ap_pinctrl 0 0 19>;
+                               };
                        };
                };
        };
index 8076681683fb8b5edac70dc658e8542f2d87653a..7835d4f517dcba703220c5b44619e2e717660c0d 100644 (file)
                                        compatible = "marvell,cp110-clock";
                                        #clock-cells = <2>;
                                };
+
+                               cpm_gpio1: gpio@100 {
+                                       compatible = "marvell,armada-8k-gpio";
+                                       offset = <0x100>;
+                                       ngpios = <32>;
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       gpio-ranges = <&cpm_pinctrl 0 0 32>;
+                                       status = "disabled";
+
+                               };
+
+                               cpm_gpio2: gpio@140 {
+                                       compatible = "marvell,armada-8k-gpio";
+                                       offset = <0x140>;
+                                       ngpios = <31>;
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       gpio-ranges = <&cpm_pinctrl 0 32 31>;
+                                       status = "disabled";
+                               };
                        };
 
                        cpm_rtc: rtc@284000 {
index a88300ae20fa69739dd02db00cfdd739059a26be..22e4feb1bacecaa655aae0ac906316f77cea52cc 100644 (file)
                                        compatible = "marvell,cp110-clock";
                                        #clock-cells = <2>;
                                };
+
+                               cps_gpio1: gpio@100 {
+                                       compatible = "marvell,armada-8k-gpio";
+                                       offset = <0x100>;
+                                       ngpios = <32>;
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       gpio-ranges = <&cps_pinctrl 0 0 32>;
+                                       status = "disabled";
+
+                               };
+
+                               cps_gpio2: gpio@140 {
+                                       compatible = "marvell,armada-8k-gpio";
+                                       offset = <0x140>;
+                                       ngpios = <31>;
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       gpio-ranges = <&cps_pinctrl 0 32 31>;
+                                       status = "disabled";
+                               };
+
                        };
 
                        cps_sata0: sata@540000 {