Hi, >From: linux-omap-owner@xxxxxxxxxxxxxxx [mailto:linux-omap-owner@xxxxxxxxxxxxxxx] On Behalf Of Cyril >Chemparathy > >Davinci's MDIO controller is present on other TI devices, without an >accompanying EMAC. For example, on tnetv107x, the same MDIO module is used in >conjunction with a 3-port switch hardware. > >By separating the MDIO controller code into its own platform driver, this >patch allows common logic to be reused on such platforms. > >Signed-off-by: Cyril Chemparathy <cyril@xxxxxx> >--- > drivers/net/Kconfig | 10 + > drivers/net/Makefile | 1 + > drivers/net/davinci_mdio.c | 386 ++++++++++++++++++++++++++++++++++++++++++ > include/linux/davinci_emac.h | 4 + > 4 files changed, 401 insertions(+), 0 deletions(-) > create mode 100644 drivers/net/davinci_mdio.c > [...] >diff --git a/drivers/net/davinci_mdio.c b/drivers/net/davinci_mdio.c >new file mode 100644 >index 0000000..d34a53a >--- /dev/null >+++ b/drivers/net/davinci_mdio.c [...] >+ >+/* wait until hardware is ready for another user access */ >+static inline u32 wait_for_user_access(struct davinci_mdio_data *data) >+{ >+ struct davinci_mdio_regs __iomem *regs = data->regs; >+ u32 reg; >+ >+ while ((reg = __raw_readl(®s->user[0].access)) & USERACCESS_GO) >+ ; potential infinite loop? I saw another place in your series using time_after, might fit in here too. >+ >+ return reg; >+} >+ >+/* wait until hardware state machine is idle */ >+static inline void wait_for_idle(struct davinci_mdio_data *data) >+{ >+ struct davinci_mdio_regs __iomem *regs = data->regs; >+ >+ while ((__raw_readl(®s->control) & CONTROL_IDLE) == 0) >+ ; Ditto >+} >+ [...] Regards, omar -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html