mvebu: add inital support for Marvell Armada XP/370 SoCs
[openwrt/openwrt.git] / target / linux / mvebu / patches-3.8 / 005-arm_mvebu_use_global_interrupts_for_gpio.patch
1 The Armada XP GPIO controller has two ways of notifying interrupts:
2 using global interrupts or using per-CPU interrupts. In an attempt to
3 use the best available features, the 'marvell,armadaxp-gpio'
4 compatible string selects a variant of the gpio-mvebu driver that
5 makes use of the per-CPU interrupts.
6
7 Unfortunately, this doesn't work properly in a SMP context, because we
8 fall into cases where the GPIO interrupt is enabled on CPU X at the
9 GPIO controller level, but on CPU Y at the interrupt controller
10 level. It is not yet clear how to fix that easily.
11
12 So for 3.8, our approach is to switch to global interrupts for GPIOs,
13 so that we do not fall into this per-CPU interrupts problem.
14
15 This patch therefore fixes GPIO interrupts on Armada XP
16 platforms. Without this patch, GPIO interrupts simply do not work
17 reliably, because their proper operation depends on which CPU the code
18 requesting the interrupt is running.
19
20 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
21 ---
22 This is 3.8-rc material.
23 ---
24 arch/arm/boot/dts/armada-xp-mv78230.dtsi | 14 ++++++--------
25 arch/arm/boot/dts/armada-xp-mv78260.dtsi | 21 +++++++++------------
26 arch/arm/boot/dts/armada-xp-mv78460.dtsi | 21 +++++++++------------
27 3 files changed, 24 insertions(+), 32 deletions(-)
28
29 diff --git a/arch/arm/boot/dts/armada-xp-mv78230.dtsi b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
30 index 271855a..e041f42 100644
31 --- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
32 +++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
33 @@ -50,27 +50,25 @@
34 };
35
36 gpio0: gpio@d0018100 {
37 - compatible = "marvell,armadaxp-gpio";
38 - reg = <0xd0018100 0x40>,
39 - <0xd0018800 0x30>;
40 + compatible = "marvell,orion-gpio";
41 + reg = <0xd0018100 0x40>;
42 ngpios = <32>;
43 gpio-controller;
44 #gpio-cells = <2>;
45 interrupt-controller;
46 #interrupts-cells = <2>;
47 - interrupts = <16>, <17>, <18>, <19>;
48 + interrupts = <82>, <83>, <84>, <85>;
49 };
50
51 gpio1: gpio@d0018140 {
52 - compatible = "marvell,armadaxp-gpio";
53 - reg = <0xd0018140 0x40>,
54 - <0xd0018840 0x30>;
55 + compatible = "marvell,orion-gpio";
56 + reg = <0xd0018140 0x40>;
57 ngpios = <17>;
58 gpio-controller;
59 #gpio-cells = <2>;
60 interrupt-controller;
61 #interrupts-cells = <2>;
62 - interrupts = <20>, <21>, <22>;
63 + interrupts = <87>, <88>, <89>;
64 };
65 };
66 };
67 diff --git a/arch/arm/boot/dts/armada-xp-mv78260.dtsi b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
68 index 1c1937d..9e23bd8 100644
69 --- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
70 +++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
71 @@ -51,39 +51,36 @@
72 };
73
74 gpio0: gpio@d0018100 {
75 - compatible = "marvell,armadaxp-gpio";
76 - reg = <0xd0018100 0x40>,
77 - <0xd0018800 0x30>;
78 + compatible = "marvell,orion-gpio";
79 + reg = <0xd0018100 0x40>;
80 ngpios = <32>;
81 gpio-controller;
82 #gpio-cells = <2>;
83 interrupt-controller;
84 #interrupts-cells = <2>;
85 - interrupts = <16>, <17>, <18>, <19>;
86 + interrupts = <82>, <83>, <84>, <85>;
87 };
88
89 gpio1: gpio@d0018140 {
90 - compatible = "marvell,armadaxp-gpio";
91 - reg = <0xd0018140 0x40>,
92 - <0xd0018840 0x30>;
93 + compatible = "marvell,orion-gpio";
94 + reg = <0xd0018140 0x40>;
95 ngpios = <32>;
96 gpio-controller;
97 #gpio-cells = <2>;
98 interrupt-controller;
99 #interrupts-cells = <2>;
100 - interrupts = <20>, <21>, <22>, <23>;
101 + interrupts = <87>, <88>, <89>, <90>;
102 };
103
104 gpio2: gpio@d0018180 {
105 - compatible = "marvell,armadaxp-gpio";
106 - reg = <0xd0018180 0x40>,
107 - <0xd0018870 0x30>;
108 + compatible = "marvell,orion-gpio";
109 + reg = <0xd0018180 0x40>;
110 ngpios = <3>;
111 gpio-controller;
112 #gpio-cells = <2>;
113 interrupt-controller;
114 #interrupts-cells = <2>;
115 - interrupts = <24>;
116 + interrupts = <91>;
117 };
118
119 ethernet@d0034000 {
120 diff --git a/arch/arm/boot/dts/armada-xp-mv78460.dtsi b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
121 index 4905cf3..9659661 100644
122 --- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi
123 +++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
124 @@ -66,39 +66,36 @@
125 };
126
127 gpio0: gpio@d0018100 {
128 - compatible = "marvell,armadaxp-gpio";
129 - reg = <0xd0018100 0x40>,
130 - <0xd0018800 0x30>;
131 + compatible = "marvell,orion-gpio";
132 + reg = <0xd0018100 0x40>;
133 ngpios = <32>;
134 gpio-controller;
135 #gpio-cells = <2>;
136 interrupt-controller;
137 #interrupts-cells = <2>;
138 - interrupts = <16>, <17>, <18>, <19>;
139 + interrupts = <82>, <83>, <84>, <85>;
140 };
141
142 gpio1: gpio@d0018140 {
143 - compatible = "marvell,armadaxp-gpio";
144 - reg = <0xd0018140 0x40>,
145 - <0xd0018840 0x30>;
146 + compatible = "marvell,orion-gpio";
147 + reg = <0xd0018140 0x40>;
148 ngpios = <32>;
149 gpio-controller;
150 #gpio-cells = <2>;
151 interrupt-controller;
152 #interrupts-cells = <2>;
153 - interrupts = <20>, <21>, <22>, <23>;
154 + interrupts = <87>, <88>, <89>, <90>;
155 };
156
157 gpio2: gpio@d0018180 {
158 - compatible = "marvell,armadaxp-gpio";
159 - reg = <0xd0018180 0x40>,
160 - <0xd0018870 0x30>;
161 + compatible = "marvell,orion-gpio";
162 + reg = <0xd0018180 0x40>;
163 ngpios = <3>;
164 gpio-controller;
165 #gpio-cells = <2>;
166 interrupt-controller;
167 #interrupts-cells = <2>;
168 - interrupts = <24>;
169 + interrupts = <91>;
170 };
171
172 ethernet@d0034000 {
173 --
174 1.7.9.5