Skip to content

Commit

Permalink
netxen: change firmware write size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amit Kumar Salecha authored and David S. Miller committed Sep 11, 2009
1 parent 5ea1c50 commit f78c085
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions drivers/net/netxen/netxen_nic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,21 +727,28 @@ netxen_load_firmware(struct netxen_adapter *adapter)
flashaddr += 8;
}
} else {
u32 data;
u64 data;
u32 hi, lo;

size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START) / 4;
size = (NETXEN_IMAGE_START - NETXEN_BOOTLD_START) / 8;
flashaddr = NETXEN_BOOTLD_START;

for (i = 0; i < size; i++) {
if (netxen_rom_fast_read(adapter,
flashaddr, (int *)&data) != 0)
flashaddr, &lo) != 0)
return -EIO;
if (netxen_rom_fast_read(adapter,
flashaddr + 4, &hi) != 0)
return -EIO;

/* hi, lo are already in host endian byteorder */
data = (((u64)hi << 32) | lo);

if (adapter->pci_mem_write(adapter,
flashaddr, &data, 4))
flashaddr, &data, 8))
return -EIO;

flashaddr += 4;
flashaddr += 8;
}
}
msleep(1);
Expand Down

0 comments on commit f78c085

Please sign in to comment.