]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
am33xx: Do not call init_timer twice
authorTom Rini <trini@ti.com>
Mon, 14 May 2012 12:38:18 +0000 (12:38 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Sat, 7 Jul 2012 12:07:21 +0000 (14:07 +0200)
We do not need to call init_timer both in SPL and U-Boot itself, just
SPL needs to initialize the timer.

Signed-off-by: Tom Rini <trini@ti.com>
arch/arm/cpu/armv7/am33xx/board.c
arch/arm/include/asm/arch-am33xx/cpu.h
board/ti/am335x/evm.c

index 6b7a494d7ccd44068a3cdb04e4bdebc8abf7129e..71309a7f479a587324165f794943d146b03ee264 100644 (file)
@@ -40,6 +40,22 @@ struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;
 #define UART_SMART_IDLE_EN     (0x1 << 0x3)
 #endif
 
+#ifdef CONFIG_SPL_BUILD
+/* Initialize timer */
+static void init_timer(void)
+{
+       /* Reset the Timer */
+       writel(0x2, (&timer_base->tscir));
+
+       /* Wait until the reset is done */
+       while (readl(&timer_base->tiocp_cfg) & 1)
+               ;
+
+       /* Start the Timer */
+       writel(0x1, (&timer_base->tclr));
+}
+#endif
+
 /*
  * early system init of muxing and clocks.
  */
@@ -88,20 +104,6 @@ void s_init(void)
        enable_mmc0_pin_mux();
 }
 
-/* Initialize timer */
-void init_timer(void)
-{
-       /* Reset the Timer */
-       writel(0x2, (&timer_base->tscir));
-
-       /* Wait until the reset is done */
-       while (readl(&timer_base->tiocp_cfg) & 1)
-               ;
-
-       /* Start the Timer */
-       writel(0x1, (&timer_base->tclr));
-}
-
 #if defined(CONFIG_OMAP_HSMMC) && !defined(CONFIG_SPL_BUILD)
 int board_mmc_init(bd_t *bis)
 {
index cd002e632d22383ee9b96f2d6e9ac26fa41f1a6e..8760cc042bee70d48807a6a835a5d7914541d581 100644 (file)
@@ -213,8 +213,6 @@ struct ctrl_stat {
        unsigned int resv1[16];
        unsigned int statusreg;         /* ofset 0x40 */
 };
-
-void init_timer(void);
 #endif /* __ASSEMBLY__ */
 #endif /* __KERNEL_STRICT_NAMES */
 
index 13dc60361a272281439be39c85795f7e54a77a3e..5e2d53ab42c5e355a967b4c666ac373fae6f89c2 100644 (file)
@@ -29,17 +29,6 @@ DECLARE_GLOBAL_DATA_PTR;
 /*
  * Basic board specific setup
  */
-int init_basic_setup(void)
-{
-       /* Initialize the Timer */
-       init_timer();
-
-       /* address of boot parameters */
-       gd->bd->bi_boot_params = PHYS_DRAM_1 + 0x100;
-
-       return 0;
-}
-
 int board_init(void)
 {
        enable_uart0_pin_mux();
@@ -49,7 +38,7 @@ int board_init(void)
        i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
 
-       init_basic_setup();
+       gd->bd->bi_boot_params = PHYS_DRAM_1 + 0x100;
 
        return 0;
 }