summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2011-10-06 12:52:22 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-12-09 17:30:08 +0100
commit5fac236a9703827666df452f093d2849625afd4d (patch)
treeb1728dc8a0291ac1411234a40260a032908e769a /board
parentd5ef19b9b349dc87611357be22e563a99528a422 (diff)
downloadu-boot-imx-5fac236a9703827666df452f093d2849625afd4d.zip
u-boot-imx-5fac236a9703827666df452f093d2849625afd4d.tar.gz
u-boot-imx-5fac236a9703827666df452f093d2849625afd4d.tar.bz2
tegra2: Use new GPIO APIs in gpio_config_uart()
... rather than open-coding the register accesses. However, gpio_request() typically stores the "label" parameter in a global data structure. This causes problems when called from gpio_config_uart(), since the code is running before relocation. To solve this, pass a NULL string to gpio_request(), and modify gpio_request() not to touch the string if it's NULL. Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
Diffstat (limited to 'board')
-rw-r--r--board/nvidia/seaboard/seaboard.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index aa77f12..7f2827b 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -37,23 +37,9 @@
*/
static void gpio_config_uart_seaboard(void)
{
- int gp = GPIO_PI3;
- struct gpio_ctlr *gpio = (struct gpio_ctlr *)NV_PA_GPIO_BASE;
- struct gpio_ctlr_bank *bank = &gpio->gpio_bank[GPIO_BANK(gp)];
- u32 val;
-
/* Enable UART via GPIO_PI3 (port 8, bit 3) so serial console works */
- val = readl(&bank->gpio_config[GPIO_PORT(gp)]);
- val |= 1 << GPIO_BIT(gp);
- writel(val, &bank->gpio_config[GPIO_PORT(gp)]);
-
- val = readl(&bank->gpio_out[GPIO_PORT(gp)]);
- val &= ~(1 << GPIO_BIT(gp));
- writel(val, &bank->gpio_out[GPIO_PORT(gp)]);
-
- val = readl(&bank->gpio_dir_out[GPIO_PORT(gp)]);
- val |= 1 << GPIO_BIT(gp);
- writel(val, &bank->gpio_dir_out[GPIO_PORT(gp)]);
+ gpio_request(GPIO_PI3, NULL);
+ gpio_direction_output(GPIO_PI3, 0);
}
void gpio_config_uart(void)