Commit 5672cfa3 authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: removed ASSERTs from util dir, part 2

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 909f43a0
...@@ -138,7 +138,6 @@ void ai_scan(si_t *sih, void *regs, uint devid) ...@@ -138,7 +138,6 @@ void ai_scan(si_t *sih, void *regs, uint devid)
default: default:
SI_ERROR(("Don't know how to do AXI enumertion on bus %d\n", SI_ERROR(("Don't know how to do AXI enumertion on bus %d\n",
sih->bustype)); sih->bustype));
ASSERT(0);
return; return;
} }
eromlim = eromptr + (ER_REMAPCONTROL / sizeof(u32)); eromlim = eromptr + (ER_REMAPCONTROL / sizeof(u32));
...@@ -322,24 +321,15 @@ void *ai_setcoreidx(si_t *sih, uint coreidx) ...@@ -322,24 +321,15 @@ void *ai_setcoreidx(si_t *sih, uint coreidx)
if (coreidx >= sii->numcores) if (coreidx >= sii->numcores)
return NULL; return NULL;
/*
* If the user has provided an interrupt mask enabled function,
* then assert interrupts are disabled before switching the core.
*/
ASSERT((sii->intrsenabled_fn == NULL)
|| !(*(sii)->intrsenabled_fn) ((sii)->intr_arg));
switch (sih->bustype) { switch (sih->bustype) {
case SI_BUS: case SI_BUS:
/* map new one */ /* map new one */
if (!sii->regs[coreidx]) { if (!sii->regs[coreidx]) {
sii->regs[coreidx] = REG_MAP(addr, SI_CORE_SIZE); sii->regs[coreidx] = REG_MAP(addr, SI_CORE_SIZE);
ASSERT(GOODREGS(sii->regs[coreidx]));
} }
sii->curmap = regs = sii->regs[coreidx]; sii->curmap = regs = sii->regs[coreidx];
if (!sii->wrappers[coreidx]) { if (!sii->wrappers[coreidx]) {
sii->wrappers[coreidx] = REG_MAP(wrap, SI_CORE_SIZE); sii->wrappers[coreidx] = REG_MAP(wrap, SI_CORE_SIZE);
ASSERT(GOODREGS(sii->wrappers[coreidx]));
} }
sii->curwrap = sii->wrappers[coreidx]; sii->curwrap = sii->wrappers[coreidx];
break; break;
...@@ -359,7 +349,6 @@ void *ai_setcoreidx(si_t *sih, uint coreidx) ...@@ -359,7 +349,6 @@ void *ai_setcoreidx(si_t *sih, uint coreidx)
break; break;
default: default:
ASSERT(0);
regs = NULL; regs = NULL;
break; break;
} }
...@@ -494,10 +483,6 @@ uint ai_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val) ...@@ -494,10 +483,6 @@ uint ai_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val)
sii = SI_INFO(sih); sii = SI_INFO(sih);
ASSERT(GOODIDX(coreidx));
ASSERT(regoff < SI_CORE_SIZE);
ASSERT((val & ~mask) == 0);
if (coreidx >= SI_MAXCORES) if (coreidx >= SI_MAXCORES)
return 0; return 0;
...@@ -508,7 +493,6 @@ uint ai_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val) ...@@ -508,7 +493,6 @@ uint ai_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val)
if (!sii->regs[coreidx]) { if (!sii->regs[coreidx]) {
sii->regs[coreidx] = REG_MAP(sii->coresba[coreidx], sii->regs[coreidx] = REG_MAP(sii->coresba[coreidx],
SI_CORE_SIZE); SI_CORE_SIZE);
ASSERT(GOODREGS(sii->regs[coreidx]));
} }
r = (u32 *) ((unsigned char *) sii->regs[coreidx] + regoff); r = (u32 *) ((unsigned char *) sii->regs[coreidx] + regoff);
} else if (sih->bustype == PCI_BUS) { } else if (sih->bustype == PCI_BUS) {
...@@ -548,7 +532,6 @@ uint ai_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val) ...@@ -548,7 +532,6 @@ uint ai_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val)
r = (u32 *) ((unsigned char *) ai_setcoreidx(&sii->pub, coreidx) + r = (u32 *) ((unsigned char *) ai_setcoreidx(&sii->pub, coreidx) +
regoff); regoff);
} }
ASSERT(r != NULL);
/* mask and set */ /* mask and set */
if (mask || val) { if (mask || val) {
...@@ -578,7 +561,6 @@ void ai_core_disable(si_t *sih, u32 bits) ...@@ -578,7 +561,6 @@ void ai_core_disable(si_t *sih, u32 bits)
sii = SI_INFO(sih); sii = SI_INFO(sih);
ASSERT(GOODREGS(sii->curwrap));
ai = sii->curwrap; ai = sii->curwrap;
/* if core is already in reset, just return */ /* if core is already in reset, just return */
...@@ -605,7 +587,6 @@ void ai_core_reset(si_t *sih, u32 bits, u32 resetbits) ...@@ -605,7 +587,6 @@ void ai_core_reset(si_t *sih, u32 bits, u32 resetbits)
volatile u32 dummy; volatile u32 dummy;
sii = SI_INFO(sih); sii = SI_INFO(sih);
ASSERT(GOODREGS(sii->curwrap));
ai = sii->curwrap; ai = sii->curwrap;
/* /*
...@@ -640,11 +621,8 @@ void ai_core_cflags_wo(si_t *sih, u32 mask, u32 val) ...@@ -640,11 +621,8 @@ void ai_core_cflags_wo(si_t *sih, u32 mask, u32 val)
return; return;
} }
ASSERT(GOODREGS(sii->curwrap));
ai = sii->curwrap; ai = sii->curwrap;
ASSERT((val & ~mask) == 0);
if (mask || val) { if (mask || val) {
w = ((R_REG(&ai->ioctrl) & ~mask) | val); w = ((R_REG(&ai->ioctrl) & ~mask) | val);
W_REG(&ai->ioctrl, w); W_REG(&ai->ioctrl, w);
...@@ -664,11 +642,8 @@ u32 ai_core_cflags(si_t *sih, u32 mask, u32 val) ...@@ -664,11 +642,8 @@ u32 ai_core_cflags(si_t *sih, u32 mask, u32 val)
return 0; return 0;
} }
ASSERT(GOODREGS(sii->curwrap));
ai = sii->curwrap; ai = sii->curwrap;
ASSERT((val & ~mask) == 0);
if (mask || val) { if (mask || val) {
w = ((R_REG(&ai->ioctrl) & ~mask) | val); w = ((R_REG(&ai->ioctrl) & ~mask) | val);
W_REG(&ai->ioctrl, w); W_REG(&ai->ioctrl, w);
...@@ -689,12 +664,8 @@ u32 ai_core_sflags(si_t *sih, u32 mask, u32 val) ...@@ -689,12 +664,8 @@ u32 ai_core_sflags(si_t *sih, u32 mask, u32 val)
return 0; return 0;
} }
ASSERT(GOODREGS(sii->curwrap));
ai = sii->curwrap; ai = sii->curwrap;
ASSERT((val & ~mask) == 0);
ASSERT((mask & ~SISF_CORE_BITS) == 0);
if (mask || val) { if (mask || val) {
w = ((R_REG(&ai->iostatus) & ~mask) | val); w = ((R_REG(&ai->iostatus) & ~mask) | val);
W_REG(&ai->iostatus, w); W_REG(&ai->iostatus, w);
......
...@@ -280,8 +280,6 @@ void pktq_flush(struct pktq *pq, bool dir, ...@@ -280,8 +280,6 @@ void pktq_flush(struct pktq *pq, bool dir,
int prec; int prec;
for (prec = 0; prec < pq->num_prec; prec++) for (prec = 0; prec < pq->num_prec; prec++)
pktq_pflush(pq, prec, dir, fn, arg); pktq_pflush(pq, prec, dir, fn, arg);
if (fn == NULL)
ASSERT(pq->len == 0);
} }
#endif /* BRCM_FULLMAC */ #endif /* BRCM_FULLMAC */
...@@ -289,8 +287,6 @@ void pktq_init(struct pktq *pq, int num_prec, int max_len) ...@@ -289,8 +287,6 @@ void pktq_init(struct pktq *pq, int num_prec, int max_len)
{ {
int prec; int prec;
ASSERT(num_prec > 0 && num_prec <= PKTQ_MAX_PREC);
/* pq is variable size; only zero out what's requested */ /* pq is variable size; only zero out what's requested */
memset(pq, 0, memset(pq, 0,
offsetof(struct pktq, q) + (sizeof(struct pktq_prec) * num_prec)); offsetof(struct pktq, q) + (sizeof(struct pktq_prec) * num_prec));
......
...@@ -60,7 +60,6 @@ u8 wf_chspec_ctlchan(chanspec_t chspec) ...@@ -60,7 +60,6 @@ u8 wf_chspec_ctlchan(chanspec_t chspec)
return CHSPEC_CHANNEL(chspec); return CHSPEC_CHANNEL(chspec);
} else { } else {
/* we only support 40MHZ with sidebands */ /* we only support 40MHZ with sidebands */
ASSERT(CHSPEC_BW(chspec) == WL_CHANSPEC_BW_40);
/* chanspec channel holds the centre frequency, use that and the /* chanspec channel holds the centre frequency, use that and the
* side band information to reconstruct the control channel number * side band information to reconstruct the control channel number
*/ */
...@@ -68,8 +67,6 @@ u8 wf_chspec_ctlchan(chanspec_t chspec) ...@@ -68,8 +67,6 @@ u8 wf_chspec_ctlchan(chanspec_t chspec)
/* control chan is the upper 20 MHZ SB of the 40MHZ channel */ /* control chan is the upper 20 MHZ SB of the 40MHZ channel */
ctl_chan = UPPER_20_SB(CHSPEC_CHANNEL(chspec)); ctl_chan = UPPER_20_SB(CHSPEC_CHANNEL(chspec));
} else { } else {
ASSERT(CHSPEC_CTL_SB(chspec) ==
WL_CHANSPEC_CTL_SB_LOWER);
/* control chan is the lower 20 MHZ SB of the 40MHZ channel */ /* control chan is the lower 20 MHZ SB of the 40MHZ channel */
ctl_chan = LOWER_20_SB(CHSPEC_CHANNEL(chspec)); ctl_chan = LOWER_20_SB(CHSPEC_CHANNEL(chspec));
} }
......
...@@ -293,23 +293,9 @@ struct hnddma_pub *dma_attach(char *name, si_t *sih, ...@@ -293,23 +293,9 @@ struct hnddma_pub *dma_attach(char *name, si_t *sih,
di->msg_level = msg_level ? msg_level : &dma_msg_level; di->msg_level = msg_level ? msg_level : &dma_msg_level;
/* old chips w/o sb is no longer supported */
ASSERT(sih != NULL);
di->dma64 = ((si_core_sflags(sih, 0, 0) & SISF_DMA64) == SISF_DMA64); di->dma64 = ((si_core_sflags(sih, 0, 0) & SISF_DMA64) == SISF_DMA64);
/* check arguments */
ASSERT(ISPOWEROF2(ntxd));
ASSERT(ISPOWEROF2(nrxd));
if (nrxd == 0)
ASSERT(dmaregsrx == NULL);
if (ntxd == 0)
ASSERT(dmaregstx == NULL);
/* init dma reg pointer */ /* init dma reg pointer */
ASSERT(ntxd <= D64MAXDD);
ASSERT(nrxd <= D64MAXDD);
di->d64txregs = (dma64regs_t *) dmaregstx; di->d64txregs = (dma64regs_t *) dmaregstx;
di->d64rxregs = (dma64regs_t *) dmaregsrx; di->d64rxregs = (dma64regs_t *) dmaregsrx;
di->hnddma.di_fn = (const di_fcn_t *)&dma64proc; di->hnddma.di_fn = (const di_fcn_t *)&dma64proc;
...@@ -488,7 +474,6 @@ dma64_dd_upd(dma_info_t *di, dma64dd_t *ddring, dmaaddr_t pa, uint outidx, ...@@ -488,7 +474,6 @@ dma64_dd_upd(dma_info_t *di, dma64dd_t *ddring, dmaaddr_t pa, uint outidx,
#else #else
if ((di->dataoffsetlow == 0) || !(PHYSADDRLO(pa) & PCI32ADDR_HIGH)) { if ((di->dataoffsetlow == 0) || !(PHYSADDRLO(pa) & PCI32ADDR_HIGH)) {
#endif /* defined(__mips__) && defined(IL_BIGENDIAN) */ #endif /* defined(__mips__) && defined(IL_BIGENDIAN) */
ASSERT((PHYSADDRHI(pa) & PCI64ADDR_HIGH) == 0);
W_SM(&ddring[outidx].addrlow, W_SM(&ddring[outidx].addrlow,
BUS_SWAP32(PHYSADDRLO(pa) + di->dataoffsetlow)); BUS_SWAP32(PHYSADDRLO(pa) + di->dataoffsetlow));
...@@ -499,11 +484,9 @@ dma64_dd_upd(dma_info_t *di, dma64dd_t *ddring, dmaaddr_t pa, uint outidx, ...@@ -499,11 +484,9 @@ dma64_dd_upd(dma_info_t *di, dma64dd_t *ddring, dmaaddr_t pa, uint outidx,
} else { } else {
/* address extension for 32-bit PCI */ /* address extension for 32-bit PCI */
u32 ae; u32 ae;
ASSERT(di->addrext);
ae = (PHYSADDRLO(pa) & PCI32ADDR_HIGH) >> PCI32ADDR_HIGH_SHIFT; ae = (PHYSADDRLO(pa) & PCI32ADDR_HIGH) >> PCI32ADDR_HIGH_SHIFT;
PHYSADDRLO(pa) &= ~PCI32ADDR_HIGH; PHYSADDRLO(pa) &= ~PCI32ADDR_HIGH;
ASSERT(PHYSADDRHI(pa) == 0);
ctrl2 |= (ae << D64_CTRL2_AE_SHIFT) & D64_CTRL2_AE; ctrl2 |= (ae << D64_CTRL2_AE_SHIFT) & D64_CTRL2_AE;
W_SM(&ddring[outidx].addrlow, W_SM(&ddring[outidx].addrlow,
...@@ -544,10 +527,6 @@ static void _dma_detach(dma_info_t *di) ...@@ -544,10 +527,6 @@ static void _dma_detach(dma_info_t *di)
DMA_TRACE(("%s: dma_detach\n", di->name)); DMA_TRACE(("%s: dma_detach\n", di->name));
/* shouldn't be here if descriptors are unreclaimed */
ASSERT(di->txin == di->txout);
ASSERT(di->rxin == di->rxout);
/* free dma descriptor rings */ /* free dma descriptor rings */
if (di->txd64) if (di->txd64)
pci_free_consistent(di->pbus, di->txdalloc, pci_free_consistent(di->pbus, di->txdalloc,
...@@ -602,14 +581,12 @@ static bool _dma_isaddrext(dma_info_t *di) ...@@ -602,14 +581,12 @@ static bool _dma_isaddrext(dma_info_t *di)
if (!_dma64_addrext(di->d64txregs)) { if (!_dma64_addrext(di->d64txregs)) {
DMA_ERROR(("%s: _dma_isaddrext: DMA64 tx doesn't have " DMA_ERROR(("%s: _dma_isaddrext: DMA64 tx doesn't have "
"AE set\n", di->name)); "AE set\n", di->name));
ASSERT(0);
} }
return true; return true;
} else if (di->d64rxregs != NULL) { } else if (di->d64rxregs != NULL) {
if (!_dma64_addrext(di->d64rxregs)) { if (!_dma64_addrext(di->d64rxregs)) {
DMA_ERROR(("%s: _dma_isaddrext: DMA64 rx doesn't have " DMA_ERROR(("%s: _dma_isaddrext: DMA64 rx doesn't have "
"AE set\n", di->name)); "AE set\n", di->name));
ASSERT(0);
} }
return true; return true;
} }
...@@ -642,8 +619,6 @@ static void _dma_ddtable_init(dma_info_t *di, uint direction, dmaaddr_t pa) ...@@ -642,8 +619,6 @@ static void _dma_ddtable_init(dma_info_t *di, uint direction, dmaaddr_t pa)
} else { } else {
/* DMA64 32bits address extension */ /* DMA64 32bits address extension */
u32 ae; u32 ae;
ASSERT(di->addrext);
ASSERT(PHYSADDRHI(pa) == 0);
/* shift the high bit(s) from pa to ae */ /* shift the high bit(s) from pa to ae */
ae = (PHYSADDRLO(pa) & PCI32ADDR_HIGH) >> ae = (PHYSADDRLO(pa) & PCI32ADDR_HIGH) >>
...@@ -783,7 +758,6 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di) ...@@ -783,7 +758,6 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di)
#ifdef BCMDBG #ifdef BCMDBG
if (resid > 0) { if (resid > 0) {
uint cur; uint cur;
ASSERT(p == NULL);
cur = cur =
B2I(((R_REG(&di->d64rxregs->status0) & B2I(((R_REG(&di->d64rxregs->status0) &
D64_RS0_CD_MASK) - D64_RS0_CD_MASK) -
...@@ -874,10 +848,7 @@ static bool BCMFASTPATH _dma_rxfill(dma_info_t *di) ...@@ -874,10 +848,7 @@ static bool BCMFASTPATH _dma_rxfill(dma_info_t *di)
pa = pci_map_single(di->pbus, p->data, pa = pci_map_single(di->pbus, p->data,
di->rxbufsize, PCI_DMA_FROMDEVICE); di->rxbufsize, PCI_DMA_FROMDEVICE);
ASSERT(IS_ALIGNED(PHYSADDRLO(pa), 4));
/* save the free packet pointer */ /* save the free packet pointer */
ASSERT(di->rxp[rxout] == NULL);
di->rxp[rxout] = p; di->rxp[rxout] = p;
/* reset flags for each descriptor */ /* reset flags for each descriptor */
...@@ -1019,8 +990,6 @@ static uint _dma_ctrlflags(dma_info_t *di, uint mask, uint flags) ...@@ -1019,8 +990,6 @@ static uint _dma_ctrlflags(dma_info_t *di, uint mask, uint flags)
return 0; return 0;
} }
ASSERT((flags & ~mask) == 0);
dmactrlflags &= ~mask; dmactrlflags &= ~mask;
dmactrlflags |= flags; dmactrlflags |= flags;
...@@ -1053,9 +1022,6 @@ static unsigned long _dma_getvar(dma_info_t *di, const char *name) ...@@ -1053,9 +1022,6 @@ static unsigned long _dma_getvar(dma_info_t *di, const char *name)
{ {
if (!strcmp(name, "&txavail")) if (!strcmp(name, "&txavail"))
return (unsigned long)&(di->hnddma.txavail); return (unsigned long)&(di->hnddma.txavail);
else {
ASSERT(0);
}
return 0; return 0;
} }
...@@ -1063,8 +1029,6 @@ static ...@@ -1063,8 +1029,6 @@ static
u8 dma_align_sizetobits(uint size) u8 dma_align_sizetobits(uint size)
{ {
u8 bitpos = 0; u8 bitpos = 0;
ASSERT(size);
ASSERT(!(size & (size - 1)));
while (size >>= 1) { while (size >>= 1) {
bitpos++; bitpos++;
} }
...@@ -1230,12 +1194,8 @@ static bool dma64_alloc(dma_info_t *di, uint direction) ...@@ -1230,12 +1194,8 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
di->txdalign = (uint) ((s8 *)di->txd64 - (s8 *) va); di->txdalign = (uint) ((s8 *)di->txd64 - (s8 *) va);
PHYSADDRLOSET(di->txdpa, PHYSADDRLOSET(di->txdpa,
PHYSADDRLO(di->txdpaorig) + di->txdalign); PHYSADDRLO(di->txdpaorig) + di->txdalign);
/* Make sure that alignment didn't overflow */
ASSERT(PHYSADDRLO(di->txdpa) >= PHYSADDRLO(di->txdpaorig));
PHYSADDRHISET(di->txdpa, PHYSADDRHI(di->txdpaorig)); PHYSADDRHISET(di->txdpa, PHYSADDRHI(di->txdpaorig));
di->txdalloc = alloced; di->txdalloc = alloced;
ASSERT(IS_ALIGNED((unsigned long)di->txd64, align));
} else { } else {
va = dma_ringalloc(di, D64RINGALIGN, size, &align_bits, va = dma_ringalloc(di, D64RINGALIGN, size, &align_bits,
&alloced, &di->rxdpaorig); &alloced, &di->rxdpaorig);
...@@ -1248,12 +1208,8 @@ static bool dma64_alloc(dma_info_t *di, uint direction) ...@@ -1248,12 +1208,8 @@ static bool dma64_alloc(dma_info_t *di, uint direction)
di->rxdalign = (uint) ((s8 *)di->rxd64 - (s8 *) va); di->rxdalign = (uint) ((s8 *)di->rxd64 - (s8 *) va);
PHYSADDRLOSET(di->rxdpa, PHYSADDRLOSET(di->rxdpa,
PHYSADDRLO(di->rxdpaorig) + di->rxdalign); PHYSADDRLO(di->rxdpaorig) + di->rxdalign);
/* Make sure that alignment didn't overflow */
ASSERT(PHYSADDRLO(di->rxdpa) >= PHYSADDRLO(di->rxdpaorig));
PHYSADDRHISET(di->rxdpa, PHYSADDRHI(di->rxdpaorig)); PHYSADDRHISET(di->rxdpa, PHYSADDRHI(di->rxdpaorig));
di->rxdalloc = alloced; di->rxdalloc = alloced;
ASSERT(IS_ALIGNED((unsigned long)di->rxd64, align));
} }
return true; return true;
...@@ -1396,7 +1352,6 @@ static int dma64_txunframed(dma_info_t *di, void *buf, uint len, bool commit) ...@@ -1396,7 +1352,6 @@ static int dma64_txunframed(dma_info_t *di, void *buf, uint len, bool commit)
flags |= D64_CTRL1_EOT; flags |= D64_CTRL1_EOT;
dma64_dd_upd(di, di->txd64, pa, txout, &flags, len); dma64_dd_upd(di, di->txd64, pa, txout, &flags, len);
ASSERT(di->txp[txout] == NULL);
/* save the buffer pointer - used by dma_getpos */ /* save the buffer pointer - used by dma_getpos */
di->txp[txout] = buf; di->txp[txout] = buf;
...@@ -1501,7 +1456,6 @@ static int BCMFASTPATH dma64_txfast(dma_info_t *di, struct sk_buff *p0, ...@@ -1501,7 +1456,6 @@ static int BCMFASTPATH dma64_txfast(dma_info_t *di, struct sk_buff *p0,
pa = map->segs[j - 1].addr; pa = map->segs[j - 1].addr;
} }
dma64_dd_upd(di, di->txd64, pa, txout, &flags, len); dma64_dd_upd(di, di->txd64, pa, txout, &flags, len);
ASSERT(di->txp[txout] == NULL);
txout = NEXTTXD(txout); txout = NEXTTXD(txout);
} }
...@@ -1648,9 +1602,6 @@ static void *BCMFASTPATH dma64_getnextrxp(dma_info_t *di, bool forceall) ...@@ -1648,9 +1602,6 @@ static void *BCMFASTPATH dma64_getnextrxp(dma_info_t *di, bool forceall)
void *rxp; void *rxp;
dmaaddr_t pa; dmaaddr_t pa;
/* if forcing, dma engine must be disabled */
ASSERT(!forceall || !dma64_rxenabled(di));
i = di->rxin; i = di->rxin;
/* return if no packets posted */ /* return if no packets posted */
...@@ -1667,7 +1618,6 @@ static void *BCMFASTPATH dma64_getnextrxp(dma_info_t *di, bool forceall) ...@@ -1667,7 +1618,6 @@ static void *BCMFASTPATH dma64_getnextrxp(dma_info_t *di, bool forceall)
/* get the packet pointer that corresponds to the rx descriptor */ /* get the packet pointer that corresponds to the rx descriptor */
rxp = di->rxp[i]; rxp = di->rxp[i];
ASSERT(rxp);
di->rxp[i] = NULL; di->rxp[i] = NULL;
PHYSADDRLOSET(pa, PHYSADDRLOSET(pa,
...@@ -1709,8 +1659,6 @@ static void dma64_txrotate(dma_info_t *di) ...@@ -1709,8 +1659,6 @@ static void dma64_txrotate(dma_info_t *di)
u32 w; u32 w;
u16 first, last; u16 first, last;
ASSERT(dma64_txsuspendedidle(di));
nactive = _dma_txactive(di); nactive = _dma_txactive(di);
ad = (u16) (B2I ad = (u16) (B2I
((((R_REG(&di->d64txregs->status1) & ((((R_REG(&di->d64txregs->status1) &
...@@ -1718,8 +1666,6 @@ static void dma64_txrotate(dma_info_t *di) ...@@ -1718,8 +1666,6 @@ static void dma64_txrotate(dma_info_t *di)
- di->xmtptrbase) & D64_XS1_AD_MASK), dma64dd_t)); - di->xmtptrbase) & D64_XS1_AD_MASK), dma64dd_t));
rot = TXD(ad - di->txin); rot = TXD(ad - di->txin);
ASSERT(rot < di->ntxd);
/* full-ring case is a lot harder - don't worry about this */ /* full-ring case is a lot harder - don't worry about this */
if (rot >= (di->ntxd - nactive)) { if (rot >= (di->ntxd - nactive)) {
DMA_ERROR(("%s: dma_txrotate: ring full - punt\n", di->name)); DMA_ERROR(("%s: dma_txrotate: ring full - punt\n", di->name));
...@@ -1753,7 +1699,6 @@ static void dma64_txrotate(dma_info_t *di) ...@@ -1753,7 +1699,6 @@ static void dma64_txrotate(dma_info_t *di)
W_SM(&di->txd64[old].addrhigh, BUS_SWAP32(0xdeadbeef)); W_SM(&di->txd64[old].addrhigh, BUS_SWAP32(0xdeadbeef));
/* move the corresponding txp[] entry */ /* move the corresponding txp[] entry */
ASSERT(di->txp[new] == NULL);
di->txp[new] = di->txp[old]; di->txp[new] = di->txp[old];
/* Move the map */ /* Move the map */
...@@ -1789,7 +1734,7 @@ uint dma_addrwidth(si_t *sih, void *dmaregs) ...@@ -1789,7 +1734,7 @@ uint dma_addrwidth(si_t *sih, void *dmaregs)
(sih->buscoretype == PCIE_CORE_ID))) (sih->buscoretype == PCIE_CORE_ID)))
return DMADDRWIDTH_64; return DMADDRWIDTH_64;
} }
ASSERT(0); /* DMA hardware not supported by this driver*/ /* DMA hardware not supported by this driver*/
return DMADDRWIDTH_64; return DMADDRWIDTH_64;
} }
......
...@@ -107,12 +107,9 @@ void si_pmu_set_switcher_voltage(si_t *sih, u8 bb_voltage, u8 rf_voltage) ...@@ -107,12 +107,9 @@ void si_pmu_set_switcher_voltage(si_t *sih, u8 bb_voltage, u8 rf_voltage)
chipcregs_t *cc; chipcregs_t *cc;
uint origidx; uint origidx;
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
W_REG(&cc->regcontrol_addr, 0x01); W_REG(&cc->regcontrol_addr, 0x01);
W_REG(&cc->regcontrol_data, (u32) (bb_voltage & 0x1f) << 22); W_REG(&cc->regcontrol_data, (u32) (bb_voltage & 0x1f) << 22);
...@@ -129,8 +126,6 @@ void si_pmu_set_ldo_voltage(si_t *sih, u8 ldo, u8 voltage) ...@@ -129,8 +126,6 @@ void si_pmu_set_ldo_voltage(si_t *sih, u8 ldo, u8 voltage)
u8 sr_cntl_shift = 0, rc_shift = 0, shift = 0, mask = 0; u8 sr_cntl_shift = 0, rc_shift = 0, shift = 0, mask = 0;
u8 addr = 0; u8 addr = 0;
ASSERT(sih->cccaps & CC_CAP_PMU);
switch (sih->chip) { switch (sih->chip) {
case BCM4336_CHIP_ID: case BCM4336_CHIP_ID:
switch (ldo) { switch (ldo) {
...@@ -150,7 +145,6 @@ void si_pmu_set_ldo_voltage(si_t *sih, u8 ldo, u8 voltage) ...@@ -150,7 +145,6 @@ void si_pmu_set_ldo_voltage(si_t *sih, u8 ldo, u8 voltage)
mask = 0xf; mask = 0xf;
break; break;
default: default:
ASSERT(false);
return; return;
} }
break; break;
...@@ -162,12 +156,10 @@ void si_pmu_set_ldo_voltage(si_t *sih, u8 ldo, u8 voltage) ...@@ -162,12 +156,10 @@ void si_pmu_set_ldo_voltage(si_t *sih, u8 ldo, u8 voltage)
mask = 0x1f; mask = 0x1f;
break; break;
default: default:
ASSERT(false);
break; break;
} }
break; break;
default: default:
ASSERT(false);
return; return;
} }
...@@ -192,12 +184,10 @@ u16 si_pmu_fast_pwrup_delay(si_t *sih) ...@@ -192,12 +184,10 @@ u16 si_pmu_fast_pwrup_delay(si_t *sih)
chn[0] = 0; /* to suppress compile error */ chn[0] = 0; /* to suppress compile error */
#endif #endif
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
switch (sih->chip) { switch (sih->chip) {
case BCM43224_CHIP_ID: case BCM43224_CHIP_ID:
...@@ -265,12 +255,9 @@ u32 si_pmu_force_ilp(si_t *sih, bool force) ...@@ -265,12 +255,9 @@ u32 si_pmu_force_ilp(si_t *sih, bool force)
uint origidx; uint origidx;
u32 oldpmucontrol; u32 oldpmucontrol;
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
oldpmucontrol = R_REG(&cc->pmucontrol); oldpmucontrol = R_REG(&cc->pmucontrol);
if (force) if (force)
...@@ -689,12 +676,9 @@ void si_pmu_res_init(si_t *sih) ...@@ -689,12 +676,9 @@ void si_pmu_res_init(si_t *sih)
char name[8], *val; char name[8], *val;
uint i, rsrcs; uint i, rsrcs;
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
switch (sih->chip) { switch (sih->chip) {
case BCM4329_CHIP_ID: case BCM4329_CHIP_ID:
...@@ -768,7 +752,6 @@ void si_pmu_res_init(si_t *sih) ...@@ -768,7 +752,6 @@ void si_pmu_res_init(si_t *sih)
/* Program up/down timers */ /* Program up/down timers */
while (pmu_res_updown_table_sz--) { while (pmu_res_updown_table_sz--) {
ASSERT(pmu_res_updown_table != NULL);
PMU_MSG(("Changing rsrc %d res_updn_timer to 0x%x\n", PMU_MSG(("Changing rsrc %d res_updn_timer to 0x%x\n",
pmu_res_updown_table[pmu_res_updown_table_sz].resnum, pmu_res_updown_table[pmu_res_updown_table_sz].resnum,
pmu_res_updown_table[pmu_res_updown_table_sz].updown)); pmu_res_updown_table[pmu_res_updown_table_sz].updown));
...@@ -792,7 +775,6 @@ void si_pmu_res_init(si_t *sih) ...@@ -792,7 +775,6 @@ void si_pmu_res_init(si_t *sih)
/* Program resource dependencies table */ /* Program resource dependencies table */
while (pmu_res_depend_table_sz--) { while (pmu_res_depend_table_sz--) {
ASSERT(pmu_res_depend_table != NULL);
if (pmu_res_depend_table[pmu_res_depend_table_sz].filter != NULL if (pmu_res_depend_table[pmu_res_depend_table_sz].filter != NULL
&& !(pmu_res_depend_table[pmu_res_depend_table_sz]. && !(pmu_res_depend_table[pmu_res_depend_table_sz].
filter) (sih)) filter) (sih))
...@@ -823,7 +805,6 @@ void si_pmu_res_init(si_t *sih) ...@@ -823,7 +805,6 @@ void si_pmu_res_init(si_t *sih)
[pmu_res_depend_table_sz].depend_mask); [pmu_res_depend_table_sz].depend_mask);
break; break;
default: default:
ASSERT(0);
break; break;
} }
} }
...@@ -1112,7 +1093,6 @@ static const pmu1_xtaltab0_t *si_pmu1_xtaltab0(si_t *sih) ...@@ -1112,7 +1093,6 @@ static const pmu1_xtaltab0_t *si_pmu1_xtaltab0(si_t *sih)
bcm_chipname(sih->chip, chn, 8))); bcm_chipname(sih->chip, chn, 8)));
break; break;
} }
ASSERT(0);
return NULL; return NULL;
} }
...@@ -1144,7 +1124,6 @@ static const pmu1_xtaltab0_t *si_pmu1_xtaldef0(si_t *sih) ...@@ -1144,7 +1124,6 @@ static const pmu1_xtaltab0_t *si_pmu1_xtaldef0(si_t *sih)
bcm_chipname(sih->chip, chn, 8))); bcm_chipname(sih->chip, chn, 8)));
break; break;
} }
ASSERT(0);
return NULL; return NULL;
} }
...@@ -1172,7 +1151,6 @@ static u32 si_pmu1_pllfvco0(si_t *sih) ...@@ -1172,7 +1151,6 @@ static u32 si_pmu1_pllfvco0(si_t *sih)
bcm_chipname(sih->chip, chn, 8))); bcm_chipname(sih->chip, chn, 8)));
break; break;
} }
ASSERT(0);
return 0; return 0;
} }
...@@ -1192,8 +1170,6 @@ si_pmu1_alpclk0(si_t *sih, chipcregs_t *cc) ...@@ -1192,8 +1170,6 @@ si_pmu1_alpclk0(si_t *sih, chipcregs_t *cc)
/* Could not find it so assign a default value */ /* Could not find it so assign a default value */
if (xt == NULL || xt->fref == 0) if (xt == NULL || xt->fref == 0)
xt = si_pmu1_xtaldef0(sih); xt = si_pmu1_xtaldef0(sih);
ASSERT(xt != NULL && xt->fref != 0);
return xt->fref * 1000; return xt->fref * 1000;
} }
...@@ -1256,7 +1232,6 @@ static void si_pmu1_pllinit0(si_t *sih, chipcregs_t *cc, u32 xtal) ...@@ -1256,7 +1232,6 @@ static void si_pmu1_pllinit0(si_t *sih, chipcregs_t *cc, u32 xtal)
PMURES_BIT(RES4329_HT_AVAIL))); PMURES_BIT(RES4329_HT_AVAIL)));
SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL, SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
PMU_MAX_TRANSITION_DLY); PMU_MAX_TRANSITION_DLY);
ASSERT(!(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL));
W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4); W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
if (xt->fref == 38400) if (xt->fref == 38400)
tmp = 0x200024C0; tmp = 0x200024C0;
...@@ -1301,7 +1276,6 @@ static void si_pmu1_pllinit0(si_t *sih, chipcregs_t *cc, u32 xtal) ...@@ -1301,7 +1276,6 @@ static void si_pmu1_pllinit0(si_t *sih, chipcregs_t *cc, u32 xtal)
udelay(100); udelay(100);
SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL, SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
PMU_MAX_TRANSITION_DLY); PMU_MAX_TRANSITION_DLY);
ASSERT(!(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL));
W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4); W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
tmp = 0x200005c0; tmp = 0x200005c0;
W_REG(&cc->pllcontrol_data, tmp); W_REG(&cc->pllcontrol_data, tmp);
...@@ -1317,7 +1291,6 @@ static void si_pmu1_pllinit0(si_t *sih, chipcregs_t *cc, u32 xtal) ...@@ -1317,7 +1291,6 @@ static void si_pmu1_pllinit0(si_t *sih, chipcregs_t *cc, u32 xtal)
udelay(100); udelay(100);
SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL, SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
PMU_MAX_TRANSITION_DLY); PMU_MAX_TRANSITION_DLY);
ASSERT(!(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL));
break; break;
case BCM4330_CHIP_ID: case BCM4330_CHIP_ID:
...@@ -1330,11 +1303,10 @@ static void si_pmu1_pllinit0(si_t *sih, chipcregs_t *cc, u32 xtal) ...@@ -1330,11 +1303,10 @@ static void si_pmu1_pllinit0(si_t *sih, chipcregs_t *cc, u32 xtal)
udelay(100); udelay(100);
SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL, SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
PMU_MAX_TRANSITION_DLY); PMU_MAX_TRANSITION_DLY);
ASSERT(!(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL));
break; break;
default: default:
ASSERT(0); break;
} }
PMU_MSG(("Done masking\n")); PMU_MSG(("Done masking\n"));
...@@ -1468,12 +1440,9 @@ void si_pmu_pll_init(si_t *sih, uint xtalfreq) ...@@ -1468,12 +1440,9 @@ void si_pmu_pll_init(si_t *sih, uint xtalfreq)
char chn[8]; char chn[8];
#endif #endif
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
switch (sih->chip) { switch (sih->chip) {
case BCM4329_CHIP_ID: case BCM4329_CHIP_ID:
...@@ -1518,12 +1487,9 @@ u32 si_pmu_alp_clock(si_t *sih) ...@@ -1518,12 +1487,9 @@ u32 si_pmu_alp_clock(si_t *sih)
char chn[8]; char chn[8];
#endif #endif
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
switch (sih->chip) { switch (sih->chip) {
case BCM43224_CHIP_ID: case BCM43224_CHIP_ID:
...@@ -1630,12 +1596,9 @@ u32 si_pmu_si_clock(si_t *sih) ...@@ -1630,12 +1596,9 @@ u32 si_pmu_si_clock(si_t *sih)
char chn[8]; char chn[8];
#endif #endif
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
switch (sih->chip) { switch (sih->chip) {
case BCM43224_CHIP_ID: case BCM43224_CHIP_ID:
...@@ -1706,8 +1669,6 @@ u32 si_pmu_cpu_clock(si_t *sih) ...@@ -1706,8 +1669,6 @@ u32 si_pmu_cpu_clock(si_t *sih)
uint origidx; uint origidx;
u32 clock; u32 clock;
ASSERT(sih->cccaps & CC_CAP_PMU);
if ((sih->pmurev >= 5) && if ((sih->pmurev >= 5) &&
!((sih->chip == BCM4329_CHIP_ID) || !((sih->chip == BCM4329_CHIP_ID) ||
(sih->chip == BCM4319_CHIP_ID) || (sih->chip == BCM4319_CHIP_ID) ||
...@@ -1731,7 +1692,6 @@ u32 si_pmu_cpu_clock(si_t *sih) ...@@ -1731,7 +1692,6 @@ u32 si_pmu_cpu_clock(si_t *sih)
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
clock = si_pmu5_clock(sih, cc, pll, PMU5_MAINPLL_CPU); clock = si_pmu5_clock(sih, cc, pll, PMU5_MAINPLL_CPU);
...@@ -1750,8 +1710,6 @@ u32 si_pmu_mem_clock(si_t *sih) ...@@ -1750,8 +1710,6 @@ u32 si_pmu_mem_clock(si_t *sih)
uint origidx; uint origidx;
u32 clock; u32 clock;
ASSERT(sih->cccaps & CC_CAP_PMU);
if ((sih->pmurev >= 5) && if ((sih->pmurev >= 5) &&
!((sih->chip == BCM4329_CHIP_ID) || !((sih->chip == BCM4329_CHIP_ID) ||
(sih->chip == BCM4319_CHIP_ID) || (sih->chip == BCM4319_CHIP_ID) ||
...@@ -1775,7 +1733,6 @@ u32 si_pmu_mem_clock(si_t *sih) ...@@ -1775,7 +1733,6 @@ u32 si_pmu_mem_clock(si_t *sih)
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
clock = si_pmu5_clock(sih, cc, pll, PMU5_MAINPLL_MEM); clock = si_pmu5_clock(sih, cc, pll, PMU5_MAINPLL_MEM);
...@@ -1802,7 +1759,6 @@ u32 si_pmu_ilp_clock(si_t *sih) ...@@ -1802,7 +1759,6 @@ u32 si_pmu_ilp_clock(si_t *sih)
u32 start, end, delta; u32 start, end, delta;
u32 origidx = si_coreidx(sih); u32 origidx = si_coreidx(sih);
chipcregs_t *cc = si_setcoreidx(sih, SI_CC_IDX); chipcregs_t *cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
start = R_REG(&cc->pmutimer); start = R_REG(&cc->pmutimer);
mdelay(ILP_CALC_DUR); mdelay(ILP_CALC_DUR);
end = R_REG(&cc->pmutimer); end = R_REG(&cc->pmutimer);
...@@ -1932,12 +1888,9 @@ void si_pmu_init(si_t *sih) ...@@ -1932,12 +1888,9 @@ void si_pmu_init(si_t *sih)
chipcregs_t *cc; chipcregs_t *cc;
uint origidx; uint origidx;
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
if (sih->pmurev == 1) if (sih->pmurev == 1)
AND_REG(&cc->pmucontrol, ~PCTL_NOILP_ON_WAIT); AND_REG(&cc->pmucontrol, ~PCTL_NOILP_ON_WAIT);
...@@ -2021,8 +1974,6 @@ void si_pmu_otp_power(si_t *sih, bool on) ...@@ -2021,8 +1974,6 @@ void si_pmu_otp_power(si_t *sih, bool on)
uint origidx; uint origidx;
u32 rsrcs = 0; /* rsrcs to turn on/off OTP power */ u32 rsrcs = 0; /* rsrcs to turn on/off OTP power */
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Don't do anything if OTP is disabled */ /* Don't do anything if OTP is disabled */
if (si_is_otp_disabled(sih)) { if (si_is_otp_disabled(sih)) {
PMU_MSG(("si_pmu_otp_power: OTP is disabled\n")); PMU_MSG(("si_pmu_otp_power: OTP is disabled\n"));
...@@ -2032,7 +1983,6 @@ void si_pmu_otp_power(si_t *sih, bool on) ...@@ -2032,7 +1983,6 @@ void si_pmu_otp_power(si_t *sih, bool on)
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
switch (sih->chip) { switch (sih->chip) {
case BCM4329_CHIP_ID: case BCM4329_CHIP_ID:
...@@ -2066,7 +2016,6 @@ void si_pmu_otp_power(si_t *sih, bool on) ...@@ -2066,7 +2016,6 @@ void si_pmu_otp_power(si_t *sih, bool on)
OR_REG(&cc->min_res_mask, (rsrcs | deps)); OR_REG(&cc->min_res_mask, (rsrcs | deps));
SPINWAIT(!(R_REG(&cc->res_state) & rsrcs), SPINWAIT(!(R_REG(&cc->res_state) & rsrcs),
PMU_MAX_TRANSITION_DLY); PMU_MAX_TRANSITION_DLY);
ASSERT(R_REG(&cc->res_state) & rsrcs);
} else { } else {
PMU_MSG(("Removing rsrc 0x%x from min_res_mask\n", PMU_MSG(("Removing rsrc 0x%x from min_res_mask\n",
rsrcs | deps)); rsrcs | deps));
...@@ -2075,7 +2024,6 @@ void si_pmu_otp_power(si_t *sih, bool on) ...@@ -2075,7 +2024,6 @@ void si_pmu_otp_power(si_t *sih, bool on)
SPINWAIT((((otps = R_REG(&cc->otpstatus)) & OTPS_READY) != SPINWAIT((((otps = R_REG(&cc->otpstatus)) & OTPS_READY) !=
(on ? OTPS_READY : 0)), 100); (on ? OTPS_READY : 0)), 100);
ASSERT((otps & OTPS_READY) == (on ? OTPS_READY : 0));
if ((otps & OTPS_READY) != (on ? OTPS_READY : 0)) if ((otps & OTPS_READY) != (on ? OTPS_READY : 0))
PMU_MSG(("OTP ready bit not %s after wait\n", PMU_MSG(("OTP ready bit not %s after wait\n",
(on ? "ON" : "OFF"))); (on ? "ON" : "OFF")));
...@@ -2090,12 +2038,9 @@ void si_pmu_rcal(si_t *sih) ...@@ -2090,12 +2038,9 @@ void si_pmu_rcal(si_t *sih)
chipcregs_t *cc; chipcregs_t *cc;
uint origidx; uint origidx;
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
switch (sih->chip) { switch (sih->chip) {
case BCM4329_CHIP_ID:{ case BCM4329_CHIP_ID:{
...@@ -2114,7 +2059,6 @@ void si_pmu_rcal(si_t *sih) ...@@ -2114,7 +2059,6 @@ void si_pmu_rcal(si_t *sih)
/* Wait for completion */ /* Wait for completion */
SPINWAIT(0 == (R_REG(&cc->chipstatus) & 0x08), SPINWAIT(0 == (R_REG(&cc->chipstatus) & 0x08),
10 * 1000 * 1000); 10 * 1000 * 1000);
ASSERT(R_REG(&cc->chipstatus) & 0x08);
/* Drop the LSB to convert from 5 bit code to 4 bit code */ /* Drop the LSB to convert from 5 bit code to 4 bit code */
rcal_code = rcal_code =
...@@ -2173,7 +2117,6 @@ void si_pmu_spuravoid(si_t *sih, u8 spuravoid) ...@@ -2173,7 +2117,6 @@ void si_pmu_spuravoid(si_t *sih, u8 spuravoid)
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
cc = (chipcregs_t *) si_switch_core(sih, CC_CORE_ID, &origidx, cc = (chipcregs_t *) si_switch_core(sih, CC_CORE_ID, &origidx,
&intr_val); &intr_val);
ASSERT(cc != NULL);
/* force the HT off */ /* force the HT off */
if (sih->chip == BCM4336_CHIP_ID) { if (sih->chip == BCM4336_CHIP_ID) {
...@@ -2183,7 +2126,6 @@ void si_pmu_spuravoid(si_t *sih, u8 spuravoid) ...@@ -2183,7 +2126,6 @@ void si_pmu_spuravoid(si_t *sih, u8 spuravoid)
/* wait for the ht to really go away */ /* wait for the ht to really go away */
SPINWAIT(((R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL) == 0), SPINWAIT(((R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL) == 0),
10000); 10000);
ASSERT((R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL) == 0);
} }
/* update the pll changes */ /* update the pll changes */
...@@ -2405,7 +2347,6 @@ bool si_pmu_is_otp_powered(si_t *sih) ...@@ -2405,7 +2347,6 @@ bool si_pmu_is_otp_powered(si_t *sih)
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
idx = si_coreidx(sih); idx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
switch (sih->chip) { switch (sih->chip) {
case BCM4329_CHIP_ID: case BCM4329_CHIP_ID:
...@@ -2454,7 +2395,6 @@ void si_pmu_sprom_enable(si_t *sih, bool enable) ...@@ -2454,7 +2395,6 @@ void si_pmu_sprom_enable(si_t *sih, bool enable)
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
/* Return to original core */ /* Return to original core */
si_setcoreidx(sih, origidx); si_setcoreidx(sih, origidx);
...@@ -2465,8 +2405,6 @@ void si_pmu_chip_init(si_t *sih) ...@@ -2465,8 +2405,6 @@ void si_pmu_chip_init(si_t *sih)
{ {
uint origidx; uint origidx;
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Gate off SPROM clock and chip select signals */ /* Gate off SPROM clock and chip select signals */
si_pmu_sprom_enable(sih, false); si_pmu_sprom_enable(sih, false);
...@@ -2480,8 +2418,6 @@ void si_pmu_chip_init(si_t *sih) ...@@ -2480,8 +2418,6 @@ void si_pmu_chip_init(si_t *sih)
/* initialize PMU switch/regulators */ /* initialize PMU switch/regulators */
void si_pmu_swreg_init(si_t *sih) void si_pmu_swreg_init(si_t *sih)
{ {
ASSERT(sih->cccaps & CC_CAP_PMU);
switch (sih->chip) { switch (sih->chip) {
case BCM4336_CHIP_ID: case BCM4336_CHIP_ID:
/* Reduce CLDO PWM output voltage to 1.2V */ /* Reduce CLDO PWM output voltage to 1.2V */
...@@ -2506,8 +2442,6 @@ void si_pmu_swreg_init(si_t *sih) ...@@ -2506,8 +2442,6 @@ void si_pmu_swreg_init(si_t *sih)
void si_pmu_radio_enable(si_t *sih, bool enable) void si_pmu_radio_enable(si_t *sih, bool enable)
{ {
ASSERT(sih->cccaps & CC_CAP_PMU);
switch (sih->chip) { switch (sih->chip) {
case BCM4319_CHIP_ID: case BCM4319_CHIP_ID:
if (enable) if (enable)
...@@ -2527,12 +2461,9 @@ si_pmu_waitforclk_on_backplane(si_t *sih, u32 clk, u32 delay) ...@@ -2527,12 +2461,9 @@ si_pmu_waitforclk_on_backplane(si_t *sih, u32 clk, u32 delay)
chipcregs_t *cc; chipcregs_t *cc;
uint origidx; uint origidx;
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
if (delay) if (delay)
SPINWAIT(((R_REG(&cc->pmustatus) & clk) != clk), delay); SPINWAIT(((R_REG(&cc->pmustatus) & clk) != clk), delay);
...@@ -2559,12 +2490,9 @@ u32 si_pmu_measure_alpclk(si_t *sih) ...@@ -2559,12 +2490,9 @@ u32 si_pmu_measure_alpclk(si_t *sih)
if (sih->pmurev < 10) if (sih->pmurev < 10)
return 0; return 0;
ASSERT(sih->cccaps & CC_CAP_PMU);
/* Remember original core before switch to chipc */ /* Remember original core before switch to chipc */
origidx = si_coreidx(sih); origidx = si_coreidx(sih);
cc = si_setcoreidx(sih, SI_CC_IDX); cc = si_setcoreidx(sih, SI_CC_IDX);
ASSERT(cc != NULL);
if (R_REG(&cc->pmustatus) & PST_EXTLPOAVAIL) { if (R_REG(&cc->pmustatus) & PST_EXTLPOAVAIL) {
u32 ilp_ctr, alp_hz; u32 ilp_ctr, alp_hz;
......
...@@ -83,8 +83,6 @@ void *pcicore_init(si_t *sih, void *pdev, void *regs) ...@@ -83,8 +83,6 @@ void *pcicore_init(si_t *sih, void *pdev, void *regs)
{ {
pcicore_info_t *pi; pcicore_info_t *pi;
ASSERT(sih->bustype == PCI_BUS);
/* alloc pcicore_info_t */ /* alloc pcicore_info_t */
pi = kzalloc(sizeof(pcicore_info_t), GFP_ATOMIC); pi = kzalloc(sizeof(pcicore_info_t), GFP_ATOMIC);
if (pi == NULL) { if (pi == NULL) {
...@@ -100,7 +98,6 @@ void *pcicore_init(si_t *sih, void *pdev, void *regs) ...@@ -100,7 +98,6 @@ void *pcicore_init(si_t *sih, void *pdev, void *regs)
pi->regs.pcieregs = (sbpcieregs_t *) regs; pi->regs.pcieregs = (sbpcieregs_t *) regs;
cap_ptr = pcicore_find_pci_capability(pi->dev, PCI_CAP_ID_EXP, cap_ptr = pcicore_find_pci_capability(pi->dev, PCI_CAP_ID_EXP,
NULL, NULL); NULL, NULL);
ASSERT(cap_ptr);
pi->pciecap_lcreg_offset = cap_ptr + PCIE_CAP_LINKCTRL_OFFSET; pi->pciecap_lcreg_offset = cap_ptr + PCIE_CAP_LINKCTRL_OFFSET;
} else } else
pi->regs.pciregs = (struct sbpciregs *) regs; pi->regs.pciregs = (struct sbpciregs *) regs;
...@@ -186,8 +183,6 @@ pcie_readreg(sbpcieregs_t *pcieregs, uint addrtype, ...@@ -186,8 +183,6 @@ pcie_readreg(sbpcieregs_t *pcieregs, uint addrtype,
{ {
uint retval = 0xFFFFFFFF; uint retval = 0xFFFFFFFF;
ASSERT(pcieregs != NULL);
switch (addrtype) { switch (addrtype) {
case PCIE_CONFIGREGS: case PCIE_CONFIGREGS:
W_REG((&pcieregs->configaddr), offset); W_REG((&pcieregs->configaddr), offset);
...@@ -200,7 +195,6 @@ pcie_readreg(sbpcieregs_t *pcieregs, uint addrtype, ...@@ -200,7 +195,6 @@ pcie_readreg(sbpcieregs_t *pcieregs, uint addrtype,
retval = R_REG(&(pcieregs->pcieinddata)); retval = R_REG(&(pcieregs->pcieinddata));
break; break;
default: default:
ASSERT(0);
break; break;
} }
...@@ -211,8 +205,6 @@ uint ...@@ -211,8 +205,6 @@ uint
pcie_writereg(sbpcieregs_t *pcieregs, uint addrtype, pcie_writereg(sbpcieregs_t *pcieregs, uint addrtype,
uint offset, uint val) uint offset, uint val)
{ {
ASSERT(pcieregs != NULL);
switch (addrtype) { switch (addrtype) {
case PCIE_CONFIGREGS: case PCIE_CONFIGREGS:
W_REG((&pcieregs->configaddr), offset); W_REG((&pcieregs->configaddr), offset);
...@@ -223,7 +215,6 @@ pcie_writereg(sbpcieregs_t *pcieregs, uint addrtype, ...@@ -223,7 +215,6 @@ pcie_writereg(sbpcieregs_t *pcieregs, uint addrtype,
W_REG((&pcieregs->pcieinddata), val); W_REG((&pcieregs->pcieinddata), val);
break; break;
default: default:
ASSERT(0);
break; break;
} }
return 0; return 0;
...@@ -383,7 +374,6 @@ static void pcie_extendL1timer(pcicore_info_t *pi, bool extend) ...@@ -383,7 +374,6 @@ static void pcie_extendL1timer(pcicore_info_t *pi, bool extend)
static void pcie_clkreq_upd(pcicore_info_t *pi, uint state) static void pcie_clkreq_upd(pcicore_info_t *pi, uint state)
{ {
si_t *sih = pi->sih; si_t *sih = pi->sih;
ASSERT(PCIE_PUB(sih));
switch (state) { switch (state) {
case SI_DOATTACH: case SI_DOATTACH:
...@@ -415,7 +405,6 @@ static void pcie_clkreq_upd(pcicore_info_t *pi, uint state) ...@@ -415,7 +405,6 @@ static void pcie_clkreq_upd(pcicore_info_t *pi, uint state)
} }
break; break;
default: default:
ASSERT(0);
break; break;
} }
} }
...@@ -533,8 +522,6 @@ static void pcie_war_noplldown(pcicore_info_t *pi) ...@@ -533,8 +522,6 @@ static void pcie_war_noplldown(pcicore_info_t *pi)
sbpcieregs_t *pcieregs = pi->regs.pcieregs; sbpcieregs_t *pcieregs = pi->regs.pcieregs;
u16 *reg16; u16 *reg16;
ASSERT(pi->sih->buscorerev == 7);
/* turn off serdes PLL down */ /* turn off serdes PLL down */
si_corereg(pi->sih, SI_CC_IDX, offsetof(chipcregs_t, chipcontrol), si_corereg(pi->sih, SI_CC_IDX, offsetof(chipcregs_t, chipcontrol),
CHIPCTRL_4321_PLL_DOWN, CHIPCTRL_4321_PLL_DOWN); CHIPCTRL_4321_PLL_DOWN, CHIPCTRL_4321_PLL_DOWN);
......
...@@ -552,11 +552,6 @@ void qm_log10(s32 N, s16 qN, s16 *log10N, s16 *qLog10N) ...@@ -552,11 +552,6 @@ void qm_log10(s32 N, s16 qN, s16 *log10N, s16 *qLog10N)
u16 u16offset; u16 u16offset;
s32 s32log; s32 s32log;
/* Logerithm of negative values is undefined.
* assert N is greater than 0.
*/
/* ASSERT(N > 0); */
/* normalize the N. */ /* normalize the N. */
s16norm = qm_norm32(N); s16norm = qm_norm32(N);
N = N << s16norm; N = N << s16norm;
......
...@@ -172,7 +172,6 @@ static bool si_buscore_setup(si_info_t *sii, chipcregs_t *cc, uint bustype, ...@@ -172,7 +172,6 @@ static bool si_buscore_setup(si_info_t *sii, chipcregs_t *cc, uint bustype,
uint pciidx, pcieidx, pcirev, pcierev; uint pciidx, pcieidx, pcirev, pcierev;
cc = si_setcoreidx(&sii->pub, SI_CC_IDX); cc = si_setcoreidx(&sii->pub, SI_CC_IDX);
ASSERT(cc);
/* get chipcommon rev */ /* get chipcommon rev */
sii->pub.ccrev = (int)si_corerev(&sii->pub); sii->pub.ccrev = (int)si_corerev(&sii->pub);
...@@ -357,7 +356,6 @@ static __used void si_nvram_process(si_info_t *sii, char *pvars) ...@@ -357,7 +356,6 @@ static __used void si_nvram_process(si_info_t *sii, char *pvars)
if (sii->pub.boardtype == 0) { if (sii->pub.boardtype == 0) {
SI_ERROR(("si_doattach: unknown board type\n")); SI_ERROR(("si_doattach: unknown board type\n"));
ASSERT(sii->pub.boardtype);
} }
sii->pub.boardflags = getintvar(pvars, "boardflags"); sii->pub.boardflags = getintvar(pvars, "boardflags");
...@@ -375,8 +373,6 @@ static si_info_t *si_doattach(si_info_t *sii, uint devid, ...@@ -375,8 +373,6 @@ static si_info_t *si_doattach(si_info_t *sii, uint devid,
chipcregs_t *cc; chipcregs_t *cc;
uint origidx; uint origidx;
ASSERT(GOODREGS(regs));
memset((unsigned char *) sii, 0, sizeof(si_info_t)); memset((unsigned char *) sii, 0, sizeof(si_info_t));
savewin = 0; savewin = 0;
...@@ -452,8 +448,6 @@ static si_info_t *si_doattach(si_info_t *sii, uint devid, ...@@ -452,8 +448,6 @@ static si_info_t *si_doattach(si_info_t *sii, uint devid,
char *pvars = NULL; char *pvars = NULL;
uint origidx; uint origidx;
ASSERT(GOODREGS(regs));
memset((unsigned char *) sii, 0, sizeof(si_info_t)); memset((unsigned char *) sii, 0, sizeof(si_info_t));
savewin = 0; savewin = 0;
...@@ -588,7 +582,6 @@ static si_info_t *si_doattach(si_info_t *sii, uint devid, ...@@ -588,7 +582,6 @@ static si_info_t *si_doattach(si_info_t *sii, uint devid,
si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, gpiotimerval), ~0, w); si_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, gpiotimerval), ~0, w);
if (PCIE(sii)) { if (PCIE(sii)) {
ASSERT(sii->pch != NULL);
pcicore_attach(sii->pch, pvars, SI_DOATTACH); pcicore_attach(sii->pch, pvars, SI_DOATTACH);
} }
...@@ -702,7 +695,6 @@ uint si_flag(si_t *sih) ...@@ -702,7 +695,6 @@ uint si_flag(si_t *sih)
if (sih->socitype == SOCI_AI) if (sih->socitype == SOCI_AI)
return ai_flag(sih); return ai_flag(sih);
else { else {
ASSERT(0);
return 0; return 0;
} }
} }
...@@ -711,8 +703,6 @@ void si_setint(si_t *sih, int siflag) ...@@ -711,8 +703,6 @@ void si_setint(si_t *sih, int siflag)
{ {
if (sih->socitype == SOCI_AI) if (sih->socitype == SOCI_AI)
ai_setint(sih, siflag); ai_setint(sih, siflag);
else
ASSERT(0);
} }
#ifndef BCMSDIO #ifndef BCMSDIO
...@@ -743,10 +733,7 @@ uint si_corerev(si_t *sih) ...@@ -743,10 +733,7 @@ uint si_corerev(si_t *sih)
{ {
if (sih->socitype == SOCI_AI) if (sih->socitype == SOCI_AI)
return ai_corerev(sih); return ai_corerev(sih);
else { return 0;
ASSERT(0);
return 0;
}
} }
#endif #endif
...@@ -790,7 +777,6 @@ void *si_setcore(si_t *sih, uint coreid, uint coreunit) ...@@ -790,7 +777,6 @@ void *si_setcore(si_t *sih, uint coreid, uint coreunit)
#ifdef BCMSDIO #ifdef BCMSDIO
return sb_setcoreidx(sih, idx); return sb_setcoreidx(sih, idx);
#else #else
ASSERT(0);
return NULL; return NULL;
#endif #endif
} }
...@@ -802,7 +788,6 @@ void *si_setcoreidx(si_t *sih, uint coreidx) ...@@ -802,7 +788,6 @@ void *si_setcoreidx(si_t *sih, uint coreidx)
if (sih->socitype == SOCI_AI) if (sih->socitype == SOCI_AI)
return ai_setcoreidx(sih, coreidx); return ai_setcoreidx(sih, coreidx);
else { else {
ASSERT(0);
return NULL; return NULL;
} }
} }
...@@ -830,7 +815,6 @@ void *si_switch_core(si_t *sih, uint coreid, uint *origidx, uint *intr_val) ...@@ -830,7 +815,6 @@ void *si_switch_core(si_t *sih, uint coreid, uint *origidx, uint *intr_val)
INTR_OFF(sii, *intr_val); INTR_OFF(sii, *intr_val);
*origidx = sii->curidx; *origidx = sii->curidx;
cc = si_setcore(sih, coreid, 0); cc = si_setcore(sih, coreid, 0);
ASSERT(cc != NULL);
return cc; return cc;
} }
...@@ -854,7 +838,6 @@ u32 si_core_cflags(si_t *sih, u32 mask, u32 val) ...@@ -854,7 +838,6 @@ u32 si_core_cflags(si_t *sih, u32 mask, u32 val)
if (sih->socitype == SOCI_AI) if (sih->socitype == SOCI_AI)
return ai_core_cflags(sih, mask, val); return ai_core_cflags(sih, mask, val);
else { else {
ASSERT(0);
return 0; return 0;
} }
} }
...@@ -864,7 +847,6 @@ u32 si_core_sflags(si_t *sih, u32 mask, u32 val) ...@@ -864,7 +847,6 @@ u32 si_core_sflags(si_t *sih, u32 mask, u32 val)
if (sih->socitype == SOCI_AI) if (sih->socitype == SOCI_AI)
return ai_core_sflags(sih, mask, val); return ai_core_sflags(sih, mask, val);
else { else {
ASSERT(0);
return 0; return 0;
} }
} }
...@@ -877,7 +859,6 @@ bool si_iscoreup(si_t *sih) ...@@ -877,7 +859,6 @@ bool si_iscoreup(si_t *sih)
#ifdef BCMSDIO #ifdef BCMSDIO
return sb_iscoreup(sih); return sb_iscoreup(sih);
#else #else
ASSERT(0);
return false; return false;
#endif #endif
} }
...@@ -900,7 +881,6 @@ uint si_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val) ...@@ -900,7 +881,6 @@ uint si_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val)
#ifdef BCMSDIO #ifdef BCMSDIO
return sb_corereg(sih, coreidx, regoff, mask, val); return sb_corereg(sih, coreidx, regoff, mask, val);
#else #else
ASSERT(0);
return 0; return 0;
#endif #endif
} }
...@@ -1020,8 +1000,6 @@ static uint si_slowclk_src(si_info_t *sii) ...@@ -1020,8 +1000,6 @@ static uint si_slowclk_src(si_info_t *sii)
chipcregs_t *cc; chipcregs_t *cc;
u32 val; u32 val;
ASSERT(SI_FAST(sii) || si_coreid(&sii->pub) == CC_CORE_ID);
if (sii->pub.ccrev < 6) { if (sii->pub.ccrev < 6) {
if (sii->pub.bustype == PCI_BUS) { if (sii->pub.bustype == PCI_BUS) {
pci_read_config_dword(sii->pbus, PCI_GPIO_OUT, pci_read_config_dword(sii->pbus, PCI_GPIO_OUT,
...@@ -1043,11 +1021,6 @@ static uint si_slowclk_freq(si_info_t *sii, bool max_freq, chipcregs_t *cc) ...@@ -1043,11 +1021,6 @@ static uint si_slowclk_freq(si_info_t *sii, bool max_freq, chipcregs_t *cc)
u32 slowclk; u32 slowclk;
uint div; uint div;
ASSERT(SI_FAST(sii) || si_coreid(&sii->pub) == CC_CORE_ID);
/* shouldn't be here unless we've established the chip has dynamic clk control */
ASSERT(R_REG(&cc->capabilities) & CC_CAP_PWR_CTL);
slowclk = si_slowclk_src(sii); slowclk = si_slowclk_src(sii);
if (sii->pub.ccrev < 6) { if (sii->pub.ccrev < 6) {
if (slowclk == SCC_SS_PCI) if (slowclk == SCC_SS_PCI)
...@@ -1068,8 +1041,6 @@ static uint si_slowclk_freq(si_info_t *sii, bool max_freq, chipcregs_t *cc) ...@@ -1068,8 +1041,6 @@ static uint si_slowclk_freq(si_info_t *sii, bool max_freq, chipcregs_t *cc)
else if (slowclk == SCC_SS_PCI) else if (slowclk == SCC_SS_PCI)
return max_freq ? (PCIMAXFREQ / div) return max_freq ? (PCIMAXFREQ / div)
: (PCIMINFREQ / div); : (PCIMINFREQ / div);
else
ASSERT(0);
} else { } else {
/* Chipc rev 10 is InstaClock */ /* Chipc rev 10 is InstaClock */
div = R_REG(&cc->system_clk_ctl) >> SYCC_CD_SHIFT; div = R_REG(&cc->system_clk_ctl) >> SYCC_CD_SHIFT;
...@@ -1129,7 +1100,6 @@ void si_clkctl_init(si_t *sih) ...@@ -1129,7 +1100,6 @@ void si_clkctl_init(si_t *sih)
if (cc == NULL) if (cc == NULL)
return; return;
} }
ASSERT(cc != NULL);
/* set all Instaclk chip ILP to 1 MHz */ /* set all Instaclk chip ILP to 1 MHz */
if (sih->ccrev >= 10) if (sih->ccrev >= 10)
...@@ -1177,7 +1147,6 @@ u16 si_clkctl_fast_pwrup_delay(si_t *sih) ...@@ -1177,7 +1147,6 @@ u16 si_clkctl_fast_pwrup_delay(si_t *sih)
if (cc == NULL) if (cc == NULL)
goto done; goto done;
} }
ASSERT(cc != NULL);
slowminfreq = si_slowclk_freq(sii, false, cc); slowminfreq = si_slowclk_freq(sii, false, cc);
fpdelay = (((R_REG(&cc->pll_on_delay) + 2) * 1000000) + fpdelay = (((R_REG(&cc->pll_on_delay) + 2) * 1000000) +
...@@ -1303,9 +1272,6 @@ static bool _si_clkctl_cc(si_info_t *sii, uint mode) ...@@ -1303,9 +1272,6 @@ static bool _si_clkctl_cc(si_info_t *sii, uint mode)
if (sii->pub.ccrev < 6) if (sii->pub.ccrev < 6)
return false; return false;
/* Chips with ccrev 10 are EOL and they don't have SYCC_HR which we use below */
ASSERT(sii->pub.ccrev != 10);
if (!fast) { if (!fast) {
INTR_OFF(sii, intr_val); INTR_OFF(sii, intr_val);
origidx = sii->curidx; origidx = sii->curidx;
...@@ -1321,7 +1287,6 @@ static bool _si_clkctl_cc(si_info_t *sii, uint mode) ...@@ -1321,7 +1287,6 @@ static bool _si_clkctl_cc(si_info_t *sii, uint mode)
if (cc == NULL) if (cc == NULL)
goto done; goto done;
} }
ASSERT(cc != NULL);
if (!CCCTL_ENAB(&sii->pub) && (sii->pub.ccrev < 20)) if (!CCCTL_ENAB(&sii->pub) && (sii->pub.ccrev < 20))
goto done; goto done;
...@@ -1344,7 +1309,6 @@ static bool _si_clkctl_cc(si_info_t *sii, uint mode) ...@@ -1344,7 +1309,6 @@ static bool _si_clkctl_cc(si_info_t *sii, uint mode)
u32 htavail = CCS_HTAVAIL; u32 htavail = CCS_HTAVAIL;
SPINWAIT(((R_REG(&cc->clk_ctl_st) & htavail) SPINWAIT(((R_REG(&cc->clk_ctl_st) & htavail)
== 0), PMU_MAX_TRANSITION_DLY); == 0), PMU_MAX_TRANSITION_DLY);
ASSERT(R_REG(&cc->clk_ctl_st) & htavail);
} else { } else {
udelay(PLL_DELAY); udelay(PLL_DELAY);
} }
...@@ -1370,7 +1334,7 @@ static bool _si_clkctl_cc(si_info_t *sii, uint mode) ...@@ -1370,7 +1334,7 @@ static bool _si_clkctl_cc(si_info_t *sii, uint mode)
break; break;
default: default:
ASSERT(0); break;
} }
done: done:
...@@ -1386,9 +1350,6 @@ int si_devpath(si_t *sih, char *path, int size) ...@@ -1386,9 +1350,6 @@ int si_devpath(si_t *sih, char *path, int size)
{ {
int slen; int slen;
ASSERT(path != NULL);
ASSERT(size >= SI_DEVPATH_BUFSZ);
if (!path || size <= 0) if (!path || size <= 0)
return -1; return -1;
...@@ -1398,7 +1359,6 @@ int si_devpath(si_t *sih, char *path, int size) ...@@ -1398,7 +1359,6 @@ int si_devpath(si_t *sih, char *path, int size)
slen = snprintf(path, (size_t) size, "sb/%u/", si_coreidx(sih)); slen = snprintf(path, (size_t) size, "sb/%u/", si_coreidx(sih));
break; break;
case PCI_BUS: case PCI_BUS:
ASSERT((SI_INFO(sih))->pbus != NULL);
slen = snprintf(path, (size_t) size, "pci/%u/%u/", slen = snprintf(path, (size_t) size, "pci/%u/%u/",
((struct pci_dev *)((SI_INFO(sih))->pbus))->bus->number, ((struct pci_dev *)((SI_INFO(sih))->pbus))->bus->number,
PCI_SLOT( PCI_SLOT(
...@@ -1413,7 +1373,6 @@ int si_devpath(si_t *sih, char *path, int size) ...@@ -1413,7 +1373,6 @@ int si_devpath(si_t *sih, char *path, int size)
#endif #endif
default: default:
slen = -1; slen = -1;
ASSERT(0);
break; break;
} }
...@@ -1507,14 +1466,12 @@ void si_sdio_init(si_t *sih) ...@@ -1507,14 +1466,12 @@ void si_sdio_init(si_t *sih)
/* get the current core index */ /* get the current core index */
idx = sii->curidx; idx = sii->curidx;
ASSERT(idx == si_findcoreidx(sih, D11_CORE_ID, 0));
/* switch to sdio core */ /* switch to sdio core */
sdpregs = (sdpcmd_regs_t *) si_setcore(sih, PCMCIA_CORE_ID, 0); sdpregs = (sdpcmd_regs_t *) si_setcore(sih, PCMCIA_CORE_ID, 0);
if (!sdpregs) if (!sdpregs)
sdpregs = sdpregs =
(sdpcmd_regs_t *) si_setcore(sih, SDIOD_CORE_ID, 0); (sdpcmd_regs_t *) si_setcore(sih, SDIOD_CORE_ID, 0);
ASSERT(sdpregs);
SI_MSG(("si_sdio_init: For PCMCIA/SDIO Corerev %d, enable ints from core %d " "through SD core %d (%p)\n", sih->buscorerev, idx, sii->curidx, sdpregs)); SI_MSG(("si_sdio_init: For PCMCIA/SDIO Corerev %d, enable ints from core %d " "through SD core %d (%p)\n", sih->buscorerev, idx, sii->curidx, sdpregs));
...@@ -1604,9 +1561,6 @@ void si_pci_setup(si_t *sih, uint coremask) ...@@ -1604,9 +1561,6 @@ void si_pci_setup(si_t *sih, uint coremask)
if (sii->pub.bustype != PCI_BUS) if (sii->pub.bustype != PCI_BUS)
return; return;
ASSERT(PCI(sii) || PCIE(sii));
ASSERT(sii->pub.buscoreidx != BADIDX);
if (PCI(sii)) { if (PCI(sii)) {
/* get current core index */ /* get current core index */
idx = sii->curidx; idx = sii->curidx;
...@@ -1663,8 +1617,6 @@ int si_pci_fixcfg(si_t *sih) ...@@ -1663,8 +1617,6 @@ int si_pci_fixcfg(si_t *sih)
si_info_t *sii = SI_INFO(sih); si_info_t *sii = SI_INFO(sih);
ASSERT(sii->pub.bustype == PCI_BUS);
/* Fixup PI in SROM shadow area to enable the correct PCI core access */ /* Fixup PI in SROM shadow area to enable the correct PCI core access */
/* save the current index */ /* save the current index */
origidx = si_coreidx(&sii->pub); origidx = si_coreidx(&sii->pub);
...@@ -1674,12 +1626,10 @@ int si_pci_fixcfg(si_t *sih) ...@@ -1674,12 +1626,10 @@ int si_pci_fixcfg(si_t *sih)
pcieregs = pcieregs =
(sbpcieregs_t *) si_setcore(&sii->pub, PCIE_CORE_ID, 0); (sbpcieregs_t *) si_setcore(&sii->pub, PCIE_CORE_ID, 0);
regs = pcieregs; regs = pcieregs;
ASSERT(pcieregs != NULL);
reg16 = &pcieregs->sprom[SRSH_PI_OFFSET]; reg16 = &pcieregs->sprom[SRSH_PI_OFFSET];
} else if (sii->pub.buscoretype == PCI_CORE_ID) { } else if (sii->pub.buscoretype == PCI_CORE_ID) {
pciregs = (struct sbpciregs *)si_setcore(&sii->pub, PCI_CORE_ID, 0); pciregs = (struct sbpciregs *)si_setcore(&sii->pub, PCI_CORE_ID, 0);
regs = pciregs; regs = pciregs;
ASSERT(pciregs != NULL);
reg16 = &pciregs->sprom[SRSH_PI_OFFSET]; reg16 = &pciregs->sprom[SRSH_PI_OFFSET];
} }
pciidx = si_coreidx(&sii->pub); pciidx = si_coreidx(&sii->pub);
...@@ -1727,8 +1677,6 @@ socram_banksize(si_info_t *sii, sbsocramregs_t *regs, u8 index, ...@@ -1727,8 +1677,6 @@ socram_banksize(si_info_t *sii, sbsocramregs_t *regs, u8 index,
uint banksize, bankinfo; uint banksize, bankinfo;
uint bankidx = index | (mem_type << SOCRAM_BANKIDX_MEMTYPE_SHIFT); uint bankidx = index | (mem_type << SOCRAM_BANKIDX_MEMTYPE_SHIFT);
ASSERT(mem_type <= SOCRAM_MEMTYPE_DEVRAM);
W_REG(&regs->bankidx, bankidx); W_REG(&regs->bankidx, bankidx);
bankinfo = R_REG(&regs->bankinfo); bankinfo = R_REG(&regs->bankinfo);
banksize = banksize =
...@@ -1863,7 +1811,6 @@ bool si_deviceremoved(si_t *sih) ...@@ -1863,7 +1811,6 @@ bool si_deviceremoved(si_t *sih)
switch (sih->bustype) { switch (sih->bustype) {
case PCI_BUS: case PCI_BUS:
ASSERT(sii->pbus != NULL);
pci_read_config_dword(sii->pbus, PCI_VENDOR_ID, &w); pci_read_config_dword(sii->pbus, PCI_VENDOR_ID, &w);
if ((w & 0xFFFF) != PCI_VENDOR_ID_BROADCOM) if ((w & 0xFFFF) != PCI_VENDOR_ID_BROADCOM)
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment