-+enum bcm63xx_regs_spi {
-+ SPI_CMD,
-+ SPI_INT_STATUS,
-+ SPI_INT_MASK_ST,
-+ SPI_INT_MASK,
-+ SPI_ST,
-+ SPI_CLK_CFG,
-+ SPI_FILL_BYTE,
-+ SPI_MSG_TAIL,
-+ SPI_RX_TAIL,
-+ SPI_MSG_CTL,
-+ SPI_MSG_DATA,
-+ SPI_RX_DATA,
-+};
-+
-+/*
-+ * register offsets
-+ */
-+static const unsigned long bcm96338_regs_spi[] = {
-+ [SPI_CMD] = SPI_BCM_6338_SPI_CMD,
-+ [SPI_INT_STATUS] = SPI_BCM_6338_SPI_INT_STATUS,
-+ [SPI_INT_MASK_ST] = SPI_BCM_6338_SPI_MASK_INT_ST,
-+ [SPI_INT_MASK] = SPI_BCM_6338_SPI_INT_MASK,
-+ [SPI_ST] = SPI_BCM_6338_SPI_ST,
-+ [SPI_CLK_CFG] = SPI_BCM_6338_SPI_CLK_CFG,
-+ [SPI_FILL_BYTE] = SPI_BCM_6338_SPI_FILL_BYTE,
-+ [SPI_MSG_TAIL] = SPI_BCM_6338_SPI_MSG_TAIL,
-+ [SPI_RX_TAIL] = SPI_BCM_6338_SPI_RX_TAIL,
-+ [SPI_MSG_CTL] = SPI_BCM_6338_SPI_MSG_CTL,
-+ [SPI_MSG_DATA] = SPI_BCM_6338_SPI_MSG_DATA,
-+ [SPI_RX_DATA] = SPI_BCM_6338_SPI_RX_DATA,
-+};
-+
-+static const unsigned long bcm96348_regs_spi[] = {
-+ [SPI_CMD] = SPI_BCM_6348_SPI_CMD,
-+ [SPI_INT_STATUS] = SPI_BCM_6348_SPI_INT_STATUS,
-+ [SPI_INT_MASK_ST] = SPI_BCM_6348_SPI_MASK_INT_ST,
-+ [SPI_INT_MASK] = SPI_BCM_6348_SPI_INT_MASK,
-+ [SPI_ST] = SPI_BCM_6348_SPI_ST,
-+ [SPI_CLK_CFG] = SPI_BCM_6348_SPI_CLK_CFG,
-+ [SPI_FILL_BYTE] = SPI_BCM_6348_SPI_FILL_BYTE,
-+ [SPI_MSG_TAIL] = SPI_BCM_6348_SPI_MSG_TAIL,
-+ [SPI_RX_TAIL] = SPI_BCM_6348_SPI_RX_TAIL,
-+ [SPI_MSG_CTL] = SPI_BCM_6348_SPI_MSG_CTL,
-+ [SPI_MSG_DATA] = SPI_BCM_6348_SPI_MSG_DATA,
-+ [SPI_RX_DATA] = SPI_BCM_6348_SPI_RX_DATA,
-+};
-+
-+static const unsigned long bcm96358_regs_spi[] = {
-+ [SPI_CMD] = SPI_BCM_6358_SPI_CMD,
-+ [SPI_INT_STATUS] = SPI_BCM_6358_SPI_INT_STATUS,
-+ [SPI_INT_MASK_ST] = SPI_BCM_6358_SPI_MASK_INT_ST,
-+ [SPI_INT_MASK] = SPI_BCM_6358_SPI_INT_MASK,
-+ [SPI_ST] = SPI_BCM_6358_SPI_STATUS,
-+ [SPI_CLK_CFG] = SPI_BCM_6358_SPI_CLK_CFG,
-+ [SPI_FILL_BYTE] = SPI_BCM_6358_SPI_FILL_BYTE,
-+ [SPI_MSG_TAIL] = SPI_BCM_6358_SPI_MSG_TAIL,
-+ [SPI_RX_TAIL] = SPI_BCM_6358_SPI_RX_TAIL,
-+ [SPI_MSG_CTL] = SPI_BCM_6358_MSG_CTL,
-+ [SPI_MSG_DATA] = SPI_BCM_6358_SPI_MSG_DATA,
-+ [SPI_RX_DATA] = SPI_BCM_6358_SPI_RX_DATA,
-+};
-+
-+
-+#ifdef BCMCPU_RUNTIME_DETECT
-+static const unsigned long *bcm63xx_regs_spi;
-+
-+static __init void bcm63xx_spi_regs_init(void)
-+{
-+ if (BCMCPU_IS_6338())
-+ bcm63xx_regs_spi = bcm96338_regs_spi;
-+ if (BCMCPU_IS_6348())
-+ bcm63xx_regs_spi = bcm96348_regs_spi;
-+ if (BCMCPU_IS_6358())
-+ bcm63xx_regs_spi = bcm96358_regs_spi;
-+}
-+#else
-+static __init void bcm63xx_spi_regs_init(void) { }
-+#endif
-+
-+static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg)
-+{
-+#ifdef BCMCPU_RUNTIME_DETECT
-+ return bcm63xx_regs_spi[reg];
-+#else
-+#ifdef CONFIG_BCM63XX_CPU_6338
-+switch (reg) {
-+ case SPI_CMD:
-+ return SPI_BCM_6338_SPI_CMD;
-+ case SPI_INT_STATUS:
-+ return SPI_BCM_6338_SPI_INT_STATUS;
-+ case SPI_INT_MASK_ST:
-+ return SPI_BCM_6338_SPI_MASK_INT_ST;
-+ case SPI_INT_MASK:
-+ return SPI_BCM_6338_SPI_INT_MASK;
-+ case SPI_ST:
-+ return SPI_BCM_6338_SPI_ST;
-+ case SPI_CLK_CFG:
-+ return SPI_BCM_6338_SPI_CLK_CFG;
-+ case SPI_FILL_BYTE:
-+ return SPI_BCM_6338_SPI_FILL_BYTE;
-+ case SPI_MSG_TAIL:
-+ return SPI_BCM_6338_SPI_MSG_TAIL;
-+ case SPI_RX_TAIL:
-+ return SPI_BCM_6338_SPI_RX_TAIL;
-+ case SPI_MSG_CTL:
-+ return SPI_BCM_6338_SPI_MSG_CTL;
-+ case SPI_MSG_DATA:
-+ return SPI_BCM_6338_SPI_MSG_DATA;
-+ case SPI_RX_DATA:
-+ return SPI_BCM_6338_SPI_RX_DATA;
-+}
-+#endif
-+#ifdef CONFIG_BCM63XX_CPU_6348
-+switch (reg) {
-+ case SPI_CMD:
-+ return SPI_BCM_6348_SPI_CMD;
-+ case SPI_INT_MASK_ST:
-+ return SPI_BCM_6348_SPI_MASK_INT_ST;
-+ case SPI_INT_MASK:
-+ return SPI_BCM_6348_SPI_INT_MASK;
-+ case SPI_INT_STATUS:
-+ return SPI_BCM_6348_SPI_INT_STATUS;
-+ case SPI_ST:
-+ return SPI_BCM_6348_SPI_ST;
-+ case SPI_CLK_CFG:
-+ return SPI_BCM_6348_SPI_CLK_CFG;
-+ case SPI_FILL_BYTE:
-+ return SPI_BCM_6348_SPI_FILL_BYTE;
-+ case SPI_MSG_TAIL:
-+ return SPI_BCM_6348_SPI_MSG_TAIL;
-+ case SPI_RX_TAIL:
-+ return SPI_BCM_6348_SPI_RX_TAIL;
-+ case SPI_MSG_CTL:
-+ return SPI_BCM_6348_SPI_MSG_CTL;
-+ case SPI_MSG_DATA:
-+ return SPI_BCM_6348_SPI_MSG_DATA;
-+ case SPI_RX_DATA:
-+ return SPI_BCM_6348_SPI_RX_DATA;
-+}
-+#endif
-+#ifdef CONFIG_BCM63XX_CPU_6358
-+switch (reg) {
-+ case SPI_CMD:
-+ return SPI_BCM_6358_SPI_CMD;
-+ case SPI_INT_STATUS:
-+ return SPI_BCM_6358_SPI_INT_STATUS;
-+ case SPI_INT_MASK_ST:
-+ return SPI_BCM_6358_SPI_MASK_INT_ST;
-+ case SPI_INT_MASK:
-+ return SPI_BCM_6358_SPI_INT_MASK;
-+ case SPI_ST:
-+ return SPI_BCM_6358_SPI_STATUS;
-+ case SPI_CLK_CFG:
-+ return SPI_BCM_6358_SPI_CLK_CFG;
-+ case SPI_FILL_BYTE:
-+ return SPI_BCM_6358_SPI_FILL_BYTE;
-+ case SPI_MSG_TAIL:
-+ return SPI_BCM_6358_SPI_MSG_TAIL;
-+ case SPI_RX_TAIL:
-+ return SPI_BCM_6358_SPI_RX_TAIL;
-+ case SPI_MSG_CTL:
-+ return SPI_BCM_6358_MSG_CTL;
-+ case SPI_MSG_DATA:
-+ return SPI_BCM_6358_SPI_MSG_DATA;
-+ case SPI_RX_DATA:
-+ return SPI_BCM_6358_SPI_RX_DATA;
-+}
-+#endif
-+#endif
-+ return 0;
-+}
-+
-+/*
-+ * helpers for the SPI register sets
-+ */
-+#define bcm_spi_readb(b,o) bcm_readb((b) + bcm63xx_spireg(o))
-+#define bcm_spi_readw(b,o) bcm_readw((b) + bcm63xx_spireg(o))
-+#define bcm_spi_writeb(v,b,o) bcm_writeb((v), (b) + bcm63xx_spireg(o))
-+#define bcm_spi_writew(v,b,o) bcm_writew((v), (b) + bcm63xx_spireg(o))
-+