summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2016-04-06 15:00:45 -0600
committerStephen Warren <swarren@nvidia.com>2016-04-21 15:54:22 -0600
commitfe808b10578de39c397c9a4ba37a0572b6f288ee (patch)
tree3b7ef7a4ae8ddb4bbbb1c60e7e415d74ce1aa380
parentac1d5375c3c72c3647eff07e776a31b493a8abff (diff)
downloadtegra-pinmux-scripts-fe808b10578de39c397c9a4ba37a0572b6f288ee.tar.gz
Adapt to latest U-Boot driver code changes
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@nvidia.com>
-rwxr-xr-xboard-to-uboot.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/board-to-uboot.py b/board-to-uboot.py
index d5e2708..7c57958 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('''\