[PATCH v5 5/6] phy: realtek: usb2: add support for RTL9607C USB2 PHY

Rustam Adilov adilov at disroot.org
Tue May 5 11:10:42 PDT 2026


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.



More information about the linux-phy mailing list