aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ssb/ssb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ssb/ssb.h')
-rw-r--r--include/linux/ssb/ssb.h69
1 files changed, 60 insertions, 9 deletions
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 5ae8fa22d331..3d0a9ff24f01 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -27,24 +27,54 @@ struct ssb_sprom {
27 u8 et1mdcport; /* MDIO for enet1 */ 27 u8 et1mdcport; /* MDIO for enet1 */
28 u8 board_rev; /* Board revision number from SPROM. */ 28 u8 board_rev; /* Board revision number from SPROM. */
29 u8 country_code; /* Country Code */ 29 u8 country_code; /* Country Code */
30 u8 ant_available_a; /* A-PHY antenna available bits (up to 4) */ 30 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */
31 u8 ant_available_bg; /* B/G-PHY antenna available bits (up to 4) */ 31 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */
32 u16 pa0b0; 32 u16 pa0b0;
33 u16 pa0b1; 33 u16 pa0b1;
34 u16 pa0b2; 34 u16 pa0b2;
35 u16 pa1b0; 35 u16 pa1b0;
36 u16 pa1b1; 36 u16 pa1b1;
37 u16 pa1b2; 37 u16 pa1b2;
38 u16 pa1lob0;
39 u16 pa1lob1;
40 u16 pa1lob2;
41 u16 pa1hib0;
42 u16 pa1hib1;
43 u16 pa1hib2;
38 u8 gpio0; /* GPIO pin 0 */ 44 u8 gpio0; /* GPIO pin 0 */
39 u8 gpio1; /* GPIO pin 1 */ 45 u8 gpio1; /* GPIO pin 1 */
40 u8 gpio2; /* GPIO pin 2 */ 46 u8 gpio2; /* GPIO pin 2 */
41 u8 gpio3; /* GPIO pin 3 */ 47 u8 gpio3; /* GPIO pin 3 */
42 u16 maxpwr_a; /* A-PHY Amplifier Max Power (in dBm Q5.2) */ 48 u16 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */
43 u16 maxpwr_bg; /* B/G-PHY Amplifier Max Power (in dBm Q5.2) */ 49 u16 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */
50 u16 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */
51 u16 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */
44 u8 itssi_a; /* Idle TSSI Target for A-PHY */ 52 u8 itssi_a; /* Idle TSSI Target for A-PHY */
45 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ 53 u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */
46 u16 boardflags_lo; /* Boardflags (low 16 bits) */ 54 u8 tri2g; /* 2.4GHz TX isolation */
47 u16 boardflags_hi; /* Boardflags (high 16 bits) */ 55 u8 tri5gl; /* 5.2GHz TX isolation */
56 u8 tri5g; /* 5.3GHz TX isolation */
57 u8 tri5gh; /* 5.8GHz TX isolation */
58 u8 rxpo2g; /* 2GHz RX power offset */
59 u8 rxpo5g; /* 5GHz RX power offset */
60 u8 rssisav2g; /* 2GHz RSSI params */
61 u8 rssismc2g;
62 u8 rssismf2g;
63 u8 bxa2g; /* 2GHz BX arch */
64 u8 rssisav5g; /* 5GHz RSSI params */
65 u8 rssismc5g;
66 u8 rssismf5g;
67 u8 bxa5g; /* 5GHz BX arch */
68 u16 cck2gpo; /* CCK power offset */
69 u32 ofdm2gpo; /* 2.4GHz OFDM power offset */
70 u32 ofdm5glpo; /* 5.2GHz OFDM power offset */
71 u32 ofdm5gpo; /* 5.3GHz OFDM power offset */
72 u32 ofdm5ghpo; /* 5.8GHz OFDM power offset */
73 u16 boardflags_lo; /* Board flags (bits 0-15) */
74 u16 boardflags_hi; /* Board flags (bits 16-31) */
75 u16 boardflags2_lo; /* Board flags (bits 32-47) */
76 u16 boardflags2_hi; /* Board flags (bits 48-63) */
77 /* TODO store board flags in a single u64 */
48 78
49 /* Antenna gain values for up to 4 antennas 79 /* Antenna gain values for up to 4 antennas
50 * on each band. Values in dBm/4 (Q5.2). Negative gain means the 80 * on each band. Values in dBm/4 (Q5.2). Negative gain means the
@@ -58,7 +88,7 @@ struct ssb_sprom {
58 } ghz5; /* 5GHz band */ 88 } ghz5; /* 5GHz band */
59 } antenna_gain; 89 } antenna_gain;
60 90
61 /* TODO - add any parameters needed from rev 2, 3, or 4 SPROMs */ 91 /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */
62}; 92};
63 93
64/* Information about the PCB the circuitry is soldered on. */ 94/* Information about the PCB the circuitry is soldered on. */
@@ -208,6 +238,7 @@ enum ssb_bustype {
208 SSB_BUSTYPE_SSB, /* This SSB bus is the system bus */ 238 SSB_BUSTYPE_SSB, /* This SSB bus is the system bus */
209 SSB_BUSTYPE_PCI, /* SSB is connected to PCI bus */ 239 SSB_BUSTYPE_PCI, /* SSB is connected to PCI bus */
210 SSB_BUSTYPE_PCMCIA, /* SSB is connected to PCMCIA bus */ 240 SSB_BUSTYPE_PCMCIA, /* SSB is connected to PCMCIA bus */
241 SSB_BUSTYPE_SDIO, /* SSB is connected to SDIO bus */
211}; 242};
212 243
213/* board_vendor */ 244/* board_vendor */
@@ -240,8 +271,12 @@ struct ssb_bus {
240 271
241 /* The core in the basic address register window. (PCI bus only) */ 272 /* The core in the basic address register window. (PCI bus only) */
242 struct ssb_device *mapped_device; 273 struct ssb_device *mapped_device;
243 /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ 274 union {
244 u8 mapped_pcmcia_seg; 275 /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */
276 u8 mapped_pcmcia_seg;
277 /* Current SSB base address window for SDIO. */
278 u32 sdio_sbaddr;
279 };
245 /* Lock for core and segment switching. 280 /* Lock for core and segment switching.
246 * On PCMCIA-host busses this is used to protect the whole MMIO access. */ 281 * On PCMCIA-host busses this is used to protect the whole MMIO access. */
247 spinlock_t bar_lock; 282 spinlock_t bar_lock;
@@ -252,6 +287,11 @@ struct ssb_bus {
252 struct pci_dev *host_pci; 287 struct pci_dev *host_pci;
253 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ 288 /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */
254 struct pcmcia_device *host_pcmcia; 289 struct pcmcia_device *host_pcmcia;
290 /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */
291 struct sdio_func *host_sdio;
292
293 /* See enum ssb_quirks */
294 unsigned int quirks;
255 295
256#ifdef CONFIG_SSB_SPROM 296#ifdef CONFIG_SSB_SPROM
257 /* Mutex to protect the SPROM writing. */ 297 /* Mutex to protect the SPROM writing. */
@@ -306,6 +346,11 @@ struct ssb_bus {
306#endif /* DEBUG */ 346#endif /* DEBUG */
307}; 347};
308 348
349enum ssb_quirks {
350 /* SDIO connected card requires performing a read after writing a 32-bit value */
351 SSB_QUIRK_SDIO_READ_AFTER_WRITE32 = (1 << 0),
352};
353
309/* The initialization-invariants. */ 354/* The initialization-invariants. */
310struct ssb_init_invariants { 355struct ssb_init_invariants {
311 /* Versioning information about the PCB. */ 356 /* Versioning information about the PCB. */
@@ -336,6 +381,12 @@ extern int ssb_bus_pcmciabus_register(struct ssb_bus *bus,
336 struct pcmcia_device *pcmcia_dev, 381 struct pcmcia_device *pcmcia_dev,
337 unsigned long baseaddr); 382 unsigned long baseaddr);
338#endif /* CONFIG_SSB_PCMCIAHOST */ 383#endif /* CONFIG_SSB_PCMCIAHOST */
384#ifdef CONFIG_SSB_SDIOHOST
385extern int ssb_bus_sdiobus_register(struct ssb_bus *bus,
386 struct sdio_func *sdio_func,
387 unsigned int quirks);
388#endif /* CONFIG_SSB_SDIOHOST */
389
339 390
340extern void ssb_bus_unregister(struct ssb_bus *bus); 391extern void ssb_bus_unregister(struct ssb_bus *bus);
341 392