|
@@ -304,6 +304,13 @@ static int mii_reg_write(const char *devname, u8 phy_adr, u8 reg_ofs, u16 data)
|
|
|
return -EFAULT;
|
|
|
}
|
|
|
|
|
|
+ /* write the phy and reg addressse into the MII address reg */
|
|
|
+ writel((phy_adr << MADR_PHY_OFFSET) | (reg_ofs << MADR_REG_OFFSET),
|
|
|
+ ®s->madr);
|
|
|
+
|
|
|
+ /* write data to the MII write register */
|
|
|
+ writel(data, ®s->mwtd);
|
|
|
+
|
|
|
/* wait till the MII is not busy */
|
|
|
timeout = MII_TIMEOUT;
|
|
|
do {
|
|
@@ -319,13 +326,6 @@ static int mii_reg_write(const char *devname, u8 phy_adr, u8 reg_ofs, u16 data)
|
|
|
return -EFAULT;
|
|
|
}
|
|
|
|
|
|
- /* write the phy and reg addressse into the MII address reg */
|
|
|
- writel((phy_adr << MADR_PHY_OFFSET) | (reg_ofs << MADR_REG_OFFSET),
|
|
|
- ®s->madr);
|
|
|
-
|
|
|
- /* write data to the MII write register */
|
|
|
- writel(data, ®s->mwtd);
|
|
|
-
|
|
|
/*debug("%s:(adr %d, off %d) <= %04x\n", __func__, phy_adr,
|
|
|
reg_ofs, data);*/
|
|
|
|