diff options
Diffstat (limited to 'drivers/net/myri10ge')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 19 |
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); |