aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx/dev-spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/bcm63xx/dev-spi.c')
-rw-r--r--arch/mips/bcm63xx/dev-spi.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/arch/mips/bcm63xx/dev-spi.c b/arch/mips/bcm63xx/dev-spi.c
index e97fd60e92ef..3065bb61820d 100644
--- a/arch/mips/bcm63xx/dev-spi.c
+++ b/arch/mips/bcm63xx/dev-spi.c
@@ -22,10 +22,6 @@
22/* 22/*
23 * register offsets 23 * register offsets
24 */ 24 */
25static const unsigned long bcm6338_regs_spi[] = {
26 __GEN_SPI_REGS_TABLE(6338)
27};
28
29static const unsigned long bcm6348_regs_spi[] = { 25static const unsigned long bcm6348_regs_spi[] = {
30 __GEN_SPI_REGS_TABLE(6348) 26 __GEN_SPI_REGS_TABLE(6348)
31}; 27};
@@ -34,23 +30,15 @@ static const unsigned long bcm6358_regs_spi[] = {
34 __GEN_SPI_REGS_TABLE(6358) 30 __GEN_SPI_REGS_TABLE(6358)
35}; 31};
36 32
37static const unsigned long bcm6368_regs_spi[] = {
38 __GEN_SPI_REGS_TABLE(6368)
39};
40
41const unsigned long *bcm63xx_regs_spi; 33const unsigned long *bcm63xx_regs_spi;
42EXPORT_SYMBOL(bcm63xx_regs_spi); 34EXPORT_SYMBOL(bcm63xx_regs_spi);
43 35
44static __init void bcm63xx_spi_regs_init(void) 36static __init void bcm63xx_spi_regs_init(void)
45{ 37{
46 if (BCMCPU_IS_6338()) 38 if (BCMCPU_IS_6338() || BCMCPU_IS_6348())
47 bcm63xx_regs_spi = bcm6338_regs_spi;
48 if (BCMCPU_IS_6348())
49 bcm63xx_regs_spi = bcm6348_regs_spi; 39 bcm63xx_regs_spi = bcm6348_regs_spi;
50 if (BCMCPU_IS_6358()) 40 if (BCMCPU_IS_6358() || BCMCPU_IS_6362() || BCMCPU_IS_6368())
51 bcm63xx_regs_spi = bcm6358_regs_spi; 41 bcm63xx_regs_spi = bcm6358_regs_spi;
52 if (BCMCPU_IS_6368())
53 bcm63xx_regs_spi = bcm6368_regs_spi;
54} 42}
55#else 43#else
56static __init void bcm63xx_spi_regs_init(void) { } 44static __init void bcm63xx_spi_regs_init(void) { }
@@ -93,13 +81,13 @@ int __init bcm63xx_spi_register(void)
93 spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); 81 spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI);
94 82
95 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { 83 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) {
96 spi_resources[0].end += BCM_6338_RSET_SPI_SIZE - 1; 84 spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1;
97 spi_pdata.fifo_size = SPI_6338_MSG_DATA_SIZE; 85 spi_pdata.fifo_size = SPI_6348_MSG_DATA_SIZE;
98 spi_pdata.msg_type_shift = SPI_6338_MSG_TYPE_SHIFT; 86 spi_pdata.msg_type_shift = SPI_6348_MSG_TYPE_SHIFT;
99 spi_pdata.msg_ctl_width = SPI_6338_MSG_CTL_WIDTH; 87 spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH;
100 } 88 }
101 89
102 if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) { 90 if (BCMCPU_IS_6358() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) {
103 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; 91 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1;
104 spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE; 92 spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE;
105 spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT; 93 spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT;