Commit 13acde8f authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

e1000: cleanup CE4100 MDIO registers access

A global variable is currently used to hold the virtual address of the
CE4100 MDIO base register address. Store the address in the e1000_hw
structure and update macros accordingly.
Signed-off-by: default avatarFlorian Fainelli <ffainelli@freebox.fr>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c26750c
...@@ -812,8 +812,7 @@ struct e1000_ffvt_entry { ...@@ -812,8 +812,7 @@ struct e1000_ffvt_entry {
#define E1000_FLA 0x0001C /* Flash Access - RW */ #define E1000_FLA 0x0001C /* Flash Access - RW */
#define E1000_MDIC 0x00020 /* MDI Control - RW */ #define E1000_MDIC 0x00020 /* MDI Control - RW */
extern void __iomem *ce4100_gbe_mdio_base_virt; #define INTEL_CE_GBE_MDIO_RCOMP_BASE (hw->ce4100_gbe_mdio_base_virt)
#define INTEL_CE_GBE_MDIO_RCOMP_BASE (ce4100_gbe_mdio_base_virt)
#define E1000_MDIO_STS (INTEL_CE_GBE_MDIO_RCOMP_BASE + 0) #define E1000_MDIO_STS (INTEL_CE_GBE_MDIO_RCOMP_BASE + 0)
#define E1000_MDIO_CMD (INTEL_CE_GBE_MDIO_RCOMP_BASE + 4) #define E1000_MDIO_CMD (INTEL_CE_GBE_MDIO_RCOMP_BASE + 4)
#define E1000_MDIO_DRV (INTEL_CE_GBE_MDIO_RCOMP_BASE + 8) #define E1000_MDIO_DRV (INTEL_CE_GBE_MDIO_RCOMP_BASE + 8)
...@@ -1343,6 +1342,7 @@ struct e1000_hw_stats { ...@@ -1343,6 +1342,7 @@ struct e1000_hw_stats {
struct e1000_hw { struct e1000_hw {
u8 __iomem *hw_addr; u8 __iomem *hw_addr;
u8 __iomem *flash_address; u8 __iomem *flash_address;
void __iomem *ce4100_gbe_mdio_base_virt;
e1000_mac_type mac_type; e1000_mac_type mac_type;
e1000_phy_type phy_type; e1000_phy_type phy_type;
u32 phy_init_script; u32 phy_init_script;
......
...@@ -33,11 +33,6 @@ ...@@ -33,11 +33,6 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
/* Intel Media SOC GbE MDIO physical base address */
static unsigned long ce4100_gbe_mdio_base_phy;
/* Intel Media SOC GbE MDIO virtual base address */
void __iomem *ce4100_gbe_mdio_base_virt;
char e1000_driver_name[] = "e1000"; char e1000_driver_name[] = "e1000";
static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
#define DRV_VERSION "7.3.21-k8-NAPI" #define DRV_VERSION "7.3.21-k8-NAPI"
...@@ -1054,11 +1049,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -1054,11 +1049,11 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
err = -EIO; err = -EIO;
if (hw->mac_type == e1000_ce4100) { if (hw->mac_type == e1000_ce4100) {
ce4100_gbe_mdio_base_phy = pci_resource_start(pdev, BAR_1); hw->ce4100_gbe_mdio_base_virt =
ce4100_gbe_mdio_base_virt = ioremap(ce4100_gbe_mdio_base_phy, ioremap(pci_resource_start(pdev, BAR_1),
pci_resource_len(pdev, BAR_1)); pci_resource_len(pdev, BAR_1));
if (!ce4100_gbe_mdio_base_virt) if (!hw->ce4100_gbe_mdio_base_virt)
goto err_mdio_ioremap; goto err_mdio_ioremap;
} }
...@@ -1249,7 +1244,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev, ...@@ -1249,7 +1244,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
err_dma: err_dma:
err_sw_init: err_sw_init:
err_mdio_ioremap: err_mdio_ioremap:
iounmap(ce4100_gbe_mdio_base_virt); iounmap(hw->ce4100_gbe_mdio_base_virt);
iounmap(hw->hw_addr); iounmap(hw->hw_addr);
err_ioremap: err_ioremap:
free_netdev(netdev); free_netdev(netdev);
...@@ -1287,7 +1282,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev) ...@@ -1287,7 +1282,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
kfree(adapter->rx_ring); kfree(adapter->rx_ring);
if (hw->mac_type == e1000_ce4100) if (hw->mac_type == e1000_ce4100)
iounmap(ce4100_gbe_mdio_base_virt); iounmap(hw->ce4100_gbe_mdio_base_virt);
iounmap(hw->hw_addr); iounmap(hw->hw_addr);
if (hw->flash_address) if (hw->flash_address)
iounmap(hw->flash_address); iounmap(hw->flash_address);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment