* [patch 01/10] [RFT] bcm43xx: add core ID for PCI-E core
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 02/10] [RFT] bcm43xx: functions for access to PCI-E registers and PCI-E MDIO Stefano Brivio
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-pcie_core_id.diff --]
[-- Type: text/plain, Size: 614 bytes --]
Add core ID for PCI-E core.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -202,6 +202,7 @@
#define BCM43xx_COREID_USB20_HOST 0x819
#define BCM43xx_COREID_USB20_DEV 0x81a
#define BCM43xx_COREID_SDIO_HOST 0x81b
+#define BCM43xx_COREID_PCIE 0x820
/* Core Information Registers */
#define BCM43xx_CIR_BASE 0xf00
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 02/10] [RFT] bcm43xx: functions for access to PCI-E registers and PCI-E MDIO
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
2006-05-18 22:00 ` [patch 01/10] [RFT] bcm43xx: add core ID for PCI-E core Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 03/10] [RFT] bcm43xx: fix reading core ID and revision from sb_id_hi Stefano Brivio
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-pcie_core_rw.diff --]
[-- Type: text/plain, Size: 2778 bytes --]
Add read and write functions for PCI-E registers
Add write function for MDIO slaves.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2973,6 +2973,45 @@ out:
return err;
}
+static u32 bcm43xx_pcie_reg_read(struct bcm43xx_private *bcm, u32 address)
+{
+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_ADDR, address);
+ return bcm43xx_read32(bcm, BCM43xx_PCIECORE_REG_DATA);
+}
+
+static void bcm43xx_pcie_reg_write(struct bcm43xx_private *bcm, u32 address,
+ u32 data)
+{
+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_ADDR, address);
+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_DATA, data);
+}
+
+static int bcm43xx_pcie_mdio_write(struct bcm43xx_private *bcm, u8 dev, u8 reg,
+ u16 data)
+{
+ int i;
+
+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_MDIO_CTL, 0x0082);
+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_MDIO_DATA, BCM43xx_PCIE_MDIO_ST |
+ BCM43xx_PCIE_MDIO_WT | (dev << BCM43xx_PCIE_MDIO_DEV) |
+ (reg << BCM43xx_PCIE_MDIO_REG) | BCM43xx_PCIE_MDIO_TA |
+ data);
+ udelay(10);
+
+ for (i = 0; i < 10; i++) {
+ if (bcm43xx_read32(bcm, BCM43xx_PCIECORE_MDIO_CTL) &
+ BCM43xx_PCIE_MDIO_TC)
+ return 0;
+ udelay(1000);
+ }
+ if (bcm43xx_read32(bcm, BCM43xx_PCIECORE_MDIO_CTL) &
+ BCM43xx_PCIE_MDIO_TC)
+ return 0;
+
+ printk(KERN_ERR PFX "Error: MDIO transaction failed\n");
+ return -EIO;
+}
+
/* Make an I/O Core usable. "core_mask" is the bitmask of the cores to enable.
* To enable core 0, pass a core_mask of 1<<0
*/
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -154,6 +154,24 @@
#define BCM43xx_SBTOPCI2_PREFETCH 0x4
#define BCM43xx_SBTOPCI2_BURST 0x8
+/* PCI-E core registers. */
+#define BCM43xx_PCIECORE_REG_ADDR 0x0130
+#define BCM43xx_PCIECORE_REG_DATA 0x0134
+#define BCM43xx_PCIECORE_MDIO_CTL 0x0128
+#define BCM43xx_PCIECORE_MDIO_DATA 0x012C
+
+/* PCI-E registers. */
+#define BCM43xx_PCIE_TLP_WORKAROUND 0x0004
+#define BCM43xx_PCIE_DLLP_LINKCTL 0x0100
+
+/* PCI-E MDIO bits. */
+#define BCM43xx_PCIE_MDIO_ST 0x40000000
+#define BCM43xx_PCIE_MDIO_WT 0x10000000
+#define BCM43xx_PCIE_MDIO_DEV 22
+#define BCM43xx_PCIE_MDIO_REG 18
+#define BCM43xx_PCIE_MDIO_TA 0x00020000
+#define BCM43xx_PCIE_MDIO_TC 0x0100
+
/* Chipcommon capabilities. */
#define BCM43xx_CAPABILITIES_PCTL 0x00040000
#define BCM43xx_CAPABILITIES_PLLMASK 0x00030000
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 03/10] [RFT] bcm43xx: fix reading core ID and revision from sb_id_hi
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
2006-05-18 22:00 ` [patch 01/10] [RFT] bcm43xx: add core ID for PCI-E core Stefano Brivio
2006-05-18 22:00 ` [patch 02/10] [RFT] bcm43xx: functions for access to PCI-E registers and PCI-E MDIO Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 04/10] [RFT] bcm43xx: use PCI-E core as a PCI core, allow wireless core with rev 10 Stefano Brivio
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-find_core_id.diff --]
[-- Type: text/plain, Size: 846 bytes --]
Fix reading core ID and revision from sb_id_hi.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2565,8 +2565,8 @@ static int bcm43xx_probe_cores(struct bc
/* fetch sb_id_hi from core information registers */
sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI);
- core_id = (sb_id_hi & 0xFFF0) >> 4;
- core_rev = (sb_id_hi & 0xF);
+ core_id = (sb_id_hi & 0x8FF0) >> 4;
+ core_rev = (sb_id_hi & 0x7000) >> 8 | (sb_id_hi & 0xF);
core_vendor = (sb_id_hi & 0xFFFF0000) >> 16;
/* if present, chipcommon is always core 0; read the chipid from it */
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 04/10] [RFT] bcm43xx: use PCI-E core as a PCI core, allow wireless core with rev 10
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
` (2 preceding siblings ...)
2006-05-18 22:00 ` [patch 03/10] [RFT] bcm43xx: fix reading core ID and revision from sb_id_hi Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 05/10] [RFT] bcm43xx: wireless core initialization for PCI-E devices Stefano Brivio
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-pcie_core_probe.diff --]
[-- Type: text/plain, Size: 905 bytes --]
Allow for PCI-E core to be considered as PCI core. Allow revision 10 of
wireless core.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2676,6 +2676,7 @@ static int bcm43xx_probe_cores(struct bc
core = NULL;
switch (core_id) {
case BCM43xx_COREID_PCI:
+ case BCM43xx_COREID_PCIE:
core = &bcm->core_pci;
if (core->available) {
printk(KERN_WARNING PFX "Multiple PCI cores found.\n");
@@ -2714,6 +2715,7 @@ static int bcm43xx_probe_cores(struct bc
case 6:
case 7:
case 9:
+ case 10:
break;
default:
printk(KERN_ERR PFX "Error: Unsupported 80211 core revision %u\n",
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 05/10] [RFT] bcm43xx: wireless core initialization for PCI-E devices
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
` (3 preceding siblings ...)
2006-05-18 22:00 ` [patch 04/10] [RFT] bcm43xx: use PCI-E core as a PCI core, allow wireless core with rev 10 Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 06/10] [RFT] bcm43xx: fix bcm43xx_wireless_core_mark_inactive Stefano Brivio
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-80211init.diff --]
[-- Type: text/plain, Size: 1068 bytes --]
Fix wireless core initialization in order to work with PCI-E devices.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2832,16 +2832,11 @@ static int bcm43xx_wireless_core_init(st
u32 sbimconfiglow;
u8 limit;
- if (bcm->chip_rev < 5) {
+ if (bcm->core_pci.rev <= 5 && bcm->core_pci.id != BCM43xx_COREID_PCIE) {
sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW);
sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK;
sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK;
- if (bcm->bustype == BCM43xx_BUSTYPE_PCI)
- sbimconfiglow |= 0x32;
- else if (bcm->bustype == BCM43xx_BUSTYPE_SB)
- sbimconfiglow |= 0x53;
- else
- assert(0);
+ sbimconfiglow |= 0x32;
bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow);
}
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 06/10] [RFT] bcm43xx: fix bcm43xx_wireless_core_mark_inactive
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
` (4 preceding siblings ...)
2006-05-18 22:00 ` [patch 05/10] [RFT] bcm43xx: wireless core initialization for PCI-E devices Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 07/10] [RFT] bcm43xx: allow PHY revision 8, dont give up on unknown phy_rev Stefano Brivio
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-80211core_inactive.diff --]
[-- Type: text/plain, Size: 734 bytes --]
Trivial change in specs related to bcm43xx_wireless_core_mark_inactive.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -1431,7 +1431,6 @@ static int bcm43xx_wireless_core_mark_in
if (err)
goto out;
sbtmstatelow = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW);
- sbtmstatelow &= ~0x20000000;
sbtmstatelow |= 0x20000000;
bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, sbtmstatelow);
err = bcm43xx_switch_core(bcm, old_core);
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 07/10] [RFT] bcm43xx: allow PHY revision 8, dont give up on unknown phy_rev
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
` (5 preceding siblings ...)
2006-05-18 22:00 ` [patch 06/10] [RFT] bcm43xx: fix bcm43xx_wireless_core_mark_inactive Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 08/10] [RFT] bcm43xx: powercontrol support for PCI-E devices Stefano Brivio
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-gphy_allow_rev8.diff --]
[-- Type: text/plain, Size: 1143 bytes --]
Allow a GPHY to have revision 8. Issue a warning instead of giving up when
dealing with an unknown core revision.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2717,10 +2717,9 @@ static int bcm43xx_probe_cores(struct bc
case 10:
break;
default:
- printk(KERN_ERR PFX "Error: Unsupported 80211 core revision %u\n",
+ printk(KERN_WARNING PFX
+ "Unsupported 80211 core revision %u\n",
core_rev);
- err = -ENODEV;
- goto out;
}
bcm->nr_80211_available++;
bcm43xx_init_struct_phyinfo(&ext_80211->phy);
@@ -3377,7 +3376,7 @@ static int bcm43xx_read_phyinfo(struct b
bcm->ieee->freq_band = IEEE80211_24GHZ_BAND;
break;
case BCM43xx_PHYTYPE_G:
- if (phy_rev > 7)
+ if (phy_rev > 8)
phy_rev_ok = 0;
bcm->ieee->modulation = IEEE80211_OFDM_MODULATION |
IEEE80211_CCK_MODULATION;
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 08/10] [RFT] bcm43xx: powercontrol support for PCI-E devices
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
` (6 preceding siblings ...)
2006-05-18 22:00 ` [patch 07/10] [RFT] bcm43xx: allow PHY revision 8, dont give up on unknown phy_rev Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 09/10] [RFT] bcm43xx: backplane setup for PCI-E devices and devices with PCI core ID > 10 Stefano Brivio
2006-05-18 22:00 ` [patch 10/10] [RFT] bcm43xx: add PCI ID for bcm4311 Stefano Brivio
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-pcie_powercontrol.diff --]
[-- Type: text/plain, Size: 1910 bytes --]
Add powercontrol support for PCI-E devices.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -140,6 +140,7 @@
/* Chipcommon registers. */
#define BCM43xx_CHIPCOMMON_CAPABILITIES 0x04
+#define BCM43xx_CHIPCOMMON_CTL 0x28
#define BCM43xx_CHIPCOMMON_PLLONDELAY 0xB0
#define BCM43xx_CHIPCOMMON_FREFSELDELAY 0xB4
#define BCM43xx_CHIPCOMMON_SLOWCLKCTL 0xB8
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_power.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_power.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_power.c
@@ -153,8 +153,6 @@ int bcm43xx_pctl_init(struct bcm43xx_pri
int err, maxfreq;
struct bcm43xx_coreinfo *old_core;
- if (!(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL))
- return 0;
old_core = bcm->current_core;
err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon);
if (err == -ENODEV)
@@ -162,6 +160,21 @@ int bcm43xx_pctl_init(struct bcm43xx_pri
if (err)
goto out;
+ if (bcm->chip_id == 0x4321) {
+ if (bcm->chip_rev == 1)
+ bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_CTL, 0x00A4);
+ if (bcm->chip_rev == 0)
+ bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_CTL, 0x03A4);
+ }
+
+ if (!(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL))
+ return 0;
+
+ if (bcm->current_core->rev >= 10)
+ bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL,
+ (bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL)
+ & 0x0000FFFF) | 0x40000);
+
maxfreq = bcm43xx_pctl_clockfreqlimit(bcm, 1);
bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_PLLONDELAY,
(maxfreq * 150 + 999999) / 1000000);
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 09/10] [RFT] bcm43xx: backplane setup for PCI-E devices and devices with PCI core ID > 10
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
` (7 preceding siblings ...)
2006-05-18 22:00 ` [patch 08/10] [RFT] bcm43xx: powercontrol support for PCI-E devices Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
2006-05-18 22:00 ` [patch 10/10] [RFT] bcm43xx: add PCI ID for bcm4311 Stefano Brivio
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-pcie_backplane.diff --]
[-- Type: text/plain, Size: 5168 bytes --]
Backplane setup for PCI-E devices and PCI devices with PCI Core ID > 10.
Use chipcommon if possible while broadcasting PCI settings.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx.h
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx.h
@@ -154,6 +154,7 @@
/* SBTOPCI2 values. */
#define BCM43xx_SBTOPCI2_PREFETCH 0x4
#define BCM43xx_SBTOPCI2_BURST 0x8
+#define BCM43xx_SBTOPCI2_MEMREAD_MULTI 0x20
/* PCI-E core registers. */
#define BCM43xx_PCIECORE_REG_ADDR 0x0130
@@ -173,6 +174,14 @@
#define BCM43xx_PCIE_MDIO_TA 0x00020000
#define BCM43xx_PCIE_MDIO_TC 0x0100
+/* MDIO devices. */
+#define BCM43xx_MDIO_SERDES_RX 0x1F
+
+/* SERDES RX registers. */
+#define BCM43xx_SERDES_RXTIMER 0x2
+#define BCM43xx_SERDES_CDR 0x6
+#define BCM43xx_SERDES_CDR_BW 0x7
+
/* Chipcommon capabilities. */
#define BCM43xx_CAPABILITIES_PCTL 0x00040000
#define BCM43xx_CAPABILITIES_PLLMASK 0x00030000
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -2952,18 +2952,26 @@ static void bcm43xx_pcicore_broadcast_va
static int bcm43xx_pcicore_commit_settings(struct bcm43xx_private *bcm)
{
- int err;
- struct bcm43xx_coreinfo *old_core;
+ int err = 0;
- old_core = bcm->current_core;
- err = bcm43xx_switch_core(bcm, &bcm->core_pci);
- if (err)
- goto out;
+ bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL);
- bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000);
+ if (bcm->core_chipcommon.available) {
+ err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon);
+ if (err)
+ goto out;
+
+ bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000);
+
+ /* this function is always called when a PCI core is mapped */
+ err = bcm43xx_switch_core(bcm, &bcm->core_pci);
+ if (err)
+ goto out;
+ } else
+ bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000);
+
+ bcm43xx_interrupt_enable(bcm, bcm->irq_savedstate);
- bcm43xx_switch_core(bcm, old_core);
- assert(err == 0);
out:
return err;
}
@@ -3026,7 +3034,8 @@ static int bcm43xx_setup_backplane_pci_c
if (err)
goto out;
- if (bcm->core_pci.rev < 6) {
+ if (bcm->current_core->rev < 6 ||
+ bcm->current_core->id == BCM43xx_COREID_PCI) {
value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC);
value |= (1 << backplane_flag_nr);
bcm43xx_write32(bcm, BCM43xx_CIR_SBINTVEC, value);
@@ -3044,21 +3053,46 @@ static int bcm43xx_setup_backplane_pci_c
}
}
- value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2);
- value |= BCM43xx_SBTOPCI2_PREFETCH | BCM43xx_SBTOPCI2_BURST;
- bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value);
-
- if (bcm->core_pci.rev < 5) {
- value = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW);
- value |= (2 << BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_SHIFT)
- & BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK;
- value |= (3 << BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_SHIFT)
- & BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK;
- bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, value);
- err = bcm43xx_pcicore_commit_settings(bcm);
- assert(err == 0);
+ if (bcm->current_core->id == BCM43xx_COREID_PCI) {
+ value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2);
+ value |= BCM43xx_SBTOPCI2_PREFETCH | BCM43xx_SBTOPCI2_BURST;
+ bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value);
+
+ if (bcm->current_core->rev < 5) {
+ value = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW);
+ value |= (2 << BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_SHIFT)
+ & BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK;
+ value |= (3 << BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_SHIFT)
+ & BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK;
+ bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, value);
+ err = bcm43xx_pcicore_commit_settings(bcm);
+ assert(err == 0);
+ } else if (bcm->current_core->rev >= 11) {
+ value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2);
+ value |= BCM43xx_SBTOPCI2_MEMREAD_MULTI;
+ bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value);
+ }
+ } else {
+ if (bcm->current_core->rev == 0 || bcm->current_core->rev == 1) {
+ value = bcm43xx_pcie_reg_read(bcm, BCM43xx_PCIE_TLP_WORKAROUND);
+ value |= 0x8;
+ bcm43xx_pcie_reg_write(bcm, BCM43xx_PCIE_TLP_WORKAROUND,
+ value);
+ }
+ if (bcm->current_core->rev == 0) {
+ bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX,
+ BCM43xx_SERDES_RXTIMER, 0x8128);
+ bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX,
+ BCM43xx_SERDES_CDR, 0x0100);
+ bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX,
+ BCM43xx_SERDES_CDR_BW, 0x1466);
+ } else if (bcm->current_core->rev == 1) {
+ value = bcm43xx_pcie_reg_read(bcm, BCM43xx_PCIE_DLLP_LINKCTL);
+ value |= 0x40;
+ bcm43xx_pcie_reg_write(bcm, BCM43xx_PCIE_DLLP_LINKCTL,
+ value);
+ }
}
-
out_switch_back:
err = bcm43xx_switch_core(bcm, old_core);
out:
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 10/10] [RFT] bcm43xx: add PCI ID for bcm4311
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
` (8 preceding siblings ...)
2006-05-18 22:00 ` [patch 09/10] [RFT] bcm43xx: backplane setup for PCI-E devices and devices with PCI core ID > 10 Stefano Brivio
@ 2006-05-18 22:00 ` Stefano Brivio
9 siblings, 0 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-18 22:00 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II, Stefano Brivio
[-- Attachment #1: bcm43xx-pcie_ids.diff --]
[-- Type: text/plain, Size: 849 bytes --]
Add PCI ID for bcm4311 PCI-E device.
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Index: wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/bcm43xx/bcm43xx_main.c
+++ wireless-dev/drivers/net/wireless/bcm43xx/bcm43xx_main.c
@@ -130,6 +130,8 @@ MODULE_PARM_DESC(fwpostfix, "Postfix for
{ PCI_VENDOR_ID_BROADCOM, 0x4301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
/* Broadcom 4307 802.11b */
{ PCI_VENDOR_ID_BROADCOM, 0x4307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ /* Broadcom 4311 802.11(a)/b/g */
+ { PCI_VENDOR_ID_BROADCOM, 0x4311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
/* Broadcom 4318 802.11b/g */
{ PCI_VENDOR_ID_BROADCOM, 0x4318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
/* Broadcom 4306 802.11b/g */
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
* [patch 00/10] [RFT] bcm43xx: support for PCI-E devices
@ 2006-05-19 15:44 Stefano Brivio
2006-05-18 22:00 ` [patch 01/10] [RFT] bcm43xx: add core ID for PCI-E core Stefano Brivio
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: Stefano Brivio @ 2006-05-19 15:44 UTC (permalink / raw)
To: netdev; +Cc: Edgar Hucek, Matthew Garrett, Louis E Garcia II
Can somebody with a bcm4311 or bcm4312 board please test this. This
patchset adds support for PCI-E devices and includes as well some minor
fixes to powercontrol, wireless core management, PCI core management.
--
Ciao
Stefano
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-05-19 15:58 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-19 15:44 [patch 00/10] [RFT] bcm43xx: support for PCI-E devices Stefano Brivio
2006-05-18 22:00 ` [patch 01/10] [RFT] bcm43xx: add core ID for PCI-E core Stefano Brivio
2006-05-18 22:00 ` [patch 02/10] [RFT] bcm43xx: functions for access to PCI-E registers and PCI-E MDIO Stefano Brivio
2006-05-18 22:00 ` [patch 03/10] [RFT] bcm43xx: fix reading core ID and revision from sb_id_hi Stefano Brivio
2006-05-18 22:00 ` [patch 04/10] [RFT] bcm43xx: use PCI-E core as a PCI core, allow wireless core with rev 10 Stefano Brivio
2006-05-18 22:00 ` [patch 05/10] [RFT] bcm43xx: wireless core initialization for PCI-E devices Stefano Brivio
2006-05-18 22:00 ` [patch 06/10] [RFT] bcm43xx: fix bcm43xx_wireless_core_mark_inactive Stefano Brivio
2006-05-18 22:00 ` [patch 07/10] [RFT] bcm43xx: allow PHY revision 8, dont give up on unknown phy_rev Stefano Brivio
2006-05-18 22:00 ` [patch 08/10] [RFT] bcm43xx: powercontrol support for PCI-E devices Stefano Brivio
2006-05-18 22:00 ` [patch 09/10] [RFT] bcm43xx: backplane setup for PCI-E devices and devices with PCI core ID > 10 Stefano Brivio
2006-05-18 22:00 ` [patch 10/10] [RFT] bcm43xx: add PCI ID for bcm4311 Stefano Brivio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).