aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit@qlogic.com>2009-09-11 07:28:11 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-11 19:58:38 -0400
commitf78c0850d2ebe7a44a4b0263480a2f1a36a92218 (patch)
tree0965632234e9a3a306ad2c8cde5f0066bb6acf9f /drivers
parent5ea1c50662d447de344812054175d7151783ea25 (diff)
netxen: change firmware write size
Use 8 byte strides for firmware download into card memory since oncard memory controller needs 8 byte (64 bit) accesses. This avoids unnecessary rmw cycles. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/netxen/netxen_nic_init.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 485b947932a1..8926b0e0c8bc 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -727,21 +727,28 @@ netxen_load_firmware(struct netxen_adapter *adapter)
727 flashaddr += 8; 727 flashaddr += 8;
728 } 728 }
729 } else { 729 } else {
730 u32 data; 730 u64 data;
731 u32 hi, lo;
731 732
732 size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START) / 4; 733 size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START) / 8;
733 flashaddr = NETXEN_BOOTLD_START; 734 flashaddr = NETXEN_BOOTLD_START;
734 735
735 for (i = 0; i < size; i++) { 736 for (i = 0; i < size; i++) {
736 if (netxen_rom_fast_read(adapter, 737 if (netxen_rom_fast_read(adapter,
737 flashaddr, (int *)&data) != 0) 738 flashaddr, &lo) != 0)
739 return -EIO;
740 if (netxen_rom_fast_read(adapter,
741 flashaddr + 4, &hi) != 0)
738 return -EIO; 742 return -EIO;
739 743
744 /* hi, lo are already in host endian byteorder */
745 data = (((u64)hi << 32) | lo);
746
740 if (adapter->pci_mem_write(adapter, 747 if (adapter->pci_mem_write(adapter,
741 flashaddr, &data, 4)) 748 flashaddr, &data, 8))
742 return -EIO; 749 return -EIO;
743 750
744 flashaddr += 4; 751 flashaddr += 8;
745 } 752 }
746 } 753 }
747 msleep(1); 754 msleep(1);