[U-Boot] [PATCHv2 1/3] at91: Minor tweaks to SPL logic for space savings on smartweb

Tom Rini trini at konsulko.com
Tue May 8 00:50:12 UTC 2018


- spl_board_init is empty on smartweb so drop that function
- When CONFIG_AT91SAM9_WATCHDOG is set we do not disable the watchdog in
  SPL and instead let full U-Boot handle it.  Instead of an empty
  function just do not call a function.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
With gcc-7.2 smartweb is 16bytes too large.  These changes bring us just
back under.
---
 arch/arm/Kconfig               | 2 +-
 arch/arm/mach-at91/spl.c       | 4 +---
 arch/arm/mach-at91/spl_at91.c  | 2 ++
 arch/arm/mach-at91/spl_atmel.c | 2 ++
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 2bbb86c462dd..a5420112f39c 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -393,7 +393,7 @@ choice
 
 config ARCH_AT91
 	bool "Atmel AT91"
-	select SPL_BOARD_INIT if SPL
+	select SPL_BOARD_INIT if SPL && !TARGET_SMARTWEB
 
 config TARGET_EDB93XX
 	bool "Support edb93xx"
diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c
index 7cba3825e7f4..8bfb2a452b5e 100644
--- a/arch/arm/mach-at91/spl.c
+++ b/arch/arm/mach-at91/spl.c
@@ -11,9 +11,7 @@
 #include <asm/arch/clk.h>
 #include <spl.h>
 
-#if defined(CONFIG_AT91SAM9_WATCHDOG)
-void at91_disable_wdt(void) { }
-#else
+#if !defined(CONFIG_AT91SAM9_WATCHDOG)
 void at91_disable_wdt(void)
 {
 	struct at91_wdt *wdt = (struct at91_wdt *)ATMEL_BASE_WDT;
diff --git a/arch/arm/mach-at91/spl_at91.c b/arch/arm/mach-at91/spl_at91.c
index d701c3586d38..8c368042a6b2 100644
--- a/arch/arm/mach-at91/spl_at91.c
+++ b/arch/arm/mach-at91/spl_at91.c
@@ -76,7 +76,9 @@ void __weak spl_board_init(void)
 void board_init_f(ulong dummy)
 {
 	lowlevel_clock_init();
+#if !defined(CONFIG_AT91SAM9_WATCHDOG)
 	at91_disable_wdt();
+#endif
 
 	/*
 	 * At this stage the main oscillator is supposed to be enabled
diff --git a/arch/arm/mach-at91/spl_atmel.c b/arch/arm/mach-at91/spl_atmel.c
index 11db1e5f8cff..597ff8c03673 100644
--- a/arch/arm/mach-at91/spl_atmel.c
+++ b/arch/arm/mach-at91/spl_atmel.c
@@ -98,8 +98,10 @@ void board_init_f(ulong dummy)
 	configure_2nd_sram_as_l2_cache();
 #endif
 
+#if !defined(CONFIG_AT91SAM9_WATCHDOG)
 	/* disable watchdog */
 	at91_disable_wdt();
+#endif
 
 	/* PMC configuration */
 	at91_pmc_init();
-- 
2.7.4



More information about the U-Boot mailing list