summaryrefslogtreecommitdiffstats
path: root/meta-agl-refhw-gen3/recipes-kernel/linux/files/0001-Create-r8a7795-USB-OVC-pin-groups.patch
blob: c2a63b51064b528202097f38d7e5f1f06e705b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
From 931e6487ca7642f94721a07c1e7da2152bda3baf Mon Sep 17 00:00:00 2001
From: Scott Murray <scott.murray@konsulko.com>
Date: Tue, 21 Sep 2021 15:31:36 -0400
Subject: [PATCH 1/4] Create r8a7795 USB OVC pin groups

Split the r8a7795 USB pin groups to create separate groups for the
OVC pins.  This is required for the AGL reference hardware boards,
which use some of the OVC pins in other pinmux modes.

Upstream-Status: pending

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
---
 .../boot/dts/renesas/r8a77950-salvator-x.dts  |  2 +-
 .../boot/dts/renesas/r8a77951-salvator-x.dts  |  2 +-
 .../boot/dts/renesas/r8a77951-salvator-xs.dts |  4 +-
 .../boot/dts/renesas/salvator-common.dtsi     |  6 +-
 arch/arm64/boot/dts/renesas/ulcb-kf.dtsi      |  2 +-
 arch/arm64/boot/dts/renesas/ulcb.dtsi         |  2 +-
 drivers/pinctrl/renesas/pfc-r8a77950.c        | 75 +++++++++++++++----
 drivers/pinctrl/renesas/pfc-r8a77951.c        | 75 +++++++++++++++----
 8 files changed, 129 insertions(+), 39 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
index 1a1f2324dd6e..776082563a30 100644
--- a/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dts
@@ -143,7 +143,7 @@ &ohci2 {
 
 &pfc {
 	usb2_pins: usb2 {
-		groups = "usb2";
+		groups = "usb2", "usb2_ovc";
 		function = "usb2";
 	};
 };
diff --git a/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts b/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
index ade33b2ee741..466b8b4f4fef 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77951-salvator-x.dts
@@ -143,7 +143,7 @@ &ohci2 {
 
 &pfc {
 	usb2_pins: usb2 {
-		groups = "usb2";
+		groups = "usb2", "usb2_ovc";
 		function = "usb2";
 	};
 };
diff --git a/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts b/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
index aa1ff538a4b6..fb1f286e2cd2 100644
--- a/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
+++ b/arch/arm64/boot/dts/renesas/r8a77951-salvator-xs.dts
@@ -167,7 +167,7 @@ pcie-sata-switch-hog {
 
 &pfc {
 	usb2_pins: usb2 {
-		groups = "usb2";
+		groups = "usb2", "usb2_ovc";
 		function = "usb2";
 	};
 
@@ -184,7 +184,7 @@ usb2_pins: usb2 {
 	 *	- Connect GP6_{04,21} to ADV7842.
 	 */
 	usb2_ch3_pins: usb2_ch3 {
-		groups = "usb2_ch3";
+		groups = "usb2_ch3", "usb2_ch3_ovc";
 		function = "usb2_ch3";
 	};
 };
diff --git a/arch/arm64/boot/dts/renesas/salvator-common.dtsi b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
index 3cc16111ede3..f26902f8ae9a 100644
--- a/arch/arm64/boot/dts/renesas/salvator-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-common.dtsi
@@ -773,13 +773,13 @@ sound_clk_pins: sound_clk {
 	};
 
 	usb0_pins: usb0 {
-		groups = "usb0";
+		groups = "usb0", "usb0_ovc";
 		function = "usb0";
 	};
 
 	usb1_pins: usb1 {
 		mux {
-			groups = "usb1";
+			groups = "usb1", "usb1_ovc";
 			function = "usb1";
 		};
 
@@ -795,7 +795,7 @@ pwen {
 	};
 
 	usb30_pins: usb30 {
-		groups = "usb30";
+		groups = "usb30", "usb30_ovc";
 		function = "usb30";
 	};
 };
diff --git a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
index 18867a494f85..6a74f21948da 100644
--- a/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb-kf.dtsi
@@ -1008,7 +1008,7 @@ sound_pcm_pins: sound-pcm {
 	};
 
 	usb0_pins: usb0 {
-		groups = "usb0";
+		groups = "usb0", "usb0_ovc";
 		function = "usb0";
 	};
 
diff --git a/arch/arm64/boot/dts/renesas/ulcb.dtsi b/arch/arm64/boot/dts/renesas/ulcb.dtsi
index cf1ec42a662b..ad0f04d9ee67 100644
--- a/arch/arm64/boot/dts/renesas/ulcb.dtsi
+++ b/arch/arm64/boot/dts/renesas/ulcb.dtsi
@@ -376,7 +376,7 @@ sound_clk_pins: sound-clk {
 	};
 
 	usb1_pins: usb1 {
-		groups = "usb1";
+		groups = "usb1", "usb1_ovc";
 		function = "usb1";
 	};
 };
diff --git a/drivers/pinctrl/renesas/pfc-r8a77950.c b/drivers/pinctrl/renesas/pfc-r8a77950.c
index fd884a0a3206..6d899897b3d2 100644
--- a/drivers/pinctrl/renesas/pfc-r8a77950.c
+++ b/drivers/pinctrl/renesas/pfc-r8a77950.c
@@ -3841,44 +3841,79 @@ static const unsigned int tpu_to3_mux[] = {
 
 /* - USB0 ------------------------------------------------------------------- */
 static const unsigned int usb0_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
+	/* PWEN */
+	RCAR_GP_PIN(6, 24),
 };
 static const unsigned int usb0_mux[] = {
-	USB0_PWEN_MARK, USB0_OVC_MARK,
+	USB0_PWEN_MARK,
+};
+static const unsigned int usb0_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 25),
+};
+static const unsigned int usb0_ovc_mux[] = {
+	USB0_OVC_MARK,
 };
 /* - USB1 ------------------------------------------------------------------- */
 static const unsigned int usb1_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
+	/* PWEN */
+	RCAR_GP_PIN(6, 26),
 };
 static const unsigned int usb1_mux[] = {
-	USB1_PWEN_MARK, USB1_OVC_MARK,
+	USB1_PWEN_MARK,
+};
+static const unsigned int usb1_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 27),
+};
+static const unsigned int usb1_ovc_mux[] = {
+	USB1_OVC_MARK,
 };
 /* - USB2 ------------------------------------------------------------------- */
 static const unsigned int usb2_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 14), RCAR_GP_PIN(6, 15),
