aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/myri10ge/myri10ge.c
diff options
context:
space:
mode:
authorBrice Goglin <brice@myri.com>2006-07-30 00:14:09 -0400
committerJeff Garzik <jeff@garzik.org>2006-08-03 17:31:10 -0400
commite454358ace657af953b5b289f49cf733973f41e4 (patch)
tree62ab274bead7523e8402e7ee9d15a55e10a0914a /drivers/net/myri10ge/myri10ge.c
parent817acf5ebd9ea21f134fc90064b0f6686c5b169d (diff)
[PATCH] myri10ge - Write the firmware in 256-bytes chunks
When writing the firmware to the NIC, the FIFO is 256-bytes long, so we use 256-bytes chunks and a read to wait until the previous write is done. Signed-off-by: Brice Goglin <brice@myri.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/myri10ge/myri10ge.c')
-rw-r--r--drivers/net/myri10ge/myri10ge.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index c3e52c806b13..198c6f0e0105 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -448,6 +448,7 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
448 struct mcp_gen_header *hdr; 448 struct mcp_gen_header *hdr;
449 size_t hdr_offset; 449 size_t hdr_offset;
450 int status; 450 int status;
451 unsigned i;
451 452
452 if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) { 453 if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) {
453 dev_err(dev, "Unable to load %s firmware image via hotplug\n", 454 dev_err(dev, "Unable to load %s firmware image via hotplug\n",
@@ -479,18 +480,12 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size)
479 goto abort_with_fw; 480 goto abort_with_fw;
480 481
481 crc = crc32(~0, fw->data, fw->size); 482 crc = crc32(~0, fw->data, fw->size);
482 if (mgp->tx.boundary == 2048) { 483 for (i = 0; i < fw->size; i += 256) {
483 /* Avoid PCI burst on chipset with unaligned completions. */ 484 myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET + i,
484 int i; 485 fw->data + i,
485 __iomem u32 *ptr = (__iomem u32 *) (mgp->sram + 486 min(256U, (unsigned)(fw->size - i)));
486 MYRI10GE_FW_OFFSET); 487 mb();
487 for (i = 0; i < fw->size / 4; i++) { 488 readb(mgp->sram);
488 __raw_writel(((u32 *) fw->data)[i], ptr + i);
489 wmb();
490 }
491 } else {
492 myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET, fw->data,
493 fw->size);
494 } 489 }
495 /* corruption checking is good for parity recovery and buggy chipset */ 490 /* corruption checking is good for parity recovery and buggy chipset */
496 memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); 491 memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size);