aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bcma/bcma.h2
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h16
-rw-r--r--include/linux/bcma/bcma_driver_pci.h125
-rw-r--r--include/linux/bcma/bcma_regs.h27
4 files changed, 169 insertions, 1 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 83c209f39493..b9f65fbee42f 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -136,6 +136,7 @@ struct bcma_device {
136 bool dev_registered; 136 bool dev_registered;
137 137
138 u8 core_index; 138 u8 core_index;
139 u8 core_unit;
139 140
140 u32 addr; 141 u32 addr;
141 u32 wrap; 142 u32 wrap;
@@ -195,6 +196,7 @@ struct bcma_bus {
195 struct list_head cores; 196 struct list_head cores;
196 u8 nr_cores; 197 u8 nr_cores;
197 u8 init_done:1; 198 u8 init_done:1;
199 u8 num;
198 200
199 struct bcma_drv_cc drv_cc; 201 struct bcma_drv_cc drv_cc;
200 struct bcma_drv_pci drv_pci; 202 struct bcma_drv_pci drv_pci;
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index a33086a7530b..e72938b10714 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -181,6 +181,22 @@
181#define BCMA_CC_FLASH_CFG 0x0128 181#define BCMA_CC_FLASH_CFG 0x0128
182#define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */ 182#define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */
183#define BCMA_CC_FLASH_WAITCNT 0x012C 183#define BCMA_CC_FLASH_WAITCNT 0x012C
184#define BCMA_CC_SROM_CONTROL 0x0190
185#define BCMA_CC_SROM_CONTROL_START 0x80000000
186#define BCMA_CC_SROM_CONTROL_BUSY 0x80000000
187#define BCMA_CC_SROM_CONTROL_OPCODE 0x60000000
188#define BCMA_CC_SROM_CONTROL_OP_READ 0x00000000
189#define BCMA_CC_SROM_CONTROL_OP_WRITE 0x20000000
190#define BCMA_CC_SROM_CONTROL_OP_WRDIS 0x40000000
191#define BCMA_CC_SROM_CONTROL_OP_WREN 0x60000000
192#define BCMA_CC_SROM_CONTROL_OTPSEL 0x00000010
193#define BCMA_CC_SROM_CONTROL_LOCK 0x00000008
194#define BCMA_CC_SROM_CONTROL_SIZE_MASK 0x00000006
195#define BCMA_CC_SROM_CONTROL_SIZE_1K 0x00000000
196#define BCMA_CC_SROM_CONTROL_SIZE_4K 0x00000002
197#define BCMA_CC_SROM_CONTROL_SIZE_16K 0x00000004
198#define BCMA_CC_SROM_CONTROL_SIZE_SHIFT 1
199#define BCMA_CC_SROM_CONTROL_PRESENT 0x00000001
184/* 0x1E0 is defined as shared BCMA_CLKCTLST */ 200/* 0x1E0 is defined as shared BCMA_CLKCTLST */
185#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ 201#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */
186#define BCMA_CC_UART0_DATA 0x0300 202#define BCMA_CC_UART0_DATA 0x0300
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 3871b668caf9..46c71e27d31f 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -53,6 +53,35 @@ struct pci_dev;
53#define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000 53#define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000
54#define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */ 54#define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */
55#define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000 55#define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000
56#define BCMA_CORE_PCI_CONFIG_ADDR 0x0120 /* pcie config space access */
57#define BCMA_CORE_PCI_CONFIG_DATA 0x0124 /* pcie config space access */
58#define BCMA_CORE_PCI_MDIO_CONTROL 0x0128 /* controls the mdio access */
59#define BCMA_CORE_PCI_MDIOCTL_DIVISOR_MASK 0x7f /* clock to be used on MDIO */
60#define BCMA_CORE_PCI_MDIOCTL_DIVISOR_VAL 0x2
61#define BCMA_CORE_PCI_MDIOCTL_PREAM_EN 0x80 /* Enable preamble sequnce */
62#define BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE 0x100 /* Tranaction complete */
63#define BCMA_CORE_PCI_MDIO_DATA 0x012c /* Data to the mdio access */
64#define BCMA_CORE_PCI_MDIODATA_MASK 0x0000ffff /* data 2 bytes */
65#define BCMA_CORE_PCI_MDIODATA_TA 0x00020000 /* Turnaround */
66#define BCMA_CORE_PCI_MDIODATA_REGADDR_SHF_OLD 18 /* Regaddr shift (rev < 10) */
67#define BCMA_CORE_PCI_MDIODATA_REGADDR_MASK_OLD 0x003c0000 /* Regaddr Mask (rev < 10) */
68#define BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF_OLD 22 /* Physmedia devaddr shift (rev < 10) */
69#define BCMA_CORE_PCI_MDIODATA_DEVADDR_MASK_OLD 0x0fc00000 /* Physmedia devaddr Mask (rev < 10) */
70#define BCMA_CORE_PCI_MDIODATA_REGADDR_SHF 18 /* Regaddr shift */
71#define BCMA_CORE_PCI_MDIODATA_REGADDR_MASK 0x007c0000 /* Regaddr Mask */
72#define BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF 23 /* Physmedia devaddr shift */
73#define BCMA_CORE_PCI_MDIODATA_DEVADDR_MASK 0x0f800000 /* Physmedia devaddr Mask */
74#define BCMA_CORE_PCI_MDIODATA_WRITE 0x10000000 /* write Transaction */
75#define BCMA_CORE_PCI_MDIODATA_READ 0x20000000 /* Read Transaction */
76#define BCMA_CORE_PCI_MDIODATA_START 0x40000000 /* start of Transaction */
77#define BCMA_CORE_PCI_MDIODATA_DEV_ADDR 0x0 /* dev address for serdes */
78#define BCMA_CORE_PCI_MDIODATA_BLK_ADDR 0x1F /* blk address for serdes */
79#define BCMA_CORE_PCI_MDIODATA_DEV_PLL 0x1d /* SERDES PLL Dev */
80#define BCMA_CORE_PCI_MDIODATA_DEV_TX 0x1e /* SERDES TX Dev */
81#define BCMA_CORE_PCI_MDIODATA_DEV_RX 0x1f /* SERDES RX Dev */
82#define BCMA_CORE_PCI_PCIEIND_ADDR 0x0130 /* indirect access to the internal register */
83#define BCMA_CORE_PCI_PCIEIND_DATA 0x0134 /* Data to/from the internal regsiter */
84#define BCMA_CORE_PCI_CLKREQENCTRL 0x0138 /* >= rev 6, Clkreq rdma control */
56#define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */ 85#define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */
57#define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */ 86#define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */
58#define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */ 87#define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */
@@ -72,20 +101,114 @@ struct pci_dev;
72#define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */ 101#define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */
73#define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */ 102#define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */
74 103
104/* PCIE protocol PHY diagnostic registers */
105#define BCMA_CORE_PCI_PLP_MODEREG 0x200 /* Mode */
106#define BCMA_CORE_PCI_PLP_STATUSREG 0x204 /* Status */
107#define BCMA_CORE_PCI_PLP_POLARITYINV_STAT 0x10 /* Status reg PCIE_PLP_STATUSREG */
108#define BCMA_CORE_PCI_PLP_LTSSMCTRLREG 0x208 /* LTSSM control */
109#define BCMA_CORE_PCI_PLP_LTLINKNUMREG 0x20c /* Link Training Link number */
110#define BCMA_CORE_PCI_PLP_LTLANENUMREG 0x210 /* Link Training Lane number */
111#define BCMA_CORE_PCI_PLP_LTNFTSREG 0x214 /* Link Training N_FTS */
112#define BCMA_CORE_PCI_PLP_ATTNREG 0x218 /* Attention */
113#define BCMA_CORE_PCI_PLP_ATTNMASKREG 0x21C /* Attention Mask */
114#define BCMA_CORE_PCI_PLP_RXERRCTR 0x220 /* Rx Error */
115#define BCMA_CORE_PCI_PLP_RXFRMERRCTR 0x224 /* Rx Framing Error */
116#define BCMA_CORE_PCI_PLP_RXERRTHRESHREG 0x228 /* Rx Error threshold */
117#define BCMA_CORE_PCI_PLP_TESTCTRLREG 0x22C /* Test Control reg */
118#define BCMA_CORE_PCI_PLP_SERDESCTRLOVRDREG 0x230 /* SERDES Control Override */
119#define BCMA_CORE_PCI_PLP_TIMINGOVRDREG 0x234 /* Timing param override */
120#define BCMA_CORE_PCI_PLP_RXTXSMDIAGREG 0x238 /* RXTX State Machine Diag */
121#define BCMA_CORE_PCI_PLP_LTSSMDIAGREG 0x23C /* LTSSM State Machine Diag */
122
123/* PCIE protocol DLLP diagnostic registers */
124#define BCMA_CORE_PCI_DLLP_LCREG 0x100 /* Link Control */
125#define BCMA_CORE_PCI_DLLP_LSREG 0x104 /* Link Status */
126#define BCMA_CORE_PCI_DLLP_LAREG 0x108 /* Link Attention */
127#define BCMA_CORE_PCI_DLLP_LSREG_LINKUP (1 << 16)
128#define BCMA_CORE_PCI_DLLP_LAMASKREG 0x10C /* Link Attention Mask */
129#define BCMA_CORE_PCI_DLLP_NEXTTXSEQNUMREG 0x110 /* Next Tx Seq Num */
130#define BCMA_CORE_PCI_DLLP_ACKEDTXSEQNUMREG 0x114 /* Acked Tx Seq Num */
131#define BCMA_CORE_PCI_DLLP_PURGEDTXSEQNUMREG 0x118 /* Purged Tx Seq Num */
132#define BCMA_CORE_PCI_DLLP_RXSEQNUMREG 0x11C /* Rx Sequence Number */
133#define BCMA_CORE_PCI_DLLP_LRREG 0x120 /* Link Replay */
134#define BCMA_CORE_PCI_DLLP_LACKTOREG 0x124 /* Link Ack Timeout */
135#define BCMA_CORE_PCI_DLLP_PMTHRESHREG 0x128 /* Power Management Threshold */
136#define BCMA_CORE_PCI_DLLP_RTRYWPREG 0x12C /* Retry buffer write ptr */
137#define BCMA_CORE_PCI_DLLP_RTRYRPREG 0x130 /* Retry buffer Read ptr */
138#define BCMA_CORE_PCI_DLLP_RTRYPPREG 0x134 /* Retry buffer Purged ptr */
139#define BCMA_CORE_PCI_DLLP_RTRRWREG 0x138 /* Retry buffer Read/Write */
140#define BCMA_CORE_PCI_DLLP_ECTHRESHREG 0x13C /* Error Count Threshold */
141#define BCMA_CORE_PCI_DLLP_TLPERRCTRREG 0x140 /* TLP Error Counter */
142#define BCMA_CORE_PCI_DLLP_ERRCTRREG 0x144 /* Error Counter */
143#define BCMA_CORE_PCI_DLLP_NAKRXCTRREG 0x148 /* NAK Received Counter */
144#define BCMA_CORE_PCI_DLLP_TESTREG 0x14C /* Test */
145#define BCMA_CORE_PCI_DLLP_PKTBIST 0x150 /* Packet BIST */
146#define BCMA_CORE_PCI_DLLP_PCIE11 0x154 /* DLLP PCIE 1.1 reg */
147
148/* SERDES RX registers */
149#define BCMA_CORE_PCI_SERDES_RX_CTRL 1 /* Rx cntrl */
150#define BCMA_CORE_PCI_SERDES_RX_CTRL_FORCE 0x80 /* rxpolarity_force */
151#define BCMA_CORE_PCI_SERDES_RX_CTRL_POLARITY 0x40 /* rxpolarity_value */
152#define BCMA_CORE_PCI_SERDES_RX_TIMER1 2 /* Rx Timer1 */
153#define BCMA_CORE_PCI_SERDES_RX_CDR 6 /* CDR */
154#define BCMA_CORE_PCI_SERDES_RX_CDRBW 7 /* CDR BW */
155
156/* SERDES PLL registers */
157#define BCMA_CORE_PCI_SERDES_PLL_CTRL 1 /* PLL control reg */
158#define BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN 0x4000 /* bit 14 is FREQDET on */
159
75/* PCIcore specific boardflags */ 160/* PCIcore specific boardflags */
76#define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */ 161#define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */
77 162
163/* PCIE Config space accessing MACROS */
164#define BCMA_CORE_PCI_CFG_BUS_SHIFT 24 /* Bus shift */
165#define BCMA_CORE_PCI_CFG_SLOT_SHIFT 19 /* Slot/Device shift */
166#define BCMA_CORE_PCI_CFG_FUN_SHIFT 16 /* Function shift */
167#define BCMA_CORE_PCI_CFG_OFF_SHIFT 0 /* Register shift */
168
169#define BCMA_CORE_PCI_CFG_BUS_MASK 0xff /* Bus mask */
170#define BCMA_CORE_PCI_CFG_SLOT_MASK 0x1f /* Slot/Device mask */
171#define BCMA_CORE_PCI_CFG_FUN_MASK 7 /* Function mask */
172#define BCMA_CORE_PCI_CFG_OFF_MASK 0xfff /* Register mask */
173
174/* PCIE Root Capability Register bits (Host mode only) */
175#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
176
177struct bcma_drv_pci;
178
179#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
180struct bcma_drv_pci_host {
181 struct bcma_drv_pci *pdev;
182
183 u32 host_cfg_addr;
184 spinlock_t cfgspace_lock;
185
186 struct pci_controller pci_controller;
187 struct pci_ops pci_ops;
188 struct resource mem_resource;
189 struct resource io_resource;
190};
191#endif
192
78struct bcma_drv_pci { 193struct bcma_drv_pci {
79 struct bcma_device *core; 194 struct bcma_device *core;
80 u8 setup_done:1; 195 u8 setup_done:1;
196 u8 hostmode:1;
197
198#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
199 struct bcma_drv_pci_host *host_controller;
200#endif
81}; 201};
82 202
83/* Register access */ 203/* Register access */
84#define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset) 204#define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset)
85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 205#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
86 206
87extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 207extern void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc);
88extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 208extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
89 struct bcma_device *core, bool enable); 209 struct bcma_device *core, bool enable);
90 210
211extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
212extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
213
91#endif /* LINUX_BCMA_DRIVER_PCI_H_ */ 214#endif /* LINUX_BCMA_DRIVER_PCI_H_ */
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index 9faae2ae02e8..5a71d5719640 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -56,4 +56,31 @@
56#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ 56#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */
57#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ 57#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */
58 58
59/* SiliconBackplane Address Map.
60 * All regions may not exist on all chips.
61 */
62#define BCMA_SOC_SDRAM_BASE 0x00000000U /* Physical SDRAM */
63#define BCMA_SOC_PCI_MEM 0x08000000U /* Host Mode sb2pcitranslation0 (64 MB) */
64#define BCMA_SOC_PCI_MEM_SZ (64 * 1024 * 1024)
65#define BCMA_SOC_PCI_CFG 0x0c000000U /* Host Mode sb2pcitranslation1 (64 MB) */
66#define BCMA_SOC_SDRAM_SWAPPED 0x10000000U /* Byteswapped Physical SDRAM */
67#define BCMA_SOC_SDRAM_R2 0x80000000U /* Region 2 for sdram (512 MB) */
68
69
70#define BCMA_SOC_PCI_DMA 0x40000000U /* Client Mode sb2pcitranslation2 (1 GB) */
71#define BCMA_SOC_PCI_DMA2 0x80000000U /* Client Mode sb2pcitranslation2 (1 GB) */
72#define BCMA_SOC_PCI_DMA_SZ 0x40000000U /* Client Mode sb2pcitranslation2 size in bytes */
73#define BCMA_SOC_PCIE_DMA_L32 0x00000000U /* PCIE Client Mode sb2pcitranslation2
74 * (2 ZettaBytes), low 32 bits
75 */
76#define BCMA_SOC_PCIE_DMA_H32 0x80000000U /* PCIE Client Mode sb2pcitranslation2
77 * (2 ZettaBytes), high 32 bits
78 */
79
80#define BCMA_SOC_PCI1_MEM 0x40000000U /* Host Mode sb2pcitranslation0 (64 MB) */
81#define BCMA_SOC_PCI1_CFG 0x44000000U /* Host Mode sb2pcitranslation1 (64 MB) */
82#define BCMA_SOC_PCIE1_DMA_H32 0xc0000000U /* PCIE Client Mode sb2pcitranslation2
83 * (2 ZettaBytes), high 32 bits
84 */
85
59#endif /* LINUX_BCMA_REGS_H_ */ 86#endif /* LINUX_BCMA_REGS_H_ */