diff options
author | Amit Kumar Salecha <amit@netxen.com> | 2009-10-16 15:50:09 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-17 23:44:42 -0700 |
commit | 6abb4b83eac25d91f6de834e97b2ea38e979575b (patch) | |
tree | d06065cc9c37f3bbc9a2a15a6c9e09535e3adb79 /drivers/net/netxen/netxen_nic_hw.c | |
parent | 0be367bd5d10634c0836f57a684432fee935d929 (diff) | |
download | linux-6abb4b83eac25d91f6de834e97b2ea38e979575b.tar.gz linux-6abb4b83eac25d91f6de834e97b2ea38e979575b.tar.bz2 linux-6abb4b83eac25d91f6de834e97b2ea38e979575b.zip |
netxen: onchip memory access change
Add support for different windowing scheme for on chip
memory in future chip revisions. This is required by
diagnostic tools.
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>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_hw.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 52a2f2d67552..a63324613430 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c @@ -31,6 +31,7 @@ #define MASK(n) ((1ULL<<(n))-1) #define MN_WIN(addr) (((addr & 0x1fc0000) >> 1) | ((addr >> 25) & 0x3ff)) #define OCM_WIN(addr) (((addr & 0x1ff0000) >> 1) | ((addr >> 25) & 0x3ff)) +#define OCM_WIN_P3P(addr) (addr & 0xffc0000) #define MS_WIN(addr) (addr & 0x0ffc0000) #define GET_MEM_OFFS_2M(addr) (addr & MASK(18)) @@ -1338,7 +1339,7 @@ static int netxen_nic_pci_set_window_2M(struct netxen_adapter *adapter, u64 addr, u32 *start) { - u32 win_read, window; + u32 window; struct pci_dev *pdev = adapter->pdev; if ((addr & 0x00ff800) == 0xff800) { @@ -1347,14 +1348,14 @@ netxen_nic_pci_set_window_2M(struct netxen_adapter *adapter, return -EIO; } - window = OCM_WIN(addr); + if (NX_IS_REVISION_P3P(adapter->ahw.revision_id)) + window = OCM_WIN_P3P(addr); + else + window = OCM_WIN(addr); + writel(window, adapter->ahw.ocm_win_crb); - win_read = readl(adapter->ahw.ocm_win_crb); - if ((win_read >> 7) != window) { - if (printk_ratelimit()) - dev_warn(&pdev->dev, "failed to set OCM window\n"); - return -EIO; - } + /* read back to flush */ + readl(adapter->ahw.ocm_win_crb); adapter->ahw.ocm_win = window; *start = NETXEN_PCI_OCM0_2M + GET_MEM_OFFS_2M(addr); |