Lines Matching refs:regs
146 rrpriv->regs = pci_iomap(pdev, 0, 0x1000); in rr_init_one()
147 if (!rrpriv->regs) { in rr_init_one()
188 writel(readl(&rrpriv->regs->HostCtrl) | NO_SWAP, in rr_init_one()
189 &rrpriv->regs->HostCtrl); in rr_init_one()
212 if (rrpriv->regs) in rr_init_one()
213 pci_iounmap(pdev, rrpriv->regs); in rr_init_one()
228 if (!(readl(&rr->regs->HostCtrl) & NIC_HALTED)) { in rr_remove_one()
231 writel(HALT_NIC, &rr->regs->HostCtrl); in rr_remove_one()
241 pci_iounmap(pdev, rr->regs); in rr_remove_one()
254 struct rr_regs __iomem *regs; in rr_issue_cmd() local
257 regs = rrpriv->regs; in rr_issue_cmd()
262 if (readl(®s->HostCtrl) & NIC_HALTED){ in rr_issue_cmd()
264 "HostCtrl %08x\n", cmd->code, readl(®s->HostCtrl)); in rr_issue_cmd()
265 if (readl(®s->Mode) & FATAL_ERR) in rr_issue_cmd()
267 readl(®s->Fail1), readl(®s->Fail2)); in rr_issue_cmd()
272 writel(*(u32*)(cmd), ®s->CmdRing[idx]); in rr_issue_cmd()
279 if (readl(®s->Mode) & FATAL_ERR) in rr_issue_cmd()
280 printk("error code %02x\n", readl(®s->Fail1)); in rr_issue_cmd()
291 struct rr_regs __iomem *regs; in rr_reset() local
296 regs = rrpriv->regs; in rr_reset()
300 writel(0x01000000, ®s->TX_state); in rr_reset()
301 writel(0xff800000, ®s->RX_state); in rr_reset()
302 writel(0, ®s->AssistState); in rr_reset()
303 writel(CLEAR_INTA, ®s->LocalCtrl); in rr_reset()
304 writel(0x01, ®s->BrkPt); in rr_reset()
305 writel(0, ®s->Timer); in rr_reset()
306 writel(0, ®s->TimerRef); in rr_reset()
307 writel(RESET_DMA, ®s->DmaReadState); in rr_reset()
308 writel(RESET_DMA, ®s->DmaWriteState); in rr_reset()
309 writel(0, ®s->DmaWriteHostHi); in rr_reset()
310 writel(0, ®s->DmaWriteHostLo); in rr_reset()
311 writel(0, ®s->DmaReadHostHi); in rr_reset()
312 writel(0, ®s->DmaReadHostLo); in rr_reset()
313 writel(0, ®s->DmaReadLen); in rr_reset()
314 writel(0, ®s->DmaWriteLen); in rr_reset()
315 writel(0, ®s->DmaWriteLcl); in rr_reset()
316 writel(0, ®s->DmaWriteIPchecksum); in rr_reset()
317 writel(0, ®s->DmaReadLcl); in rr_reset()
318 writel(0, ®s->DmaReadIPchecksum); in rr_reset()
319 writel(0, ®s->PciState); in rr_reset()
321 writel(SWAP_DATA | PTR64BIT | PTR_WD_SWAP, ®s->Mode); in rr_reset()
323 writel(SWAP_DATA | PTR64BIT | PTR_WD_NOSWAP, ®s->Mode); in rr_reset()
325 writel(SWAP_DATA | PTR32BIT | PTR_WD_NOSWAP, ®s->Mode); in rr_reset()
332 writel(0xdf000, ®s->RxBase); in rr_reset()
333 writel(0xdf000, ®s->RxPrd); in rr_reset()
334 writel(0xdf000, ®s->RxCon); in rr_reset()
335 writel(0xce000, ®s->TxBase); in rr_reset()
336 writel(0xce000, ®s->TxPrd); in rr_reset()
337 writel(0xce000, ®s->TxCon); in rr_reset()
338 writel(0, ®s->RxIndPro); in rr_reset()
339 writel(0, ®s->RxIndCon); in rr_reset()
340 writel(0, ®s->RxIndRef); in rr_reset()
341 writel(0, ®s->TxIndPro); in rr_reset()
342 writel(0, ®s->TxIndCon); in rr_reset()
343 writel(0, ®s->TxIndRef); in rr_reset()
344 writel(0xcc000, ®s->pad10[0]); in rr_reset()
345 writel(0, ®s->DrCmndPro); in rr_reset()
346 writel(0, ®s->DrCmndCon); in rr_reset()
347 writel(0, ®s->DwCmndPro); in rr_reset()
348 writel(0, ®s->DwCmndCon); in rr_reset()
349 writel(0, ®s->DwCmndRef); in rr_reset()
350 writel(0, ®s->DrDataPro); in rr_reset()
351 writel(0, ®s->DrDataCon); in rr_reset()
352 writel(0, ®s->DrDataRef); in rr_reset()
353 writel(0, ®s->DwDataPro); in rr_reset()
354 writel(0, ®s->DwDataCon); in rr_reset()
355 writel(0, ®s->DwDataRef); in rr_reset()
358 writel(0xffffffff, ®s->MbEvent); in rr_reset()
359 writel(0, ®s->Event); in rr_reset()
361 writel(0, ®s->TxPi); in rr_reset()
362 writel(0, ®s->IpRxPi); in rr_reset()
364 writel(0, ®s->EvtCon); in rr_reset()
365 writel(0, ®s->EvtPrd); in rr_reset()
370 writel(0, ®s->CmdRing[i]); in rr_reset()
375 writel(RBURST_64|WBURST_64, ®s->PciState); in rr_reset()
386 writel(start_pc + 0x800, ®s->Pc); in rr_reset()
390 writel(start_pc, ®s->Pc); in rr_reset()
405 struct rr_regs __iomem *regs = rrpriv->regs; in rr_read_eeprom() local
408 io = readl(®s->ExtIo); in rr_read_eeprom()
409 writel(0, ®s->ExtIo); in rr_read_eeprom()
410 misc = readl(®s->LocalCtrl); in rr_read_eeprom()
411 writel(0, ®s->LocalCtrl); in rr_read_eeprom()
412 host = readl(®s->HostCtrl); in rr_read_eeprom()
413 writel(host | HALT_NIC, ®s->HostCtrl); in rr_read_eeprom()
417 writel((EEPROM_BASE + ((offset+i) << 3)), ®s->WinBase); in rr_read_eeprom()
419 buf[i] = (readl(®s->WinData) >> 24) & 0xff; in rr_read_eeprom()
423 writel(host, ®s->HostCtrl); in rr_read_eeprom()
424 writel(misc, ®s->LocalCtrl); in rr_read_eeprom()
425 writel(io, ®s->ExtIo); in rr_read_eeprom()
457 struct rr_regs __iomem *regs = rrpriv->regs; in write_eeprom() local
460 io = readl(®s->ExtIo); in write_eeprom()
461 writel(0, ®s->ExtIo); in write_eeprom()
462 misc = readl(®s->LocalCtrl); in write_eeprom()
463 writel(ENABLE_EEPROM_WRITE, ®s->LocalCtrl); in write_eeprom()
467 writel((EEPROM_BASE + ((offset+i) << 3)), ®s->WinBase); in write_eeprom()
474 if ((readl(®s->WinData) & 0xff000000) != data){ in write_eeprom()
475 writel(data, ®s->WinData); in write_eeprom()
481 if ((readl(®s->WinData) & 0xff000000) == in write_eeprom()
488 readl(®s->WinData)); in write_eeprom()
496 writel(misc, ®s->LocalCtrl); in write_eeprom()
497 writel(io, ®s->ExtIo); in write_eeprom()
508 struct rr_regs __iomem *regs; in rr_init() local
512 regs = rrpriv->regs; in rr_init()
514 rev = readl(®s->FwRev); in rr_init()
530 printk(" Maximum receive rings %i\n", readl(®s->MaxRxRng)); in rr_init()
560 struct rr_regs __iomem *regs; in rr_init1() local
568 regs = rrpriv->regs; in rr_init1()
572 hostctrl = readl(®s->HostCtrl); in rr_init1()
573 writel(hostctrl | HALT_NIC | RR_CLEAR_INT, ®s->HostCtrl); in rr_init1()
584 set_rxaddr(regs, rrpriv->rx_ctrl_dma); in rr_init1()
585 set_infoaddr(regs, rrpriv->info_dma); in rr_init1()
599 writel(0, ®s->CmdRing[i]); in rr_init1()
626 writel(0x5000, ®s->ConRetry); in rr_init1()
627 writel(0x100, ®s->ConRetryTmr); in rr_init1()
628 writel(0x500000, ®s->ConTmout); in rr_init1()
629 writel(0x60, ®s->IntrTmr); in rr_init1()
630 writel(0x500000, ®s->TxDataMvTimeout); in rr_init1()
631 writel(0x200000, ®s->RxDataMvTimeout); in rr_init1()
632 writel(0x80, ®s->WriteDmaThresh); in rr_init1()
633 writel(0x80, ®s->ReadDmaThresh); in rr_init1()
639 writel(hostctrl, ®s->HostCtrl); in rr_init1()
730 struct rr_regs __iomem *regs; in rr_handle_event() local
734 regs = rrpriv->regs; in rr_handle_event()
739 tmp = readl(®s->FwRev); in rr_handle_event()
744 writel(RX_RING_ENTRIES - 1, ®s->IpRxPi); in rr_handle_event()
764 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
765 ®s->HostCtrl); in rr_handle_event()
771 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
772 ®s->HostCtrl); in rr_handle_event()
795 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
796 ®s->HostCtrl); in rr_handle_event()
807 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
808 ®s->HostCtrl); in rr_handle_event()
814 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
815 ®s->HostCtrl); in rr_handle_event()
821 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
822 ®s->HostCtrl); in rr_handle_event()
828 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
829 ®s->HostCtrl); in rr_handle_event()
882 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
883 ®s->HostCtrl); in rr_handle_event()
889 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
890 ®s->HostCtrl); in rr_handle_event()
896 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_handle_event()
897 ®s->HostCtrl); in rr_handle_event()
933 struct rr_regs __iomem *regs = rrpriv->regs; in rx_int() local
1014 writel(index, ®s->IpRxPi); in rx_int()
1027 struct rr_regs __iomem *regs; in rr_interrupt() local
1032 regs = rrpriv->regs; in rr_interrupt()
1034 if (!(readl(®s->HostCtrl) & RR_INT)) in rr_interrupt()
1039 prodidx = readl(®s->EvtPrd); in rr_interrupt()
1102 writel(eidx, ®s->EvtCon); in rr_interrupt()
1159 struct rr_regs __iomem *regs = rrpriv->regs; in rr_timer() local
1162 if (readl(®s->HostCtrl) & NIC_HALTED){ in rr_timer()
1173 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, in rr_timer()
1174 ®s->HostCtrl); in rr_timer()
1187 struct rr_regs __iomem *regs; in rr_open() local
1192 regs = rrpriv->regs; in rr_open()
1220 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, ®s->HostCtrl); in rr_open()
1221 readl(®s->HostCtrl); in rr_open()
1246 writel(readl(®s->HostCtrl)|HALT_NIC|RR_CLEAR_INT, ®s->HostCtrl); in rr_open()
1269 struct rr_regs __iomem *regs; in rr_dump() local
1275 regs = rrpriv->regs; in rr_dump()
1280 readl(®s->RxPrd), readl(®s->TxPrd), in rr_dump()
1281 readl(®s->EvtPrd), readl(®s->TxPi), in rr_dump()
1284 printk("Error code 0x%x\n", readl(®s->Fail1)); in rr_dump()
1286 index = (((readl(®s->EvtPrd) >> 8) & 0xff) - 1) % TX_RING_ENTRIES; in rr_dump()
1332 struct rr_regs __iomem *regs = rrpriv->regs; in rr_close() local
1347 tmp = readl(®s->HostCtrl); in rr_close()
1353 writel(tmp, ®s->HostCtrl); in rr_close()
1354 readl(®s->HostCtrl); in rr_close()
1363 writel(0, ®s->TxPi); in rr_close()
1364 writel(0, ®s->IpRxPi); in rr_close()
1366 writel(0, ®s->EvtCon); in rr_close()
1367 writel(0, ®s->EvtPrd); in rr_close()
1370 writel(0, ®s->CmdRing[i]); in rr_close()
1399 struct rr_regs __iomem *regs = rrpriv->regs; in rr_start_xmit() local
1407 if (readl(®s->Mode) & FATAL_ERR) in rr_start_xmit()
1409 readl(®s->Fail1), readl(®s->Fail2)); in rr_start_xmit()
1451 writel(txctrl->pi, ®s->TxPi); in rr_start_xmit()
1474 struct rr_regs __iomem *regs; in rr_load_firmware() local
1481 regs = rrpriv->regs; in rr_load_firmware()
1486 if (!(readl(®s->HostCtrl) & NIC_HALTED)){ in rr_load_firmware()
1492 localctrl = readl(®s->LocalCtrl); in rr_load_firmware()
1493 writel(0, ®s->LocalCtrl); in rr_load_firmware()
1495 writel(0, ®s->EvtPrd); in rr_load_firmware()
1496 writel(0, ®s->RxPrd); in rr_load_firmware()
1497 writel(0, ®s->TxPrd); in rr_load_firmware()
1504 io = readl(®s->ExtIo); in rr_load_firmware()
1505 writel(0, ®s->ExtIo); in rr_load_firmware()
1509 writel(i * 4, ®s->WinBase); in rr_load_firmware()
1511 writel(0, ®s->WinData); in rr_load_firmware()
1514 writel(io, ®s->ExtIo); in rr_load_firmware()
1560 writel(sptr, ®s->WinBase); in rr_load_firmware()
1562 writel(tmp, ®s->WinData); in rr_load_firmware()
1570 writel(localctrl, ®s->LocalCtrl); in rr_load_firmware()