Patchwork [U-Boot,v3,4/7] tegra: Allow boards to perform early GPIO setup

login
register
mail settings
Submitter Thierry Reding
Date June 5, 2012, 6:02 a.m.
Message ID <1338876150-8170-4-git-send-email-thierry.reding@avionic-design.de>
Download mbox | patch
Permalink /patch/163018/
State Accepted
Delegated to: Tom Warren
Headers show

Comments

Thierry Reding - June 5, 2012, 6:02 a.m.
The new gpio_early_init() function, which does nothing by default, can
be overridden by boards to configure GPIOs at an early stage.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
---
Changes in v3:
- none

Changes in v2:
- new patch required for TEC support

 board/nvidia/common/board.c |    7 +++++++
 board/nvidia/common/board.h |    1 +
 2 files changed, 8 insertions(+)

Patch

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 2e22133..a159deb 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -132,11 +132,18 @@  int board_init(void)
 }
 
 #ifdef CONFIG_BOARD_EARLY_INIT_F
+static void __gpio_early_init(void)
+{
+}
+
+void gpio_early_init(void) __attribute__((weak, alias("__gpio_early_init")));
+
 int board_early_init_f(void)
 {
 	board_init_uart_f();
 
 	/* Initialize periph GPIOs */
+	gpio_early_init();
 #ifdef CONFIG_SPI_UART_SWITCH
 	gpio_early_init_uart();
 #else
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 09fb158..dada4c4 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -25,6 +25,7 @@ 
 #define _BOARD_H_
 
 void gpio_config_uart(void);
+void gpio_early_init(void);
 void gpio_early_init_uart(void);
 
 /*