[U-Boot] [RFC 3/3] ARM: do not assign gd outside of crt0.S

Jeroen Hofstee jeroen at myspectrum.nl
Sat Aug 24 18:32:43 CEST 2013


---
 arch/arm/cpu/arm926ejs/davinci/spl.c           | 3 +--
 arch/arm/cpu/armv7/exynos/spl_boot.c           | 6 ++----
 arch/arm/cpu/armv7/omap-common/hwinit-common.c | 2 --
 arch/arm/cpu/armv7/omap3/board.c               | 2 --
 board/isee/igep0033/board.c                    | 1 -
 board/phytec/pcm051/board.c                    | 2 --
 board/ti/am335x/board.c                        | 2 --
 board/ti/ti814x/evm.c                          | 2 --
 board/woodburn/woodburn.c                      | 3 ---
 9 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
index 59b304e..0af3646 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -50,8 +50,7 @@ void board_init_f(ulong dummy)
 	/* Third, we clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
-	/* Finally, setup gd and move to the next step. */
-	gd = &gdata;
+	/* Finally move to the next step. */
 	board_init_r(NULL, 0);
 }
 
diff --git a/arch/arm/cpu/armv7/exynos/spl_boot.c b/arch/arm/cpu/armv7/exynos/spl_boot.c
index 3651c00..c0287aa 100644
--- a/arch/arm/cpu/armv7/exynos/spl_boot.c
+++ b/arch/arm/cpu/armv7/exynos/spl_boot.c
@@ -149,9 +149,8 @@ void memzero(void *s, size_t n)
  *
  * @param gdp   Value to give to gd
  */
-static void setup_global_data(gd_t *gdp)
+static void setup_global_data(void)
 {
-	gd = gdp;
 	memzero((void *)gd, sizeof(gd_t));
 	gd->flags |= GD_FLG_RELOC;
 	gd->baudrate = CONFIG_BAUDRATE;
@@ -160,10 +159,9 @@ static void setup_global_data(gd_t *gdp)
 
 void board_init_f(unsigned long bootflag)
 {
-	__aligned(8) gd_t local_gd;
 	__attribute__((noreturn)) void (*uboot)(void);
 
-	setup_global_data(&local_gd);
+	setup_global_data();
 
 	if (do_lowlevel_init())
 		power_exit_wakeup();
diff --git a/arch/arm/cpu/armv7/omap-common/hwinit-common.c b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
index 85d3754..69cbfd6 100644
--- a/arch/arm/cpu/armv7/omap-common/hwinit-common.c
+++ b/arch/arm/cpu/armv7/omap-common/hwinit-common.c
@@ -143,8 +143,6 @@ void s_init(void)
 	srcomp_enable();
 	setup_clocks_for_console();
 
-	gd = &gdata;
-
 	preloader_console_init();
 	do_io_settings();
 #endif
diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 7d1f8d9..3c0042d 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -240,8 +240,6 @@ void s_init(void)
 #endif
 
 #ifdef CONFIG_SPL_BUILD
-	gd = &gdata;
-
 	preloader_console_init();
 
 	timer_init();
diff --git a/board/isee/igep0033/board.c b/board/isee/igep0033/board.c
index c0f0c0d..8cb9e4c 100644
--- a/board/isee/igep0033/board.c
+++ b/board/isee/igep0033/board.c
@@ -102,7 +102,6 @@ void s_init(void)
 	enable_uart0_pin_mux();
 
 	uart_soft_reset();
-	gd = &gdata;
 
 	preloader_console_init();
 
diff --git a/board/phytec/pcm051/board.c b/board/phytec/pcm051/board.c
index 6291d03..3bf45ac 100644
--- a/board/phytec/pcm051/board.c
+++ b/board/phytec/pcm051/board.c
@@ -113,8 +113,6 @@ void s_init(void)
 	enable_uart0_pin_mux();
 	uart_soft_reset();
 
-	gd = &gdata;
-
 	preloader_console_init();
 
 	/* Initalize the board header */
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 7138d73..f11eb93 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -328,8 +328,6 @@ void s_init(void)
 
 	uart_soft_reset();
 
-	gd = &gdata;
-
 	preloader_console_init();
 
 	/* Initalize the board header */
diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c
index 17fba5a..7800a4d 100644
--- a/board/ti/ti814x/evm.c
+++ b/board/ti/ti814x/evm.c
@@ -143,8 +143,6 @@ void s_init(void)
 	/* Enable UART */
 	uart_enable();
 
-	gd = &gdata;
-
 	preloader_console_init();
 
 	config_dmm(&evm_lisa_map_regs);
diff --git a/board/woodburn/woodburn.c b/board/woodburn/woodburn.c
index 2744514..3da61a4 100644
--- a/board/woodburn/woodburn.c
+++ b/board/woodburn/woodburn.c
@@ -137,9 +137,6 @@ void board_init_f(ulong dummy)
 	/* Clear the BSS. */
 	memset(__bss_start, 0, __bss_end - __bss_start);
 
-	/* Set global data pointer. */
-	gd = &gdata;
-
 	preloader_console_init();
 	timer_init();
 
-- 
1.8.1.2



More information about the U-Boot mailing list