aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index 2b40a5a19c47..aac15421bd1e 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -377,7 +377,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
377 recv_crb_registers[ctx]. 377 recv_crb_registers[ctx].
378 crb_rcvpeg_state)); 378 crb_rcvpeg_state));
379 while (state != PHAN_PEG_RCV_INITIALIZED && loops < 20) { 379 while (state != PHAN_PEG_RCV_INITIALIZED && loops < 20) {
380 udelay(100); 380 msleep(1);
381 /* Window 1 call */ 381 /* Window 1 call */
382 state = readl(NETXEN_CRB_NORMALIZE(adapter, 382 state = readl(NETXEN_CRB_NORMALIZE(adapter,
383 recv_crb_registers 383 recv_crb_registers
@@ -394,7 +394,7 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
394 } 394 }
395 adapter->intr_scheme = readl( 395 adapter->intr_scheme = readl(
396 NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW)); 396 NETXEN_CRB_NORMALIZE(adapter, CRB_NIC_CAPABILITIES_FW));
397 printk(KERN_NOTICE "%s: FW capabilities:0x%x\n", netdev->name, 397 printk(KERN_NOTICE "%s: FW capabilities:0x%x\n", netxen_nic_driver_name,
398 adapter->intr_scheme); 398 adapter->intr_scheme);
399 DPRINTK(INFO, "Receive Peg ready too. starting stuff\n"); 399 DPRINTK(INFO, "Receive Peg ready too. starting stuff\n");
400 400
@@ -701,7 +701,7 @@ void netxen_nic_pci_change_crbwindow(struct netxen_adapter *adapter, u32 wndw)
701 adapter->curr_window = 0; 701 adapter->curr_window = 0;
702} 702}
703 703
704void netxen_load_firmware(struct netxen_adapter *adapter) 704int netxen_load_firmware(struct netxen_adapter *adapter)
705{ 705{
706 int i; 706 int i;
707 u32 data, size = 0; 707 u32 data, size = 0;
@@ -713,15 +713,24 @@ void netxen_load_firmware(struct netxen_adapter *adapter)
713 writel(1, NETXEN_CRB_NORMALIZE(adapter, NETXEN_ROMUSB_GLB_CAS_RST)); 713 writel(1, NETXEN_CRB_NORMALIZE(adapter, NETXEN_ROMUSB_GLB_CAS_RST));
714 714
715 for (i = 0; i < size; i++) { 715 for (i = 0; i < size; i++) {
716 if (netxen_rom_fast_read(adapter, flashaddr, (int *)&data) != 0) { 716 int retries = 10;
717 DPRINTK(ERR, 717 if (netxen_rom_fast_read(adapter, flashaddr, (int *)&data) != 0)
718 "Error in netxen_rom_fast_read(). Will skip" 718 return -EIO;
719 "loading flash image\n"); 719
720 return;
721 }
722 off = netxen_nic_pci_set_window(adapter, memaddr); 720 off = netxen_nic_pci_set_window(adapter, memaddr);
723 addr = pci_base_offset(adapter, off); 721 addr = pci_base_offset(adapter, off);
724 writel(data, addr); 722 writel(data, addr);
723 do {
724 if (readl(addr) == data)
725 break;
726 msleep(100);
727 writel(data, addr);
728 } while (--retries);
729 if (!retries) {
730 printk(KERN_ERR "%s: firmware load aborted, write failed at 0x%x\n",
731 netxen_nic_driver_name, memaddr);
732 return -EIO;
733 }
725 flashaddr += 4; 734 flashaddr += 4;
726 memaddr += 4; 735 memaddr += 4;
727 } 736 }
@@ -731,7 +740,7 @@ void netxen_load_firmware(struct netxen_adapter *adapter)
731 NETXEN_CRB_NORMALIZE(adapter, NETXEN_ROMUSB_GLB_CHIP_CLK_CTRL)); 740 NETXEN_CRB_NORMALIZE(adapter, NETXEN_ROMUSB_GLB_CHIP_CLK_CTRL));
732 writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_ROMUSB_GLB_CAS_RST)); 741 writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_ROMUSB_GLB_CAS_RST));
733 742
734 udelay(100); 743 return 0;
735} 744}
736 745
737int 746int