]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
microblaze: Move timer initialization to board.c
authorMichal Simek <monstr@monstr.eu>
Fri, 16 Apr 2010 09:37:41 +0000 (11:37 +0200)
committerMichal Simek <monstr@monstr.eu>
Fri, 16 Apr 2010 10:15:31 +0000 (12:15 +0200)
I would like to handle case where system doesn't contain
intc that's why I need timer initialization out of intc code.

Signed-off-by: Michal Simek <monstr@monstr.eu>
arch/microblaze/cpu/interrupts.c
arch/microblaze/cpu/timer.c
arch/microblaze/lib/board.c

index a6021c99c3b2ab6a563fdfb1acc14b2ce6ed3d30..b8db68afd01e40a3bf23c66942e1ee18fff4d821 100644 (file)
@@ -46,9 +46,6 @@ int disable_interrupts (void)
 }
 
 #ifdef CONFIG_SYS_INTC_0
-#ifdef CONFIG_SYS_TIMER_0
-extern void timer_init (void);
-#endif
 #ifdef CONFIG_SYS_FSL_2
 extern void fsl_init2 (void);
 #endif
@@ -142,9 +139,6 @@ int interrupts_init (void)
        }
        /* initialize intc controller */
        intc_init ();
-#ifdef CONFIG_SYS_TIMER_0
-       timer_init ();
-#endif
 #ifdef CONFIG_SYS_FSL_2
        fsl_init2 ();
 #endif
index a91eabc64280a84f5219f14b11fae9f6b0bcdf53..4936c628abe06a8e00759020b797a80cf8100dd6 100644 (file)
@@ -60,7 +60,7 @@ void timer_isr (void *arg)
        tmr->control = tmr->control | TIMER_INTERRUPT;
 }
 
-void timer_init (void)
+int timer_init (void)
 {
        tmr->loadreg = CONFIG_SYS_TIMER_0_PRELOAD;
        tmr->control = TIMER_INTERRUPT | TIMER_RESET;
@@ -68,6 +68,7 @@ void timer_init (void)
            TIMER_ENABLE | TIMER_ENABLE_INTR | TIMER_RELOAD | TIMER_DOWN_COUNT;
        reset_timer ();
        install_interrupt_handler (CONFIG_SYS_TIMER_0_IRQ, timer_isr, (void *)tmr);
+       return 0;
 }
 #endif
 #endif
index d4baea930af8a058538369a529696b62320096e4..7dfa71c0fb8598b397dfe8a7d5799ec568db9154 100644 (file)
@@ -44,6 +44,10 @@ extern int interrupts_init (void);
 #if defined(CONFIG_CMD_NET)
 extern int eth_init (bd_t * bis);
 #endif
+#ifdef CONFIG_SYS_TIMER_0
+extern int timer_init (void);
+#endif
+
 
 /*
  * All attempts to come up with a "common" initialization sequence
@@ -67,6 +71,9 @@ init_fnc_t *init_sequence[] = {
 #endif
 #ifdef CONFIG_SYS_INTC_0
        interrupts_init,
+#endif
+#ifdef CONFIG_SYS_TIMER_0
+       timer_init,
 #endif
        NULL,
 };