m68knommu: remove kludge seting of MCF_IPSBAR for ColdFire 54xx
authorGreg Ungerer <gerg@uclinux.org>
Sat, 5 Mar 2011 12:17:17 +0000 (22:17 +1000)
committerGreg Ungerer <gerg@uclinux.org>
Tue, 15 Mar 2011 11:01:53 +0000 (21:01 +1000)
The ColdFire 54xx family shares the same interrupt controller used
on the 523x, 527x and 528x ColdFire parts, but it isn't offset
relative to the IPSBAR register. The 54xx doesn't have an IPSBAR
register.

By including the base address of the peripheral registers in the register
definitions (MCFICM_INTC0 and MCFICM_INTC1 in this case) we can avoid
having to define a fake IPSBAR for the 54xx. And this makes the register
address definitions of these more consistent, the majority of the other
register address defines include the peripheral base address already.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
arch/m68k/include/asm/coldfire.h
arch/m68k/include/asm/m523xsim.h
arch/m68k/include/asm/m527xsim.h
arch/m68k/include/asm/m528xsim.h
arch/m68k/include/asm/m54xxsim.h
arch/m68knommu/platform/coldfire/intc-2.c

index d70cf0f1c40a602c0ce69ac85faae468fabe3ba2..91676454731b8c6a696d03a0a6ab74a2e21b9af8 100644 (file)
@@ -31,9 +31,7 @@
  *     This is generally setup by the boards start up code.
  */
 #define        MCF_MBAR        0x10000000
-#if defined(CONFIG_M54xx)
-#define        MCF_IPSBAR      MCF_MBAR
-#elif defined(CONFIG_M520x)
+#if defined(CONFIG_M520x)
 #define        MCF_IPSBAR      0xFC000000
 #else
 #define        MCF_IPSBAR      0x40000000
index 4ad7a00257a820a1bff3df7946873e62cc56fed7..9701ed34d2340f6c57fbe0787f950353357bb0ba 100644 (file)
@@ -19,8 +19,9 @@
 /*
  *     Define the 523x SIM register set addresses.
  */
-#define        MCFICM_INTC0            0x0c00          /* Base for Interrupt Ctrl 0 */
-#define        MCFICM_INTC1            0x0d00          /* Base for Interrupt Ctrl 0 */
+#define        MCFICM_INTC0            (MCF_IPSBAR + 0x0c00)   /* Base for Interrupt Ctrl 0 */
+#define        MCFICM_INTC1            (MCF_IPSBAR + 0x0d00)   /* Base for Interrupt Ctrl 0 */
+
 #define        MCFINTC_IPRH            0x00            /* Interrupt pending 32-63 */
 #define        MCFINTC_IPRL            0x04            /* Interrupt pending 1-31 */
 #define        MCFINTC_IMRH            0x08            /* Interrupt mask 32-63 */
index e8042e8bc003fc726f0d6bc106e233e6da309dbe..3712f611bd5ee1a9ccf3df9ae7967d84a40da7e7 100644 (file)
@@ -19,8 +19,9 @@
 /*
  *     Define the 5270/5271 SIM register set addresses.
  */
-#define        MCFICM_INTC0            0x0c00          /* Base for Interrupt Ctrl 0 */
-#define        MCFICM_INTC1            0x0d00          /* Base for Interrupt Ctrl 1 */
+#define        MCFICM_INTC0            (MCF_IPSBAR + 0x0c00)   /* Base for Interrupt Ctrl 0 */
+#define        MCFICM_INTC1            (MCF_IPSBAR + 0x0d00)   /* Base for Interrupt Ctrl 1 */
+
 #define        MCFINTC_IPRH            0x00            /* Interrupt pending 32-63 */
 #define        MCFINTC_IPRL            0x04            /* Interrupt pending 1-31 */
 #define        MCFINTC_IMRH            0x08            /* Interrupt mask 32-63 */