+	/* PWEN */
+	RCAR_GP_PIN(6, 14),
 };
 static const unsigned int usb2_mux[] = {
-	USB2_PWEN_MARK, USB2_OVC_MARK,
+	USB2_PWEN_MARK,
+};
+static const unsigned int usb2_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 15),
+};
+static const unsigned int usb2_ovc_mux[] = {
+	USB2_OVC_MARK,
 };
 
 /* - USB30 ------------------------------------------------------------------ */
 static const unsigned int usb30_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29),
+	/* PWEN */
+	RCAR_GP_PIN(6, 28),
 };
 static const unsigned int usb30_mux[] = {
-	USB30_PWEN_MARK, USB30_OVC_MARK,
+	USB30_PWEN_MARK,
+};
+static const unsigned int usb30_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 29),
+};
+static const unsigned int usb30_ovc_mux[] = {
+	USB30_OVC_MARK,
 };
 /* - USB31 ------------------------------------------------------------------ */
 static const unsigned int usb31_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31),
+	/* PWEN */
+	RCAR_GP_PIN(6, 30),
 };
 static const unsigned int usb31_mux[] = {
-	USB31_PWEN_MARK, USB31_OVC_MARK,
+	USB31_PWEN_MARK,
+};
+static const unsigned int usb31_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 31),
+};
+static const unsigned int usb31_ovc_mux[] = {
+	USB31_OVC_MARK,
 };
 
 static const unsigned int vin4_data18_a_pins[] = {
@@ -4434,10 +4469,15 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
 	SH_PFC_PIN_GROUP(tpu_to2),
 	SH_PFC_PIN_GROUP(tpu_to3),
 	SH_PFC_PIN_GROUP(usb0),
+	SH_PFC_PIN_GROUP(usb0_ovc),
 	SH_PFC_PIN_GROUP(usb1),
+	SH_PFC_PIN_GROUP(usb1_ovc),
 	SH_PFC_PIN_GROUP(usb2),
+	SH_PFC_PIN_GROUP(usb2_ovc),
 	SH_PFC_PIN_GROUP(usb30),
+	SH_PFC_PIN_GROUP(usb30_ovc),
 	SH_PFC_PIN_GROUP(usb31),
+	SH_PFC_PIN_GROUP(usb31_ovc),
 	VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
 	VIN_DATA_PIN_GROUP(vin4_data, 16, _a),
 	SH_PFC_PIN_GROUP(vin4_data18_a),
@@ -4936,22 +4976,27 @@ static const char * const tpu_groups[] = {
 
 static const char * const usb0_groups[] = {
 	"usb0",
+	"usb0_ovc",
 };
 
 static const char * const usb1_groups[] = {
 	"usb1",
+	"usb1_ovc",
 };
 
 static const char * const usb2_groups[] = {
 	"usb2",
+	"usb2_ovc",
 };
 
 static const char * const usb30_groups[] = {
 	"usb30",
+	"usb30_ovc",
 };
 
 static const char * const usb31_groups[] = {
 	"usb31",
+	"usb31_ovc",
 };
 
 static const char * const vin4_groups[] = {
diff --git a/drivers/pinctrl/renesas/pfc-r8a77951.c b/drivers/pinctrl/renesas/pfc-r8a77951.c
index 36436907e215..523a2d7e5e48 100644
--- a/drivers/pinctrl/renesas/pfc-r8a77951.c
+++ b/drivers/pinctrl/renesas/pfc-r8a77951.c
@@ -3985,44 +3985,79 @@ static const unsigned int tpu_to3_mux[] = {
 
 /* - USB0 ------------------------------------------------------------------- */
 static const unsigned int usb0_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25),
+	/* PWEN */
+	RCAR_GP_PIN(6, 24),
 };
 static const unsigned int usb0_mux[] = {
-	USB0_PWEN_MARK, USB0_OVC_MARK,
+	USB0_PWEN_MARK,
+};
+static const unsigned int usb0_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 25),
+};
+static const unsigned int usb0_ovc_mux[] = {
+	USB0_OVC_MARK,
 };
 /* - USB1 ------------------------------------------------------------------- */
 static const unsigned int usb1_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 26), RCAR_GP_PIN(6, 27),
