Sonics Silicon Backplane module
cover Sonics Silicon Backplane module
Hi.
This patch series creates a new Sonics Silicon Backplane driver and converts the bcm43xx and b44 drivers to use it. The bcm43xx patch is tested and it works. But the b44 patch is only compile tested, as I don't have the hardware (yet?).
These patches apply against wireless-dev.
Signature · 1 line
Greetings Michael.
A message that is not in the archive (sent off-list or not yet received): [email protected]
RFC PATCH 3/3 b44: convert to ssb module
This is not runtime tested.
drivers/net/Kconfig +1 -1
@@ -1388,7 +1388,7 @@ config B44 tristate "Broadcom 4400 ethernet support" - depends on NET_PCI && PCI + depends on NET_PCI && PCI && SONICS_SILICON_BACKPLANE select MII help If you have a network (Ethernet) controller of this type, say Y and
drivers/net/b44.c +35 -97
224 lines not on this page · raw message
drivers/net/b44.h +4 -70
89 lines not on this page · raw message
Signature · 1 line
Greetings Michael.
Re: [patch RFC 3/3] b44: convert to ssb module
drivers/net/b44.c line 2018
Quoted 6 lines · Michael Buesch
drivers/net/b44.c +1
-1@@ -2093,13 +2015,13 @@ bp->imask =IMASK_DEF ; bp->core_unit =ssb_core_unit (bp); - bp->dma_offset =SB_PCI_DMA ; + bp->dma_offset =0x40000000 ;/* Client Mode PCI memory access space (1GB) */
Probably shouldn't change anything to a magic number...
Signature · 2 lines
John W. Linville [email protected]
Re: [patch RFC 3/3] b44: convert to ssb module
Quoted 10 lines · John W. Linville
drivers/net/b44.c line 2018
Quoted 6 lines · Michael Buesch
drivers/net/b44.c +1
-1@@ -2093,13 +2015,13 @@ bp->imask =IMASK_DEF ; bp->core_unit =ssb_core_unit (bp); - bp->dma_offset =SB_PCI_DMA ; + bp->dma_offset =0x40000000 ;/* Client Mode PCI memory access space (1GB) */ Probably shouldn't change anything to a magic number...
Well, SB_PCI_DMA wasn't really a useful name, too IMHO :) But you're right. We should use a define. And I know that. This is only a patch for testing if it actually works with the ssb module (I can not test this).
Besides that, we should probably get rid of dma_offset completely, as it is not really an offset, but a routing bit.
You can take a look at the new DMA engine code of bcm43xx. It's the same engine.
BTW: John, I see that the new DMA engine code is not applied to wireless-dev (64-bit DMA and >1G support). But I think I already sent the patch. Where did it get lost? Was it my fault?
Signature · 1 line
Greetings Michael.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [patch RFC 3/3] b44: convert to ssb module
Quoted 6 lines · Michael Buesch
You can take a look at the new DMA engine code of bcm43xx. It's the same engine.
BTW: John, I see that the new DMA engine code is not applied to wireless-dev (64-bit DMA and >1G support). But I think I already sent the patch. Where did it get lost? Was it my fault?
http://marc.theaimsgroup.com/?l=linux-netdev&m=115056542006772&w=2
Is this the patch? I think this one is a victim of the "RFT" subject. Oh, and the patch seemed to not be totally working based on this post:
http://marc.theaimsgroup.com/?l=linux-netdev&m=115075858220477&w=2
Was there a newer version that I missed? Did you still want the older version applied anyway?
John
Signature · 2 lines
John W. Linville [email protected]
Re: [patch RFC 3/3] b44: convert to ssb module
Quoted 10 lines · John W. Linville
Quoted 6 lines · Michael Buesch
You can take a look at the new DMA engine code of bcm43xx. It's the same engine.
BTW: John, I see that the new DMA engine code is not applied to wireless-dev (64-bit DMA and >1G support). But I think I already sent the patch. Where did it get lost? Was it my fault?
http://marc.theaimsgroup.com/?l=linux-netdev&m=115056542006772&w=2
Hm, I _think_ that was the right one.
But I will dig out the right one and resend to make sure things don't randomly break.
Quoted 4 lines
Is this the patch? I think this one is a victim of the "RFT" subject. Oh, and the patch seemed to not be totally working based on this post:
http://marc.theaimsgroup.com/?l=linux-netdev&m=115075858220477&w=2
I think this oops comes from buggy (or too new) firmware. I think we can ignore it for now.
Signature · 1 line
Greetings Michael.
RFC PATCH 1/3 add Sonics Silicon Backplane module
In reply to Michael Bueschdrivers/misc/Kconfig +11 -0
@@ -28,5 +28,16 @@ If unsure, say N. +config SONICS_SILICON_BACKPLANE + tristate "Sonics Silicon Backplane support" + depends on PCI && EXPERIMENTAL + default m + ---help--- + The Sonics Silicon Backplane is used in some chips such + as the Broadcom 43xx and 44xx series. + The Backplane ties several chip-cores together. + + If unsure, say M. + endmenu
drivers/misc/Makefile +3 -2
@@ -3,5 +3,6 @@ # obj- := misc.o # Dummy rule to force built-in.o to be made -obj-$(CONFIG_IBM_ASM) += ibmasm/ -obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/ +obj-$(CONFIG_IBM_ASM) += ibmasm/ +obj-$(CONFIG_HDPU_FEATURES) += hdpuftrs/ +obj-$(CONFIG_SONICS_SILICON_BACKPLANE) += ssb.o
drivers/misc/ssb.c new file +502 -0
502 lines not on this page · raw message
include/linux/ssb.h new file +309 -0
309 lines not on this page · raw message
Signature · 1 line
Greetings Michael.
RFC PATCH 2/3 bcm43xx-d80211: convert to ssb module
In reply to Michael BueschMore #defines in bcm43xx.h can be deleted and the corresponding #defines in ssh.h can be used instead. But I leave this alone for now...
drivers/net/wireless/d80211/bcm43xx/bcm43xx.h +22 -65
@@ -11,6 +11,7 @@#include <asm/atomic.h> #include <asm/io.h> +#include <linux/ssb.h> #include <linux/wireless.h> #include <net/d80211.h> #include <net/d80211_mgmt.h>
@@ -186,25 +187,7 @@#define BCM43xx_PCTL_FORCE_PLL 0x1000#define BCM43xx_PCTL_DYN_XTAL 0x2000 -/* COREIDs */ -#define BCM43xx_COREID_CHIPCOMMON 0x800 -#define BCM43xx_COREID_ILINE20 0x801 -#define BCM43xx_COREID_SDRAM 0x803 -#define BCM43xx_COREID_PCI 0x804 -#define BCM43xx_COREID_MIPS 0x805 -#define BCM43xx_COREID_ETHERNET 0x806 -#define BCM43xx_COREID_V90 0x807 -#define BCM43xx_COREID_USB11_HOSTDEV 0x80a -#define BCM43xx_COREID_IPSEC 0x80b -#define BCM43xx_COREID_PCMCIA 0x80d -#define BCM43xx_COREID_EXT_IF 0x80f -#define BCM43xx_COREID_80211 0x812 -#define BCM43xx_COREID_MIPS_3302 0x816 -#define BCM43xx_COREID_USB11_HOST 0x817 -#define BCM43xx_COREID_USB11_DEV 0x818 -#define BCM43xx_COREID_USB20_HOST 0x819 -#define BCM43xx_COREID_USB20_DEV 0x81a -#define BCM43xx_COREID_SDIO_HOST 0x81b +// FIXME: deletes SSB duplicates. /* Core Information Registers */ #define BCM43xx_CIR_BASE 0xf00
@@ -578,29 +561,9 @@#define BCM43xx_MAX_80211_CORES 2 -#ifdef CONFIG_BCM947XX -#define core_offset (bcm) (bcm)->current_core_offset -#else -#define core_offset (bcm) 0 -#endif - -/* Generic information about a core. */ -struct bcm43xx_coreinfo { -u8 available:1 , - enabled:1 , - initialized:1 ; -/** core_rev revision number */ -u8 rev; -/** Index number for _switch_core() */ -u8 index; -/** core_id ID number */ -u16 id; -/** Core-specific data. */ -void *priv; -}; -/* Additional information for each 80211 core. */ -struct bcm43xx_coreinfo_80211 { +struct bcm43xx_corepriv_80211 { +u8 initialized:1 ;/* PHY device. */ struct bcm43xx_phyinfo phy;/* Radio device. */
@@ -615,7 +578,7 @@/* Context information for a noise calculation (Link Quality). */ struct bcm43xx_noise_calculation { -struct bcm43xx_coreinfo *core_at_start; +struct ssb_core *core_at_start;u8 channel_at_start;u8 calculation_running:1 ;u8 nr_samples;
@@ -685,6 +648,8 @@*/ struct bcm43xx_private { +/* Pointer to the Sonics Silicon Backplane. */ +struct ssb *ssb;struct ieee80211_hw *ieee;struct ieee80211_low_level_stats ieee_stats;
@@ -735,27 +700,19 @@struct bcm43xx_led leds[BCM43xx_NR_LEDS];spinlock_t leds_lock; -/* The currently active core. */ -struct bcm43xx_coreinfo *current_core; -#ifdef CONFIG_BCM947XX -/** current core memory offset */ -u32 current_core_offset; -#endif -struct bcm43xx_coreinfo *active_80211_core; -/* coreinfo structs for all possible cores follow. -* Note that a core might not exist. -* So check the coreinfo flags before using it. +/* Pointers to the available cores. +* If a core is not available, this is NULL. */ -struct bcm43xx_coreinfo core_chipcommon; -struct bcm43xx_coreinfo core_pci; -struct bcm43xx_coreinfo core_80211[ BCM43xx_MAX_80211_CORES ]; +struct ssb_core *core_80211[ BCM43xx_MAX_80211_CORES ]; +struct ssb_core *active_80211_core;//FIXME remove? +struct ssb_core *core_chipcommon; +struct ssb_core *core_pci; +/* Additional information, specific to the 80211 cores. */ -struct bcm43xx_coreinfo_80211 core_80211_ext[ BCM43xx_MAX_80211_CORES ]; +struct bcm43xx_corepriv_80211 corepriv_80211[ BCM43xx_MAX_80211_CORES ];/* Number of available 80211 cores. */ int nr_80211_available; -u32 chipcommon_capabilities; -/* Reason code of the last interrupt. */ u32 irq_reason;u32 dma_reason[4 ];
@@ -829,11 +786,11 @@* any of these functions. */ static inline -struct bcm43xx_coreinfo_80211 * +struct bcm43xx_corepriv_80211 *bcm43xx_current_80211_priv (struct bcm43xx_private *bcm) { -assert (bcm->current_core->id == BCM43xx_COREID_80211); -return bcm->current_core->priv; +assert (bcm->ssb->current_core->cc ==SSB_CC_80211 ); +return bcm->ssb->current_core->priv; }static inline struct bcm43xx_pio *bcm43xx_current_pio (struct bcm43xx_private *bcm)
@@ -894,25 +851,25 @@static inline u16 bcm43xx_read16 (struct bcm43xx_private *bcm,u16 offset) { -return ioread16 (bcm->mmio_addr +core_offset (bcm) + offset); +return ioread16 (bcm->mmio_addr +ssb_core_offset (bcm->ssb) + offset); }static inline void bcm43xx_write16 (struct bcm43xx_private *bcm,u16 offset,u16 value) { -iowrite16 (value, bcm->mmio_addr +core_offset (bcm) + offset); +iowrite16 (value, bcm->mmio_addr +ssb_core_offset (bcm->ssb) + offset); }static inline u32 bcm43xx_read32 (struct bcm43xx_private *bcm,u16 offset) { -return ioread32 (bcm->mmio_addr +core_offset (bcm) + offset); +return ioread32 (bcm->mmio_addr +ssb_core_offset (bcm->ssb) + offset); }static inline void bcm43xx_write32 (struct bcm43xx_private *bcm,u16 offset,u32 value) { -iowrite32 (value, bcm->mmio_addr +core_offset (bcm) + offset); +iowrite32 (value, bcm->mmio_addr +ssb_core_offset (bcm->ssb) + offset); } static inline
drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +176 -522
1,057 lines not on this page · raw message
drivers/net/wireless/d80211/bcm43xx/bcm43xx_debugfs.c +7 -7
@@ -95,21 +95,21 @@fappend ("IRQ: %d\n" , bcm->irq);fappend ("mmio_addr: 0x%p\n" , bcm->mmio_addr);fappend ("chip_id: 0x%04x chip_rev: 0x%02x\n" , bcm->chip_id, bcm->chip_rev); -if ((bcm->core_80211[0 ].rev >=3 ) && (bcm43xx_read32 (bcm,0x0158 ) & (1 <<16 ))) +if ((bcm->core_80211[0 ]->rev >=3 ) && (bcm43xx_read32 (bcm,0x0158 ) & (1 <<16 )))fappend ("Radio disabled by hardware!\n" ); -if ((bcm->core_80211[0 ].rev <3 ) && !(bcm43xx_read16 (bcm,0x049A ) & (1 <<4 ))) +if ((bcm->core_80211[0 ]->rev <3 ) && !(bcm43xx_read16 (bcm,0x049A ) & (1 <<4 )))fappend ("Radio disabled by hardware!\n" );fappend ("board_vendor: 0x%04x board_type: 0x%04x\n" , bcm->board_vendor, bcm->board_type);fappend ("\nCores:\n" ); -#define fappend_core (name, info) fappend("core \"" name "\" %s, %s, id: 0x%04x, " \ +#define fappend_core (name, info) fappend("core \"" name "\" %s, id: 0x%04x, " \ "rev: 0x%02x, index: 0x%02x\n", \ - (info).available \ + (info) \ ? "available" : "nonavailable", \ - (info).enabled \ - ? "enabled" : "disabled", \ - (info).id, (info).rev, (info).index) + (info) ? (info)->cc : 0, \ + (info) ? (info)->rev : 0, \ + (info) ? (info)->index : 0)fappend_core ("CHIPCOMMON" , bcm->core_chipcommon);fappend_core ("PCI" , bcm->core_pci);fappend_core ("first 80211" , bcm->core_80211[0 ]);
drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +1 -1
@@ -569,7 +569,7 @@ goto err_destroy_tx3; dma->rx_ring0 = ring; -if (bcm->current_core->rev <5 ) { +if (bcm->ssb->current_core->rev <5 ) { ring =bcm43xx_setup_dmaring (bcm, BCM43xx_MMIO_DMA4_BASE, BCM43xx_RXRING_SLOTS,0 );if (!ring)
drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.h +0 -2
@@ -128,8 +128,6 @@void bcm43xx_dummy_transmission (struct bcm43xx_private *bcm); -int bcm43xx_switch_core (struct bcm43xx_private *bcm,struct bcm43xx_coreinfo *new_core); -int bcm43xx_select_wireless_core (struct bcm43xx_private *bcm,int phytype);
drivers/net/wireless/d80211/bcm43xx/bcm43xx_phy.c +4 -4
@@ -90,7 +90,7 @@ phy->is_locked =0 ;return ; } -if (bcm->current_core->rev <3 ) { +if (bcm->ssb->current_core->rev <3 ) {bcm43xx_mac_suspend (bcm);spin_lock (&phy->lock); }else {
@@ -105,7 +105,7 @@struct bcm43xx_phyinfo *phy =bcm43xx_current_phy (bcm);assert (irqs_disabled ()); -if (bcm->current_core->rev <3 ) { +if (bcm->ssb->current_core->rev <3 ) {if (phy->is_locked) {spin_unlock (&phy->lock);bcm43xx_mac_enable (bcm);
@@ -161,7 +161,7 @@struct bcm43xx_phyinfo *phy =bcm43xx_current_phy (bcm);u32 flags; -if (bcm->current_core->rev <5 ) +if (bcm->ssb->current_core->rev <5 ) goto out; flags =bcm43xx_read32 (bcm, BCM43xx_CIR_SBTMSTATEHIGH);
@@ -2329,7 +2329,7 @@ }break ;case BCM43xx_PHYTYPE_B: -if (bcm->current_core->rev ==2 ) +if (bcm->ssb->current_core->rev ==2 ) value = (3 /*automatic*/ <<7 );else value = (antennadiv <<7 );
drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c +2 -2
@@ -316,7 +316,7 @@ queue->bcm = bcm; queue->mmio_base = pio_mmio_base; - queue->need_workarounds = (bcm->current_core->rev <3 ); + queue->need_workarounds = (bcm->ssb->current_core->rev <3 );INIT_LIST_HEAD (&queue->txfree);INIT_LIST_HEAD (&queue->txqueue);
@@ -420,7 +420,7 @@ goto err_destroy2; pio->queue3 = queue; -if (bcm->current_core->rev <3 ) +if (bcm->ssb->current_core->rev <3 ) bcm->irq_savedstate |= BCM43xx_IRQ_PIO_WORKAROUND; dprintk(KERN_INFO PFX "PIO initialized\n");
drivers/net/wireless/d80211/bcm43xx/bcm43xx_power.c +36 -31
168 lines not on this page · raw message
drivers/net/wireless/d80211/bcm43xx/bcm43xx_radio.c +1 -1
@@ -1997,7 +1997,7 @@bcm43xx_phy_write (bcm,0x0010 ,bcm43xx_phy_read (bcm,0x0010 ) |0x0008 );bcm43xx_phy_write (bcm,0x0011 ,bcm43xx_phy_read (bcm,0x0011 ) |0x0008 ); } -if (phy->type == BCM43xx_PHYTYPE_G && bcm->current_core->rev >=5 ) { +if (phy->type == BCM43xx_PHYTYPE_G && bcm->ssb->current_core->rev >=5 ) {bcm43xx_phy_write (bcm,0x0811 ,bcm43xx_phy_read (bcm,0x0811 ) |0x008C );bcm43xx_phy_write (bcm,0x0812 ,bcm43xx_phy_read (bcm,0x0812 ) &0xFF73 ); }else
drivers/net/wireless/d80211/bcm43xx/Kconfig +1 -1
@@ -1,6 +1,6 @@ config BCM43XX_D80211 tristate "Broadcom BCM43xx wireless support (DeviceScape stack)" - depends on PCI && D80211 && NET_RADIO && EXPERIMENTAL + depends on PCI && SONICS_SILICON_BACKPLANE && D80211 && NET_RADIO && EXPERIMENTAL select FW_LOADER ---help--- This is an experimental driver for the Broadcom 43xx wireless chip,
Signature · 1 line
Greetings Michael.