On Tue, Jan 22, 2019 at 4:54 PM Carlo Caione <ccai...@baylibre.com> wrote: > > On 22/01/19 22:21, Joe Hershberger wrote: > >On Wed, Jan 16, 2019 at 12:06 PM Carlo Caione <ccai...@baylibre.com> wrote: > >> > >> Two new helper functions (phy_read_mmd() and phy_write_mmd()) are added > >> to allow access to the MMD PHY registers. > >> > >> The MMD PHY registers can be accessed by two means: > >> > >> 1. Using two new MMD access function hooks in the PHY driver. These > >> functions can be implemented when the PHY driver does not support the > >> standard IEEE Compatible clause 45 access mechanism described in clause > >> 22 or if the PHY uses its own non-standard access mechanism. > >> > >> 2. The standard clause 45 access extensions to the MMD registers through > >> the indirection registers (clause 22) in all the other cases. > >> > >> Signed-off-by: Carlo Caione <ccai...@baylibre.com> > > > >This seems like a duplicate of https://patchwork.ozlabs.org/patch/1015782/ > > Well, I should have looked better. Interestingly I was going to use my > patch to fix the exact same issue on a different PHY. > > The problem I see with that patch is that it is assuming that all the > PHY devices support clause 45 access extension using the clause 22 > registers. This is not always true (see for example [0]). That's why I > added two new hooks in the PHY driver.
Ah, I didn't realize there were other ways to access it. > On a side note looking at that patch it seems that 'addr' (documented as > the PHY address in the same patch) is being passed to 'phy_write' where > we should have the 'devad' parameter instead (MDIO_DEVAD_NONE)? That is peculiar... Vlad, that wasn't your intent, was it? > >The command patch should probably be adapted to use that. > > Let me know if you think it is valuable still to add the two hooks on > top of that patch. If we have to override the access then probably so. Maybe it would make more sense to have a v2 from you that removes the duplicate code from the ti phy driver and then have Vlad's smartEEE patch be rebased on that. I have not yet pushed Vlad's patches so we have an opportunity to do it more cleanly potentially. Thoughts from each of you? > Thanks, > > [0] https://patchwork.ozlabs.org/patch/351634/ > > -- > Carlo Caione > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > https://lists.denx.de/listinfo/u-boot _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot