-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPB-beaglearcade.dts
425 lines (365 loc) · 8.27 KB
/
PB-beaglearcade.dts
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
417
418
419
420
421
422
423
424
425
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/*
* Adafruit PiGRRL GamePad to PocketBeagle Button/Pin assignments
* All signals are Active Low and a ground will need to be connected
* enter and esc are not used in this project
*
* UP - Pin 36 to P2_06
* DOWN - Pin 37 to P2_02
* LEFT - Pin 7 to P2_08
* RIGHT - Pin 35 to P2_04
* SELECT - Pin 29 to P2_24
* START - Pin 31 to P2_20
* A - Pin 8 to P1_02
* B - Pin 10 to P1_34
* X - Pin 38 to P2_33
* Y - Pin 12 to P2_35
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/interrupt-controller/irq.h>
/ {
/*
* Free up the pins used by the cape from the pinmux helpers.
*/
fragment@0 {
target = <&ocp>;
__overlay__ {
P1_04_pinmux { status = "disabled"; }; /* LEDs - left */
P2_03_pinmux { status = "disabled"; }; /* LEDs - right */
P1_06_pinmux { status = "disabled"; }; /* LCD - CS */
P1_08_pinmux { status = "disabled"; }; /* LCD - SCLK */
P1_10_pinmux { status = "disabled"; }; /* LCD - MISO */
P1_12_pinmux { status = "disabled"; }; /* LCD - MOSI */
P2_01_pinmux { status = "disabled"; }; /* LCD - LED */
P2_17_pinmux { status = "disabled"; }; /* LCD - DC */
P2_19_pinmux { status = "disabled"; }; /* LCD - RST */
P2_02_pinmux { status = "disabled"; }; /* keys - down */
P2_04_pinmux { status = "disabled"; }; /* keys - right */
P2_06_pinmux { status = "disabled"; }; /* keys - up */
P2_08_pinmux { status = "disabled"; }; /* keys - left */
P2_18_pinmux { status = "disabled"; }; /* keys - enter */
P2_20_pinmux { status = "disabled"; }; /* keys - one */
P2_22_pinmux { status = "disabled"; }; /* keys - esc */
P2_24_pinmux { status = "disabled"; }; /* keys - five */
P1_02_pinmux { status = "disabled"; }; /* keys - L-ctrl */
P1_34_pinmux { status = "disabled"; }; /* keys - L-alt */
P2_33_pinmux { status = "disabled"; }; /* keys - space */
P2_35_pinmux { status = "disabled"; }; /* keys - L-shift */
};
};
/*
* Free up the gpios used by the cape-universal gpio helpers.
*/
fragment@1 {
target = <&ocp>;
__overlay__ {
cape-universal { status = "disabled"; };
};
};
/*
* Make a new set of gpio helpers.
*/
fragment@2 {
target = <&ocp>;
__overlay__ {
cape-universal@1 {
compatible = "gpio-of-helper";
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <>;
P1_20 {
gpio-name = "P1_20";
gpio = <&gpio0 20 0>;
input;
dir-changeable;
};
P1_26 {
gpio-name = "P1_26";
gpio = <&gpio0 12 0>;
input;
dir-changeable;
};
P1_28 {
gpio-name = "P1_28";
gpio = <&gpio0 13 0>;
input;
dir-changeable;
};
P1_29 {
gpio-name = "P1_29";
gpio = <&gpio3 21 0>;
input;
dir-changeable;
};
P1_30 {
gpio-name = "P1_30";
gpio = <&gpio1 11 0>;
input;
dir-changeable;
};
P1_31 {
gpio-name = "P1_31";
gpio = <&gpio3 18 0>;
input;
dir-changeable;
};
P1_32 {
gpio-name = "P1_32";
gpio = <&gpio1 10 0>;
input;
dir-changeable;
};
P1_33 {
gpio-name = "P1_33";
gpio = <&gpio3 15 0>;
input;
dir-changeable;
};
P1_35 {
gpio-name = "P1_35";
gpio = <&gpio2 24 0>;
input;
dir-changeable;
};
P1_36 {
gpio-name = "P1_36";
gpio = <&gpio3 14 0>;
input;
dir-changeable;
};
P2_05 {
gpio-name = "P2_05";
gpio = <&gpio0 30 0>;
input;
dir-changeable;
};
P2_07 {
gpio-name = "P2_07";
gpio = <&gpio0 31 0>;
input;
dir-changeable;
};
P2_09 {
gpio-name = "P2_09";
gpio = <&gpio0 15 0>;
input;
dir-changeable;
};
P2_10 {
gpio-name = "P2_10";
gpio = <&gpio1 20 0>;
input;
dir-changeable;
};
P2_11 {
gpio-name = "P2_11";
gpio = <&gpio0 14 0>;
input;
dir-changeable;
};
P2_25 {
gpio-name = "P2_25";
gpio = <&gpio1 9 0>;
input;
dir-changeable;
};
P2_27 {
gpio-name = "P2_27";
gpio = <&gpio1 8 0>;
input;
dir-changeable;
};
P2_28 {
gpio-name = "P2_28";
gpio = <&gpio3 20 0>;
input;
dir-changeable;
};
P2_29 {
gpio-name = "P2_29";
gpio = <&gpio0 7 0>;
input;
dir-changeable;
};
P2_30 {
gpio-name = "P2_30";
gpio = <&gpio3 17 0>;
input;
dir-changeable;
};
P2_31 {
gpio-name = "P2_31";
gpio = <&gpio0 19 0>;
input;
dir-changeable;
};
P2_32 {
gpio-name = "P2_32";
gpio = <&gpio3 16 0>;
input;
dir-changeable;
};
P2_34 {
gpio-name = "P2_34";
gpio = <&gpio3 19 0>;
input;
dir-changeable;
};
};
};
};
/*
* Free up the SPI port used by the cape and reallocate it for the LCD.
*/
fragment@3 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
channel@0 {
status = "disabled";
};
channel@1 {
status = "disabled";
};
adafruit28: adafruit28@0{
compatible = "ilitek,ili9341";
pinctrl-names = "default";
pinctrl-0 = <
&P1_06_spi_cs_pin /* CS */
&P1_08_spi_sclk_pin /* SCLK */
&P1_10_spi_pin /* MISO */
&P1_12_spi_pin /* MOSI */
&P2_19_gpio_pin /* RST */
&P2_17_gpio_pin /* DC */
&P2_01_gpio_pin /* LED */
>;
reg = <0>;
buswidth = <8>;
reset-gpios = <&gpio0 27 0>;
dc-gpios = <&gpio2 1 0>;
led-gpios = <&gpio1 18 1>;
debug = <1>;
spi-max-frequency = <32000000>;
rotate = <0>;
bgr;
fps = <30>;
};
};
};
/*
* Load the drivers for the buttons and LEDs.
*/
fragment@4 {
target-path="/";
__overlay__ {
gpio-keys {
compatible = "gpio-keys";
autorepeat;
pinctrl-names = "default";
pinctrl-0 = <
&P2_02_gpio_pu_pin /* down */
&P2_04_gpio_pu_pin /* right */
&P2_06_gpio_pu_pin /* up */
&P2_08_gpio_pu_pin /* left */
&P2_18_gpio_pu_pin /* enter */
&P2_20_gpio_pu_pin /* one */
&P2_22_gpio_pu_pin /* esc */
&P2_24_gpio_pu_pin /* five */
&P1_02_gpio_pu_pin /* L-ctrl */
&P1_34_gpio_pu_pin /* L-alt */
&P2_33_gpio_pu_pin /* space */
&P2_35_gpio_pu_pin /* L-shift */
>;
left {
label = "left";
linux,code = <105>;
gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
};
right {
label = "right";
linux,code = <106>;
gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
};
up {
label = "up";
linux,code = <103>;
gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;
};
down {
label = "down";
linux,code = <108>;
gpios = <&gpio1 27 GPIO_ACTIVE_LOW>;
};
five {
label = "five";
linux,code = <6>;
gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
};
one {
label = "one";
linux,code = <2>;
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
esc {
label = "esc";
linux,code = <1>;
gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
};
enter {
label = "enter";
linux,code = <28>;
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
L-ctrl {
label = "L-ctrl";
linux,code = <29>;
gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
};
L-alt {
label = "L-alt";
linux,code = <56>;
gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
};
space {
label = "space";
linux,code = <57>;
gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
};
L-shift {
label = "L-shift";
linux,code = <42>;
gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
};
};
capeleds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <
&P1_04_gpio_pin /* left */
&P2_03_gpio_pin /* right */
>;
led@1 {
label = "gamingpocketcape::left";
gpios = <&gpio2 25 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
led@2 {
label = "gamingpocketcape::right";
gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
default-state = "off";
};
};
};
};
};