Skip to content

Commit

Permalink
arm64: dts: marvell: add gpio support for Armada 7K/8K
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gregory CLEMENT committed Jun 20, 2017
1 parent ae701b6 commit 63dac0f
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arch/arm64/boot/dts/marvell/armada-70x0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@

#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";
Expand Down
16 changes: 16 additions & 0 deletions arch/arm64/boot/dts/marvell/armada-80x0.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@
#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";
Expand Down
10 changes: 10 additions & 0 deletions arch/arm64/boot/dts/marvell/armada-ap806.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
aliases {
serial0 = &uart0;
serial1 = &uart1;
gpio0 = &ap_gpio;
};

psci {
Expand Down Expand Up @@ -256,6 +257,15 @@
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>;
};
};
};
};
Expand Down
21 changes: 21 additions & 0 deletions arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,27 @@
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 {
Expand Down
22 changes: 22 additions & 0 deletions arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,28 @@
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 {
Expand Down

0 comments on commit 63dac0f

Please sign in to comment.