All of lore.kernel.org
 help / color / mirror / Atom feed
* [pinmux PATCH] Warn about unconfigured pins
@ 2014-08-21 23:26 Stephen Warren
       [not found] ` <1408663564-3281-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2014-08-21 23:26 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA; +Cc: Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

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-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 board-to-kernel-dt.py     | 2 ++
 board-to-uboot.py         | 2 ++
 tegra_pmx_board_parser.py | 8 ++++++++
 3 files changed, 12 insertions(+)

diff --git a/board-to-kernel-dt.py b/board-to-kernel-dt.py
index 966fee29eea9..86739db90bee 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 e4df06e2606a..c67919176a3f 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 352bbe0a2499..7b45abe74a00 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 = {}
-- 
2.1.0.rc2.3.g67de23d

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [pinmux PATCH] Warn about unconfigured pins
       [not found] ` <1408663564-3281-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2014-08-22 17:53   ` Stephen Warren
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Warren @ 2014-08-22 17:53 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA; +Cc: Stephen Warren

On 08/21/2014 05:26 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> When generating a kernel or U-Boot pinmux configuration, complain about
> pins that have no configuration. That's probably a bug in the spreadsheet.

I've applied this.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-22 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-21 23:26 [pinmux PATCH] Warn about unconfigured pins Stephen Warren
     [not found] ` <1408663564-3281-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-08-22 17:53   ` Stephen Warren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.