aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mach-bcm63xx
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2013-06-18 12:55:40 -0400
committerRalf Baechle <ralf@linux-mips.org>2013-07-01 09:10:53 -0400
commit7b9334215f53135fb9cbdf0b44833cbc8e7d57b2 (patch)
treebe404d8c6355d162e5a8c9042cbf93d4c6861147 /arch/mips/include/asm/mach-bcm63xx
parentae8de61c726f4f2c4b1b4d8263c9c71b82503e0d (diff)
MIPS: BCM63XX: add support for BCM3368 Cable Modem
The Broadcom BCM3368 Cable Modem SoC is extremely similar to the existing BCM63xx DSL SoCs, in particular BCM6358, therefore little effort in the existing code base is required to get it supported. This patch adds support for the following on-chip peripherals: - two UARTS - GPIO - Ethernet - SPI - PCI - NOR Flash The most noticeable difference with 3368 is that it has its peripheral register at 0xfff8_0000 we check that separately in ioremap.h. Since 3368 is identical to 6358 for its clock and reset bits, we use them verbatim. Signed-off-by: Florian Fainelli <florian@openwrt.org> Cc: linux-mips@linux-mips.org Cc: cernekee@gmail.com Cc: jogo@openwrt.org Patchwork: https://patchwork.linux-mips.org/patch/5499/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include/asm/mach-bcm63xx')
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h110
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h1
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h45
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/ioremap.h4
4 files changed, 159 insertions, 1 deletions
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
index 336228990808..9d3c08e4a7e4 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
@@ -9,6 +9,7 @@
9 * compile time if only one CPU support is enabled (idea stolen from 9 * compile time if only one CPU support is enabled (idea stolen from
10 * arm mach-types) 10 * arm mach-types)
11 */ 11 */
12#define BCM3368_CPU_ID 0x3368
12#define BCM6328_CPU_ID 0x6328 13#define BCM6328_CPU_ID 0x6328
13#define BCM6338_CPU_ID 0x6338 14#define BCM6338_CPU_ID 0x6338
14#define BCM6345_CPU_ID 0x6345 15#define BCM6345_CPU_ID 0x6345
@@ -22,6 +23,19 @@ u16 __bcm63xx_get_cpu_id(void);
22u8 bcm63xx_get_cpu_rev(void); 23u8 bcm63xx_get_cpu_rev(void);
23unsigned int bcm63xx_get_cpu_freq(void); 24unsigned int bcm63xx_get_cpu_freq(void);
24 25
26#ifdef CONFIG_BCM63XX_CPU_3368
27# ifdef bcm63xx_get_cpu_id
28# undef bcm63xx_get_cpu_id
29# define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id()
30# define BCMCPU_RUNTIME_DETECT
31# else
32# define bcm63xx_get_cpu_id() BCM3368_CPU_ID
33# endif
34# define BCMCPU_IS_3368() (bcm63xx_get_cpu_id() == BCM3368_CPU_ID)
35#else
36# define BCMCPU_IS_3368() (0)
37#endif
38
25#ifdef CONFIG_BCM63XX_CPU_6328 39#ifdef CONFIG_BCM63XX_CPU_6328
26# ifdef bcm63xx_get_cpu_id 40# ifdef bcm63xx_get_cpu_id
27# undef bcm63xx_get_cpu_id 41# undef bcm63xx_get_cpu_id
@@ -191,6 +205,53 @@ enum bcm63xx_regs_set {
191#define RSET_RNG_SIZE 20 205#define RSET_RNG_SIZE 20
192 206
193/* 207/*
208 * 3368 register sets base address
209 */
210#define BCM_3368_DSL_LMEM_BASE (0xdeadbeef)
211#define BCM_3368_PERF_BASE (0xfff8c000)
212#define BCM_3368_TIMER_BASE (0xfff8c040)
213#define BCM_3368_WDT_BASE (0xfff8c080)
214#define BCM_3368_UART0_BASE (0xfff8c100)
215#define BCM_3368_UART1_BASE (0xfff8c120)
216#define BCM_3368_GPIO_BASE (0xfff8c080)
217#define BCM_3368_SPI_BASE (0xfff8c800)
218#define BCM_3368_HSSPI_BASE (0xdeadbeef)
219#define BCM_3368_UDC0_BASE (0xdeadbeef)
220#define BCM_3368_USBDMA_BASE (0xdeadbeef)
221#define BCM_3368_OHCI0_BASE (0xdeadbeef)
222#define BCM_3368_OHCI_PRIV_BASE (0xdeadbeef)
223#define BCM_3368_USBH_PRIV_BASE (0xdeadbeef)
224#define BCM_3368_USBD_BASE (0xdeadbeef)
225#define BCM_3368_MPI_BASE (0xfff80000)
226#define BCM_3368_PCMCIA_BASE (0xfff80054)
227#define BCM_3368_PCIE_BASE (0xdeadbeef)
228#define BCM_3368_SDRAM_REGS_BASE (0xdeadbeef)
229#define BCM_3368_DSL_BASE (0xdeadbeef)
230#define BCM_3368_UBUS_BASE (0xdeadbeef)
231#define BCM_3368_ENET0_BASE (0xfff98000)
232#define BCM_3368_ENET1_BASE (0xfff98800)
233#define BCM_3368_ENETDMA_BASE (0xfff99800)
234#define BCM_3368_ENETDMAC_BASE (0xfff99900)
235#define BCM_3368_ENETDMAS_BASE (0xfff99a00)
236#define BCM_3368_ENETSW_BASE (0xdeadbeef)
237#define BCM_3368_EHCI0_BASE (0xdeadbeef)
238#define BCM_3368_SDRAM_BASE (0xdeadbeef)
239#define BCM_3368_MEMC_BASE (0xfff84000)
240#define BCM_3368_DDR_BASE (0xdeadbeef)
241#define BCM_3368_M2M_BASE (0xdeadbeef)
242#define BCM_3368_ATM_BASE (0xdeadbeef)
243#define BCM_3368_XTM_BASE (0xdeadbeef)
244#define BCM_3368_XTMDMA_BASE (0xdeadbeef)
245#define BCM_3368_XTMDMAC_BASE (0xdeadbeef)
246#define BCM_3368_XTMDMAS_BASE (0xdeadbeef)
247#define BCM_3368_PCM_BASE (0xfff9c200)
248#define BCM_3368_PCMDMA_BASE (0xdeadbeef)
249#define BCM_3368_PCMDMAC_BASE (0xdeadbeef)
250#define BCM_3368_PCMDMAS_BASE (0xdeadbeef)
251#define BCM_3368_RNG_BASE (0xdeadbeef)
252#define BCM_3368_MISC_BASE (0xdeadbeef)
253
254/*
194 * 6328 register sets base address 255 * 6328 register sets base address
195 */ 256 */
196#define BCM_6328_DSL_LMEM_BASE (0xdeadbeef) 257#define BCM_6328_DSL_LMEM_BASE (0xdeadbeef)
@@ -620,6 +681,9 @@ static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
620#ifdef BCMCPU_RUNTIME_DETECT 681#ifdef BCMCPU_RUNTIME_DETECT
621 return bcm63xx_regs_base[set]; 682 return bcm63xx_regs_base[set];
622#else 683#else
684#ifdef CONFIG_BCM63XX_CPU_3368
685 __GEN_RSET(3368)
686#endif
623#ifdef CONFIG_BCM63XX_CPU_6328 687#ifdef CONFIG_BCM63XX_CPU_6328
624 __GEN_RSET(6328) 688 __GEN_RSET(6328)
625#endif 689#endif
@@ -687,6 +751,52 @@ enum bcm63xx_irq {
687}; 751};
688 752
689/* 753/*
754 * 3368 irqs
755 */
756#define BCM_3368_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
757#define BCM_3368_SPI_IRQ (IRQ_INTERNAL_BASE + 1)
758#define BCM_3368_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
759#define BCM_3368_UART1_IRQ (IRQ_INTERNAL_BASE + 3)
760#define BCM_3368_DSL_IRQ 0
761#define BCM_3368_UDC0_IRQ 0
762#define BCM_3368_OHCI0_IRQ 0
763#define BCM_3368_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
764#define BCM_3368_ENET1_IRQ (IRQ_INTERNAL_BASE + 6)
765#define BCM_3368_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
766#define BCM_3368_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15)
767#define BCM_3368_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16)
768#define BCM_3368_HSSPI_IRQ 0
769#define BCM_3368_EHCI0_IRQ 0
770#define BCM_3368_USBD_IRQ 0
771#define BCM_3368_USBD_RXDMA0_IRQ 0
772#define BCM_3368_USBD_TXDMA0_IRQ 0
773#define BCM_3368_USBD_RXDMA1_IRQ 0
774#define BCM_3368_USBD_TXDMA1_IRQ 0
775#define BCM_3368_USBD_RXDMA2_IRQ 0
776#define BCM_3368_USBD_TXDMA2_IRQ 0
777#define BCM_3368_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 17)
778#define BCM_3368_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 18)
779#define BCM_3368_PCI_IRQ (IRQ_INTERNAL_BASE + 31)
780#define BCM_3368_PCMCIA_IRQ 0
781#define BCM_3368_ATM_IRQ 0
782#define BCM_3368_ENETSW_RXDMA0_IRQ 0
783#define BCM_3368_ENETSW_RXDMA1_IRQ 0
784#define BCM_3368_ENETSW_RXDMA2_IRQ 0
785#define BCM_3368_ENETSW_RXDMA3_IRQ 0
786#define BCM_3368_ENETSW_TXDMA0_IRQ 0
787#define BCM_3368_ENETSW_TXDMA1_IRQ 0
788#define BCM_3368_ENETSW_TXDMA2_IRQ 0
789#define BCM_3368_ENETSW_TXDMA3_IRQ 0
790#define BCM_3368_XTM_IRQ 0
791#define BCM_3368_XTM_DMA0_IRQ 0
792
793#define BCM_3368_EXT_IRQ0 (IRQ_INTERNAL_BASE + 25)
794#define BCM_3368_EXT_IRQ1 (IRQ_INTERNAL_BASE + 26)
795#define BCM_3368_EXT_IRQ2 (IRQ_INTERNAL_BASE + 27)
796#define BCM_3368_EXT_IRQ3 (IRQ_INTERNAL_BASE + 28)
797
798
799/*
690 * 6328 irqs 800 * 6328 irqs
691 */ 801 */
692#define BCM_6328_HIGH_IRQ_BASE (IRQ_INTERNAL_BASE + 32) 802#define BCM_6328_HIGH_IRQ_BASE (IRQ_INTERNAL_BASE + 32)
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
index 35baa1a60a64..565ff36a1119 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
@@ -11,6 +11,7 @@ static inline unsigned long bcm63xx_gpio_count(void)
11 switch (bcm63xx_get_cpu_id()) { 11 switch (bcm63xx_get_cpu_id()) {
12 case BCM6328_CPU_ID: 12 case BCM6328_CPU_ID:
13 return 32; 13 return 32;
14 case BCM3368_CPU_ID:
14 case BCM6358_CPU_ID: 15 case BCM6358_CPU_ID:
15 return 40; 16 return 40;
16 case BCM6338_CPU_ID: 17 case BCM6338_CPU_ID:
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
index 3203fe49b34d..654213746b32 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
@@ -15,6 +15,39 @@
15/* Clock Control register */ 15/* Clock Control register */
16#define PERF_CKCTL_REG 0x4 16#define PERF_CKCTL_REG 0x4
17 17
18#define CKCTL_3368_MAC_EN (1 << 3)
19#define CKCTL_3368_TC_EN (1 << 5)
20#define CKCTL_3368_US_TOP_EN (1 << 6)
21#define CKCTL_3368_DS_TOP_EN (1 << 7)
22#define CKCTL_3368_APM_EN (1 << 8)
23#define CKCTL_3368_SPI_EN (1 << 9)
24#define CKCTL_3368_USBS_EN (1 << 10)
25#define CKCTL_3368_BMU_EN (1 << 11)
26#define CKCTL_3368_PCM_EN (1 << 12)
27#define CKCTL_3368_NTP_EN (1 << 13)
28#define CKCTL_3368_ACP_B_EN (1 << 14)
29#define CKCTL_3368_ACP_A_EN (1 << 15)
30#define CKCTL_3368_EMUSB_EN (1 << 17)
31#define CKCTL_3368_ENET0_EN (1 << 18)
32#define CKCTL_3368_ENET1_EN (1 << 19)
33#define CKCTL_3368_USBU_EN (1 << 20)
34#define CKCTL_3368_EPHY_EN (1 << 21)
35
36#define CKCTL_3368_ALL_SAFE_EN (CKCTL_3368_MAC_EN | \
37 CKCTL_3368_TC_EN | \
38 CKCTL_3368_US_TOP_EN | \
39 CKCTL_3368_DS_TOP_EN | \
40 CKCTL_3368_APM_EN | \
41 CKCTL_3368_SPI_EN | \
42 CKCTL_3368_USBS_EN | \
43 CKCTL_3368_BMU_EN | \
44 CKCTL_3368_PCM_EN | \
45 CKCTL_3368_NTP_EN | \
46 CKCTL_3368_ACP_B_EN | \
47 CKCTL_3368_ACP_A_EN | \
48 CKCTL_3368_EMUSB_EN | \
49 CKCTL_3368_USBU_EN)
50
18#define CKCTL_6328_PHYMIPS_EN (1 << 0) 51#define CKCTL_6328_PHYMIPS_EN (1 << 0)
19#define CKCTL_6328_ADSL_QPROC_EN (1 << 1) 52#define CKCTL_6328_ADSL_QPROC_EN (1 << 1)
20#define CKCTL_6328_ADSL_AFE_EN (1 << 2) 53#define CKCTL_6328_ADSL_AFE_EN (1 << 2)
@@ -181,6 +214,7 @@
181#define SYS_PLL_SOFT_RESET 0x1 214#define SYS_PLL_SOFT_RESET 0x1
182 215
183/* Interrupt Mask register */ 216/* Interrupt Mask register */
217#define PERF_IRQMASK_3368_REG 0xc
184#define PERF_IRQMASK_6328_REG 0x20 218#define PERF_IRQMASK_6328_REG 0x20
185#define PERF_IRQMASK_6338_REG 0xc 219#define PERF_IRQMASK_6338_REG 0xc
186#define PERF_IRQMASK_6345_REG 0xc 220#define PERF_IRQMASK_6345_REG 0xc
@@ -190,6 +224,7 @@
190#define PERF_IRQMASK_6368_REG 0x20 224#define PERF_IRQMASK_6368_REG 0x20
191 225
192/* Interrupt Status register */ 226/* Interrupt Status register */
227#define PERF_IRQSTAT_3368_REG 0x10
193#define PERF_IRQSTAT_6328_REG 0x28 228#define PERF_IRQSTAT_6328_REG 0x28
194#define PERF_IRQSTAT_6338_REG 0x10 229#define PERF_IRQSTAT_6338_REG 0x10
195#define PERF_IRQSTAT_6345_REG 0x10 230#define PERF_IRQSTAT_6345_REG 0x10
@@ -199,6 +234,7 @@
199#define PERF_IRQSTAT_6368_REG 0x28 234#define PERF_IRQSTAT_6368_REG 0x28
200 235
201/* External Interrupt Configuration register */ 236/* External Interrupt Configuration register */
237#define PERF_EXTIRQ_CFG_REG_3368 0x14
202#define PERF_EXTIRQ_CFG_REG_6328 0x18 238#define PERF_EXTIRQ_CFG_REG_6328 0x18
203#define PERF_EXTIRQ_CFG_REG_6338 0x14 239#define PERF_EXTIRQ_CFG_REG_6338 0x14
204#define PERF_EXTIRQ_CFG_REG_6345 0x14 240#define PERF_EXTIRQ_CFG_REG_6345 0x14
@@ -236,6 +272,13 @@
236#define PERF_SOFTRESET_6362_REG 0x10 272#define PERF_SOFTRESET_6362_REG 0x10
237#define PERF_SOFTRESET_6368_REG 0x10 273#define PERF_SOFTRESET_6368_REG 0x10
238 274
275#define SOFTRESET_3368_SPI_MASK (1 << 0)
276#define SOFTRESET_3368_ENET_MASK (1 << 2)
277#define SOFTRESET_3368_MPI_MASK (1 << 3)
278#define SOFTRESET_3368_EPHY_MASK (1 << 6)
279#define SOFTRESET_3368_USBS_MASK (1 << 11)
280#define SOFTRESET_3368_PCM_MASK (1 << 13)
281
239#define SOFTRESET_6328_SPI_MASK (1 << 0) 282#define SOFTRESET_6328_SPI_MASK (1 << 0)
240#define SOFTRESET_6328_EPHY_MASK (1 << 1) 283#define SOFTRESET_6328_EPHY_MASK (1 << 1)
241#define SOFTRESET_6328_SAR_MASK (1 << 2) 284#define SOFTRESET_6328_SAR_MASK (1 << 2)
@@ -1293,7 +1336,7 @@
1293#define SPI_6348_RX_DATA 0x80 1336#define SPI_6348_RX_DATA 0x80
1294#define SPI_6348_RX_DATA_SIZE 0x3f 1337#define SPI_6348_RX_DATA_SIZE 0x3f
1295 1338
1296/* BCM 6358/6262/6368 SPI core */ 1339/* BCM 3368/6358/6262/6368 SPI core */
1297#define SPI_6358_MSG_CTL 0x00 /* 16-bits register */ 1340#define SPI_6358_MSG_CTL 0x00 /* 16-bits register */
1298#define SPI_6358_MSG_CTL_WIDTH 16 1341#define SPI_6358_MSG_CTL_WIDTH 16
1299#define SPI_6358_MSG_DATA 0x02 1342#define SPI_6358_MSG_DATA 0x02
diff --git a/arch/mips/include/asm/mach-bcm63xx/ioremap.h b/arch/mips/include/asm/mach-bcm63xx/ioremap.h
index 94e3011ba7df..ff15e3b14e7a 100644
--- a/arch/mips/include/asm/mach-bcm63xx/ioremap.h
+++ b/arch/mips/include/asm/mach-bcm63xx/ioremap.h
@@ -11,6 +11,10 @@ static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size)
11static inline int is_bcm63xx_internal_registers(phys_t offset) 11static inline int is_bcm63xx_internal_registers(phys_t offset)
12{ 12{
13 switch (bcm63xx_get_cpu_id()) { 13 switch (bcm63xx_get_cpu_id()) {
14 case BCM3368_CPU_ID:
15 if (offset >= 0xfff80000)
16 return 1;
17 break;
14 case BCM6338_CPU_ID: 18 case BCM6338_CPU_ID:
15 case BCM6345_CPU_ID: 19 case BCM6345_CPU_ID:
16 case BCM6348_CPU_ID: 20 case BCM6348_CPU_ID: