Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Florian Fainelli and committed by
Ralf Baechle
7b933421 ae8de61c

+259 -19
+4
arch/mips/bcm63xx/Kconfig
··· 1 1 menu "CPU support" 2 2 depends on BCM63XX 3 3 4 + config BCM63XX_CPU_3368 5 + bool "support 3368 CPU" 6 + select HW_HAS_PCI 7 + 4 8 config BCM63XX_CPU_6328 5 9 bool "support 6328 CPU" 6 10 select HW_HAS_PCI
+9 -9
arch/mips/bcm63xx/clk.c
··· 84 84 else 85 85 clk_disable_unlocked(&clk_enet_misc); 86 86 87 - if (BCMCPU_IS_6358()) { 87 + if (BCMCPU_IS_3368() || BCMCPU_IS_6358()) { 88 88 u32 mask; 89 89 90 90 if (clk->id == 0) ··· 110 110 */ 111 111 static void ephy_set(struct clk *clk, int enable) 112 112 { 113 - if (!BCMCPU_IS_6358()) 114 - return; 115 - bcm_hwclock_set(CKCTL_6358_EPHY_EN, enable); 113 + if (BCMCPU_IS_3368() || BCMCPU_IS_6358()) 114 + bcm_hwclock_set(CKCTL_6358_EPHY_EN, enable); 116 115 } 117 116 118 117 ··· 154 155 */ 155 156 static void pcm_set(struct clk *clk, int enable) 156 157 { 157 - if (!BCMCPU_IS_6358()) 158 - return; 159 - bcm_hwclock_set(CKCTL_6358_PCM_EN, enable); 158 + if (BCMCPU_IS_3368()) 159 + bcm_hwclock_set(CKCTL_3368_PCM_EN, enable); 160 + if (BCMCPU_IS_6358()) 161 + bcm_hwclock_set(CKCTL_6358_PCM_EN, enable); 160 162 } 161 163 162 164 static struct clk clk_pcm = { ··· 211 211 mask = CKCTL_6338_SPI_EN; 212 212 else if (BCMCPU_IS_6348()) 213 213 mask = CKCTL_6348_SPI_EN; 214 - else if (BCMCPU_IS_6358()) 214 + else if (BCMCPU_IS_3368() || BCMCPU_IS_6358()) 215 215 mask = CKCTL_6358_SPI_EN; 216 216 else if (BCMCPU_IS_6362()) 217 217 mask = CKCTL_6362_SPI_EN; ··· 338 338 return &clk_xtm; 339 339 if (!strcmp(id, "periph")) 340 340 return &clk_periph; 341 - if (BCMCPU_IS_6358() && !strcmp(id, "pcm")) 341 + if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm")) 342 342 return &clk_pcm; 343 343 if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec")) 344 344 return &clk_ipsec;
+25 -3
arch/mips/bcm63xx/cpu.c
··· 29 29 static unsigned int bcm63xx_cpu_freq; 30 30 static unsigned int bcm63xx_memory_size; 31 31 32 + static const unsigned long bcm3368_regs_base[] = { 33 + __GEN_CPU_REGS_TABLE(3368) 34 + }; 35 + 36 + static const int bcm3368_irqs[] = { 37 + __GEN_CPU_IRQ_TABLE(3368) 38 + }; 39 + 32 40 static const unsigned long bcm6328_regs_base[] = { 33 41 __GEN_CPU_REGS_TABLE(6328) 34 42 }; ··· 124 116 static unsigned int detect_cpu_clock(void) 125 117 { 126 118 switch (bcm63xx_get_cpu_id()) { 119 + case BCM3368_CPU_ID: 120 + return 300000000; 121 + 127 122 case BCM6328_CPU_ID: 128 123 { 129 124 unsigned int tmp, mips_pll_fcvo; ··· 277 266 banks = (val & SDRAM_CFG_BANK_MASK) ? 2 : 1; 278 267 } 279 268 280 - if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) { 269 + if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6368()) { 281 270 val = bcm_memc_readl(MEMC_CFG_REG); 282 271 rows = (val & MEMC_CFG_ROW_MASK) >> MEMC_CFG_ROW_SHIFT; 283 272 cols = (val & MEMC_CFG_COL_MASK) >> MEMC_CFG_COL_SHIFT; ··· 313 302 chipid_reg = BCM_6345_PERF_BASE; 314 303 break; 315 304 case CPU_BMIPS4350: 316 - if ((read_c0_prid() & 0xf0) == 0x10) 305 + switch ((read_c0_prid() & 0xff)) { 306 + case 0x04: 307 + chipid_reg = BCM_3368_PERF_BASE; 308 + break; 309 + case 0x10: 317 310 chipid_reg = BCM_6345_PERF_BASE; 318 - else 311 + break; 312 + default: 319 313 chipid_reg = BCM_6368_PERF_BASE; 314 + break; 315 + } 320 316 break; 321 317 } 322 318 ··· 340 322 bcm63xx_cpu_rev = (tmp & REV_REVID_MASK) >> REV_REVID_SHIFT; 341 323 342 324 switch (bcm63xx_cpu_id) { 325 + case BCM3368_CPU_ID: 326 + bcm63xx_regs_base = bcm3368_regs_base; 327 + bcm63xx_irqs = bcm3368_irqs; 328 + break; 343 329 case BCM6328_CPU_ID: 344 330 bcm63xx_regs_base = bcm6328_regs_base; 345 331 bcm63xx_irqs = bcm6328_irqs;
+1
arch/mips/bcm63xx/dev-flash.c
··· 71 71 case BCM6348_CPU_ID: 72 72 /* no way to auto detect so assume parallel */ 73 73 return BCM63XX_FLASH_TYPE_PARALLEL; 74 + case BCM3368_CPU_ID: 74 75 case BCM6358_CPU_ID: 75 76 val = bcm_gpio_readl(GPIO_STRAPBUS_REG); 76 77 if (val & STRAPBUS_6358_BOOT_SEL_PARALLEL)
+4 -2
arch/mips/bcm63xx/dev-spi.c
··· 37 37 { 38 38 if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) 39 39 bcm63xx_regs_spi = bcm6348_regs_spi; 40 - if (BCMCPU_IS_6358() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) 40 + if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || 41 + BCMCPU_IS_6362() || BCMCPU_IS_6368()) 41 42 bcm63xx_regs_spi = bcm6358_regs_spi; 42 43 } 43 44 #else ··· 88 87 spi_pdata.msg_ctl_width = SPI_6348_MSG_CTL_WIDTH; 89 88 } 90 89 91 - if (BCMCPU_IS_6358() || BCMCPU_IS_6362() || BCMCPU_IS_6368()) { 90 + if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() || 91 + BCMCPU_IS_6368()) { 92 92 spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; 93 93 spi_pdata.fifo_size = SPI_6358_MSG_DATA_SIZE; 94 94 spi_pdata.msg_type_shift = SPI_6358_MSG_TYPE_SHIFT;
+2 -1
arch/mips/bcm63xx/dev-uart.c
··· 54 54 if (id >= ARRAY_SIZE(bcm63xx_uart_devices)) 55 55 return -ENODEV; 56 56 57 - if (id == 1 && (!BCMCPU_IS_6358() && !BCMCPU_IS_6368())) 57 + if (id == 1 && (!BCMCPU_IS_3368() && !BCMCPU_IS_6358() && 58 + !BCMCPU_IS_6368())) 58 59 return -ENODEV; 59 60 60 61 if (id == 0) {
+19
arch/mips/bcm63xx/irq.c
··· 27 27 static void __internal_irq_unmask_64(unsigned int irq) __maybe_unused; 28 28 29 29 #ifndef BCMCPU_RUNTIME_DETECT 30 + #ifdef CONFIG_BCM63XX_CPU_3368 31 + #define irq_stat_reg PERF_IRQSTAT_3368_REG 32 + #define irq_mask_reg PERF_IRQMASK_3368_REG 33 + #define irq_bits 32 34 + #define is_ext_irq_cascaded 0 35 + #define ext_irq_start 0 36 + #define ext_irq_end 0 37 + #define ext_irq_count 4 38 + #define ext_irq_cfg_reg1 PERF_EXTIRQ_CFG_REG_3368 39 + #define ext_irq_cfg_reg2 0 40 + #endif 30 41 #ifdef CONFIG_BCM63XX_CPU_6328 31 42 #define irq_stat_reg PERF_IRQSTAT_6328_REG 32 43 #define irq_mask_reg PERF_IRQMASK_6328_REG ··· 151 140 irq_mask_addr = bcm63xx_regset_address(RSET_PERF); 152 141 153 142 switch (bcm63xx_get_cpu_id()) { 143 + case BCM3368_CPU_ID: 144 + irq_stat_addr += PERF_IRQSTAT_3368_REG; 145 + irq_mask_addr += PERF_IRQMASK_3368_REG; 146 + irq_bits = 32; 147 + ext_irq_count = 4; 148 + ext_irq_cfg_reg1 = PERF_EXTIRQ_CFG_REG_3368; 149 + break; 154 150 case BCM6328_CPU_ID: 155 151 irq_stat_addr += PERF_IRQSTAT_6328_REG; 156 152 irq_mask_addr += PERF_IRQMASK_6328_REG; ··· 497 479 reg &= ~EXTIRQ_CFG_BOTHEDGE_6348(irq); 498 480 break; 499 481 482 + case BCM3368_CPU_ID: 500 483 case BCM6328_CPU_ID: 501 484 case BCM6338_CPU_ID: 502 485 case BCM6345_CPU_ID:
+3 -1
arch/mips/bcm63xx/prom.c
··· 26 26 bcm_wdt_writel(WDT_STOP_2, WDT_CTL_REG); 27 27 28 28 /* disable all hardware blocks clock for now */ 29 - if (BCMCPU_IS_6328()) 29 + if (BCMCPU_IS_3368()) 30 + mask = CKCTL_3368_ALL_SAFE_EN; 31 + else if (BCMCPU_IS_6328()) 30 32 mask = CKCTL_6328_ALL_SAFE_EN; 31 33 else if (BCMCPU_IS_6338()) 32 34 mask = CKCTL_6338_ALL_SAFE_EN;
+28 -1
arch/mips/bcm63xx/reset.c
··· 30 30 [BCM63XX_RESET_PCIE] = BCM## __cpu ##_RESET_PCIE, \ 31 31 [BCM63XX_RESET_PCIE_EXT] = BCM## __cpu ##_RESET_PCIE_EXT, 32 32 33 + #define BCM3368_RESET_SPI SOFTRESET_3368_SPI_MASK 34 + #define BCM3368_RESET_ENET SOFTRESET_3368_ENET_MASK 35 + #define BCM3368_RESET_USBH 0 36 + #define BCM3368_RESET_USBD SOFTRESET_3368_USBS_MASK 37 + #define BCM3368_RESET_DSL 0 38 + #define BCM3368_RESET_SAR 0 39 + #define BCM3368_RESET_EPHY SOFTRESET_3368_EPHY_MASK 40 + #define BCM3368_RESET_ENETSW 0 41 + #define BCM3368_RESET_PCM SOFTRESET_3368_PCM_MASK 42 + #define BCM3368_RESET_MPI SOFTRESET_3368_MPI_MASK 43 + #define BCM3368_RESET_PCIE 0 44 + #define BCM3368_RESET_PCIE_EXT 0 45 + 33 46 #define BCM6328_RESET_SPI SOFTRESET_6328_SPI_MASK 34 47 #define BCM6328_RESET_ENET 0 35 48 #define BCM6328_RESET_USBH SOFTRESET_6328_USBH_MASK ··· 130 117 /* 131 118 * core reset bits 132 119 */ 120 + static const u32 bcm3368_reset_bits[] = { 121 + __GEN_RESET_BITS_TABLE(3368) 122 + }; 123 + 133 124 static const u32 bcm6328_reset_bits[] = { 134 125 __GEN_RESET_BITS_TABLE(6328) 135 126 }; ··· 163 146 164 147 static int __init bcm63xx_reset_bits_init(void) 165 148 { 166 - if (BCMCPU_IS_6328()) { 149 + if (BCMCPU_IS_3368()) { 150 + reset_reg = PERF_SOFTRESET_6358_REG; 151 + bcm63xx_reset_bits = bcm3368_reset_bits; 152 + } else if (BCMCPU_IS_6328()) { 167 153 reset_reg = PERF_SOFTRESET_6328_REG; 168 154 bcm63xx_reset_bits = bcm6328_reset_bits; 169 155 } else if (BCMCPU_IS_6338()) { ··· 189 169 return 0; 190 170 } 191 171 #else 172 + 173 + #ifdef CONFIG_BCM63XX_CPU_3368 174 + static const u32 bcm63xx_reset_bits[] = { 175 + __GEN_RESET_BITS_TABLE(3368) 176 + }; 177 + #define reset_reg PERF_SOFTRESET_6358_REG 178 + #endif 192 179 193 180 #ifdef CONFIG_BCM63XX_CPU_6328 194 181 static const u32 bcm63xx_reset_bits[] = {
+3
arch/mips/bcm63xx/setup.c
··· 68 68 69 69 /* mask and clear all external irq */ 70 70 switch (bcm63xx_get_cpu_id()) { 71 + case BCM3368_CPU_ID: 72 + perf_regs[0] = PERF_EXTIRQ_CFG_REG_3368; 73 + break; 71 74 case BCM6328_CPU_ID: 72 75 perf_regs[0] = PERF_EXTIRQ_CFG_REG_6328; 73 76 break;
+110
arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
··· 9 9 * compile time if only one CPU support is enabled (idea stolen from 10 10 * arm mach-types) 11 11 */ 12 + #define BCM3368_CPU_ID 0x3368 12 13 #define BCM6328_CPU_ID 0x6328 13 14 #define BCM6338_CPU_ID 0x6338 14 15 #define BCM6345_CPU_ID 0x6345 ··· 22 21 u16 __bcm63xx_get_cpu_id(void); 23 22 u8 bcm63xx_get_cpu_rev(void); 24 23 unsigned int bcm63xx_get_cpu_freq(void); 24 + 25 + #ifdef CONFIG_BCM63XX_CPU_3368 26 + # ifdef bcm63xx_get_cpu_id 27 + # undef bcm63xx_get_cpu_id 28 + # define bcm63xx_get_cpu_id() __bcm63xx_get_cpu_id() 29 + # define BCMCPU_RUNTIME_DETECT 30 + # else 31 + # define bcm63xx_get_cpu_id() BCM3368_CPU_ID 32 + # endif 33 + # define BCMCPU_IS_3368() (bcm63xx_get_cpu_id() == BCM3368_CPU_ID) 34 + #else 35 + # define BCMCPU_IS_3368() (0) 36 + #endif 25 37 26 38 #ifdef CONFIG_BCM63XX_CPU_6328 27 39 # ifdef bcm63xx_get_cpu_id ··· 203 189 #define RSET_XTMDMAC_SIZE(chans) (16 * (chans)) 204 190 #define RSET_XTMDMAS_SIZE(chans) (16 * (chans)) 205 191 #define RSET_RNG_SIZE 20 192 + 193 + /* 194 + * 3368 register sets base address 195 + */ 196 + #define BCM_3368_DSL_LMEM_BASE (0xdeadbeef) 197 + #define BCM_3368_PERF_BASE (0xfff8c000) 198 + #define BCM_3368_TIMER_BASE (0xfff8c040) 199 + #define BCM_3368_WDT_BASE (0xfff8c080) 200 + #define BCM_3368_UART0_BASE (0xfff8c100) 201 + #define BCM_3368_UART1_BASE (0xfff8c120) 202 + #define BCM_3368_GPIO_BASE (0xfff8c080) 203 + #define BCM_3368_SPI_BASE (0xfff8c800) 204 + #define BCM_3368_HSSPI_BASE (0xdeadbeef) 205 + #define BCM_3368_UDC0_BASE (0xdeadbeef) 206 + #define BCM_3368_USBDMA_BASE (0xdeadbeef) 207 + #define BCM_3368_OHCI0_BASE (0xdeadbeef) 208 + #define BCM_3368_OHCI_PRIV_BASE (0xdeadbeef) 209 + #define BCM_3368_USBH_PRIV_BASE (0xdeadbeef) 210 + #define BCM_3368_USBD_BASE (0xdeadbeef) 211 + #define BCM_3368_MPI_BASE (0xfff80000) 212 + #define BCM_3368_PCMCIA_BASE (0xfff80054) 213 + #define BCM_3368_PCIE_BASE (0xdeadbeef) 214 + #define BCM_3368_SDRAM_REGS_BASE (0xdeadbeef) 215 + #define BCM_3368_DSL_BASE (0xdeadbeef) 216 + #define BCM_3368_UBUS_BASE (0xdeadbeef) 217 + #define BCM_3368_ENET0_BASE (0xfff98000) 218 + #define BCM_3368_ENET1_BASE (0xfff98800) 219 + #define BCM_3368_ENETDMA_BASE (0xfff99800) 220 + #define BCM_3368_ENETDMAC_BASE (0xfff99900) 221 + #define BCM_3368_ENETDMAS_BASE (0xfff99a00) 222 + #define BCM_3368_ENETSW_BASE (0xdeadbeef) 223 + #define BCM_3368_EHCI0_BASE (0xdeadbeef) 224 + #define BCM_3368_SDRAM_BASE (0xdeadbeef) 225 + #define BCM_3368_MEMC_BASE (0xfff84000) 226 + #define BCM_3368_DDR_BASE (0xdeadbeef) 227 + #define BCM_3368_M2M_BASE (0xdeadbeef) 228 + #define BCM_3368_ATM_BASE (0xdeadbeef) 229 + #define BCM_3368_XTM_BASE (0xdeadbeef) 230 + #define BCM_3368_XTMDMA_BASE (0xdeadbeef) 231 + #define BCM_3368_XTMDMAC_BASE (0xdeadbeef) 232 + #define BCM_3368_XTMDMAS_BASE (0xdeadbeef) 233 + #define BCM_3368_PCM_BASE (0xfff9c200) 234 + #define BCM_3368_PCMDMA_BASE (0xdeadbeef) 235 + #define BCM_3368_PCMDMAC_BASE (0xdeadbeef) 236 + #define BCM_3368_PCMDMAS_BASE (0xdeadbeef) 237 + #define BCM_3368_RNG_BASE (0xdeadbeef) 238 + #define BCM_3368_MISC_BASE (0xdeadbeef) 206 239 207 240 /* 208 241 * 6328 register sets base address ··· 681 620 #ifdef BCMCPU_RUNTIME_DETECT 682 621 return bcm63xx_regs_base[set]; 683 622 #else 623 + #ifdef CONFIG_BCM63XX_CPU_3368 624 + __GEN_RSET(3368) 625 + #endif 684 626 #ifdef CONFIG_BCM63XX_CPU_6328 685 627 __GEN_RSET(6328) 686 628 #endif ··· 749 685 IRQ_XTM, 750 686 IRQ_XTM_DMA0, 751 687 }; 688 + 689 + /* 690 + * 3368 irqs 691 + */ 692 + #define BCM_3368_TIMER_IRQ (IRQ_INTERNAL_BASE + 0) 693 + #define BCM_3368_SPI_IRQ (IRQ_INTERNAL_BASE + 1) 694 + #define BCM_3368_UART0_IRQ (IRQ_INTERNAL_BASE + 2) 695 + #define BCM_3368_UART1_IRQ (IRQ_INTERNAL_BASE + 3) 696 + #define BCM_3368_DSL_IRQ 0 697 + #define BCM_3368_UDC0_IRQ 0 698 + #define BCM_3368_OHCI0_IRQ 0 699 + #define BCM_3368_ENET0_IRQ (IRQ_INTERNAL_BASE + 8) 700 + #define BCM_3368_ENET1_IRQ (IRQ_INTERNAL_BASE + 6) 701 + #define BCM_3368_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9) 702 + #define BCM_3368_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15) 703 + #define BCM_3368_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16) 704 + #define BCM_3368_HSSPI_IRQ 0 705 + #define BCM_3368_EHCI0_IRQ 0 706 + #define BCM_3368_USBD_IRQ 0 707 + #define BCM_3368_USBD_RXDMA0_IRQ 0 708 + #define BCM_3368_USBD_TXDMA0_IRQ 0 709 + #define BCM_3368_USBD_RXDMA1_IRQ 0 710 + #define BCM_3368_USBD_TXDMA1_IRQ 0 711 + #define BCM_3368_USBD_RXDMA2_IRQ 0 712 + #define BCM_3368_USBD_TXDMA2_IRQ 0 713 + #define BCM_3368_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 17) 714 + #define BCM_3368_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 18) 715 + #define BCM_3368_PCI_IRQ (IRQ_INTERNAL_BASE + 31) 716 + #define BCM_3368_PCMCIA_IRQ 0 717 + #define BCM_3368_ATM_IRQ 0 718 + #define BCM_3368_ENETSW_RXDMA0_IRQ 0 719 + #define BCM_3368_ENETSW_RXDMA1_IRQ 0 720 + #define BCM_3368_ENETSW_RXDMA2_IRQ 0 721 + #define BCM_3368_ENETSW_RXDMA3_IRQ 0 722 + #define BCM_3368_ENETSW_TXDMA0_IRQ 0 723 + #define BCM_3368_ENETSW_TXDMA1_IRQ 0 724 + #define BCM_3368_ENETSW_TXDMA2_IRQ 0 725 + #define BCM_3368_ENETSW_TXDMA3_IRQ 0 726 + #define BCM_3368_XTM_IRQ 0 727 + #define BCM_3368_XTM_DMA0_IRQ 0 728 + 729 + #define BCM_3368_EXT_IRQ0 (IRQ_INTERNAL_BASE + 25) 730 + #define BCM_3368_EXT_IRQ1 (IRQ_INTERNAL_BASE + 26) 731 + #define BCM_3368_EXT_IRQ2 (IRQ_INTERNAL_BASE + 27) 732 + #define BCM_3368_EXT_IRQ3 (IRQ_INTERNAL_BASE + 28) 733 + 752 734 753 735 /* 754 736 * 6328 irqs
+1
arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h
··· 11 11 switch (bcm63xx_get_cpu_id()) { 12 12 case BCM6328_CPU_ID: 13 13 return 32; 14 + case BCM3368_CPU_ID: 14 15 case BCM6358_CPU_ID: 15 16 return 40; 16 17 case BCM6338_CPU_ID:
+44 -1
arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
··· 15 15 /* Clock Control register */ 16 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 51 #define CKCTL_6328_PHYMIPS_EN (1 << 0) 19 52 #define CKCTL_6328_ADSL_QPROC_EN (1 << 1) 20 53 #define CKCTL_6328_ADSL_AFE_EN (1 << 2) ··· 214 181 #define SYS_PLL_SOFT_RESET 0x1 215 182 216 183 /* Interrupt Mask register */ 184 + #define PERF_IRQMASK_3368_REG 0xc 217 185 #define PERF_IRQMASK_6328_REG 0x20 218 186 #define PERF_IRQMASK_6338_REG 0xc 219 187 #define PERF_IRQMASK_6345_REG 0xc ··· 224 190 #define PERF_IRQMASK_6368_REG 0x20 225 191 226 192 /* Interrupt Status register */ 193 + #define PERF_IRQSTAT_3368_REG 0x10 227 194 #define PERF_IRQSTAT_6328_REG 0x28 228 195 #define PERF_IRQSTAT_6338_REG 0x10 229 196 #define PERF_IRQSTAT_6345_REG 0x10 ··· 234 199 #define PERF_IRQSTAT_6368_REG 0x28 235 200 236 201 /* External Interrupt Configuration register */ 202 + #define PERF_EXTIRQ_CFG_REG_3368 0x14 237 203 #define PERF_EXTIRQ_CFG_REG_6328 0x18 238 204 #define PERF_EXTIRQ_CFG_REG_6338 0x14 239 205 #define PERF_EXTIRQ_CFG_REG_6345 0x14 ··· 271 235 #define PERF_SOFTRESET_6358_REG 0x34 272 236 #define PERF_SOFTRESET_6362_REG 0x10 273 237 #define PERF_SOFTRESET_6368_REG 0x10 238 + 239 + #define SOFTRESET_3368_SPI_MASK (1 << 0) 240 + #define SOFTRESET_3368_ENET_MASK (1 << 2) 241 + #define SOFTRESET_3368_MPI_MASK (1 << 3) 242 + #define SOFTRESET_3368_EPHY_MASK (1 << 6) 243 + #define SOFTRESET_3368_USBS_MASK (1 << 11) 244 + #define SOFTRESET_3368_PCM_MASK (1 << 13) 274 245 275 246 #define SOFTRESET_6328_SPI_MASK (1 << 0) 276 247 #define SOFTRESET_6328_EPHY_MASK (1 << 1) ··· 1336 1293 #define SPI_6348_RX_DATA 0x80 1337 1294 #define SPI_6348_RX_DATA_SIZE 0x3f 1338 1295 1339 - /* BCM 6358/6262/6368 SPI core */ 1296 + /* BCM 3368/6358/6262/6368 SPI core */ 1340 1297 #define SPI_6358_MSG_CTL 0x00 /* 16-bits register */ 1341 1298 #define SPI_6358_MSG_CTL_WIDTH 16 1342 1299 #define SPI_6358_MSG_DATA 0x02
+4
arch/mips/include/asm/mach-bcm63xx/ioremap.h
··· 11 11 static inline int is_bcm63xx_internal_registers(phys_t offset) 12 12 { 13 13 switch (bcm63xx_get_cpu_id()) { 14 + case BCM3368_CPU_ID: 15 + if (offset >= 0xfff80000) 16 + return 1; 17 + break; 14 18 case BCM6338_CPU_ID: 15 19 case BCM6345_CPU_ID: 16 20 case BCM6348_CPU_ID:
+2 -1
arch/mips/pci/pci-bcm63xx.c
··· 266 266 /* setup PCI to local bus access, used by PCI device to target 267 267 * local RAM while bus mastering */ 268 268 bcm63xx_int_cfg_writel(0, PCI_BASE_ADDRESS_3); 269 - if (BCMCPU_IS_6358() || BCMCPU_IS_6368()) 269 + if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6368()) 270 270 val = MPI_SP0_REMAP_ENABLE_MASK; 271 271 else 272 272 val = 0; ··· 338 338 case BCM6328_CPU_ID: 339 339 case BCM6362_CPU_ID: 340 340 return bcm63xx_register_pcie(); 341 + case BCM3368_CPU_ID: 341 342 case BCM6348_CPU_ID: 342 343 case BCM6358_CPU_ID: 343 344 case BCM6368_CPU_ID: