Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[deliverable/linux.git] / arch / m68knommu / platform / 5307 / config.c
index 39da9e9ff674ef87a315a166f168fb979c250833..00900ac06a9c9e4cdb51780b5741447c940a5e6a 100644 (file)
 
 /***************************************************************************/
 
-extern unsigned int mcf_timervector;
-extern unsigned int mcf_profilevector;
-extern unsigned int mcf_timerlevel;
-
-/***************************************************************************/
-
 /*
  *     Some platforms need software versions of the GPIO data registers.
  */
@@ -64,11 +58,11 @@ static void __init m5307_uart_init_line(int line, int irq)
        if (line == 0) {
                writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
                writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR);
-               mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
+               mcf_mapirq2imr(irq, MCFINTC_UART0);
        } else if (line == 1) {
                writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
                writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR);
-               mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
+               mcf_mapirq2imr(irq, MCFINTC_UART1);
        }
 }
 
@@ -83,35 +77,19 @@ static void __init m5307_uarts_init(void)
 
 /***************************************************************************/
 
-void mcf_autovector(unsigned int vec)
-{
-       volatile unsigned char  *mbar;
-
-       if ((vec >= 25) && (vec <= 31)) {
-               mbar = (volatile unsigned char *) MCF_MBAR;
-               vec = 0x1 << (vec - 24);
-               *(mbar + MCFSIM_AVR) |= vec;
-               mcf_setimr(mcf_getimr() & ~vec);
-       }
-}
-
-/***************************************************************************/
-
-void mcf_settimericr(unsigned int timer, unsigned int level)
+static void __init m5307_timers_init(void)
 {
-       volatile unsigned char *icrp;
-       unsigned int icr, imr;
-
-       if (timer <= 2) {
-               switch (timer) {
-               case 2:  icr = MCFSIM_TIMER2ICR; imr = MCFSIM_IMR_TIMER2; break;
-               default: icr = MCFSIM_TIMER1ICR; imr = MCFSIM_IMR_TIMER1; break;
-               }
-
-               icrp = (volatile unsigned char *) (MCF_MBAR + icr);
-               *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
-               mcf_setimr(mcf_getimr() & ~imr);
-       }
+       /* Timer1 is always used as system timer */
+       writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI3,
+               MCF_MBAR + MCFSIM_TIMER1ICR);
+       mcf_mapirq2imr(MCF_IRQ_TIMER, MCFINTC_TIMER1);
+
+#ifdef CONFIG_HIGHPROFILE
+       /* Timer2 is to be used as a high speed profile timer  */
+       writeb(MCFSIM_ICR_AUTOVEC | MCFSIM_ICR_LEVEL7 | MCFSIM_ICR_PRI3,
+               MCF_MBAR + MCFSIM_TIMER2ICR);
+       mcf_mapirq2imr(MCF_IRQ_PROFILER, MCFINTC_TIMER2);
+#endif
 }
 
 /***************************************************************************/
@@ -129,20 +107,22 @@ void m5307_cpu_reset(void)
 
 void __init config_BSP(char *commandp, int size)
 {
-       mcf_setimr(MCFSIM_IMR_MASKALL);
-
 #if defined(CONFIG_NETtel) || \
     defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
        /* Copy command line from FLASH to local buffer... */
        memcpy(commandp, (char *) 0xf0004000, size);
        commandp[size-1] = 0;
-       /* Different timer setup - to prevent device clash */
-       mcf_timervector = 30;
-       mcf_profilevector = 31;
-       mcf_timerlevel = 6;
 #endif
 
        mach_reset = m5307_cpu_reset;
+       m5307_timers_init();
+       m5307_uarts_init();
+
+       /* Only support the external interrupts on their primary level */
+       mcf_mapirq2imr(25, MCFINTC_EINT1);
+       mcf_mapirq2imr(27, MCFINTC_EINT3);
+       mcf_mapirq2imr(29, MCFINTC_EINT5);
+       mcf_mapirq2imr(31, MCFINTC_EINT7);
 
 #ifdef CONFIG_BDM_DISABLE
        /*
@@ -158,7 +138,6 @@ void __init config_BSP(char *commandp, int size)
 
 static int __init init_BSP(void)
 {
-       m5307_uarts_init();
        platform_add_devices(m5307_devices, ARRAY_SIZE(m5307_devices));
        return 0;
 }
This page took 0.027026 seconds and 5 git commands to generate.