cpsw_mdio_get_alive reads the wrong register.
See page 2316 in SPRUH73Q AM335x TRM
Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
#define USERACCESS_PHY_REG_SHIFT (21)
#define USERACCESS_PHY_ADDR_SHIFT (16)
#define USERACCESS_DATA GENMASK(15, 0)
- } user[0];
+ } user[2];
};
#define CPSW_MDIO_DIV_DEF 0xff
struct cpsw_mdio *mdio = bus->priv;
u32 val;
- val = readl(&mdio->regs->control);
- return val & GENMASK(15, 0);
+ val = readl(&mdio->regs->alive);
+ return val & GENMASK(7, 0);
}
struct mii_dev *cpsw_mdio_init(const char *name, phys_addr_t mdio_base,