m68knommu: make 528x QSPI platform addressing consistent
authorGreg Ungerer <gerg@uclinux.org>
Sat, 24 Dec 2011 02:42:30 +0000 (12:42 +1000)
committerGreg Ungerer <gerg@uclinux.org>
Sun, 4 Mar 2012 23:43:09 +0000 (09:43 +1000)
If we make all QSPI (SPI protocol) addressing consistent across all ColdFire
family members then we will be able to remove the duplicated plaform data
and code and use a single setup for all.

So modify the ColdFire 528x QSPI addressing so that:

. base addresses are absolute (not relative to MBAR peripheral register)
. use a common name for IRQs used
. move chip select definitions (CS) to appropriate header

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
arch/m68k/include/asm/m528xsim.h
arch/m68k/include/asm/mcfqspi.h
arch/m68k/platform/528x/config.c

index a363c648b97bcf60b048b0d97d8f831deda056e8..e4581a4a10359f365e97ed8721018d1449008982 100644 (file)
@@ -51,6 +51,8 @@
 #define        MCF_IRQ_FECTX0          (MCFINT_VECBASE + MCFINT_FECTX0)
 #define        MCF_IRQ_FECENTC0        (MCFINT_VECBASE + MCFINT_FECENTC0)
 
+#define        MCF_IRQ_QSPI            (MCFINT_VECBASE + MCFINT_QSPI)
+
 /*
  *     SDRAM configuration registers.
  */
 #define        MCFFEC_BASE0            (MCF_IPSBAR + 0x00001000)
 #define        MCFFEC_SIZE0            0x800
 
+/*
+ *     QSPI module.
+ */
+#define        MCFQSPI_IOBASE          (MCF_IPSBAR + 0x340)
+#define        MCFQSPI_SIZE            0x40
+
+#define        MCFQSPI_CS0             147
+#define        MCFQSPI_CS1             148
+#define        MCFQSPI_CS2             149
+#define        MCFQSPI_CS3             150
+
 /*
  *     GPIO registers
  */
index 57fcbc2c0dac9e68e69e14a88416b7ffb2af9693..f3d9640f788d6a96bd364d87a55b00c6a31b2256 100644 (file)
@@ -21,9 +21,7 @@
 #ifndef mcfqspi_h
 #define mcfqspi_h
 
-#if defined(CONFIG_M528x)
-#define        MCFQSPI_IOBASE          (MCF_IPSBAR + 0x340)
-#elif defined(CONFIG_M532x)
+#if defined(CONFIG_M532x)
 #define MCFQSPI_IOBASE         0xFC058000
 #endif
 #define MCFQSPI_IOSIZE         0x40
index 3e015dc00c8edf7d8168b7159fde5ec709aaeb60..24f5afcf008249cbec59822f7952aeeb9495760b 100644 (file)
 #if defined(CONFIG_SPI_COLDFIRE_QSPI) || defined(CONFIG_SPI_COLDFIRE_QSPI_MODULE)
 static struct resource m528x_qspi_resources[] = {
        {
-               .start          = MCFQSPI_IOBASE,
-               .end            = MCFQSPI_IOBASE + MCFQSPI_IOSIZE - 1,
+               .start          = MCFQSPI_BASE,
+               .end            = MCFQSPI_BASE + MCFQSPI_SIZE - 1,
                .flags          = IORESOURCE_MEM,
        },
        {
-               .start          = MCFINT_VECBASE + MCFINT_QSPI,
-               .end            = MCFINT_VECBASE + MCFINT_QSPI,
+               .start          = MCF_IRQ_QSPI,
+               .end            = MCF_IRQ_QSPI,
                .flags          = IORESOURCE_IRQ,
        },
 };
 
-#define MCFQSPI_CS0    147
-#define MCFQSPI_CS1    148
-#define MCFQSPI_CS2    149
-#define MCFQSPI_CS3    150
-
 static int m528x_cs_setup(struct mcfqspi_cs_control *cs_control)
 {
        int status;