bcm63xx: refresh 3.6 patches
[librecmc/librecmc.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 --- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
30 +++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
31 @@ -50,27 +50,25 @@
32                 };
33  
34                 gpio0: gpio@d0018100 {
35 -                       compatible = "marvell,armadaxp-gpio";
36 -                       reg = <0xd0018100 0x40>,
37 -                           <0xd0018800 0x30>;
38 +                       compatible = "marvell,orion-gpio";
39 +                       reg = <0xd0018100 0x40>;
40                         ngpios = <32>;
41                         gpio-controller;
42                         #gpio-cells = <2>;
43                         interrupt-controller;
44                         #interrupts-cells = <2>;
45 -                       interrupts = <16>, <17>, <18>, <19>;
46 +                       interrupts = <82>, <83>, <84>, <85>;
47                 };
48  
49                 gpio1: gpio@d0018140 {
50 -                       compatible = "marvell,armadaxp-gpio";
51 -                       reg = <0xd0018140 0x40>,
52 -                           <0xd0018840 0x30>;
53 +                       compatible = "marvell,orion-gpio";
54 +                       reg = <0xd0018140 0x40>;
55                         ngpios = <17>;
56                         gpio-controller;
57                         #gpio-cells = <2>;
58                         interrupt-controller;
59                         #interrupts-cells = <2>;
60 -                       interrupts = <20>, <21>, <22>;
61 +                       interrupts = <87>, <88>, <89>;
62                 };
63         };
64  };
65 --- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
66 +++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
67 @@ -51,39 +51,36 @@
68                 };
69  
70                 gpio0: gpio@d0018100 {
71 -                       compatible = "marvell,armadaxp-gpio";
72 -                       reg = <0xd0018100 0x40>,
73 -                           <0xd0018800 0x30>;
74 +                       compatible = "marvell,orion-gpio";
75 +                       reg = <0xd0018100 0x40>;
76                         ngpios = <32>;
77                         gpio-controller;
78                         #gpio-cells = <2>;
79                         interrupt-controller;
80                         #interrupts-cells = <2>;
81 -                       interrupts = <16>, <17>, <18>, <19>;
82 +                       interrupts = <82>, <83>, <84>, <85>;
83                 };
84  
85                 gpio1: gpio@d0018140 {
86 -                       compatible = "marvell,armadaxp-gpio";
87 -                       reg = <0xd0018140 0x40>,
88 -                           <0xd0018840 0x30>;
89 +                       compatible = "marvell,orion-gpio";
90 +                       reg = <0xd0018140 0x40>;
91                         ngpios = <32>;
92                         gpio-controller;
93                         #gpio-cells = <2>;
94                         interrupt-controller;
95                         #interrupts-cells = <2>;
96 -                       interrupts = <20>, <21>, <22>, <23>;
97 +                       interrupts = <87>, <88>, <89>, <90>;
98                 };
99  
100                 gpio2: gpio@d0018180 {
101 -                       compatible = "marvell,armadaxp-gpio";
102 -                       reg = <0xd0018180 0x40>,
103 -                           <0xd0018870 0x30>;
104 +                       compatible = "marvell,orion-gpio";
105 +                       reg = <0xd0018180 0x40>;
106                         ngpios = <3>;
107                         gpio-controller;
108                         #gpio-cells = <2>;
109                         interrupt-controller;
110                         #interrupts-cells = <2>;
111 -                       interrupts = <24>;
112 +                       interrupts = <91>;
113                 };
114  
115                 ethernet@d0034000 {
116 --- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi
117 +++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
118 @@ -66,39 +66,36 @@
119                 };
120  
121                 gpio0: gpio@d0018100 {
122 -                       compatible = "marvell,armadaxp-gpio";
123 -                       reg = <0xd0018100 0x40>,
124 -                           <0xd0018800 0x30>;
125 +                       compatible = "marvell,orion-gpio";
126 +                       reg = <0xd0018100 0x40>;
127                         ngpios = <32>;
128                         gpio-controller;
129                         #gpio-cells = <2>;
130                         interrupt-controller;
131                         #interrupts-cells = <2>;
132 -                       interrupts = <16>, <17>, <18>, <19>;
133 +                       interrupts = <82>, <83>, <84>, <85>;
134                 };
135  
136                 gpio1: gpio@d0018140 {
137 -                       compatible = "marvell,armadaxp-gpio";
138 -                       reg = <0xd0018140 0x40>,
139 -                           <0xd0018840 0x30>;
140 +                       compatible = "marvell,orion-gpio";
141 +                       reg = <0xd0018140 0x40>;
142                         ngpios = <32>;
143                         gpio-controller;
144                         #gpio-cells = <2>;
145                         interrupt-controller;
146                         #interrupts-cells = <2>;
147 -                       interrupts = <20>, <21>, <22>, <23>;
148 +                       interrupts = <87>, <88>, <89>, <90>;
149                 };
150  
151                 gpio2: gpio@d0018180 {
152 -                       compatible = "marvell,armadaxp-gpio";
153 -                       reg = <0xd0018180 0x40>,
154 -                           <0xd0018870 0x30>;
155 +                       compatible = "marvell,orion-gpio";
156 +                       reg = <0xd0018180 0x40>;
157                         ngpios = <3>;
158                         gpio-controller;
159                         #gpio-cells = <2>;
160                         interrupt-controller;
161                         #interrupts-cells = <2>;
162 -                       interrupts = <24>;
163 +                       interrupts = <91>;
164                 };
165  
166                 ethernet@d0034000 {