提交 f78c0850 编写于 作者: A Amit Kumar Salecha 提交者: David S. Miller

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: NAmit Kumar Salecha <amit@netxen.com>
Signed-off-by: NDhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5ea1c506
...@@ -727,21 +727,28 @@ netxen_load_firmware(struct netxen_adapter *adapter) ...@@ -727,21 +727,28 @@ netxen_load_firmware(struct netxen_adapter *adapter)
flashaddr += 8; flashaddr += 8;
} }
} else { } 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; flashaddr = NETXEN_BOOTLD_START;
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
if (netxen_rom_fast_read(adapter, 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; return -EIO;
/* hi, lo are already in host endian byteorder */
data = (((u64)hi << 32) | lo);
if (adapter->pci_mem_write(adapter, if (adapter->pci_mem_write(adapter,
flashaddr, &data, 4)) flashaddr, &data, 8))
return -EIO; return -EIO;
flashaddr += 4; flashaddr += 8;
} }
} }
msleep(1); msleep(1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册