aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/b43/main.c12
-rw-r--r--drivers/ssb/b43_pci_bridge.c1
-rw-r--r--drivers/ssb/pci.c74
-rw-r--r--include/linux/ssb/ssb_regs.h36
4 files changed, 111 insertions, 12 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 26e733a5a56e..c627bac87a40 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -97,6 +97,7 @@ static const struct ssb_device_id b43_ssb_tbl[] = {
97 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 10), 97 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 10),
98 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 11), 98 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 11),
99 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13), 99 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 13),
100 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 15),
100 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 16), 101 SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 16),
101 SSB_DEVTABLE_END 102 SSB_DEVTABLE_END
102}; 103};
@@ -3756,6 +3757,12 @@ static int b43_phy_versioning(struct b43_wldev *dev)
3756 unsupported = 1; 3757 unsupported = 1;
3757 break; 3758 break;
3758#endif 3759#endif
3760#ifdef CONFIG_B43_PHY_LP
3761 case B43_PHYTYPE_LP:
3762 if (phy_rev > 1)
3763 unsupported = 1;
3764 break;
3765#endif
3759 default: 3766 default:
3760 unsupported = 1; 3767 unsupported = 1;
3761 }; 3768 };
@@ -3808,6 +3815,10 @@ static int b43_phy_versioning(struct b43_wldev *dev)
3808 if (radio_ver != 0x2055 && radio_ver != 0x2056) 3815 if (radio_ver != 0x2055 && radio_ver != 0x2056)
3809 unsupported = 1; 3816 unsupported = 1;
3810 break; 3817 break;
3818 case B43_PHYTYPE_LP:
3819 if (radio_ver != 0x2062)
3820 unsupported = 1;
3821 break;
3811 default: 3822 default:
3812 B43_WARN_ON(1); 3823 B43_WARN_ON(1);
3813 } 3824 }
@@ -4402,6 +4413,7 @@ static int b43_wireless_core_attach(struct b43_wldev *dev)
4402 break; 4413 break;
4403 case B43_PHYTYPE_G: 4414 case B43_PHYTYPE_G:
4404 case B43_PHYTYPE_N: 4415 case B43_PHYTYPE_N:
4416 case B43_PHYTYPE_LP:
4405 have_2ghz_phy = 1; 4417 have_2ghz_phy = 1;
4406 break; 4418 break;
4407 default: 4419 default:
diff --git a/drivers/ssb/b43_pci_bridge.c b/drivers/ssb/b43_pci_bridge.c
index 6433a7ed39f8..27a677584a4c 100644
--- a/drivers/ssb/b43_pci_bridge.c
+++ b/drivers/ssb/b43_pci_bridge.c
@@ -21,6 +21,7 @@ static const struct pci_device_id b43_pci_bridge_tbl[] = {
21 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4307) }, 21 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4307) },
22 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4311) }, 22 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4311) },
23 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4312) }, 23 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4312) },
24 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4315) },
24 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4318) }, 25 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4318) },
25 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4319) }, 26 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4319) },
26 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4320) }, 27 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4320) },
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index d5cde051806b..c958ac16423c 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -467,6 +467,51 @@ static void sprom_extract_r45(struct ssb_sprom *out, const u16 *in)
467 /* TODO - get remaining rev 4 stuff needed */ 467 /* TODO - get remaining rev 4 stuff needed */
468} 468}
469 469
470static void sprom_extract_r8(struct ssb_sprom *out, const u16 *in)
471{
472 int i;
473 u16 v;
474
475 /* extract the MAC address */
476 for (i = 0; i < 3; i++) {
477 v = in[SPOFF(SSB_SPROM1_IL0MAC) + i];
478 *(((__be16 *)out->il0mac) + i) = cpu_to_be16(v);
479 }
480 SPEX(country_code, SSB_SPROM8_CCODE, 0xFFFF, 0);
481 SPEX(boardflags_lo, SSB_SPROM8_BFLLO, 0xFFFF, 0);
482 SPEX(boardflags_hi, SSB_SPROM8_BFLHI, 0xFFFF, 0);
483 SPEX(ant_available_a, SSB_SPROM8_ANTAVAIL, SSB_SPROM8_ANTAVAIL_A,
484 SSB_SPROM8_ANTAVAIL_A_SHIFT);
485 SPEX(ant_available_bg, SSB_SPROM8_ANTAVAIL, SSB_SPROM8_ANTAVAIL_BG,
486 SSB_SPROM8_ANTAVAIL_BG_SHIFT);
487 SPEX(maxpwr_bg, SSB_SPROM8_MAXP_BG, SSB_SPROM8_MAXP_BG_MASK, 0);
488 SPEX(itssi_bg, SSB_SPROM8_MAXP_BG, SSB_SPROM8_ITSSI_BG,
489 SSB_SPROM8_ITSSI_BG_SHIFT);
490 SPEX(maxpwr_a, SSB_SPROM8_MAXP_A, SSB_SPROM8_MAXP_A_MASK, 0);
491 SPEX(itssi_a, SSB_SPROM8_MAXP_A, SSB_SPROM8_ITSSI_A,
492 SSB_SPROM8_ITSSI_A_SHIFT);
493 SPEX(gpio0, SSB_SPROM8_GPIOA, SSB_SPROM8_GPIOA_P0, 0);
494 SPEX(gpio1, SSB_SPROM8_GPIOA, SSB_SPROM8_GPIOA_P1,
495 SSB_SPROM8_GPIOA_P1_SHIFT);
496 SPEX(gpio2, SSB_SPROM8_GPIOB, SSB_SPROM8_GPIOB_P2, 0);
497 SPEX(gpio3, SSB_SPROM8_GPIOB, SSB_SPROM8_GPIOB_P3,
498 SSB_SPROM8_GPIOB_P3_SHIFT);
499
500 /* Extract the antenna gain values. */
501 SPEX(antenna_gain.ghz24.a0, SSB_SPROM8_AGAIN01,
502 SSB_SPROM8_AGAIN0, SSB_SPROM8_AGAIN0_SHIFT);
503 SPEX(antenna_gain.ghz24.a1, SSB_SPROM8_AGAIN01,
504 SSB_SPROM8_AGAIN1, SSB_SPROM8_AGAIN1_SHIFT);
505 SPEX(antenna_gain.ghz24.a2, SSB_SPROM8_AGAIN23,
506 SSB_SPROM8_AGAIN2, SSB_SPROM8_AGAIN2_SHIFT);
507 SPEX(antenna_gain.ghz24.a3, SSB_SPROM8_AGAIN23,
508 SSB_SPROM8_AGAIN3, SSB_SPROM8_AGAIN3_SHIFT);
509 memcpy(&out->antenna_gain.ghz5, &out->antenna_gain.ghz24,
510 sizeof(out->antenna_gain.ghz5));
511
512 /* TODO - get remaining rev 8 stuff needed */
513}
514
470static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out, 515static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
471 const u16 *in, u16 size) 516 const u16 *in, u16 size)
472{ 517{
@@ -487,15 +532,25 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
487 out->revision = 4; 532 out->revision = 4;
488 sprom_extract_r45(out, in); 533 sprom_extract_r45(out, in);
489 } else { 534 } else {
490 if (out->revision == 0) 535 switch (out->revision) {
491 goto unsupported; 536 case 1:
492 if (out->revision >= 1 && out->revision <= 3) { 537 case 2:
538 case 3:
493 sprom_extract_r123(out, in); 539 sprom_extract_r123(out, in);
494 } 540 break;
495 if (out->revision == 4 || out->revision == 5) 541 case 4:
542 case 5:
496 sprom_extract_r45(out, in); 543 sprom_extract_r45(out, in);
497 if (out->revision > 5) 544 break;
498 goto unsupported; 545 case 8:
546 sprom_extract_r8(out, in);
547 break;
548 default:
549 ssb_printk(KERN_WARNING PFX "Unsupported SPROM"
550 " revision %d detected. Will extract"
551 " v1\n", out->revision);
552 sprom_extract_r123(out, in);
553 }
499 } 554 }
500 555
501 if (out->boardflags_lo == 0xFFFF) 556 if (out->boardflags_lo == 0xFFFF)
@@ -504,11 +559,6 @@ static int sprom_extract(struct ssb_bus *bus, struct ssb_sprom *out,
504 out->boardflags_hi = 0; /* per specs */ 559 out->boardflags_hi = 0; /* per specs */
505 560
506 return 0; 561 return 0;
507unsupported:
508 ssb_printk(KERN_WARNING PFX "Unsupported SPROM revision %d "
509 "detected. Will extract v1\n", out->revision);
510 sprom_extract_r123(out, in);
511 return 0;
512} 562}
513 563
514static int ssb_pci_sprom_get(struct ssb_bus *bus, 564static int ssb_pci_sprom_get(struct ssb_bus *bus,
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index 99a0f991e850..a01b982b5783 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -326,6 +326,42 @@
326#define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */ 326#define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */
327#define SSB_SPROM5_GPIOB_P3_SHIFT 8 327#define SSB_SPROM5_GPIOB_P3_SHIFT 8
328 328
329/* SPROM Revision 8 */
330#define SSB_SPROM8_BFLLO 0x1084 /* Boardflags (low 16 bits) */
331#define SSB_SPROM8_BFLHI 0x1086 /* Boardflags Hi */
332#define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */
333#define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */
334#define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/
335#define SSB_SPROM8_ANTAVAIL_A 0xFF00 /* A-PHY bitfield */
336#define SSB_SPROM8_ANTAVAIL_A_SHIFT 8
337#define SSB_SPROM8_ANTAVAIL_BG 0x00FF /* B-PHY and G-PHY bitfield */
338#define SSB_SPROM8_ANTAVAIL_BG_SHIFT 0
339#define SSB_SPROM8_AGAIN01 0x109E /* Antenna Gain (in dBm Q5.2) */
340#define SSB_SPROM8_AGAIN0 0x00FF /* Antenna 0 */
341#define SSB_SPROM8_AGAIN0_SHIFT 0
342#define SSB_SPROM8_AGAIN1 0xFF00 /* Antenna 1 */
343#define SSB_SPROM8_AGAIN1_SHIFT 8
344#define SSB_SPROM8_AGAIN23 0x10A0
345#define SSB_SPROM8_AGAIN2 0x00FF /* Antenna 2 */
346#define SSB_SPROM8_AGAIN2_SHIFT 0
347#define SSB_SPROM8_AGAIN3 0xFF00 /* Antenna 3 */
348#define SSB_SPROM8_AGAIN3_SHIFT 8
349#define SSB_SPROM8_GPIOA 0x1096 /*Gen. Purpose IO # 0 and 1 */
350#define SSB_SPROM8_GPIOA_P0 0x00FF /* Pin 0 */
351#define SSB_SPROM8_GPIOA_P1 0xFF00 /* Pin 1 */
352#define SSB_SPROM8_GPIOA_P1_SHIFT 8
353#define SSB_SPROM8_GPIOB 0x1098 /* Gen. Purpose IO # 2 and 3 */
354#define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */
355#define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */
356#define SSB_SPROM8_GPIOB_P3_SHIFT 8
357#define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power BG in path 1 */
358#define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */
359#define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */
360#define SSB_SPROM8_ITSSI_BG_SHIFT 8
361#define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power A in path 1 */
362#define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power A */
363#define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */
364#define SSB_SPROM8_ITSSI_A_SHIFT 8
329 365
330/* Values for SSB_SPROM1_BINF_CCODE */ 366/* Values for SSB_SPROM1_BINF_CCODE */
331enum { 367enum {