Re: [PATCH v2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2.

Marek Vasut
2022-12-05T19:08:46Z

On 12/5/22 19:54, Xavier Drudis Ferran wrote:
> arch/arm/dts/rk3399.dtsi has a node
>
> usb_host0_ehci: usb@fe380000 {
> compatible = "generic-ehci";
>
> with clocks:
>
> clocks = <&cru HCLK_HOST0>, <&cru HCLK_HOST0_ARB>,
> <&u2phy0>;
>
> The first 2 refer to nodes with class UCLASS_CLK, but &u2phy0
> has class UCLASS_PHY.

[...]

> 5- Trying to replicate linux and have usb2phy somehow provide a clk,
> or have a separate clock device for usb2phy in addition to the phy
> device. I just can't seem to imagine how to achieve this with the
> U-Boot driver model, maybe because of my limited familiarity with
> it.

Yes please

Have a look at the end of drivers/led/led_gpio.c and how gpio_led_wrap
binds a gpio_led driver to each LED. You can bind an UCLASS_PHY and
UCLASS_CLK driver to the u2phy0 the same way, the u2phy0 would behave
the same way as gpio_led_wrap wrapper . You would likely be using
device_bind_driver() instead of device_bind_driver_to_node() in the bind
callback. …