Commit f9fbbc18 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by Dale Farnsworth

mv643xx_eth: Remove SHARED_REGS register address bias

Start counting mv643xx_eth register addresses from zero, instead of
from 0x2000 (MV643XX_ETH_SHARED_REGS.)
Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Acked-by: default avatarTzachi Perelstein <tzachi@marvell.com>
Signed-off-by: default avatarDale Farnsworth <dale@farnsworth.org>
parent 9c1bbdfe
...@@ -78,26 +78,19 @@ static const struct ethtool_ops mv643xx_ethtool_ops; ...@@ -78,26 +78,19 @@ static const struct ethtool_ops mv643xx_ethtool_ops;
static char mv643xx_driver_name[] = "mv643xx_eth"; static char mv643xx_driver_name[] = "mv643xx_eth";
static char mv643xx_driver_version[] = "1.0"; static char mv643xx_driver_version[] = "1.0";
static void __iomem *mv643xx_eth_shared_base; static void __iomem *mv643xx_eth_base;
/* used to protect MV643XX_ETH_SMI_REG, which is shared across ports */ /* used to protect MV643XX_ETH_SMI_REG, which is shared across ports */
static DEFINE_SPINLOCK(mv643xx_eth_phy_lock); static DEFINE_SPINLOCK(mv643xx_eth_phy_lock);
static inline u32 mv_read(int offset) static inline u32 mv_read(int offset)
{ {
void __iomem *reg_base; return readl(mv643xx_eth_base + offset);
reg_base = mv643xx_eth_shared_base - MV643XX_ETH_SHARED_REGS;
return readl(reg_base + offset);
} }
static inline void mv_write(int offset, u32 data) static inline void mv_write(int offset, u32 data)
{ {
void __iomem *reg_base; writel(data, mv643xx_eth_base + offset);
reg_base = mv643xx_eth_shared_base - MV643XX_ETH_SHARED_REGS;
writel(data, reg_base + offset);
} }
/* /*
...@@ -1470,9 +1463,8 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) ...@@ -1470,9 +1463,8 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
if (res == NULL) if (res == NULL)
return -ENODEV; return -ENODEV;
mv643xx_eth_shared_base = ioremap(res->start, mv643xx_eth_base = ioremap(res->start, res->end - res->start + 1);
MV643XX_ETH_SHARED_REGS_SIZE); if (mv643xx_eth_base == NULL)
if (mv643xx_eth_shared_base == NULL)
return -ENOMEM; return -ENOMEM;
return 0; return 0;
...@@ -1481,8 +1473,8 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) ...@@ -1481,8 +1473,8 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
static int mv643xx_eth_shared_remove(struct platform_device *pdev) static int mv643xx_eth_shared_remove(struct platform_device *pdev)
{ {
iounmap(mv643xx_eth_shared_base); iounmap(mv643xx_eth_base);
mv643xx_eth_shared_base = NULL; mv643xx_eth_base = NULL;
return 0; return 0;
} }
......
This diff is collapsed.
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