diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2009-10-13 01:31:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-13 14:48:19 -0400 |
commit | 47abe35610cbbfb3cc92847efdf588a8be1f5ebc (patch) | |
tree | 13f9e7a04b31a4138e3e069f62377f75b049e31f /drivers/net/netxen/netxen_nic_main.c | |
parent | 1f5e055db369a5d1c74174571585a4ec2e6c40fb (diff) |
netxen: add access to on chip memory for tools
Add access to on chip memory, this is used by
debug and diagnostic tools only.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 302675a972e8..b7f607061865 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -607,13 +607,11 @@ netxen_setup_pci_map(struct netxen_adapter *adapter) | |||
607 | * accessed it should set the window to 0 and then reset it to 1. | 607 | * accessed it should set the window to 0 and then reset it to 1. |
608 | */ | 608 | */ |
609 | adapter->curr_window = 255; | 609 | adapter->curr_window = 255; |
610 | adapter->ahw.qdr_sn_window = -1; | 610 | adapter->ahw.ocm_win = -1; |
611 | adapter->ahw.ddr_mn_window = -1; | ||
612 | 611 | ||
613 | /* remap phys address */ | 612 | /* remap phys address */ |
614 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ | 613 | mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */ |
615 | mem_len = pci_resource_len(pdev, 0); | 614 | mem_len = pci_resource_len(pdev, 0); |
616 | pci_len0 = 0; | ||
617 | 615 | ||
618 | /* 128 Meg of memory */ | 616 | /* 128 Meg of memory */ |
619 | if (mem_len == NETXEN_PCI_128MB_SIZE) { | 617 | if (mem_len == NETXEN_PCI_128MB_SIZE) { |
@@ -622,6 +620,7 @@ netxen_setup_pci_map(struct netxen_adapter *adapter) | |||
622 | SECOND_PAGE_GROUP_SIZE); | 620 | SECOND_PAGE_GROUP_SIZE); |
623 | mem_ptr2 = ioremap(mem_base + THIRD_PAGE_GROUP_START, | 621 | mem_ptr2 = ioremap(mem_base + THIRD_PAGE_GROUP_START, |
624 | THIRD_PAGE_GROUP_SIZE); | 622 | THIRD_PAGE_GROUP_SIZE); |
623 | pci_len0 = FIRST_PAGE_GROUP_SIZE; | ||
625 | } else if (mem_len == NETXEN_PCI_32MB_SIZE) { | 624 | } else if (mem_len == NETXEN_PCI_32MB_SIZE) { |
626 | mem_ptr1 = ioremap(mem_base, SECOND_PAGE_GROUP_SIZE); | 625 | mem_ptr1 = ioremap(mem_base, SECOND_PAGE_GROUP_SIZE); |
627 | mem_ptr2 = ioremap(mem_base + THIRD_PAGE_GROUP_START - | 626 | mem_ptr2 = ioremap(mem_base + THIRD_PAGE_GROUP_START - |
@@ -634,19 +633,6 @@ netxen_setup_pci_map(struct netxen_adapter *adapter) | |||
634 | return -EIO; | 633 | return -EIO; |
635 | } | 634 | } |
636 | pci_len0 = mem_len; | 635 | pci_len0 = mem_len; |
637 | |||
638 | adapter->ahw.ddr_mn_window = 0; | ||
639 | adapter->ahw.qdr_sn_window = 0; | ||
640 | |||
641 | adapter->ahw.mn_win_crb = NETXEN_PCI_CRBSPACE + | ||
642 | 0x100000 + PCIX_MN_WINDOW + (pci_func * 0x20); | ||
643 | adapter->ahw.ms_win_crb = NETXEN_PCI_CRBSPACE + | ||
644 | 0x100000 + PCIX_SN_WINDOW; | ||
645 | if (pci_func < 4) | ||
646 | adapter->ahw.ms_win_crb += (pci_func * 0x20); | ||
647 | else | ||
648 | adapter->ahw.ms_win_crb += | ||
649 | 0xA0 + ((pci_func - 4) * 0x10); | ||
650 | } else { | 636 | } else { |
651 | return -EIO; | 637 | return -EIO; |
652 | } | 638 | } |
@@ -660,6 +646,11 @@ netxen_setup_pci_map(struct netxen_adapter *adapter) | |||
660 | adapter->ahw.pci_base1 = mem_ptr1; | 646 | adapter->ahw.pci_base1 = mem_ptr1; |
661 | adapter->ahw.pci_base2 = mem_ptr2; | 647 | adapter->ahw.pci_base2 = mem_ptr2; |
662 | 648 | ||
649 | if (!NX_IS_REVISION_P2(adapter->ahw.revision_id)) { | ||
650 | adapter->ahw.ocm_win_crb = netxen_get_ioaddr(adapter, | ||
651 | NETXEN_PCIX_PS_REG(PCIE_MN_WINDOW_REG(pci_func))); | ||
652 | } | ||
653 | |||
663 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) | 654 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
664 | goto skip_doorbell; | 655 | goto skip_doorbell; |
665 | 656 | ||
@@ -1447,6 +1438,7 @@ netxen_nic_resume(struct pci_dev *pdev) | |||
1447 | return err; | 1438 | return err; |
1448 | 1439 | ||
1449 | adapter->curr_window = 255; | 1440 | adapter->curr_window = 255; |
1441 | adapter->ahw.ocm_win = -1; | ||
1450 | 1442 | ||
1451 | err = netxen_start_firmware(adapter); | 1443 | err = netxen_start_firmware(adapter); |
1452 | if (err) { | 1444 | if (err) { |