index a6d2f4d9aaa059acb55b889f3d1967ad6ed18ef9..a918545f6a5aecd21934f0a371cc3e624649e06f 100644 (file)
@@ -19,8 +19,9 @@
 /*
  *     Define the 5280/5282 SIM register set addresses.
  */
-#define        MCFICM_INTC0            0x0c00          /* Base for Interrupt Ctrl 0 */
-#define        MCFICM_INTC1            0x0d00          /* Base for Interrupt Ctrl 0 */
+#define        MCFICM_INTC0            (MCF_IPSBAR + 0x0c00)   /* Base for Interrupt Ctrl 0 */
+#define        MCFICM_INTC1            (MCF_IPSBAR + 0x0d00)   /* Base for Interrupt Ctrl 0 */
+
 #define        MCFINTC_IPRH            0x00            /* Interrupt pending 32-63 */
 #define        MCFINTC_IPRL            0x04            /* Interrupt pending 1-31 */
 #define        MCFINTC_IMRH            0x08            /* Interrupt mask 32-63 */
index 462ae5328441ab163df7497bd4061c9573608735..cc5d94d215b4f698c24f60c69f6131773c7279cc 100644 (file)
@@ -15,7 +15,8 @@
 /*
  *      Interrupt Controller Registers
  */
-#define MCFICM_INTC0           0x0700          /* Base for Interrupt Ctrl 0 */
+#define MCFICM_INTC0           (MCF_MBAR + 0x700)      /* Base for Interrupt Ctrl 0 */
+
 #define MCFINTC_IPRH           0x00            /* Interrupt pending 32-63 */
 #define MCFINTC_IPRL           0x04            /* Interrupt pending 1-31 */
 #define MCFINTC_IMRH           0x08            /* Interrupt mask 32-63 */
index 71e07fb69302f7448f2f750e833181e4b277dcb6..ec869c8e88907adeb7ee7a9c5aeb5bde925e41b4 100644 (file)
@@ -52,11 +52,10 @@ static void intc_irq_mask(struct irq_data *d)
                u32 val, imrbit;
 
                irq -= MCFINT_VECBASE;
-               imraddr = MCF_IPSBAR;
 #ifdef MCFICM_INTC1
-               imraddr += (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0;
+               imraddr = (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0;
 #else
-               imraddr += MCFICM_INTC0;
+               imraddr = MCFICM_INTC0;
 #endif
                imraddr += (irq & 0x20) ? MCFINTC_IMRH : MCFINTC_IMRL;
                imrbit = 0x1 << (irq & 0x1f);
@@ -75,11 +74,10 @@ static void intc_irq_unmask(struct irq_data *d)
                u32 val, imrbit;
 
                irq -= MCFINT_VECBASE;
-               intaddr = MCF_IPSBAR;
 #ifdef MCFICM_INTC1
-               intaddr += (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0;
+               intaddr = (irq & 0x40) ? MCFICM_INTC1 : MCFICM_INTC0;
 #else
-               intaddr += MCFICM_INTC0;
+               intaddr = MCFICM_INTC0;
 #endif
                imraddr = intaddr + ((irq & 0x20) ? MCFINTC_IMRH : MCFINTC_IMRL);
                icraddr = intaddr + MCFINTC_ICR0 + (irq & 0x3f);
@@ -116,9 +114,9 @@ void __init init_IRQ(void)
        init_vectors();
 
        /* Mask all interrupt sources */
-       __raw_writel(0x1, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL);
+       __raw_writel(0x1, MCFICM_INTC0 + MCFINTC_IMRL);
 #ifdef MCFICM_INTC1
-       __raw_writel(0x1, MCF_IPSBAR + MCFICM_INTC1 + MCFINTC_IMRL);
+       __raw_writel(0x1, MCFICM_INTC1 + MCFINTC_IMRL);
 #endif
 
        for (irq = 0; (irq < NR_IRQS); irq++) {
This page took 0.02886 seconds and 5 git commands to generate.