aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2011-12-12 18:15:10 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-13 15:48:30 -0500
commit99559f136559e6822f20fcf1b63e6910df126941 (patch)
tree1686bf90851e763a7d27df41a919f4c0d581c6df
parent3b758a68402fc5b1c2dbc246595dbdc062bf0da9 (diff)
brcm80211: smac: cleanup si_info structure definition
Number of fields are no longer needed as the BCMA provides it or makes them redundant. These have been removed. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/aiutils.c51
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/aiutils.h27
2 files changed, 11 insertions, 67 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
index f78350a668df..34a5e022509e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -454,29 +454,6 @@ struct aidmp {
454 u32 componentid3; /* 0xffc */ 454 u32 componentid3; /* 0xffc */
455}; 455};
456 456
457/* parse the enumeration rom to identify all cores */
458static void ai_scan(struct si_pub *sih, struct bcma_bus *bus)
459{
460 struct si_info *sii = (struct si_info *)sih;
461 struct bcma_device *core;
462 uint idx;
463
464 list_for_each_entry(core, &bus->cores, list) {
465 idx = core->core_index;
466 sii->cia[idx] = core->id.manuf << CIA_MFG_SHIFT;
467 sii->cia[idx] |= core->id.id << CIA_CID_SHIFT;
468 sii->cia[idx] |= core->id.class << CIA_CCL_SHIFT;
469 sii->cib[idx] = core->id.rev << CIB_REV_SHIFT;
470 sii->coreid[idx] = core->id.id;
471 sii->coresba[idx] = core->addr;
472 sii->coresba_size[idx] = 0x1000;
473 sii->coresba2[idx] = 0;
474 sii->coresba2_size[idx] = 0;
475 sii->wrapba[idx] = core->wrap;
476 sii->numcores++;
477 }
478}
479
480/* return true if PCIE capability exists in the pci config space */ 457/* return true if PCIE capability exists in the pci config space */
481static bool ai_ispcie(struct si_info *sii) 458static bool ai_ispcie(struct si_info *sii)
482{ 459{
@@ -502,10 +479,16 @@ static bool ai_buscore_prep(struct si_info *sii)
502static bool 479static bool
503ai_buscore_setup(struct si_info *sii, struct bcma_device *cc) 480ai_buscore_setup(struct si_info *sii, struct bcma_device *cc)
504{ 481{
482 struct bcma_device *core;
505 bool pci, pcie; 483 bool pci, pcie;
506 uint i; 484 uint i;
507 uint pciidx, pcieidx, pcirev, pcierev; 485 uint pciidx, pcieidx, pcirev, pcierev;
508 486
487
488 /* no cores found, bail out */
489 if (cc->bus->nr_cores == 0)
490 return false;
491
509 /* get chipcommon rev */ 492 /* get chipcommon rev */
510 sii->pub.ccrev = cc->id.rev; 493 sii->pub.ccrev = cc->id.rev;
511 494
@@ -532,11 +515,11 @@ ai_buscore_setup(struct si_info *sii, struct bcma_device *cc)
532 pcirev = pcierev = NOREV; 515 pcirev = pcierev = NOREV;
533 pciidx = pcieidx = BADIDX; 516 pciidx = pcieidx = BADIDX;
534 517
535 for (i = 0; i < sii->numcores; i++) { 518 list_for_each_entry(core, &cc->bus->cores, list) {
536 uint cid, crev; 519 uint cid, crev;
537 520
538 cid = sii->coreid[i]; 521 cid = core->id.id;
539 crev = (sii->cib[i] & CIB_REV_MASK) >> CIB_REV_SHIFT; 522 crev = core->id.rev;
540 523
541 if (cid == PCI_CORE_ID) { 524 if (cid == PCI_CORE_ID) {
542 pciidx = i; 525 pciidx = i;
@@ -596,7 +579,6 @@ static __used void ai_nvram_process(struct si_info *sii)
596static struct si_info *ai_doattach(struct si_info *sii, 579static struct si_info *ai_doattach(struct si_info *sii,
597 struct bcma_bus *pbus) 580 struct bcma_bus *pbus)
598{ 581{
599 void __iomem *regs = pbus->mmio;
600 struct si_pub *sih = &sii->pub; 582 struct si_pub *sih = &sii->pub;
601 u32 w, savewin; 583 u32 w, savewin;
602 struct bcma_device *cc; 584 struct bcma_device *cc;
@@ -609,8 +591,6 @@ static struct si_info *ai_doattach(struct si_info *sii,
609 sii->icbus = pbus; 591 sii->icbus = pbus;
610 sii->buscoreidx = BADIDX; 592 sii->buscoreidx = BADIDX;
611 sii->pcibus = pbus->host_pci; 593 sii->pcibus = pbus->host_pci;
612 sii->curmap = regs;
613 sii->curwrap = sii->curmap + SI_CORE_SIZE;
614 594
615 /* switch to Chipcommon core */ 595 /* switch to Chipcommon core */
616 cc = pbus->drv_cc.core; 596 cc = pbus->drv_cc.core;
@@ -634,19 +614,10 @@ static struct si_info *ai_doattach(struct si_info *sii,
634 sih->chippkg = (w & CID_PKG_MASK) >> CID_PKG_SHIFT; 614 sih->chippkg = (w & CID_PKG_MASK) >> CID_PKG_SHIFT;
635 615
636 /* scan for cores */ 616 /* scan for cores */
637 if (socitype == SOCI_AI) { 617 if (socitype != SOCI_AI)
638 SI_MSG("Found chip type AI (0x%08x)\n", w);
639 /* pass chipc address instead of original core base */
640 ai_scan(&sii->pub, pbus);
641 } else {
642 /* Found chip of unknown type */
643 return NULL;
644 }
645 /* no cores found, bail out */
646 if (sii->numcores == 0)
647 return NULL; 618 return NULL;
648 619
649 /* bus/core/clk setup */ 620 SI_MSG("Found chip type AI (0x%08x)\n", w);
650 if (!ai_buscore_setup(sii, cc)) 621 if (!ai_buscore_setup(sii, cc))
651 goto exit; 622 goto exit;
652 623
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
index 6742758e4d45..f9f88ddbe4af 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
@@ -174,39 +174,12 @@ struct si_info {
174 struct si_pub pub; /* back plane public state (must be first) */ 174 struct si_pub pub; /* back plane public state (must be first) */
175 struct bcma_bus *icbus; /* handle to soc interconnect bus */ 175 struct bcma_bus *icbus; /* handle to soc interconnect bus */
176 struct pci_dev *pcibus; /* handle to pci bus */ 176 struct pci_dev *pcibus; /* handle to pci bus */
177 uint dev_coreid; /* the core provides driver functions */
178 void *intr_arg; /* interrupt callback function arg */
179 u32 (*intrsoff_fn) (void *intr_arg); /* turns chip interrupts off */
180 /* restore chip interrupts */
181 void (*intrsrestore_fn) (void *intr_arg, u32 arg);
182 /* check if interrupts are enabled */
183 bool (*intrsenabled_fn) (void *intr_arg);
184
185 struct pcicore_info *pch; /* PCI/E core handle */ 177 struct pcicore_info *pch; /* PCI/E core handle */
186 178
187 struct list_head var_list; /* list of srom variables */ 179 struct list_head var_list; /* list of srom variables */
188 180
189 void __iomem *curmap; /* current regs va */
190 void __iomem *regs[SI_MAXCORES]; /* other regs va */
191
192 u32 chipst; /* chip status */ 181 u32 chipst; /* chip status */
193 uint curidx; /* current core index */
194 uint buscoreidx; /* buscore index */ 182 uint buscoreidx; /* buscore index */
195 uint numcores; /* # discovered cores */
196 uint coreid[SI_MAXCORES]; /* id of each core */
197 u32 coresba[SI_MAXCORES]; /* backplane address of each core */
198 void *regs2[SI_MAXCORES]; /* 2nd virtual address per core (usbh20) */
199 u32 coresba2[SI_MAXCORES]; /* 2nd phys address per core (usbh20) */
200 u32 coresba_size[SI_MAXCORES]; /* backplane address space size */
201 u32 coresba2_size[SI_MAXCORES]; /* second address space size */
202
203 void *curwrap; /* current wrapper va */
204 void *wrappers[SI_MAXCORES]; /* other cores wrapper va */
205 u32 wrapba[SI_MAXCORES]; /* address of controlling wrapper */
206
207 u32 cia[SI_MAXCORES]; /* erom cia entry for each core */
208 u32 cib[SI_MAXCORES]; /* erom cia entry for each core */
209 u32 oob_router; /* oob router registers for axi */
210}; 183};
211 184
212/* 185/*