summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2015-03-17 13:27:30 -0600
committerStephen Warren <swarren@nvidia.com>2015-03-25 12:02:51 -0600
commitd5a43a4bc02221bbeb25629e9acf490e61eab552 (patch)
tree85b7b177a088c9794895ec4a28e10b15e36ff638
parentf69acc27558b8104cf17baa0799cb4447d6d6df8 (diff)
downloadtegra-pinmux-scripts-d5a43a4bc02221bbeb25629e9acf490e61eab552.tar.gz
csv-to-board: handle missing package columns
Some board spreadsheets may have irrelevant package columns removed, leaving only the package column that the specific board uses. Update csv-to-board to handle missing package columns. Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rwxr-xr-xcsv-to-board.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/csv-to-board.py b/csv-to-board.py
index 2860c02..b2d1c46 100755
--- a/csv-to-board.py
+++ b/csv-to-board.py
@@ -190,18 +190,27 @@ with open(board_conf['filename'], newline='') as fh:
try:
cols[colid] = row.index(coltext)
except:
- if board_conf['soc'] != 'tegra124':
- raise
- if colid != COL_RCV_SEL:
- print('ERROR: Header column "%s" not found' % coltext, file=sys.stderr)
- sys.exit(1)
+ if colid in (COL_BALL_MID, COL_BALL_DSC):
+ pass
+ else:
+ if board_conf['soc'] != 'tegra124':
+ raise
+ if colid != COL_RCV_SEL:
+ print('ERROR: Header column "%s" not found' % coltext, file=sys.stderr)
+ sys.exit(1)
cols[colid] = None
found_header = True
continue
ball_name = row[cols[COL_BALL_NAME]].lower()
- ball_mid = row[cols[COL_BALL_MID]]
- ball_dsc = row[cols[COL_BALL_DSC]]
+ if cols[COL_BALL_MID]:
+ ball_mid = row[cols[COL_BALL_MID]]
+ else:
+ ball_mid = None
+ if cols[COL_BALL_DSC]:
+ ball_dsc = row[cols[COL_BALL_DSC]]
+ else:
+ ball_dsc = None
# Section title row
if not ball_mid and not ball_dsc: