aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/include/asm/mach-bcm63xx
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2012-07-24 10:33:13 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-07-24 10:33:13 -0400
commit19c860d932de520017c9b2d88cd9dff90b71ba36 (patch)
tree2feb7f7cb1c91f5bdd6ce761ff4e421814237274 /arch/mips/include/asm/mach-bcm63xx
parent76f42fe8117c85fced0135b23835890cfa41a47b (diff)
MIPS: BCM63XX: Add PCIe Support for BCM6328
Add support for the PCIe port found on BCM6328. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Cc: linux-mips@linux-mips.org Cc: Maxime Bizon <mbizon@freebox.fr> Cc: Florian Fainelli <florian@openwrt.org> Cc: Kevin Cernekee <cernekee@gmail.com> Patchwork: https://patchwork.linux-mips.org/patch/3956/ Reviewed-by: Florian Fainelli <florian@openwrt.org> 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.h9
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h6
-rw-r--r--arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h54
3 files changed, 69 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
index b842b6d2ba5e..e104ddb694a8 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
@@ -122,6 +122,7 @@ enum bcm63xx_regs_set {
122 RSET_USBH_PRIV, 122 RSET_USBH_PRIV,
123 RSET_MPI, 123 RSET_MPI,
124 RSET_PCMCIA, 124 RSET_PCMCIA,
125 RSET_PCIE,
125 RSET_DSL, 126 RSET_DSL,
126 RSET_ENET0, 127 RSET_ENET0,
127 RSET_ENET1, 128 RSET_ENET1,
@@ -188,6 +189,7 @@ enum bcm63xx_regs_set {
188#define BCM_6328_USBH_PRIV_BASE (0xdeadbeef) 189#define BCM_6328_USBH_PRIV_BASE (0xdeadbeef)
189#define BCM_6328_MPI_BASE (0xdeadbeef) 190#define BCM_6328_MPI_BASE (0xdeadbeef)
190#define BCM_6328_PCMCIA_BASE (0xdeadbeef) 191#define BCM_6328_PCMCIA_BASE (0xdeadbeef)
192#define BCM_6328_PCIE_BASE (0xb0e40000)
191#define BCM_6328_SDRAM_REGS_BASE (0xdeadbeef) 193#define BCM_6328_SDRAM_REGS_BASE (0xdeadbeef)
192#define BCM_6328_DSL_BASE (0xb0001900) 194#define BCM_6328_DSL_BASE (0xb0001900)
193#define BCM_6328_UBUS_BASE (0xdeadbeef) 195#define BCM_6328_UBUS_BASE (0xdeadbeef)
@@ -232,6 +234,7 @@ enum bcm63xx_regs_set {
232#define BCM_6338_USBH_PRIV_BASE (0xdeadbeef) 234#define BCM_6338_USBH_PRIV_BASE (0xdeadbeef)
233#define BCM_6338_MPI_BASE (0xfffe3160) 235#define BCM_6338_MPI_BASE (0xfffe3160)
234#define BCM_6338_PCMCIA_BASE (0xdeadbeef) 236#define BCM_6338_PCMCIA_BASE (0xdeadbeef)
237#define BCM_6338_PCIE_BASE (0xdeadbeef)
235#define BCM_6338_SDRAM_REGS_BASE (0xfffe3100) 238#define BCM_6338_SDRAM_REGS_BASE (0xfffe3100)
236#define BCM_6338_DSL_BASE (0xfffe1000) 239#define BCM_6338_DSL_BASE (0xfffe1000)
237#define BCM_6338_UBUS_BASE (0xdeadbeef) 240#define BCM_6338_UBUS_BASE (0xdeadbeef)
@@ -279,6 +282,7 @@ enum bcm63xx_regs_set {
279#define BCM_6345_ENETSW_BASE (0xdeadbeef) 282#define BCM_6345_ENETSW_BASE (0xdeadbeef)
280#define BCM_6345_PCMCIA_BASE (0xfffe2028) 283#define BCM_6345_PCMCIA_BASE (0xfffe2028)
281#define BCM_6345_MPI_BASE (0xfffe2000) 284#define BCM_6345_MPI_BASE (0xfffe2000)
285#define BCM_6345_PCIE_BASE (0xdeadbeef)
282#define BCM_6345_OHCI0_BASE (0xfffe2100) 286#define BCM_6345_OHCI0_BASE (0xfffe2100)
283#define BCM_6345_OHCI_PRIV_BASE (0xfffe2200) 287#define BCM_6345_OHCI_PRIV_BASE (0xfffe2200)
284#define BCM_6345_USBH_PRIV_BASE (0xdeadbeef) 288#define BCM_6345_USBH_PRIV_BASE (0xdeadbeef)
@@ -320,6 +324,7 @@ enum bcm63xx_regs_set {
320#define BCM_6348_USBH_PRIV_BASE (0xdeadbeef) 324#define BCM_6348_USBH_PRIV_BASE (0xdeadbeef)
321#define BCM_6348_MPI_BASE (0xfffe2000) 325#define BCM_6348_MPI_BASE (0xfffe2000)
322#define BCM_6348_PCMCIA_BASE (0xfffe2054) 326#define BCM_6348_PCMCIA_BASE (0xfffe2054)
327#define BCM_6348_PCIE_BASE (0xdeadbeef)
323#define BCM_6348_SDRAM_REGS_BASE (0xfffe2300) 328#define BCM_6348_SDRAM_REGS_BASE (0xfffe2300)
324#define BCM_6348_M2M_BASE (0xfffe2800) 329#define BCM_6348_M2M_BASE (0xfffe2800)
325#define BCM_6348_DSL_BASE (0xfffe3000) 330#define BCM_6348_DSL_BASE (0xfffe3000)
@@ -362,6 +367,7 @@ enum bcm63xx_regs_set {
362#define BCM_6358_USBH_PRIV_BASE (0xfffe1500) 367#define BCM_6358_USBH_PRIV_BASE (0xfffe1500)
363#define BCM_6358_MPI_BASE (0xfffe1000) 368#define BCM_6358_MPI_BASE (0xfffe1000)
364#define BCM_6358_PCMCIA_BASE (0xfffe1054) 369#define BCM_6358_PCMCIA_BASE (0xfffe1054)
370#define BCM_6358_PCIE_BASE (0xdeadbeef)
365#define BCM_6358_SDRAM_REGS_BASE (0xfffe2300) 371#define BCM_6358_SDRAM_REGS_BASE (0xfffe2300)
366#define BCM_6358_M2M_BASE (0xdeadbeef) 372#define BCM_6358_M2M_BASE (0xdeadbeef)
367#define BCM_6358_DSL_BASE (0xfffe3000) 373#define BCM_6358_DSL_BASE (0xfffe3000)
@@ -405,6 +411,7 @@ enum bcm63xx_regs_set {
405#define BCM_6368_USBH_PRIV_BASE (0xb0001700) 411#define BCM_6368_USBH_PRIV_BASE (0xb0001700)
406#define BCM_6368_MPI_BASE (0xb0001000) 412#define BCM_6368_MPI_BASE (0xb0001000)
407#define BCM_6368_PCMCIA_BASE (0xb0001054) 413#define BCM_6368_PCMCIA_BASE (0xb0001054)
414#define BCM_6368_PCIE_BASE (0xdeadbeef)
408#define BCM_6368_SDRAM_REGS_BASE (0xdeadbeef) 415#define BCM_6368_SDRAM_REGS_BASE (0xdeadbeef)
409#define BCM_6368_M2M_BASE (0xdeadbeef) 416#define BCM_6368_M2M_BASE (0xdeadbeef)
410#define BCM_6368_DSL_BASE (0xdeadbeef) 417#define BCM_6368_DSL_BASE (0xdeadbeef)
@@ -453,6 +460,7 @@ extern const unsigned long *bcm63xx_regs_base;
453 __GEN_RSET_BASE(__cpu, USBH_PRIV) \ 460 __GEN_RSET_BASE(__cpu, USBH_PRIV) \
454 __GEN_RSET_BASE(__cpu, MPI) \ 461 __GEN_RSET_BASE(__cpu, MPI) \
455 __GEN_RSET_BASE(__cpu, PCMCIA) \ 462 __GEN_RSET_BASE(__cpu, PCMCIA) \
463 __GEN_RSET_BASE(__cpu, PCIE) \
456 __GEN_RSET_BASE(__cpu, DSL) \ 464 __GEN_RSET_BASE(__cpu, DSL) \
457 __GEN_RSET_BASE(__cpu, ENET0) \ 465 __GEN_RSET_BASE(__cpu, ENET0) \
458 __GEN_RSET_BASE(__cpu, ENET1) \ 466 __GEN_RSET_BASE(__cpu, ENET1) \
@@ -493,6 +501,7 @@ extern const unsigned long *bcm63xx_regs_base;
493 [RSET_USBH_PRIV] = BCM_## __cpu ##_USBH_PRIV_BASE, \ 501 [RSET_USBH_PRIV] = BCM_## __cpu ##_USBH_PRIV_BASE, \
494 [RSET_MPI] = BCM_## __cpu ##_MPI_BASE, \ 502 [RSET_MPI] = BCM_## __cpu ##_MPI_BASE, \
495 [RSET_PCMCIA] = BCM_## __cpu ##_PCMCIA_BASE, \ 503 [RSET_PCMCIA] = BCM_## __cpu ##_PCMCIA_BASE, \
504 [RSET_PCIE] = BCM_## __cpu ##_PCIE_BASE, \
496 [RSET_DSL] = BCM_## __cpu ##_DSL_BASE, \ 505 [RSET_DSL] = BCM_## __cpu ##_DSL_BASE, \
497 [RSET_ENET0] = BCM_## __cpu ##_ENET0_BASE, \ 506 [RSET_ENET0] = BCM_## __cpu ##_ENET0_BASE, \
498 [RSET_ENET1] = BCM_## __cpu ##_ENET1_BASE, \ 507 [RSET_ENET1] = BCM_## __cpu ##_ENET1_BASE, \
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
index 6dcd8b23592b..9203d90e610c 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h
@@ -40,6 +40,10 @@
40#define BCM_CB_MEM_END_PA (BCM_CB_MEM_BASE_PA + \ 40#define BCM_CB_MEM_END_PA (BCM_CB_MEM_BASE_PA + \
41 BCM_CB_MEM_SIZE - 1) 41 BCM_CB_MEM_SIZE - 1)
42 42
43#define BCM_PCIE_MEM_BASE_PA 0x10f00000
44#define BCM_PCIE_MEM_SIZE (16 * 1024 * 1024)
45#define BCM_PCIE_MEM_END_PA (BCM_PCIE_MEM_BASE_PA + \
46 BCM_PCIE_MEM_SIZE - 1)
43 47
44/* 48/*
45 * Internal registers are accessed through KSEG3 49 * Internal registers are accessed through KSEG3
@@ -85,6 +89,8 @@
85#define bcm_mpi_writel(v, o) bcm_rset_writel(RSET_MPI, (v), (o)) 89#define bcm_mpi_writel(v, o) bcm_rset_writel(RSET_MPI, (v), (o))
86#define bcm_pcmcia_readl(o) bcm_rset_readl(RSET_PCMCIA, (o)) 90#define bcm_pcmcia_readl(o) bcm_rset_readl(RSET_PCMCIA, (o))
87#define bcm_pcmcia_writel(v, o) bcm_rset_writel(RSET_PCMCIA, (v), (o)) 91#define bcm_pcmcia_writel(v, o) bcm_rset_writel(RSET_PCMCIA, (v), (o))
92#define bcm_pcie_readl(o) bcm_rset_readl(RSET_PCIE, (o))
93#define bcm_pcie_writel(v, o) bcm_rset_writel(RSET_PCIE, (v), (o))
88#define bcm_sdram_readl(o) bcm_rset_readl(RSET_SDRAM, (o)) 94#define bcm_sdram_readl(o) bcm_rset_readl(RSET_SDRAM, (o))
89#define bcm_sdram_writel(v, o) bcm_rset_writel(RSET_SDRAM, (v), (o)) 95#define bcm_sdram_writel(v, o) bcm_rset_writel(RSET_SDRAM, (v), (o))
90#define bcm_memc_readl(o) bcm_rset_readl(RSET_MEMC, (o)) 96#define bcm_memc_readl(o) bcm_rset_readl(RSET_MEMC, (o))
diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
index 4fc2ab2c278a..4ccc2a748aff 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
@@ -1162,6 +1162,9 @@
1162/************************************************************************* 1162/*************************************************************************
1163 * _REG relative to RSET_MISC 1163 * _REG relative to RSET_MISC
1164 *************************************************************************/ 1164 *************************************************************************/
1165#define MISC_SERDES_CTRL_REG 0x0
1166#define SERDES_PCIE_EN (1 << 0)
1167#define SERDES_PCIE_EXD_EN (1 << 15)
1165 1168
1166#define MISC_STRAPBUS_6328_REG 0x240 1169#define MISC_STRAPBUS_6328_REG 0x240
1167#define STRAPBUS_6328_FCVO_SHIFT 7 1170#define STRAPBUS_6328_FCVO_SHIFT 7
@@ -1169,4 +1172,55 @@
1169#define STRAPBUS_6328_BOOT_SEL_SERIAL (1 << 28) 1172#define STRAPBUS_6328_BOOT_SEL_SERIAL (1 << 28)
1170#define STRAPBUS_6328_BOOT_SEL_NAND (0 << 28) 1173#define STRAPBUS_6328_BOOT_SEL_NAND (0 << 28)
1171 1174
1175/*************************************************************************
1176 * _REG relative to RSET_PCIE
1177 *************************************************************************/
1178
1179#define PCIE_CONFIG2_REG 0x408
1180#define CONFIG2_BAR1_SIZE_EN 1
1181#define CONFIG2_BAR1_SIZE_MASK 0xf
1182
1183#define PCIE_IDVAL3_REG 0x43c
1184#define IDVAL3_CLASS_CODE_MASK 0xffffff
1185#define IDVAL3_SUBCLASS_SHIFT 8
1186#define IDVAL3_CLASS_SHIFT 16
1187
1188#define PCIE_DLSTATUS_REG 0x1048
1189#define DLSTATUS_PHYLINKUP (1 << 13)
1190
1191#define PCIE_BRIDGE_OPT1_REG 0x2820
1192#define OPT1_RD_BE_OPT_EN (1 << 7)
1193#define OPT1_RD_REPLY_BE_FIX_EN (1 << 9)
1194#define OPT1_PCIE_BRIDGE_HOLE_DET_EN (1 << 11)
1195#define OPT1_L1_INT_STATUS_MASK_POL (1 << 12)
1196
1197#define PCIE_BRIDGE_OPT2_REG 0x2824
1198#define OPT2_UBUS_UR_DECODE_DIS (1 << 2)
1199#define OPT2_TX_CREDIT_CHK_EN (1 << 4)
1200#define OPT2_CFG_TYPE1_BD_SEL (1 << 7)
1201#define OPT2_CFG_TYPE1_BUS_NO_SHIFT 16
1202#define OPT2_CFG_TYPE1_BUS_NO_MASK (0xff << OPT2_CFG_TYPE1_BUS_NO_SHIFT)
1203
1204#define PCIE_BRIDGE_BAR0_BASEMASK_REG 0x2828
1205#define PCIE_BRIDGE_BAR1_BASEMASK_REG 0x2830
1206#define BASEMASK_REMAP_EN (1 << 0)
1207#define BASEMASK_SWAP_EN (1 << 1)
1208#define BASEMASK_MASK_SHIFT 4
1209#define BASEMASK_MASK_MASK (0xfff << BASEMASK_MASK_SHIFT)
1210#define BASEMASK_BASE_SHIFT 20
1211#define BASEMASK_BASE_MASK (0xfff << BASEMASK_BASE_SHIFT)
1212
1213#define PCIE_BRIDGE_BAR0_REBASE_ADDR_REG 0x282c
1214#define PCIE_BRIDGE_BAR1_REBASE_ADDR_REG 0x2834
1215#define REBASE_ADDR_BASE_SHIFT 20
1216#define REBASE_ADDR_BASE_MASK (0xfff << REBASE_ADDR_BASE_SHIFT)
1217
1218#define PCIE_BRIDGE_RC_INT_MASK_REG 0x2854
1219#define PCIE_RC_INT_A (1 << 0)
1220#define PCIE_RC_INT_B (1 << 1)
1221#define PCIE_RC_INT_C (1 << 2)
1222#define PCIE_RC_INT_D (1 << 3)
1223
1224#define PCIE_DEVICE_OFFSET 0x8000
1225
1172#endif /* BCM63XX_REGS_H_ */ 1226#endif /* BCM63XX_REGS_H_ */