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