linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pinmux scripts PATCH] Adapt to latest U-Boot driver code changes
@ 2016-04-21 21:58 Stephen Warren
       [not found] ` <1461275928-3866-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2016-04-21 21:58 UTC (permalink / raw)
  To: swarren-3lzwWm7+Weoh9ZMKESR00Q
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren

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

This makes the script generate code that matches U-Boot as of its commit
"ARM: tegra: use DT bindings for GPIO naming".

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 board-to-uboot.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/board-to-uboot.py b/board-to-uboot.py
index d5e2708c6695..7c57958c3956 100755
--- a/board-to-uboot.py
+++ b/board-to-uboot.py
@@ -59,9 +59,9 @@ print('''\
 #ifndef _PINMUX_CONFIG_%(board_define)s_H_
 #define _PINMUX_CONFIG_%(board_define)s_H_
 
-#define GPIO_INIT(_gpio, _init)				\\
+#define GPIO_INIT(_port, _gpio, _init)			\\
 	{						\\
-		.gpio	= GPIO_P##_gpio,		\\
+		.gpio	= TEGRA_GPIO(_port, _gpio),	\\
 		.init	= TEGRA_GPIO_INIT_##_init,	\\
 	}
 
@@ -77,12 +77,18 @@ gpio_table = []
 for pincfg in board.pincfgs_by_num():
     if not pincfg.gpio_init:
         continue
+    gpio = pincfg.gpio_pin.gpio.upper()
+    port = gpio[:-1]
+    assert port.isalpha()
+    pin = gpio[-1]
+    assert pin.isdigit()
     row = (
-        pincfg.gpio_pin.gpio.upper(),
+        port,
+        pin,
         pincfg.gpio_init.upper(),
     )
     gpio_table.append(row)
-headings = ('gpio', 'init_val')
+headings = ('port', 'pin', 'init_val')
 dump_c_table(headings, 'GPIO_INIT', gpio_table)
 
 print('''\
-- 
2.8.1

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

* Re: [pinmux scripts PATCH] Adapt to latest U-Boot driver code changes
       [not found] ` <1461275928-3866-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2016-04-22 19:54   ` Stephen Warren
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Warren @ 2016-04-22 19:54 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA; +Cc: Stephen Warren

On 04/21/2016 03:58 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>
> This makes the script generate code that matches U-Boot as of its commit
> "ARM: tegra: use DT bindings for GPIO naming".

Applied.

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

end of thread, other threads:[~2016-04-22 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-21 21:58 [pinmux scripts PATCH] Adapt to latest U-Boot driver code changes Stephen Warren
     [not found] ` <1461275928-3866-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2016-04-22 19:54   ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).