Skip to content
This repository was archived by the owner on Aug 3, 2021. It is now read-only.

Commit ca5bbef

Browse files
committed
Support Tegra210
Tegra210 changes the pinmux HW in a few ways; at least: - The set of drive groups is much more 1:1 with the set of pins. Most pins have an associated drive group register as well as an associated pinmux register, and most drive groups cover a single pin. - Some register fields have moved from the drive group registers into the pinmux registers. - The set of available options for each pin and group varies relative to previous chips, and hence the register layouts vary a bit too. This patch updates tegra-pinmux-scripts minimally to handle these changes, to a level equivalent to the support for previous chips. For example, some new options such as per-pin schmitt aren't handled since the syseng-supplied pinmux spreadsheets don't provide a value for this option. csv-to-board-tegra124-xlsx.py is renamed to csv-to-board.py since it now supports boards using different SoCs, and it's not worth encoding all supported SoCs in the filename (Tegra30/114 aren't supported by it, hence the previous naming). Signed-off-by: Stephen Warren <[email protected]>
1 parent 32ceb32 commit ca5bbef

14 files changed

+1572
-227
lines changed

board-to-kernel-dt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ def mapper_bool(val):
5656
print(' nvidia,enable-input = <' + mapper_bool(pincfg.e_inp) + '>;')
5757
if pincfg.gpio_pin.od:
5858
print(' nvidia,open-drain = <' + mapper_bool(pincfg.od) + '>;')
59-
if hasattr(pincfg.gpio_pin, 'rcv_sel') and pincfg.gpio_pin.rcv_sel:
59+
if board.soc.soc_pins_have_rcv_sel and pincfg.gpio_pin.rcv_sel and hasattr(pincfg.gpio_pin, 'rcv_sel'):
6060
print(' nvidia,rcv-sel = <' + mapper_bool(pincfg.rcv_sel) + '>;')
61+
if board.soc.soc_pins_have_e_io_hv and pincfg.gpio_pin.e_io_hv and hasattr(pincfg.gpio_pin, 'e_io_hv'):
62+
print(' nvidia,io-hv = <' + mapper_bool(pincfg.e_io_hv) + '>;')
6163
print(' };')
6264

6365
# FIXME: Handle drive groups

