summaryrefslogtreecommitdiff
path: root/csv-to-board.py
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2015-03-24 16:36:18 -0600
committerStephen Warren <swarren@nvidia.com>2015-03-25 12:02:51 -0600
commit39af52fc08dfa0a065add47cdc15d50e1f1ed5cc (patch)
treeee30a0f9a99100e5bb3cbe1510760e048bdb3252 /csv-to-board.py
parent4f47990bce794c231cfa9fb123953e496f646855 (diff)
downloadtegra-pinmux-scripts-39af52fc08dfa0a065add47cdc15d50e1f1ed5cc.tar.gz
Support for MIPI pad ctrl groups in *.board
Update csv-to-board.py to extract, and board-to-*.py to emit, configuration for MIPI pad ctrl groups. Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'csv-to-board.py')
-rwxr-xr-xcsv-to-board.py30
1 files changed, 23 insertions, 7 deletions
diff --git a/csv-to-board.py b/csv-to-board.py
index b2d1c46..6865358 100755
--- a/csv-to-board.py
+++ b/csv-to-board.py
@@ -173,6 +173,7 @@ def rcv_sel_munge(d):
found_header = False
pin_table = []
+mipi_table = []
with open(board_conf['filename'], newline='') as fh:
csv = csv.reader(fh)
lnum = 0
@@ -203,6 +204,12 @@ with open(board_conf['filename'], newline='') as fh:
continue
ball_name = row[cols[COL_BALL_NAME]].lower()
+ if ball_name.startswith('mipi_pad_ctrl_'):
+ ball_name = ball_name[14:]
+ mipi = soc.mipi_pad_ctrl_group_by_name(ball_name)
+ else:
+ mipi = None
+
if cols[COL_BALL_MID]:
ball_mid = row[cols[COL_BALL_MID]]
else:
@@ -212,12 +219,17 @@ with open(board_conf['filename'], newline='') as fh:
else:
ball_dsc = None
+
# Section title row
- if not ball_mid and not ball_dsc:
+ if not ball_mid and not ball_dsc and not mipi:
continue
mux = func_munge(row[cols[COL_MUX]].lower())
+ if mipi:
+ mipi_table.append((repr(mipi.name), repr(mux)))
+ continue
+
# Pin not affected by pinmux
if mux in ('', '0', '#n/a'):
continue
@@ -286,21 +298,25 @@ with open(board_conf['filename'], newline='') as fh:
pin_table.append((repr(gpio_pin.fullname), repr(mux), repr(gpio_init), repr(pupd), repr(tri), repr(e_input), repr(od), repr(rcv_sel)))
-headings = ('pin', 'mux', 'gpio_init', 'pull', 'tri', 'e_inp', 'od')
+pin_headings = ('pin', 'mux', 'gpio_init', 'pull', 'tri', 'e_inp', 'od')
if soc.soc_pins_have_e_io_hv:
- headings += ('e_io_hv',)
+ pin_headings += ('e_io_hv',)
if soc.soc_pins_have_rcv_sel:
- headings += ('rcv_sel',)
+ pin_headings += ('rcv_sel',)
+
+mipi_headings = ('pin', 'mux')
cfgfile = os.path.join('configs', args.board + '.board')
with open(cfgfile, 'wt') as fh:
print('soc = \'%s\'' % board_conf['soc'], file=fh)
print(file=fh)
print('pins = (', file=fh)
-
- dump_py_table(headings, pin_table, file=fh)
-
+ dump_py_table(pin_headings, pin_table, file=fh)
print(')', file=fh)
print('', file=fh)
print('drive_groups = (', file=fh)
print(')', file=fh)
+ print('', file=fh)
+ print('mipi_pad_ctrl_groups = (', file=fh)
+ dump_py_table(mipi_headings, mipi_table, file=fh)
+ print(')', file=fh)