[PATCH v5 5/6] phy: realtek: usb2: add support for RTL9607C USB2 PHY
Vladimir Oltean
olteanv at gmail.com
Tue May 5 12:25:56 PDT 2026
On Tue, May 05, 2026 at 06:10:42PM +0000, Rustam Adilov wrote:
> On 2026-05-05 11:30, Vladimir Oltean wrote:
> > On Tue, Apr 21, 2026 at 12:19:40AM +0500, Rustam Adilov wrote:
> >> Add support for the usb2 phy of RTL9607C series based SoCs.
> >> Add the macros and phy config struct for rtl9607.
> >>
> >> RTL9607C requires to clear a "force host disconnect" bit in the
> >> specific register (which is at an offset from reg_wrap_vstatus)
> >> before proceeding with phy parameter writes. Since it belongs into
> >> the vstatus register region, it doesn't need bytes swapping.
> >>
> >> Add the bool variable to the driver data struct and hide this whole
> >> procedure under the if statement that checks this new variable.
> >>
> >> Add the appropriate little endian read and write functions for rtl9607
> >> and assign them to its phy config struct.
> >>
> >> As mentioned earlier, the readl/writel are native endian on MIPS arch
> >> if SWAP_IO_SPACE is not enabled. Since enabling SWAP_IO_SPACE results
> >> in boot hang on RTL9607C machine, wrapping le32 around readl/writel
> >> should be a good compromise, but swab32 could be also work.
> >>
> >> Co-developed-by: Michael Zavertkin <misha.zavertkin at mail.ru>
> >> Signed-off-by: Michael Zavertkin <misha.zavertkin at mail.ru>
> >> Signed-off-by: Rustam Adilov <adilov at disroot.org>
> >> ---
> >
> > Have you considered ioread32() instead of wrapping le32 around readl()?
>
> I think you meant ioread32be() and yes i have considered it. If this is what
> it takes to get rid of le32 warning you mentioned from an earlier email then
> so be it.
No, I meant ioread32(). When I read Documentation/driver-api/device-io.rst,
it says ioread32() is for a little endian peripheral and ioread32be()
for big endian peripherals. You have a little endian peripheral (relevant)
and a big endian CPU (not relevant) so I don't see why ioread32() wouldn't
be the correct accessor to use.
More information about the linux-phy
mailing list