board-to-uboot.py

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,48 @@
8080
print('''\
8181
};
8282
83-
#define PINCFG(_pingrp, _mux, _pull, _tri, _io, _od, _rcv_sel) \\
84-
{ \\
85-
.pingrp = PMUX_PINGRP_##_pingrp, \\
86-
.func = PMUX_FUNC_##_mux, \\
87-
.pull = PMUX_PULL_##_pull, \\
88-
.tristate = PMUX_TRI_##_tri, \\
89-
.io = PMUX_PIN_##_io, \\
90-
.od = PMUX_PIN_OD_##_od, \\
91-
.rcv_sel = PMUX_PIN_RCV_SEL_##_rcv_sel, \\
92-
.lock = PMUX_PIN_LOCK_DEFAULT, \\
93-
.ioreset = PMUX_PIN_IO_RESET_DEFAULT, \\
83+
''', end='')
84+
85+
params = ['_pingrp', '_mux', '_pull', '_tri', '_io', '_od']
86+
if board.soc.soc_pins_have_rcv_sel:
87+
params += ['_rcv_sel',]
88+
if board.soc.soc_pins_have_e_io_hv:
89+
params += ['_e_io_hv',]
90+
s = gen_wrapped_c_macro_header('PINCFG', params)
91+
92+
s += '''\
93+
{
94+
.pingrp = PMUX_PINGRP_##_pingrp,
95+
.func = PMUX_FUNC_##_mux,
96+
.pull = PMUX_PULL_##_pull,
97+
.tristate = PMUX_TRI_##_tri,
98+
.io = PMUX_PIN_##_io,
99+
.od = PMUX_PIN_OD_##_od,
100+
'''
101+
102+
if board.soc.soc_pins_have_rcv_sel:
103+
s += '''\
104+
.rcv_sel = PMUX_PIN_RCV_SEL_##_rcv_sel,
105+
'''
106+
107+
if board.soc.soc_pins_have_e_io_hv:
108+
s += '''\
109+
.e_io_hv = PMUX_PIN_E_IO_HV_##_e_io_hv,
110+
'''
111+
112+
s += '''\
113+
.lock = PMUX_PIN_LOCK_DEFAULT,
114+
'''
115+
116+
if board.soc.soc_pins_have_ior:
117+
s += '''\
118+
.ioreset = PMUX_PIN_IO_RESET_DEFAULT,
119+
'''
120+
121+
s = append_aligned_tabs_indent_with_tabs(s)
122+
print(s)
123+
124+
print('''\
94125
}
95126
96127
static const struct pmux_pingrp_config %(board_varname)s_pingrps[] = {
@@ -125,6 +156,11 @@ def mapper_rcv_sel(gpio_pin, val):
125156
return 'DEFAULT'
126157
return {False: 'NORMAL', True: 'HIGH'}[val]
127158

159+
def mapper_e_io_hv(gpio_pin, val):
160+
if not gpio_pin.e_io_hv:
161+
return 'DEFAULT'
162+
return {False: 'NORMAL', True: 'HIGH'}[val]
163+
128164
pincfg_table = []
129165
for pincfg in board.pincfgs_by_num():
130166
row = (
@@ -135,12 +171,16 @@ def mapper_rcv_sel(gpio_pin, val):
135171
mapper_e_input(pincfg.e_inp),
136172
mapper_od(pincfg.gpio_pin, pincfg.od),
137173
)
138-
if board.soc.has_rcv_sel:
174+
if board.soc.soc_pins_have_rcv_sel:
139175
row += (mapper_rcv_sel(pincfg.gpio_pin, pincfg.rcv_sel),)
176+
if board.soc.soc_pins_have_e_io_hv:
177+
row += (mapper_e_io_hv(pincfg.gpio_pin, pincfg.e_io_hv),)
140178
pincfg_table.append(row)
141179
headings = ('pingrp', 'mux', 'pull', 'tri', 'e_input', 'od')
142-
if board.soc.has_rcv_sel:
180+
if board.soc.soc_pins_have_rcv_sel:
143181
headings += ('rcv_sel',)
182+
if board.soc.soc_pins_have_e_io_hv:
183+
headings += ('e_io_hv',)
144184
dump_c_table(headings, 'PINCFG', pincfg_table)
145185

146186
print('''\

configs/tegra114.soc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ kernel_copyright_years = '2012-2013'
55
kernel_author = 'Pritesh Raithatha <[email protected]>'
66
uboot_copyright_years = '2010-2014'
77

8+
soc_has_io_clamping = True
9+
soc_combine_pin_drvgroup = False
10+
soc_rsvd_base = 1
11+
soc_drvgroups_have_drvtype = True
12+
soc_drvgroups_have_hsm = True
13+
soc_drvgroups_have_lpmd = True
14+
soc_drvgroups_have_schmitt = True
15+
soc_pins_all_have_od = False
16+
soc_pins_all_have_schmitt = False
17+
soc_pins_have_drvtype = False
18+
soc_pins_have_e_io_hv = False
19+
soc_pins_have_hsm = False
20+
soc_pins_have_ior = True
21+
soc_pins_have_od = True
22+
soc_pins_have_rcv_sel = True
23+
soc_pins_have_schmitt = False
24+
soc_drv_reg_base = 0x868
25+
soc_einput_b = 5
26+
soc_odrain_b = 6
27+
828
gpios = (
929
#name, gpio, reg, f0, f1, f2, f3, od, ior, rcv_sel
1030
('clk_32k_out', 'a0', 0x331c, 'blink', 'soc', 'rsvd3', 'rsvd4', False, False, False),

configs/tegra124.soc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ kernel_copyright_years = '2013-2014'
66
kernel_author = 'Ashwini Ghuge <[email protected]>'
77
uboot_copyright_years = '2013-2014'
88

9+
soc_has_io_clamping = True
10+
soc_combine_pin_drvgroup = False
11+
soc_rsvd_base = 1
12+
soc_drvgroups_have_drvtype = True
13+
soc_drvgroups_have_hsm = True
14+
soc_drvgroups_have_lpmd = True
15+
soc_drvgroups_have_schmitt = True
16+
soc_pins_all_have_od = False
17+
soc_pins_all_have_schmitt = False
18+
soc_pins_have_drvtype = False
19+
soc_pins_have_e_io_hv = False
20+
soc_pins_have_hsm = False
21+
soc_pins_have_ior = True
22+
soc_pins_have_od = True
23+
soc_pins_have_rcv_sel = True
24+
soc_pins_have_schmitt = False
25+
soc_drv_reg_base = 0x868
26+
soc_einput_b = 5
27+
soc_odrain_b = 6
28+
929
gpios = (
1030
#name, gpio, reg, f0, f1, f2, f3, od, ior, rcv_sel
1131
('clk_32k_out', 'a0', 0x331c, 'blink', 'soc', 'rsvd3', 'rsvd4', False, False, False),

0 commit comments

Comments
 (0)