diff options
author | Amit Kumar Salecha <amit@qlogic.com> | 2009-10-16 11:50:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-18 02:44:41 -0400 |
commit | 0be367bd5d10634c0836f57a684432fee935d929 (patch) | |
tree | da3f8b320d4166e4132bc37653d22d3c4d6edcc1 | |
parent | fb1f6a4378fe211d8c1397311d26e747e5ec61c5 (diff) |
netxen: reset sequence changes
Future revisions need different chip reset sequence
and firmware initialization.
Also clean up some never used debug code.
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>
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 2 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 41 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 2 |
3 files changed, 16 insertions, 29 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index a608e25807ba..db28f8a6f8af 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1270,7 +1270,7 @@ int netxen_load_firmware(struct netxen_adapter *adapter); | |||
1270 | int netxen_need_fw_reset(struct netxen_adapter *adapter); | 1270 | int netxen_need_fw_reset(struct netxen_adapter *adapter); |
1271 | void netxen_request_firmware(struct netxen_adapter *adapter); | 1271 | void netxen_request_firmware(struct netxen_adapter *adapter); |
1272 | void netxen_release_firmware(struct netxen_adapter *adapter); | 1272 | void netxen_release_firmware(struct netxen_adapter *adapter); |
1273 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose); | 1273 | int netxen_pinit_from_rom(struct netxen_adapter *adapter); |
1274 | 1274 | ||
1275 | int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp); | 1275 | int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp); |
1276 | int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, | 1276 | int netxen_rom_fast_read_words(struct netxen_adapter *adapter, int addr, |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 83387c791d5f..a5248447789b 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -437,7 +437,7 @@ int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | |||
437 | #define NETXEN_BOARDNUM 0x400c | 437 | #define NETXEN_BOARDNUM 0x400c |
438 | #define NETXEN_CHIPNUM 0x4010 | 438 | #define NETXEN_CHIPNUM 0x4010 |
439 | 439 | ||
440 | int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | 440 | int netxen_pinit_from_rom(struct netxen_adapter *adapter) |
441 | { | 441 | { |
442 | int addr, val; | 442 | int addr, val; |
443 | int i, n, init_delay = 0; | 443 | int i, n, init_delay = 0; |
@@ -450,21 +450,6 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
450 | NXWR32(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 0xffffffff); | 450 | NXWR32(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 0xffffffff); |
451 | netxen_rom_unlock(adapter); | 451 | netxen_rom_unlock(adapter); |
452 | 452 | ||
453 | if (verbose) { | ||
454 | if (netxen_rom_fast_read(adapter, NETXEN_BOARDTYPE, &val) == 0) | ||
455 | printk("P2 ROM board type: 0x%08x\n", val); | ||
456 | else | ||
457 | printk("Could not read board type\n"); | ||
458 | if (netxen_rom_fast_read(adapter, NETXEN_BOARDNUM, &val) == 0) | ||
459 | printk("P2 ROM board num: 0x%08x\n", val); | ||
460 | else | ||
461 | printk("Could not read board number\n"); | ||
462 | if (netxen_rom_fast_read(adapter, NETXEN_CHIPNUM, &val) == 0) | ||
463 | printk("P2 ROM chip num: 0x%08x\n", val); | ||
464 | else | ||
465 | printk("Could not read chip number\n"); | ||
466 | } | ||
467 | |||
468 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { | 453 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { |
469 | if (netxen_rom_fast_read(adapter, 0, &n) != 0 || | 454 | if (netxen_rom_fast_read(adapter, 0, &n) != 0 || |
470 | (n != 0xcafecafe) || | 455 | (n != 0xcafecafe) || |
@@ -486,11 +471,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
486 | n &= ~0x80000000; | 471 | n &= ~0x80000000; |
487 | } | 472 | } |
488 | 473 | ||
489 | if (n < 1024) { | 474 | if (n >= 1024) { |
490 | if (verbose) | ||
491 | printk(KERN_DEBUG "%s: %d CRB init values found" | ||
492 | " in ROM.\n", netxen_nic_driver_name, n); | ||
493 | } else { | ||
494 | printk(KERN_ERR "%s:n=0x%x Error! NetXen card flash not" | 475 | printk(KERN_ERR "%s:n=0x%x Error! NetXen card flash not" |
495 | " initialized.\n", __func__, n); | 476 | " initialized.\n", __func__, n); |
496 | return -EIO; | 477 | return -EIO; |
@@ -502,6 +483,7 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
502 | netxen_nic_driver_name); | 483 | netxen_nic_driver_name); |
503 | return -ENOMEM; | 484 | return -ENOMEM; |
504 | } | 485 | } |
486 | |||
505 | for (i = 0; i < n; i++) { | 487 | for (i = 0; i < n; i++) { |
506 | if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 || | 488 | if (netxen_rom_fast_read(adapter, 8*i + 4*offset, &val) != 0 || |
507 | netxen_rom_fast_read(adapter, 8*i + 4*offset + 4, &addr) != 0) { | 489 | netxen_rom_fast_read(adapter, 8*i + 4*offset + 4, &addr) != 0) { |
@@ -512,11 +494,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
512 | buf[i].addr = addr; | 494 | buf[i].addr = addr; |
513 | buf[i].data = val; | 495 | buf[i].data = val; |
514 | 496 | ||
515 | if (verbose) | ||
516 | printk(KERN_DEBUG "%s: PCI: 0x%08x == 0x%08x\n", | ||
517 | netxen_nic_driver_name, | ||
518 | (u32)netxen_decode_crb_addr(addr), val); | ||
519 | } | 497 | } |
498 | |||
520 | for (i = 0; i < n; i++) { | 499 | for (i = 0; i < n; i++) { |
521 | 500 | ||
522 | off = netxen_decode_crb_addr(buf[i].addr); | 501 | off = netxen_decode_crb_addr(buf[i].addr); |
@@ -526,6 +505,10 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
526 | continue; | 505 | continue; |
527 | } | 506 | } |
528 | off += NETXEN_PCI_CRBSPACE; | 507 | off += NETXEN_PCI_CRBSPACE; |
508 | |||
509 | if (off & 1) | ||
510 | continue; | ||
511 | |||
529 | /* skipping cold reboot MAGIC */ | 512 | /* skipping cold reboot MAGIC */ |
530 | if (off == NETXEN_CAM_RAM(0x1fc)) | 513 | if (off == NETXEN_CAM_RAM(0x1fc)) |
531 | continue; | 514 | continue; |
@@ -542,7 +525,8 @@ int netxen_pinit_from_rom(struct netxen_adapter *adapter, int verbose) | |||
542 | continue; | 525 | continue; |
543 | if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */ | 526 | if (off == (ROMUSB_GLB + 0x1c)) /* MS clock */ |
544 | continue; | 527 | continue; |
545 | if (off == (NETXEN_CRB_PEG_NET_1 + 0x18)) | 528 | if (off == (NETXEN_CRB_PEG_NET_1 + 0x18) && |
529 | !NX_IS_REVISION_P3P(adapter->ahw.revision_id)) | ||
546 | buf[i].data = 0x1020; | 530 | buf[i].data = 0x1020; |
547 | /* skip the function enable register */ | 531 | /* skip the function enable register */ |
548 | if (off == NETXEN_PCIE_REG(PCIE_SETUP_FUNCTION)) | 532 | if (off == NETXEN_PCIE_REG(PCIE_SETUP_FUNCTION)) |
@@ -751,7 +735,10 @@ netxen_load_firmware(struct netxen_adapter *adapter) | |||
751 | } | 735 | } |
752 | msleep(1); | 736 | msleep(1); |
753 | 737 | ||
754 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | 738 | if (NX_IS_REVISION_P3P(adapter->ahw.revision_id)) { |
739 | NXWR32(adapter, NETXEN_CRB_PEG_NET_0 + 0x18, 0x1020); | ||
740 | NXWR32(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 0x80001e); | ||
741 | } else if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | ||
755 | NXWR32(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 0x80001d); | 742 | NXWR32(adapter, NETXEN_ROMUSB_GLB_SW_RESET, 0x80001d); |
756 | else { | 743 | else { |
757 | NXWR32(adapter, NETXEN_ROMUSB_GLB_CHIP_CLK_CTRL, 0x3fff); | 744 | NXWR32(adapter, NETXEN_ROMUSB_GLB_CHIP_CLK_CTRL, 0x3fff); |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 5bc8520e3e15..2d772dd381fe 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -810,7 +810,7 @@ netxen_start_firmware(struct netxen_adapter *adapter) | |||
810 | 810 | ||
811 | if (first_boot != 0x55555555) { | 811 | if (first_boot != 0x55555555) { |
812 | NXWR32(adapter, CRB_CMDPEG_STATE, 0); | 812 | NXWR32(adapter, CRB_CMDPEG_STATE, 0); |
813 | netxen_pinit_from_rom(adapter, 0); | 813 | netxen_pinit_from_rom(adapter); |
814 | msleep(1); | 814 | msleep(1); |
815 | } | 815 | } |
816 | 816 | ||