Updates for BSP v5.5.0
[AGL/meta-agl-refhw.git] / meta-agl-refhw-gen3 / recipes-kernel / linux / files / 0001-Create-r8a7795-USB-OVC-pin-groups.patch
1 From 931e6487ca7642f94721a07c1e7da2152bda3baf Mon Sep 17 00:00:00 2001
2 From: Scott Murray <scott.murray@konsulko.com>
3 Date: Tue, 21 Sep 2021 15:31:36 -0400
4 Subject: [PATCH 1/4] Create r8a7795 USB OVC pin groups
5
6 Split the r8a7795 USB pin groups to create separate groups for the
7 OVC pins.  This is required for the AGL reference hardware boards,
8 which use some of the OVC pins in other pinmux modes.
9
10 Upstream-Status: pending
11
12 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
13 Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
14 ---
15  .../boot/dts/renesas/r8a77950-salvator-x.dts  |  2 +-
16  .../boot/dts/renesas/r8a77951-salvator-x.dts  |  2 +-
17  .../boot/dts/renesas/r8a77951-salvator-xs.dts |  4 +-
18  .../boot/dts/renesas/salvator-common.dtsi     |  6 +-
19  arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |  2 +-
20  arch/arm64/boot/dts/renesas/ulcb.dtsi         |  2 +-
21  drivers/pinctrl/renesas/pfc-r8a77950.c        | 75 +++++++++++++++----
22  drivers/pinctrl/renesas/pfc-r8a77951.c        | 75 +++++++++++++++----
23  8 files changed, 129 insertions(+), 39 deletions(-)
24
25 diff --git a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
26 index 1a1f2324dd6e..776082563a30 100644
27 --- a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
28 +++ b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
29 @@ -143,7 +143,7 @@ &ohci2 {
30  
31  &pfc {
32         usb2_pins: usb2 {
33 -               groups = "usb2";
34 +               groups = "usb2", "usb2_ovc";
35                 function = "usb2";
36         };
37  };
38 diff --git a/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
39 index ade33b2ee741..466b8b4f4fef 100644
40 --- a/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
41 +++ b/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
42 @@ -143,7 +143,7 @@ &ohci2 {
43  
44  &pfc {
45         usb2_pins: usb2 {
46 -               groups = "usb2";
47 +               groups = "usb2", "usb2_ovc";
48                 function = "usb2";
49         };
50  };
51 diff --git a/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts b/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
52 index aa1ff538a4b6..fb1f286e2cd2 100644
53 --- a/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
54 +++ b/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
55 @@ -167,7 +167,7 @@ pcie-sata-switch-hog {
56  
57  &pfc {
58         usb2_pins: usb2 {
59 -               groups = "usb2";
60 +               groups = "usb2", "usb2_ovc";
61                 function = "usb2";
62         };
63  
64 @@ -184,7 +184,7 @@ usb2_pins: usb2 {
65          *      - Connect GP6_{04,21} to ADV7842.
66          */
67         usb2_ch3_pins: usb2_ch3 {
68 -               groups = "usb2_ch3";
69 +               groups = "usb2_ch3", "usb2_ch3_ovc";
70                 function = "usb2_ch3";
71         };
72  };
73 diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
74 index 3cc16111ede3..f26902f8ae9a 100644
75 --- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
76 +++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
77 @@ -773,13 +773,13 @@ sound_clk_pins: sound_clk {
78         };
79  
80         usb0_pins: usb0 {
81 -               groups = "usb0";
82 +               groups = "usb0", "usb0_ovc";
83                 function = "usb0";
84         };
85  
86         usb1_pins: usb1 {
87                 mux {
88 -                       groups = "usb1";
89 +                       groups = "usb1", "usb1_ovc";
90                         function = "usb1";
91                 };
92  
93 @@ -795,7 +795,7 @@ pwen {
94         };
95  
96         usb30_pins: usb30 {
97 -               groups = "usb30";
98 +               groups = "usb30", "usb30_ovc";
99                 function = "usb30";
100         };
101  };
102 diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
103 index 18867a494f85..6a74f21948da 100644
104 --- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
105 +++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
106 @@ -1008,7 +1008,7 @@ sound_pcm_pins: sound-pcm {
107         };
108  
109         usb0_pins: usb0 {
110 -               groups = "usb0";
111 +               groups = "usb0", "usb0_ovc";
112                 function = "usb0";
113         };
114  
115 diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
116 index cf1ec42a662b..ad0f04d9ee67 100644
117 --- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
118 +++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
119 @@ -376,7 +376,7 @@ sound_clk_pins: sound-clk {
120         };
121  
122         usb1_pins: usb1 {
123 -               groups = "usb1";
124 +               groups = "usb1", "usb1_ovc";
125                 function = "usb1";
126         };
127  };
128 diff --git a/drivers/pinctrl/renesas/pfc-r8a77950.c b/drivers/pinctrl/renesas/pfc-r8a77950.c
129 index fd884a0a3206..6d899897b3d2 100644
130 --- a/drivers/pinctrl/renesas/pfc-r8a77950.c
131 +++ b/drivers/pinctrl/renesas/pfc-r8a77950.c
132 @@ -3841,44 +3841,79 @@ static const unsigned int tpu_to3_mux[] = {
133  
134  /* - USB0 ------------------------------------------------------------------- */
135  static const unsigned int usb0_pins[] = {
136 -       /* PWEN, OVC */
137 -       RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
138 +       /* PWEN */
139 +       RCAR_GP_PIN(6, 24),
140  };
141  static const unsigned int usb0_mux[] = {
142 -       USB0_PWEN_MARK, USB0_OVC_MARK,
143 +       USB0_PWEN_MARK,
144 +};
145 +static const unsigned int usb0_ovc_pins[] = {
146 +       /* OVC */
147 +       RCAR_GP_PIN(6, 25),
148 +};
149 +static const unsigned int usb0_ovc_mux[] = {
150 +       USB0_OVC_MARK,
151  };
152  /* - USB1 ------------------------------------------------------------------- */
153  static const unsigned int usb1_pins[] = {
154 -       /* PWEN, OVC */
155 -       RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
156 +       /* PWEN */
157 +       RCAR_GP_PIN(6, 26),
158  };
159  static const unsigned int usb1_mux[] = {
160 -       USB1_PWEN_MARK, USB1_OVC_MARK,
161 +       USB1_PWEN_MARK,
162 +};
163 +static const unsigned int usb1_ovc_pins[] = {
164 +       /* OVC */
165 +       RCAR_GP_PIN(6, 27),
166 +};
167 +static const unsigned int usb1_ovc_mux[] = {
168 +       USB1_OVC_MARK,
169  };
170  /* - USB2 ------------------------------------------------------------------- */
171  static const unsigned int usb2_pins[] = {
172 -       /* PWEN, OVC */
173 -       RCAR_GP_PIN(6, 14), RCAR_GP_PIN(6, 15),
174 +       /* PWEN */
175 +       RCAR_GP_PIN(6, 14),
176  };
177  static const unsigned int usb2_mux[] = {
178 -       USB2_PWEN_MARK, USB2_OVC_MARK,
179 +       USB2_PWEN_MARK,
180 +};
181 +static const unsigned int usb2_ovc_pins[] = {
182 +       /* OVC */
183 +       RCAR_GP_PIN(6, 15),
184 +};
185 +static const unsigned int usb2_ovc_mux[] = {
186 +       USB2_OVC_MARK,
187  };
188  
189  /* - USB30 ------------------------------------------------------------------ */
190  static const unsigned int usb30_pins[] = {
191 -       /* PWEN, OVC */
192 -       RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29),
193 +       /* PWEN */
194 +       RCAR_GP_PIN(6, 28),
195  };
196  static const unsigned int usb30_mux[] = {
197 -       USB30_PWEN_MARK, USB30_OVC_MARK,
198 +       USB30_PWEN_MARK,
199 +};
200 +static const unsigned int usb30_ovc_pins[] = {
201 +       /* OVC */
202 +       RCAR_GP_PIN(6, 29),
203 +};
204 +static const unsigned int usb30_ovc_mux[] = {
205 +       USB30_OVC_MARK,
206  };
207  /* - USB31 ------------------------------------------------------------------ */
208  static const unsigned int usb31_pins[] = {
209 -       /* PWEN, OVC */
210 -       RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31),
211 +       /* PWEN */
212 +       RCAR_GP_PIN(6, 30),
213  };
214  static const unsigned int usb31_mux[] = {
215 -       USB31_PWEN_MARK, USB31_OVC_MARK,
216 +       USB31_PWEN_MARK,
217 +};
218 +static const unsigned int usb31_ovc_pins[] = {
219 +       /* OVC */
220 +       RCAR_GP_PIN(6, 31),
221 +};
222 +static const unsigned int usb31_ovc_mux[] = {
223 +       USB31_OVC_MARK,
224  };
225  
226  static const unsigned int vin4_data18_a_pins[] = {
227 @@ -4434,10 +4469,15 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
228         SH_PFC_PIN_GROUP(tpu_to2),
229         SH_PFC_PIN_GROUP(tpu_to3),
230         SH_PFC_PIN_GROUP(usb0),
231 +       SH_PFC_PIN_GROUP(usb0_ovc),
232         SH_PFC_PIN_GROUP(usb1),
233 +       SH_PFC_PIN_GROUP(usb1_ovc),
234         SH_PFC_PIN_GROUP(usb2),
235 +       SH_PFC_PIN_GROUP(usb2_ovc),
236         SH_PFC_PIN_GROUP(usb30),
237 +       SH_PFC_PIN_GROUP(usb30_ovc),
238         SH_PFC_PIN_GROUP(usb31),
239 +       SH_PFC_PIN_GROUP(usb31_ovc),
240         VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
241         VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
242         SH_PFC_PIN_GROUP(vin4_data18_a),
243 @@ -4936,22 +4976,27 @@ static const char * const tpu_groups[] = {
244  
245  static const char * const usb0_groups[] = {
246         "usb0",
247 +       "usb0_ovc",
248  };
249  
250  static const char * const usb1_groups[] = {
251         "usb1",
252 +       "usb1_ovc",
253  };
254  
255  static const char * const usb2_groups[] = {
256         "usb2",
257 +       "usb2_ovc",
258  };
259  
260  static const char * const usb30_groups[] = {
261         "usb30",
262 +       "usb30_ovc",
263  };
264  
265  static const char * const usb31_groups[] = {
266         "usb31",
267 +       "usb31_ovc",
268  };
269  
270  static const char * const vin4_groups[] = {
271 diff --git a/drivers/pinctrl/renesas/pfc-r8a77951.c b/drivers/pinctrl/renesas/pfc-r8a77951.c
272 index 36436907e215..523a2d7e5e48 100644
273 --- a/drivers/pinctrl/renesas/pfc-r8a77951.c
274 +++ b/drivers/pinctrl/renesas/pfc-r8a77951.c
275 @@ -3985,44 +3985,79 @@ static const unsigned int tpu_to3_mux[] = {
276  
277  /* - USB0 ------------------------------------------------------------------- */
278  static const unsigned int usb0_pins[] = {
279 -       /* PWEN, OVC */
280 -       RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
281 +       /* PWEN */
282 +       RCAR_GP_PIN(6, 24),
283  };
284  static const unsigned int usb0_mux[] = {
285 -       USB0_PWEN_MARK, USB0_OVC_MARK,
286 +       USB0_PWEN_MARK,
287 +};
288 +static const unsigned int usb0_ovc_pins[] = {
289 +       /* OVC */
290 +       RCAR_GP_PIN(6, 25),
291 +};
292 +static const unsigned int usb0_ovc_mux[] = {
293 +       USB0_OVC_MARK,
294  };
295  /* - USB1 ------------------------------------------------------------------- */
296  static const unsigned int usb1_pins[] = {
297 -       /* PWEN, OVC */
298 -       RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
299 +       /* PWEN */
300 +       RCAR_GP_PIN(6, 26),
301  };
302  static const unsigned int usb1_mux[] = {
303 -       USB1_PWEN_MARK, USB1_OVC_MARK,
304 +       USB1_PWEN_MARK,
305 +};
306 +static const unsigned int usb1_ovc_pins[] = {
307 +       /* OVC */
308 +       RCAR_GP_PIN(6, 27),
309 +};
310 +static const unsigned int usb1_ovc_mux[] = {
311 +       USB1_OVC_MARK,
312  };
313  /* - USB2 ------------------------------------------------------------------- */
314  static const unsigned int usb2_pins[] = {
315 -       /* PWEN, OVC */
316 -       RCAR_GP_PIN(6, 14), RCAR_GP_PIN(6, 15),
317 +       /* PWEN */
318 +       RCAR_GP_PIN(6, 14),
319  };
320  static const unsigned int usb2_mux[] = {
321 -       USB2_PWEN_MARK, USB2_OVC_MARK,
322 +       USB2_PWEN_MARK,
323 +};
324 +static const unsigned int usb2_ovc_pins[] = {
325 +       /* OVC */
326 +       RCAR_GP_PIN(6, 15),
327 +};
328 +static const unsigned int usb2_ovc_mux[] = {
329 +       USB2_OVC_MARK,
330  };
331  /* - USB2_CH3 --------------------------------------------------------------- */
332  static const unsigned int usb2_ch3_pins[] = {
333 -       /* PWEN, OVC */
334 -       RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31),
335 +       /* PWEN */
336 +       RCAR_GP_PIN(6, 30),
337  };
338  static const unsigned int usb2_ch3_mux[] = {
339 -       USB2_CH3_PWEN_MARK, USB2_CH3_OVC_MARK,
340 +       USB2_CH3_PWEN_MARK,
341 +};
342 +static const unsigned int usb2_ch3_ovc_pins[] = {
343 +       /* OVC */
344 +       RCAR_GP_PIN(6, 31),
345 +};
346 +static const unsigned int usb2_ch3_ovc_mux[] = {
347 +       USB2_CH3_OVC_MARK,
348  };
349  
350  /* - USB30 ------------------------------------------------------------------ */
351  static const unsigned int usb30_pins[] = {
352 -       /* PWEN, OVC */
353 -       RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29),
354 +       /* PWEN */
355 +       RCAR_GP_PIN(6, 28),
356  };
357  static const unsigned int usb30_mux[] = {
358 -       USB30_PWEN_MARK, USB30_OVC_MARK,
359 +       USB30_PWEN_MARK,
360 +};
361 +static const unsigned int usb30_ovc_pins[] = {
362 +       /* OVC */
363 +       RCAR_GP_PIN(6, 29),
364 +};
365 +static const unsigned int usb30_ovc_mux[] = {
366 +       USB30_OVC_MARK,
367  };
368  
369  /* - VIN4 ------------------------------------------------------------------- */
370 @@ -4545,10 +4580,15 @@ static const struct {
371                 SH_PFC_PIN_GROUP(tpu_to2),
372                 SH_PFC_PIN_GROUP(tpu_to3),
373                 SH_PFC_PIN_GROUP(usb0),
374 +               SH_PFC_PIN_GROUP(usb0_ovc),
375                 SH_PFC_PIN_GROUP(usb1),
376 +               SH_PFC_PIN_GROUP(usb1_ovc),
377                 SH_PFC_PIN_GROUP(usb2),
378 +               SH_PFC_PIN_GROUP(usb2_ovc),
379                 SH_PFC_PIN_GROUP(usb2_ch3),
380 +               SH_PFC_PIN_GROUP(usb2_ch3_ovc),
381                 SH_PFC_PIN_GROUP(usb30),
382 +               SH_PFC_PIN_GROUP(usb30_ovc),
383                 VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
384                 VIN_DATA_PIN_GROUP(vin4_data, 10, _a),
385                 VIN_DATA_PIN_GROUP(vin4_data, 12, _a),
386 @@ -5103,22 +5143,27 @@ static const char * const tpu_groups[] = {
387  
388  static const char * const usb0_groups[] = {
389         "usb0",
390 +       "usb0_ovc",
391  };
392  
393  static const char * const usb1_groups[] = {
394         "usb1",
395 +       "usb1_ovc",
396  };
397  
398  static const char * const usb2_groups[] = {
399         "usb2",
400 +       "usb2_ovc",
401  };
402  
403  static const char * const usb2_ch3_groups[] = {
404         "usb2_ch3",
405 +       "usb2_ch3_ovc",
406  };
407  
408  static const char * const usb30_groups[] = {
409         "usb30",
410 +       "usb30_ovc",
411  };
412  
413  static const char * const vin4_groups[] = {
414 -- 
415 2.31.1
416