@@ -19,7 +19,7 @@ mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "marvell,orion-mdio";
- reg = <0xd0072004 0x4>;
+ reg = <0xd0072000 0x8>;
};
And at the board level:
@@ -91,7 +91,7 @@
#address-cells = <1>;
#size-cells = <0>;
compatible = "marvell,orion-mdio";
- reg = <0xd0072004 0x4>;
+ reg = <0xd0072000 0x8>;
};
ethernet@d0070000 {
@@ -29,6 +29,7 @@
#include <linux/platform_device.h>
#include <linux/delay.h>
+#define MVMDIO_SMI_REG 0x0004
#define MVMDIO_SMI_DATA_SHIFT 0
#define MVMDIO_SMI_PHY_ADDR_SHIFT 16
#define MVMDIO_SMI_PHY_REG_SHIFT 21
@@ -52,7 +53,7 @@ static int orion_mdio_wait_ready(struct mii_bus *bus)
count = 0;
while (1) {
- val = readl(dev->regs);
+ val = readl(dev->regs + MVMDIO_SMI_REG);
if (!(val & MVMDIO_SMI_BUSY))
break;
@@ -87,12 +88,12 @@ static int orion_mdio_read(struct mii_bus *bus, int mii_id,
writel(((mii_id << MVMDIO_SMI_PHY_ADDR_SHIFT) |
(regnum << MVMDIO_SMI_PHY_REG_SHIFT) |
MVMDIO_SMI_READ_OPERATION),
- dev->regs);
+ dev->regs + MVMDIO_SMI_REG);
/* Wait for the value to become available */
count = 0;
while (1) {
- val = readl(dev->regs);
+ val = readl(dev->regs + MVMDIO_SMI_REG);
if (val & MVMDIO_SMI_READ_VALID)
break;
@@ -129,7 +130,7 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id,
(regnum << MVMDIO_SMI_PHY_REG_SHIFT) |
MVMDIO_SMI_WRITE_OPERATION |
(value << MVMDIO_SMI_DATA_SHIFT)),
- dev->regs);
+ dev->regs + MVMDIO_SMI_REG);
mutex_unlock(&dev->lock);
This patch changes the mvmdio driver not to assume that the MVMDIO_SMI_REG is at offset 0 of the resource we are being passed via Device Tree. This is actually required to reduce the differences between the mv643xx_eth SMI driver and mvmdio. The only user of the "orion-mdio" binding is updated accordingly. Signed-off-by: Florian Fainelli <florian@openwrt.org> --- Documentation/devicetree/bindings/net/marvell-orion-mdio.txt | 2 +- arch/arm/boot/dts/armada-370-xp.dtsi | 2 +- drivers/net/ethernet/marvell/mvmdio.c | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-)