brcm63xx: add preliminary support for 3.13
[openwrt.git] / target / linux / brcm63xx / patches-3.13 / 314-MIPS-BCM63XX-remove-RUNTIME_DETECT-from-spi-code.patch
1 From 94f819bc230bb61a9ff21da6c860a40ca68c2805 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Tue, 3 Dec 2013 13:43:35 +0100
4 Subject: [PATCH 5/8] MIPS: BCM63XX: remove !RUNTIME_DETECT from spi code
5
6 ---
7  arch/mips/bcm63xx/dev-spi.c                        |  4 ---
8  .../include/asm/mach-bcm63xx/bcm63xx_dev_spi.h     | 31 ----------------------
9  2 files changed, 35 deletions(-)
10
11 --- a/arch/mips/bcm63xx/dev-spi.c
12 +++ b/arch/mips/bcm63xx/dev-spi.c
13 @@ -18,7 +18,6 @@
14  #include <bcm63xx_dev_spi.h>
15  #include <bcm63xx_regs.h>
16  
17 -#ifdef BCMCPU_RUNTIME_DETECT
18  /*
19   * register offsets
20   */
21 @@ -41,9 +40,6 @@ static __init void bcm63xx_spi_regs_init
22                 BCMCPU_IS_6362() || BCMCPU_IS_6368())
23                 bcm63xx_regs_spi = bcm6358_regs_spi;
24  }
25 -#else
26 -static __init void bcm63xx_spi_regs_init(void) { }
27 -#endif
28  
29  static struct resource spi_resources[] = {
30         {
31 --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
32 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_spi.h
33 @@ -30,26 +30,6 @@ enum bcm63xx_regs_spi {
34         SPI_RX_DATA,
35  };
36  
37 -#define __GEN_SPI_RSET_BASE(__cpu, __rset)                             \
38 -       case SPI_## __rset:                                             \
39 -               return SPI_## __cpu ##_## __rset;
40 -
41 -#define __GEN_SPI_RSET(__cpu)                                          \
42 -       switch (reg) {                                                  \
43 -       __GEN_SPI_RSET_BASE(__cpu, CMD)                                 \
44 -       __GEN_SPI_RSET_BASE(__cpu, INT_STATUS)                          \
45 -       __GEN_SPI_RSET_BASE(__cpu, INT_MASK_ST)                         \
46 -       __GEN_SPI_RSET_BASE(__cpu, INT_MASK)                            \
47 -       __GEN_SPI_RSET_BASE(__cpu, ST)                                  \
48 -       __GEN_SPI_RSET_BASE(__cpu, CLK_CFG)                             \
49 -       __GEN_SPI_RSET_BASE(__cpu, FILL_BYTE)                           \
50 -       __GEN_SPI_RSET_BASE(__cpu, MSG_TAIL)                            \
51 -       __GEN_SPI_RSET_BASE(__cpu, RX_TAIL)                             \
52 -       __GEN_SPI_RSET_BASE(__cpu, MSG_CTL)                             \
53 -       __GEN_SPI_RSET_BASE(__cpu, MSG_DATA)                            \
54 -       __GEN_SPI_RSET_BASE(__cpu, RX_DATA)                             \
55 -       }
56 -
57  #define __GEN_SPI_REGS_TABLE(__cpu)                                    \
58         [SPI_CMD]               = SPI_## __cpu ##_CMD,                  \
59         [SPI_INT_STATUS]        = SPI_## __cpu ##_INT_STATUS,           \
60 @@ -66,20 +46,9 @@ enum bcm63xx_regs_spi {
61  
62  static inline unsigned long bcm63xx_spireg(enum bcm63xx_regs_spi reg)
63  {
64 -#ifdef BCMCPU_RUNTIME_DETECT
65         extern const unsigned long *bcm63xx_regs_spi;
66  
67         return bcm63xx_regs_spi[reg];
68 -#else
69 -#if defined(CONFIG_BCM63XX_CPU_6338) || defined(CONFIG_BCM63XX_CPU_6348)
70 -       __GEN_SPI_RSET(6348)
71 -#endif
72 -#if defined(CONFIG_BCM63XX_CPU_6358) || defined(CONFIG_BCM63XX_CPU_6362) || \
73 -       defined(CONFIG_BCM63XX_CPU_6368)
74 -       __GEN_SPI_RSET(6358)
75 -#endif
76 -#endif
77 -       return 0;
78  }
79  
80  #endif /* BCM63XX_DEV_SPI_H */