+	/* PWEN */
+	RCAR_GP_PIN(6, 26),
 };
 static const unsigned int usb1_mux[] = {
-	USB1_PWEN_MARK, USB1_OVC_MARK,
+	USB1_PWEN_MARK,
+};
+static const unsigned int usb1_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 27),
+};
+static const unsigned int usb1_ovc_mux[] = {
+	USB1_OVC_MARK,
 };
 /* - USB2 ------------------------------------------------------------------- */
 static const unsigned int usb2_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 14), RCAR_GP_PIN(6, 15),
+	/* PWEN */
+	RCAR_GP_PIN(6, 14),
 };
 static const unsigned int usb2_mux[] = {
-	USB2_PWEN_MARK, USB2_OVC_MARK,
+	USB2_PWEN_MARK,
+};
+static const unsigned int usb2_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 15),
+};
+static const unsigned int usb2_ovc_mux[] = {
+	USB2_OVC_MARK,
 };
 /* - USB2_CH3 --------------------------------------------------------------- */
 static const unsigned int usb2_ch3_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 30), RCAR_GP_PIN(6, 31),
+	/* PWEN */
+	RCAR_GP_PIN(6, 30),
 };
 static const unsigned int usb2_ch3_mux[] = {
-	USB2_CH3_PWEN_MARK, USB2_CH3_OVC_MARK,
+	USB2_CH3_PWEN_MARK,
+};
+static const unsigned int usb2_ch3_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 31),
+};
+static const unsigned int usb2_ch3_ovc_mux[] = {
+	USB2_CH3_OVC_MARK,
 };
 
 /* - USB30 ------------------------------------------------------------------ */
 static const unsigned int usb30_pins[] = {
-	/* PWEN, OVC */
-	RCAR_GP_PIN(6, 28), RCAR_GP_PIN(6, 29),
+	/* PWEN */
+	RCAR_GP_PIN(6, 28),
 };
 static const unsigned int usb30_mux[] = {
-	USB30_PWEN_MARK, USB30_OVC_MARK,
+	USB30_PWEN_MARK,
+};
+static const unsigned int usb30_ovc_pins[] = {
+	/* OVC */
+	RCAR_GP_PIN(6, 29),
+};
+static const unsigned int usb30_ovc_mux[] = {
+	USB30_OVC_MARK,
 };
 
 /* - VIN4 ------------------------------------------------------------------- */
@@ -4545,10 +4580,15 @@ static const struct {
 		SH_PFC_PIN_GROUP(tpu_to2),
 		SH_PFC_PIN_GROUP(tpu_to3),
 		SH_PFC_PIN_GROUP(usb0),
+		SH_PFC_PIN_GROUP(usb0_ovc),
 		SH_PFC_PIN_GROUP(usb1),
+		SH_PFC_PIN_GROUP(usb1_ovc),
 		SH_PFC_PIN_GROUP(usb2),
+		SH_PFC_PIN_GROUP(usb2_ovc),
 		SH_PFC_PIN_GROUP(usb2_ch3),
+		SH_PFC_PIN_GROUP(usb2_ch3_ovc),
 		SH_PFC_PIN_GROUP(usb30),
+		SH_PFC_PIN_GROUP(usb30_ovc),
 		VIN_DATA_PIN_GROUP(vin4_data, 8, _a),
 		VIN_DATA_PIN_GROUP(vin4_data, 10, _a),
 		VIN_DATA_PIN_GROUP(vin4_data, 12, _a),
@@ -5103,22 +5143,27 @@ static const char * const tpu_groups[] = {
 
 static const char * const usb0_groups[] = {
 	"usb0",
+	"usb0_ovc",
 };
 
 static const char * const usb1_groups[] = {
 	"usb1",
+	"usb1_ovc",
 };
 
 static const char * const usb2_groups[] = {
 	"usb2",
+	"usb2_ovc",
 };
 
 static const char * const usb2_ch3_groups[] = {
 	"usb2_ch3",
+	"usb2_ch3_ovc",
 };
 
 static const char * const usb30_groups[] = {
 	"usb30",
+	"usb30_ovc",
 };
 
 static const char * const vin4_groups[] = {
-- 
2.31.1