aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ssb
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:04:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 00:04:44 -0400
commitf8965467f366fd18f01feafb5db10512d7b4422c (patch)
tree3706a9cd779859271ca61b85c63a1bc3f82d626e /drivers/ssb
parenta26272e5200765691e67d6780e52b32498fdb659 (diff)
parent2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1674 commits) qlcnic: adding co maintainer ixgbe: add support for active DA cables ixgbe: dcb, do not tag tc_prio_control frames ixgbe: fix ixgbe_tx_is_paused logic ixgbe: always enable vlan strip/insert when DCB is enabled ixgbe: remove some redundant code in setting FCoE FIP filter ixgbe: fix wrong offset to fc_frame_header in ixgbe_fcoe_ddp ixgbe: fix header len when unsplit packet overflows to data buffer ipv6: Never schedule DAD timer on dead address ipv6: Use POSTDAD state ipv6: Use state_lock to protect ifa state ipv6: Replace inet6_ifaddr->dead with state cxgb4: notify upper drivers if the device is already up when they load cxgb4: keep interrupts available when the ports are brought down cxgb4: fix initial addition of MAC address cnic: Return SPQ credit to bnx2x after ring setup and shutdown. cnic: Convert cnic_local_flags to atomic ops. can: Fix SJA1000 command register writes on SMP systems bridge: fix build for CONFIG_SYSFS disabled ARCNET: Limit com20020 PCI ID matches for SOHARD cards ... Fix up various conflicts with pcmcia tree drivers/net/ {pcmcia/3c589_cs.c, wireless/orinoco/orinoco_cs.c and wireless/orinoco/spectrum_cs.c} and feature removal (Documentation/feature-removal-schedule.txt). Also fix a non-content conflict due to pm_qos_requirement getting renamed in the PM tree (now pm_qos_request) in net/mac80211/scan.c
Diffstat (limited to 'drivers/ssb')
-rw-r--r--drivers/ssb/driver_chipcommon.c3
-rw-r--r--drivers/ssb/main.c3
-rw-r--r--drivers/ssb/pci.c14
-rw-r--r--drivers/ssb/sprom.c14
4 files changed, 31 insertions, 3 deletions
diff --git a/drivers/ssb/driver_chipcommon.c b/drivers/ssb/driver_chipcommon.c
index 9681536163ca..59ae76bace14 100644
--- a/drivers/ssb/driver_chipcommon.c
+++ b/drivers/ssb/driver_chipcommon.c
@@ -233,6 +233,8 @@ void ssb_chipcommon_init(struct ssb_chipcommon *cc)
233{ 233{
234 if (!cc->dev) 234 if (!cc->dev)
235 return; /* We don't have a ChipCommon */ 235 return; /* We don't have a ChipCommon */
236 if (cc->dev->id.revision >= 11)
237 cc->status = chipco_read32(cc, SSB_CHIPCO_CHIPSTAT);
236 ssb_pmu_init(cc); 238 ssb_pmu_init(cc);
237 chipco_powercontrol_init(cc); 239 chipco_powercontrol_init(cc);
238 ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST); 240 ssb_chipco_set_clockmode(cc, SSB_CLKMODE_FAST);
@@ -370,6 +372,7 @@ u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value)
370{ 372{
371 return chipco_write32_masked(cc, SSB_CHIPCO_GPIOCTL, mask, value); 373 return chipco_write32_masked(cc, SSB_CHIPCO_GPIOCTL, mask, value);
372} 374}
375EXPORT_SYMBOL(ssb_chipco_gpio_control);
373 376
374u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value) 377u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value)
375{ 378{
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index bc9bdb277bec..51275aac5b34 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -834,6 +834,9 @@ int ssb_bus_pcibus_register(struct ssb_bus *bus,
834 if (!err) { 834 if (!err) {
835 ssb_printk(KERN_INFO PFX "Sonics Silicon Backplane found on " 835 ssb_printk(KERN_INFO PFX "Sonics Silicon Backplane found on "
836 "PCI device %s\n", dev_name(&host_pci->dev)); 836 "PCI device %s\n", dev_name(&host_pci->dev));
837 } else {
838 ssb_printk(KERN_ERR PFX "Failed to register PCI version"
839 " of SSB with error %d\n", err);
837 } 840 }
838 841
839 return err; 842 return err;
diff --git a/drivers/ssb/pci.c b/drivers/ssb/pci.c
index a8dbb06623c9..989e2752cc36 100644
--- a/drivers/ssb/pci.c
+++ b/drivers/ssb/pci.c
@@ -168,7 +168,7 @@ err_pci:
168} 168}
169 169
170/* Get the word-offset for a SSB_SPROM_XXX define. */ 170/* Get the word-offset for a SSB_SPROM_XXX define. */
171#define SPOFF(offset) (((offset) - SSB_SPROM_BASE) / sizeof(u16)) 171#define SPOFF(offset) ((offset) / sizeof(u16))
172/* Helper to extract some _offset, which is one of the SSB_SPROM_XXX defines. */ 172/* Helper to extract some _offset, which is one of the SSB_SPROM_XXX defines. */
173#define SPEX16(_outvar, _offset, _mask, _shift) \ 173#define SPEX16(_outvar, _offset, _mask, _shift) \
174 out->_outvar = ((in[SPOFF(_offset)] & (_mask)) >> (_shift)) 174 out->_outvar = ((in[SPOFF(_offset)] & (_mask)) >> (_shift))
@@ -254,7 +254,7 @@ static int sprom_do_read(struct ssb_bus *bus, u16 *sprom)
254 int i; 254 int i;
255 255
256 for (i = 0; i < bus->sprom_size; i++) 256 for (i = 0; i < bus->sprom_size; i++)
257 sprom[i] = ioread16(bus->mmio + SSB_SPROM_BASE + (i * 2)); 257 sprom[i] = ioread16(bus->mmio + bus->sprom_offset + (i * 2));
258 258
259 return 0; 259 return 0;
260} 260}
@@ -285,7 +285,7 @@ static int sprom_do_write(struct ssb_bus *bus, const u16 *sprom)
285 ssb_printk("75%%"); 285 ssb_printk("75%%");
286 else if (i % 2) 286 else if (i % 2)
287 ssb_printk("."); 287 ssb_printk(".");
288 writew(sprom[i], bus->mmio + SSB_SPROM_BASE + (i * 2)); 288 writew(sprom[i], bus->mmio + bus->sprom_offset + (i * 2));
289 mmiowb(); 289 mmiowb();
290 msleep(20); 290 msleep(20);
291 } 291 }
@@ -621,6 +621,14 @@ static int ssb_pci_sprom_get(struct ssb_bus *bus,
621 int err = -ENOMEM; 621 int err = -ENOMEM;
622 u16 *buf; 622 u16 *buf;
623 623
624 if (!ssb_is_sprom_available(bus)) {
625 ssb_printk(KERN_ERR PFX "No SPROM available!\n");
626 return -ENODEV;
627 }
628
629 bus->sprom_offset = (bus->chipco.dev->id.revision < 31) ?
630 SSB_SPROM_BASE1 : SSB_SPROM_BASE31;
631
624 buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL); 632 buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL);
625 if (!buf) 633 if (!buf)
626 goto out; 634 goto out;
diff --git a/drivers/ssb/sprom.c b/drivers/ssb/sprom.c
index f2f920fef10d..007bc3a03486 100644
--- a/drivers/ssb/sprom.c
+++ b/drivers/ssb/sprom.c
@@ -176,3 +176,17 @@ const struct ssb_sprom *ssb_get_fallback_sprom(void)
176{ 176{
177 return fallback_sprom; 177 return fallback_sprom;
178} 178}
179
180/* http://bcm-v4.sipsolutions.net/802.11/IsSpromAvailable */
181bool ssb_is_sprom_available(struct ssb_bus *bus)
182{
183 /* status register only exists on chipcomon rev >= 11 and we need check
184 for >= 31 only */
185 /* this routine differs from specs as we do not access SPROM directly
186 on PCMCIA */
187 if (bus->bustype == SSB_BUSTYPE_PCI &&
188 bus->chipco.dev->id.revision >= 31)
189 return bus->chipco.capabilities & SSB_CHIPCO_CAP_SPROM;
190
191 return true;
192}