aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mach-bcm63xx
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 17:52:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-13 17:52:21 -0400
commitd1447464789918db1e1a3d0aaf50d3d0f6487a4f (patch)
tree490bd5c493cdba742dc90d3731962226838e5f33 /arch/mips/include/asm/mach-bcm63xx
parent833e68340d108d88f4cb79b7d7223f6859d362ca (diff)
parent6ac5310e649df5fcd240d764503bf16a1317ea39 (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "MIPS updates: - All the things that didn't make 3.10. - Removes the Windriver PPMC platform. Nobody will miss it. - Remove a workaround from kernel/irq/irqdomain.c which was there exclusivly for MIPS. Patch by Grant Likely. - More small improvments for the SEAD 3 platform - Improvments on the BMIPS / SMP support for the BCM63xx series. - Various cleanups of dead leftovers. - Platform support for the Cavium Octeon-based EdgeRouter Lite. Two large KVM patchsets didn't make it for this pull request because their respective authors are vacationing" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (124 commits) MIPS: Kconfig: Add missing MODULES dependency to VPE_LOADER MIPS: BCM63xx: CLK: Add dummy clk_{set,round}_rate() functions MIPS: SEAD3: Disable L2 cache on SEAD-3. MIPS: BCM63xx: Enable second core SMP on BCM6328 if available MIPS: BCM63xx: Add SMP support to prom.c MIPS: define write{b,w,l,q}_relaxed MIPS: Expose missing pci_io{map,unmap} declarations MIPS: Malta: Update GCMP detection. Revert "MIPS: make CAC_ADDR and UNCAC_ADDR account for PHYS_OFFSET" MIPS: APSP: Remove <asm/kspd.h> SSB: Kconfig: Amend SSB_EMBEDDED dependencies MIPS: microMIPS: Fix improper definition of ISA exception bit. MIPS: Don't try to decode microMIPS branch instructions where they cannot exist. MIPS: Declare emulate_load_store_microMIPS as a static function. MIPS: Fix typos and cleanup comment MIPS: Cleanup indentation and whitespace MIPS: BMIPS: support booting from physical CPU other than 0 MIPS: Only set cpu_has_mmips if SYS_SUPPORTS_MICROMIPS MIPS: GIC: Fix gic_set_affinity infinite loop MIPS: Don't save/restore OCTEON wide multiplier state on syscalls. ...
Diffstat (limited to 'arch/mips/include/asm/mach-bcm63xx')
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h112
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_gpio.h1
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h52
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h6
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/ioremap.h4
5 files changed, 174 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 e6e65dc7d502..19f9134bfe2f 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
@@ -194,6 +208,53 @@ enum bcm63xx_regs_set {
194#define RSET_RNG_SIZE 20 208#define RSET_RNG_SIZE 20
195 209
196/* 210/*
211 * 3368 register sets base address
212 */
213#define BCM_3368_DSL_LMEM_BASE (0xdeadbeef)
214#define BCM_3368_PERF_BASE (0xfff8c000)
215#define BCM_3368_TIMER_BASE (0xfff8c040)
216#define BCM_3368_WDT_BASE (0xfff8c080)
217#define BCM_3368_UART0_BASE (0xfff8c100)
218#define BCM_3368_UART1_BASE (0xfff8c120)
219#define BCM_3368_GPIO_BASE (0xfff8c080)
220#define BCM_3368_SPI_BASE (0xfff8c800)
221#define BCM_3368_HSSPI_BASE (0xdeadbeef)
222#define BCM_3368_UDC0_BASE (0xdeadbeef)
223#define BCM_3368_USBDMA_BASE (0xdeadbeef)
224#define BCM_3368_OHCI0_BASE (0xdeadbeef)
225#define BCM_3368_OHCI_PRIV_BASE (0xdeadbeef)
226#define BCM_3368_USBH_PRIV_BASE (0xdeadbeef)
227#define BCM_3368_USBD_BASE (0xdeadbeef)
228#define BCM_3368_MPI_BASE (0xfff80000)
229#define BCM_3368_PCMCIA_BASE (0xfff80054)
230#define BCM_3368_PCIE_BASE (0xdeadbeef)
231#define BCM_3368_SDRAM_REGS_BASE (0xdeadbeef)
232#define BCM_3368_DSL_BASE (0xdeadbeef)
233#define BCM_3368_UBUS_BASE (0xdeadbeef)
234#define BCM_3368_ENET0_BASE (0xfff98000)
235#define BCM_3368_ENET1_BASE (0xfff98800)
236#define BCM_3368_ENETDMA_BASE (0xfff99800)
237#define BCM_3368_ENETDMAC_BASE (0xfff99900)
238#define BCM_3368_ENETDMAS_BASE (0xfff99a00)
239#define BCM_3368_ENETSW_BASE (0xdeadbeef)
240#define BCM_3368_EHCI0_BASE (0xdeadbeef)
241#define BCM_3368_SDRAM_BASE (0xdeadbeef)
242#define BCM_3368_MEMC_BASE (0xfff84000)
243#define BCM_3368_DDR_BASE (0xdeadbeef)
244#define BCM_3368_M2M_BASE (0xdeadbeef)
245#define BCM_3368_ATM_BASE (0xdeadbeef)
246#define BCM_3368_XTM_BASE (0xdeadbeef)
247#define BCM_3368_XTMDMA_BASE (0xdeadbeef)
248#define BCM_3368_XTMDMAC_BASE (0xdeadbeef)
249#define BCM_3368_XTMDMAS_BASE (0xdeadbeef)
250#define BCM_3368_PCM_BASE (0xfff9c200)
251#define BCM_3368_PCMDMA_BASE (0xdeadbeef)
252#define BCM_3368_PCMDMAC_BASE (0xdeadbeef)
253#define BCM_3368_PCMDMAS_BASE (0xdeadbeef)
254#define BCM_3368_RNG_BASE (0xdeadbeef)
255#define BCM_3368_MISC_BASE (0xdeadbeef)
256
257/*
197 * 6328 register sets base address 258 * 6328 register sets base address
198 */ 259 */
199#define BCM_6328_DSL_LMEM_BASE (0xdeadbeef) 260#define BCM_6328_DSL_LMEM_BASE (0xdeadbeef)
@@ -238,6 +299,8 @@ enum bcm63xx_regs_set {
238#define BCM_6328_PCMDMAS_BASE (0xdeadbeef) 299#define BCM_6328_PCMDMAS_BASE (0xdeadbeef)
239#define BCM_6328_RNG_BASE (0xdeadbeef) 300#define BCM_6328_RNG_BASE (0xdeadbeef)
240#define BCM_6328_MISC_BASE (0xb0001800) 301#define BCM_6328_MISC_BASE (0xb0001800)
302#define BCM_6328_OTP_BASE (0xb0000600)
303
241/* 304/*
242 * 6338 register sets base address 305 * 6338 register sets base address
243 */ 306 */
@@ -623,6 +686,9 @@ static inline unsigned long bcm63xx_regset_address(enum bcm63xx_regs_set set)
623#ifdef BCMCPU_RUNTIME_DETECT 686#ifdef BCMCPU_RUNTIME_DETECT
624 return bcm63xx_regs_base[set]; 687 return bcm63xx_regs_base[set];
625#else 688#else
689#ifdef CONFIG_BCM63XX_CPU_3368
690 __GEN_RSET(3368)
691#endif
626#ifdef CONFIG_BCM63XX_CPU_6328 692#ifdef CONFIG_BCM63XX_CPU_6328
627 __GEN_RSET(6328) 693 __GEN_RSET(6328)
628#endif 694#endif
@@ -690,6 +756,52 @@ enum bcm63xx_irq {
690}; 756};
691 757
692/* 758/*
759 * 3368 irqs
760 */
761#define BCM_3368_TIMER_IRQ (IRQ_INTERNAL_BASE + 0)
762#define BCM_3368_SPI_IRQ (IRQ_INTERNAL_BASE + 1)
763#define BCM_3368_UART0_IRQ (IRQ_INTERNAL_BASE + 2)
764#define BCM_3368_UART1_IRQ (IRQ_INTERNAL_BASE + 3)
765#define BCM_3368_DSL_IRQ 0
766#define BCM_3368_UDC0_IRQ 0
767#define BCM_3368_OHCI0_IRQ 0
768#define BCM_3368_ENET0_IRQ (IRQ_INTERNAL_BASE + 8)
769#define BCM_3368_ENET1_IRQ (IRQ_INTERNAL_BASE + 6)
770#define BCM_3368_ENET_PHY_IRQ (IRQ_INTERNAL_BASE + 9)
771#define BCM_3368_ENET0_RXDMA_IRQ (IRQ_INTERNAL_BASE + 15)
772#define BCM_3368_ENET0_TXDMA_IRQ (IRQ_INTERNAL_BASE + 16)
773#define BCM_3368_HSSPI_IRQ 0
774#define BCM_3368_EHCI0_IRQ 0
775#define BCM_3368_USBD_IRQ 0
776#define BCM_3368_USBD_RXDMA0_IRQ 0
777#define BCM_3368_USBD_TXDMA0_IRQ 0
778#define BCM_3368_USBD_RXDMA1_IRQ 0
779#define BCM_3368_USBD_TXDMA1_IRQ 0
780#define BCM_3368_USBD_RXDMA2_IRQ 0
781#define BCM_3368_USBD_TXDMA2_IRQ 0
782#define BCM_3368_ENET1_RXDMA_IRQ (IRQ_INTERNAL_BASE + 17)
783#define BCM_3368_ENET1_TXDMA_IRQ (IRQ_INTERNAL_BASE + 18)
784#define BCM_3368_PCI_IRQ (IRQ_INTERNAL_BASE + 31)
785#define BCM_3368_PCMCIA_IRQ 0
786#define BCM_3368_ATM_IRQ 0
787#define BCM_3368_ENETSW_RXDMA0_IRQ 0
788#define BCM_3368_ENETSW_RXDMA1_IRQ 0
789#define BCM_3368_ENETSW_RXDMA2_IRQ 0
790#define BCM_3368_ENETSW_RXDMA3_IRQ 0
791#define BCM_3368_ENETSW_TXDMA0_IRQ 0
792#define BCM_3368_ENETSW_TXDMA1_IRQ 0
793#define BCM_3368_ENETSW_TXDMA2_IRQ 0
794#define BCM_3368_ENETSW_TXDMA3_IRQ 0
795#define BCM_3368_XTM_IRQ 0
796#define BCM_3368_XTM_DMA0_IRQ 0
797
798#define BCM_3368_EXT_IRQ0 (IRQ_INTERNAL_BASE + 25)
799#define BCM_3368_EXT_IRQ1 (IRQ_INTERNAL_BASE + 26)
800#define BCM_3368_EXT_IRQ2 (IRQ_INTERNAL_BASE + 27)
801#define BCM_3368_EXT_IRQ3 (IRQ_INTERNAL_BASE + 28)
802
803
804/*
693 * 6328 irqs 805 * 6328 irqs
694 */ 806 */
695#define BCM_6328_HIGH_IRQ_BASE (IRQ_INTERNAL_BASE + 32) 807#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 eff7ca7d12b0..9875db31d883 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)
@@ -1370,7 +1413,7 @@
1370#define SPI_6348_RX_DATA 0x80 1413#define SPI_6348_RX_DATA 0x80
1371#define SPI_6348_RX_DATA_SIZE 0x3f 1414#define SPI_6348_RX_DATA_SIZE 0x3f
1372 1415
1373/* BCM 6358/6262/6368 SPI core */ 1416/* BCM 3368/6358/6262/6368 SPI core */
1374#define SPI_6358_MSG_CTL 0x00 /* 16-bits register */ 1417#define SPI_6358_MSG_CTL 0x00 /* 16-bits register */
1375#define SPI_6358_MSG_CTL_WIDTH 16 1418#define SPI_6358_MSG_CTL_WIDTH 16
1376#define SPI_6358_MSG_DATA 0x02 1419#define SPI_6358_MSG_DATA 0x02
@@ -1511,4 +1554,11 @@
1511 1554
1512#define PCIE_DEVICE_OFFSET 0x8000 1555#define PCIE_DEVICE_OFFSET 0x8000
1513 1556
1557/*************************************************************************
1558 * _REG relative to RSET_OTP
1559 *************************************************************************/
1560
1561#define OTP_USER_BITS_6328_REG(i) (0x20 + (i) * 4)
1562#define OTP_6328_REG3_TP1_DISABLED BIT(9)
1563
1514#endif /* BCM63XX_REGS_H_ */ 1564#endif /* BCM63XX_REGS_H_ */
diff --git a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
index d9aee1a833f3..b86a0efba665 100644
--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
+++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h
@@ -47,6 +47,12 @@ struct board_info {
47 47
48 /* GPIO LEDs */ 48 /* GPIO LEDs */
49 struct gpio_led leds[5]; 49 struct gpio_led leds[5];
50
51 /* External PHY reset GPIO */
52 unsigned int ephy_reset_gpio;
53
54 /* External PHY reset GPIO flags from gpio.h */
55 unsigned long ephy_reset_gpio_flags;
50}; 56};
51 57
52#endif /* ! BOARD_BCM963XX_H_ */ 58#endif /* ! BOARD_BCM963XX_H_ */
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: