Skip to content

Commit 4de745b

Browse files
sinha-shreyashravi-rahul
authored andcommitted
[j722s]: added rpi header support for j722s
Signed-off-by: Shreyash Sinha <[email protected]>
1 parent 1972d07 commit 4de745b

File tree

5 files changed

+109
-5
lines changed

5 files changed

+109
-5
lines changed

lib/python/TI/GPIO/gpio_pin_data.py

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
AM69_SK = "AM69_SK"
2828
AM62A_SK = "AM62A_SK"
2929
AM62P_SK = "AM62P_SK"
30+
J722S_EVM = "J722S_EVM"
3031

3132
OFFSET_ENTRY = 0
3233
GPIO_CHIP_ENTRY = 1
@@ -201,7 +202,7 @@
201202
(25, 2, "601000.gpio", 8, 14, "GPIO1_25", None, None),
202203
(24, 2, "601000.gpio", 10, 15, "GPIO1_24", None, None),
203204
(11, 2, "601000.gpio", 11, 17, "GPIO1_11", None, None),
204-
(14, 2, "601000.gpio", 12, 18, "GPIO1_14", None, None),
205+
(14, 2, "601000.gpio", 12, 18, "GPIO1_14", "23000000.pwm", 1),
205206
(42, 1, "600000.gpio", 13, 27, "GPIO0_42", None, None),
206207
(22, 2, "601000.gpio", 15, 22, "GPIO1_22", None, None),
207208
(38, 1, "600000.gpio", 16, 23, "GPIO0_38", None, None),
@@ -210,13 +211,13 @@
210211
(19, 2, "601000.gpio", 21, 9, "GPIO1_19", None, None),
211212
(14, 1, "600000.gpio", 22, 25, "GPIO0_14", None, None),
212213
(17, 2, "601000.gpio", 23, 11, "GPIO1_17", None, None),
213-
(15, 2, "601000.gpio", 24, 8, "GPIO1_15", "23000000.pwm", 0),
214-
(16, 2, "601000.gpio", 26, 7, "GPIO1_16", "23000000.pwm", 1),
214+
(15, 2, "601000.gpio", 24, 8, "GPIO1_15", None, None),
215+
(16, 2, "601000.gpio", 26, 7, "GPIO1_16", None, None),
215216
(36, 1, "600000.gpio", 29, 5, "GPIO0_36", None, None),
216217
(33, 1, "600000.gpio", 31, 6, "GPIO0_33", None, None),
217218
(40, 1, "600000.gpio", 32, 12, "GPIO0_40", None, None),
218219
(10, 2, "601000.gpio", 33, 13, "GPIO1_10", "23010000.pwm", 1),
219-
(13, 2, "601000.gpio", 35, 19, "GPIO1_13", None, None),
220+
(13, 2, "601000.gpio", 35, 19, "GPIO1_13", "23000000.pwm", 0),
220221
(9, 2, "601000.gpio", 36, 16, "GPIO1_09", "23010000.pwm", 0),
221222
(41, 1, "600000.gpio", 37, 26, "GPIO0_41", None, None),
222223
(8, 2, "601000.gpio", 38, 20, "GPIO1_08", None, None),
@@ -228,6 +229,41 @@
228229
"ti,am62p5",
229230
)
230231

232+
J722S_EVM_PIN_DEFS = [
233+
# OFFSET GPIOCHIP_X sysfs_dir BOARD BCM SOC_NAME PWM_SysFs PWM_Id
234+
(18, 1, "4201000.gpio", 3, 2, "I2C2_SDA", None, None),
235+
(17, 1, "4201000.gpio", 5, 3, "I2C2_SCL", None, None),
236+
(38, 2, "600000.gpio", 7, 4, "GPIO0_38", None, None),
237+
(14, 3, "601000.gpio", 8, 14, "GPIO1_14", None, None),
238+
(13, 3, "601000.gpio", 10, 15, "GPIO1_13", None, None),
239+
(8, 3, "601000.gpio", 11, 17, "GPIO1_08", None, None),
240+
(11, 3, "601000.gpio", 12, 18, "GPIO1_11", None, None),
241+
(33, 2, "600000.gpio", 13, 27, "GPIO0_33", None, None),
242+
(7, 3, "601000.gpio", 15, 22, "GPIO1_07", None, None),
243+
(7, 1, "4201000.gpio", 16, 23, "MCU_GPIO0_07", None, None),
244+
(8, 1, "4201000.gpio", 18, 24, "MCU_GPIO0_08", None, None),
245+
(3, 1, "4201000.gpio", 19, 10, "MCU_GPIO0_03", None, None),
246+
(4, 1, "4201000.gpio", 21, 9, "MCU_GPIO0_04", None, None),
247+
(42, 2, "600000.gpio", 22, 25, "GPIO0_42", None, None),
248+
(2, 1, "4201000.gpio", 23, 11, "MCU_GPIO0_02", None, None),
249+
(0, 1, "4201000.gpio", 24, 8, "MCU_GPIO0_00", None, None),
250+
(1, 1, "4201000.gpio", 26, 7, "MCU_GPIO0_01", None, None),
251+
(15, 3, "601000.gpio", 29, 5, "GPIO1_15", "23000000.pwm", 0),
252+
(17, 3, "601000.gpio", 31, 6, "GPIO1_17", "23010000.pwm", 1),
253+
(16, 3, "601000.gpio", 32, 12, "GPIO1_16", None, None),
254+
(18, 3, "601000.gpio", 33, 13, "GPIO1_18", "23010000.pwm", 0),
255+
(12, 3, "601000.gpio", 35, 19, "GPIO1_12", None, None),
256+
(41, 2, "600000.gpio", 36, 16, "GPIO0_41", None, None),
257+
(36, 2, "600000.gpio", 37, 26, "GPIO0_36", None, None),
258+
(10, 3, "601000.gpio", 38, 20, "GPIO1_10", None, None),
259+
(9, 3, "601000.gpio", 40, 21, "GPIO1_09", None, None),
260+
]
261+
262+
compats_j722sevm = (
263+
"ti,j722s-evm",
264+
"ti,j722s",
265+
)
266+
231267
board_gpio_data = {
232268
J721E_SK: (
233269
J721E_SK_PIN_DEFS,
@@ -279,6 +315,16 @@
279315
"PROCESSOR": "ARM A53",
280316
},
281317
),
318+
J722S_EVM: (
319+
J722S_EVM_PIN_DEFS,
320+
{
321+
"RAM": "8192M",
322+
"REVISION": "E1",
323+
"TYPE": "J722S_EVM",
324+
"MANUFACTURER": "TI",
325+
"PROCESSOR": "ARM A53",
326+
},
327+
),
282328
}
283329

284330

@@ -313,6 +359,8 @@ def matches(vals):
313359
model = AM62A_SK
314360
elif matches(compats_am62psk):
315361
model = AM62P_SK
362+
elif matches(compats_j722sevm):
363+
model = J722S_EVM
316364

317365
else:
318366
raise Exception("Could not determine TI SOC model")

samples/simple_pwm.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"AM69_SK": 32,
3030
"AM62A_SK": 35,
3131
"AM62P_SK": 35,
32+
"J722S_EVM": 33,
3233
}
3334
output_pin = output_pins.get(GPIO.model, None)
3435
if output_pin is None:

samples/test_all_pins.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252
"input_only": (),
5353
"hw_pwm": (24, 26, 33, 36), # HW PWMs to skip for this test
5454
},
55+
"J722S_EVM": {
56+
"unimplemented": (),
57+
"input_only": (),
58+
"hw_pwm": (29, 31, 33), # HW PWMs to skip for this test
59+
},
5560
}
5661

5762
pin_data = pin_datas.get(GPIO.model)

samples/test_all_pins_input.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,41 @@
122122
(31, 6, "GPIO0_33"),
123123
(32, 12, "GPIO0_40"),
124124
# (33, 13, "GPIO1_10"),
125-
# (36, 16, "GPIO1_9"),
125+
# (36, 19, "GPIO1_9"),
126126
(37, 26, "GPIO0_41"),
127127
]
128128

129+
j722s_evm_pin_defs = [
130+
# BOARD BCM SOC
131+
(7, 4, "GPIO0_38"),
132+
(8, 14, "GPIO1_14"),
133+
(10, 15, "GPIO1_13"),
134+
(11, 17, "GPIO1_08"),
135+
(12, 18, "GPIO1_11"),
136+
(13, 27, "GPIO0_33"),
137+
# (15, 22, "GPIO1_07"),
138+
(16, 23, "MCU_GPIO0_07"),
139+
(18, 24, "MCU_GPIO0_08"),
140+
(19, 10, "MCU_GPIO0_03"),
141+
(21, 9, "MCU_GPIO0_04"),
142+
(22, 25, "GPIO0_42"),
143+
(23, 11, "MCU_GPIO0_02"),
144+
(24, 8, "MCU_GPIO0_00"),
145+
(26, 7, "MCU_GPIO0_01"),
146+
(32, 12, "GPIO1_16"),
147+
(35, 19, "GPIO1_12"),
148+
(37, 26, "GPIO0_36"),
149+
(38, 20, "GPIO1_10"),
150+
(40, 21, "GPIO1_09"),
151+
]
152+
129153
all_pins = {
130154
"J721E_SK": j721e_sk_pin_defs, # all non hw-pwm pins
131155
"AM68_SK": am68_sk_pin_defs, # all non hw-pwm pins
132156
"AM69_SK": am69_sk_pin_defs, # all non hw-pwm pins
133157
"AM62A_SK": am62a_sk_pin_defs, # all non hw-pwm pins
134158
"AM62P_SK": am62p_sk_pin_defs, # all non hw-pwm pins
159+
"J722S_EVM": j722s_evm_pin_defs, # all non hw-pwm pins
135160
}
136161

137162
pin_defs = all_pins.get(GPIO.model)

samples/test_all_pins_pwm.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,31 @@
8181
], # Can be any valid GPIO pins
8282
"hw_pwm": [24, 26, 33, 36], # Designated HW PWM pins
8383
},
84+
"J722S_EVM": {
85+
"sw_pwm": [
86+
7,
87+
8,
88+
10,
89+
11,
90+
12,
91+
13,
92+
15,
93+
16,
94+
18,
95+
19,
96+
21,
97+
22,
98+
23,
99+
24,
100+
26,
101+
32,
102+
35,
103+
37,
104+
38,
105+
40,
106+
], # Can be any valid GPIO pins
107+
"hw_pwm": [29, 31, 33], # Designated HW PWM pins
108+
},
84109
}
85110

86111
pin_data = all_pwm_pins.get(GPIO.model)

0 commit comments

Comments
 (0)