diff options
author | Stephen Warren <swarren@nvidia.com> | 2014-08-21 17:23:47 -0600 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2014-08-21 17:24:43 -0600 |
commit | 7177283483479405a5f9b4406ce4dde5e813fd8d (patch) | |
tree | 0eebf81515cf69e888a859e9cbfbe96f225a7b08 | |
parent | 8b77013470e2eab19151e06b82505eb309ef394f (diff) | |
download | tegra-pinmux-scripts-7177283483479405a5f9b4406ce4dde5e813fd8d.tar.gz |
Warn about unconfigured pins
When generating a kernel or U-Boot pinmux configuration, complain about
pins that have no configuration. That's probably a bug in the spreadsheet.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
-rwxr-xr-x | board-to-kernel-dt.py | 2 | ||||
-rwxr-xr-x | board-to-uboot.py | 2 | ||||
-rw-r--r-- | tegra_pmx_board_parser.py | 8 |
3 files changed, 12 insertions, 0 deletions
diff --git a/board-to-kernel-dt.py b/board-to-kernel-dt.py index 966fee2..86739db 100755 --- a/board-to-kernel-dt.py +++ b/board-to-kernel-dt.py @@ -63,3 +63,5 @@ for pincfg in board.pincfgs_by_num(): # FIXME: Handle drive groups print(' };') + +board.warn_about_unconfigured_pins() diff --git a/board-to-uboot.py b/board-to-uboot.py index e4df06e..c679191 100755 --- a/board-to-uboot.py +++ b/board-to-uboot.py @@ -168,3 +168,5 @@ print('''\ #endif /* PINMUX_CONFIG_%s_H */ ''' % board.definename, end='') + +board.warn_about_unconfigured_pins() diff --git a/tegra_pmx_board_parser.py b/tegra_pmx_board_parser.py index 352bbe0..7b45abe 100644 --- a/tegra_pmx_board_parser.py +++ b/tegra_pmx_board_parser.py @@ -19,6 +19,7 @@ # DEALINGS IN THE SOFTWARE. import os.path +import sys import tegra_pmx_soc_parser from tegra_pmx_parser_utils import * @@ -62,6 +63,13 @@ class Board(TopLevelParsedObj): def pincfgs_by_num(self): return self._pincfgs_by_num + def warn_about_unconfigured_pins(self): + unconfigured_gpio_pins = {gpio_pin.fullname for gpio_pin in self.soc.gpios_pins_by_num()} + for gpio_pin in self.pincfgs_by_num(): + unconfigured_gpio_pins.remove(gpio_pin.gpio_pin.fullname) + for gpio_pin in unconfigured_gpio_pins: + print('WARNING: Unconfigured pin ' + gpio_pin, file=sys.stderr) + def load_board(boardname): fn = os.path.join(configs_dir, boardname + '.board') d = {} |