<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/phy/rockchip, branch v2023.10</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/phy/rockchip?h=v2023.10</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/phy/rockchip?h=v2023.10'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2023-07-31T12:33:18Z</updated>
<entry>
<title>phy: rockchip-inno-usb2: Add USB2 PHY for RK3328</title>
<updated>2023-07-31T12:33:18Z</updated>
<author>
<name>Jagan Teki</name>
<email>jagan@amarulasolutions.com</email>
</author>
<published>2023-06-06T17:09:16Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=9aa93d84038bb47bcd4e9ac4287ef63e1b022971'/>
<id>urn:sha1:9aa93d84038bb47bcd4e9ac4287ef63e1b022971</id>
<content type='text'>
USB2.0 Host and OTG controllers in RK3328 are using USB2PHY.

Add support for it.

Signed-off-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Reviewed-by: Xavier Drudis Ferran &lt;xdrudis@tinet.cat&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip: add usbdp combo phy driver</title>
<updated>2023-07-28T10:45:02Z</updated>
<author>
<name>Frank Wang</name>
<email>frank.wang@rock-chips.com</email>
</author>
<published>2023-05-29T10:01:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7b57ca18f8a3a88216b69cd295e1eed2b0c6c1be'/>
<id>urn:sha1:7b57ca18f8a3a88216b69cd295e1eed2b0c6c1be</id>
<content type='text'>
This adds a new USBDP combo PHY with Samsung IP block driver.
The PHY is a combo between USB 3.0 and DisplayPort alt mode.

Signed-off-by: Frank Wang &lt;frank.wang@rock-chips.com&gt;
[eugen.hristev@collabora.com: ported to 2023.07, clean-up]
Signed-off-by: Eugen Hristev &lt;eugen.hristev@collabora.com&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip: inno-usb2: fix phy reg=0 case</title>
<updated>2023-06-29T10:31:48Z</updated>
<author>
<name>Eugen Hristev</name>
<email>eugen.hristev@collabora.com</email>
</author>
<published>2023-05-22T08:39:58Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3cc537842fefde785cee5dc62fc0b9866c730ae5'/>
<id>urn:sha1:3cc537842fefde785cee5dc62fc0b9866c730ae5</id>
<content type='text'>
The support for #address-cells=2 has a loophole: if the reg is actually 0,
but the #address-cells is actually 1, like in such case below:

syscon {
	#address-cells = &lt;1&gt;;

	phy {
		reg = &lt;0 0x10&gt;;
	};
};

then the second u32 of the 'reg' is the size, not the address.

The code should check for the parent's #address-cells value, and not
assume that if the first u32 is 0, then the #address-cells is 2, and the
reg property is something like
	reg = &lt;0 0xff00 0x10&gt;;

Fixed this by looking for the #address-cells value and retrieving the
reg address only if this is ==2.
To avoid breaking anything I also kept the check `if reg==0` as some DT's
may have a wrong #address-cells as parent and even if this commit is
correct, it might break the existing wrong device-trees.

Fixes: d538efb9adcf ("phy: rockchip: inno-usb2: Add support #address_cells = 2")
Signed-off-by: Eugen Hristev &lt;eugen.hristev@collabora.com&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip-inno-usb2: Implement clock operations for usb2phy clock</title>
<updated>2023-06-07T21:41:47Z</updated>
<author>
<name>Xavier Drudis Ferran</name>
<email>xdrudis@tinet.cat</email>
</author>
<published>2023-06-05T15:06:57Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=40359c94405b103d25233d8d727d671748b751b9'/>
<id>urn:sha1:40359c94405b103d25233d8d727d671748b751b9</id>
<content type='text'>
This clock doesn't seem needed but appears in a phandle list used by
ehci-generic.c to bulk enable it. The phandle list comes from linux,
where it is needed for suspend/resume to work [1].

My tests give the same results with or without this patch, but Marek
Vasut found it weird to declare an empty clk_ops [2].

So I adapted the code from linux 6.1-rc8 so that it hopefully works
if it ever has some user. For now, without real use, it seems to
at least not give any errors when called.

Link: [1] https://lkml.kernel.org/lkml/1731551.Q6cHK6n5ZM@phil/T/
      [2] https://patchwork.ozlabs.org/project/uboot/patch/Y5IWpjYLB4aXMy9o@localhost/

Cc: Simon Glass &lt;sjg@chromium.org&gt;
Cc: Philipp Tomsich &lt;philipp.tomsich@vrull.eu&gt;
Cc: Kever Yang &lt;kever.yang@rock-chips.com&gt;
Cc: Lukasz Majewski &lt;lukma@denx.de&gt;
Cc: Sean Anderson &lt;seanga2@gmail.com&gt;
Cc: Marek Vasut &lt;marex@denx.de&gt;
Cc: Christoph Fritz &lt;chf.fritz@googlemail.com&gt;
Cc: Jagan Teki &lt;jagan@amarulasolutions.com&gt;

Signed-off-by: Xavier Drudis Ferran &lt;xdrudis@tinet.cat&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Tested-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt; # rk3399, rk3328, rv1126
</content>
</entry>
<entry>
<title>phy: rockchip-inno-usb2: Add usb2phy clock provider of 480MHz clock</title>
<updated>2023-06-07T21:41:47Z</updated>
<author>
<name>Xavier Drudis Ferran</name>
<email>xdrudis@tinet.cat</email>
</author>
<published>2023-06-05T15:05:53Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=e81512ac30c154c320b54036919cd3a6f4cc1516'/>
<id>urn:sha1:e81512ac30c154c320b54036919cd3a6f4cc1516</id>
<content type='text'>
arch/arm/dts/rk3399.dtsi has a node

  usb_host0_ehci: usb@fe380000 {
       compatible = "generic-ehci";

with clocks:

       clocks = &lt;&amp;cru HCLK_HOST0&gt;, &lt;&amp;cru HCLK_HOST0_ARB&gt;,
                &lt;&amp;u2phy0&gt;;

The first 2 refer to nodes with class UCLASS_CLK, but &amp;u2phy0
has class UCLASS_PHY.

  u2phy0: usb2phy@e450 {
       compatible = "rockchip,rk3399-usb2phy";

Since clk_get_bulk() only looks for devices with UCLASS_CLK,
it fails with -ENODEV and then ehci_usb_probe() aborts.

The consequence is peripherals connected to a USB 2 port (e.g. in a
Rock Pi 4 the white port, nearer the edge) not being detected.
They're detected if CONFIG_USB_OHCI_GENERIC is selected in Kconfig,
because ohci_usb_probe() does not abort when one clk_get_by_index()
fails, but then they work in USB 1 mode.

rk3399.dtsi comes from linux and the  u2phy0 was added[1] to the clock
list in:

    commit b5d1c57299734f5b54035ef2e61706b83041f20c
    Author: William wu &lt;wulf@rock-chips.com&gt;
    Date:   Wed Dec 21 18:41:05 2016 +0800

    arm64: dts: rockchip: add u2phy clock for ehci and ohci of rk3399

    We found that the suspend process was blocked when it run into
    ehci/ohci module due to clk-480m of usb2-phy was disabled.
    [...]

Suspend concerns don't apply to U-Boot, and the problem with U-Boot
failing to probe EHCI doesn't apply to linux, because in linux
rockchip_usb2phy_clk480m_register makes u2phy0 a proper clock provider
when called by rockchip_usb2phy_probe().

So I can think of a few alternative solutions:

1- Change ehci_usb_probe() to make it more similar to
   ohci_usb_probe(), and survive failure to get one clock. Looks a
   little harder, and I don't know whether it could break something if
   it ignored a clock that was important for something else than
   suspend.

2- Change rk3399.dtsi effectively reverting the linux commit
   b5d1c57299734f5b54035ef2e61706b83041f20c. This dealigns the .dtsi
   from linux and seems fragile at the next synchronisation.

3- Change the clock list in rk3399-u-boot.dtsi or somewhere else.
   This survives .dts* sync but may survive "too much" and miss some
   change from linux that we might want.

4- Enable CONFIG_USB_OHCI_GENERIC and use the ports in USB 1 mode.
   This would need to be made for all boards using rk3399.  In a
   simple test reading one file from USB storage it gave 769.5 KiB/s
   instead of 20.5 MiB/s with solution 2.

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.

This patch tries to implement option 5 as Marek Vasut requested in
December 5th.  Options 1 and 3 didn't get through [2][3].

It just registers usb2phy as a clock driver (device_bind_driver()
didn't work but device_bind_driver_to_node() did), without any
specific operations, so that ehci-generic.c finds it and is happy. It
worked in my tests on a Rock Pi 4 B+ (rk3399).

Link: [1] https://lkml.kernel.org/lkml/1731551.Q6cHK6n5ZM@phil/T/
      [2] https://patchwork.ozlabs.org/project/uboot/patch/20220701185959.GC1700@begut/
      [3] https://patchwork.ozlabs.org/project/uboot/patch/Y44+ayJfUlI08ptM@localhost/

Cc: Simon Glass &lt;sjg@chromium.org&gt;
Cc: Philipp Tomsich &lt;philipp.tomsich@vrull.eu&gt;
Cc: Kever Yang &lt;kever.yang@rock-chips.com&gt;
Cc: Lukasz Majewski &lt;lukma@denx.de&gt;
Cc: Sean Anderson &lt;seanga2@gmail.com&gt;
Cc: Marek Vasut &lt;marex@denx.de&gt;
Cc: Christoph Fritz &lt;chf.fritz@googlemail.com&gt;
Cc: Jagan Teki &lt;jagan@amarulasolutions.com&gt;

Signed-off-by: Xavier Drudis Ferran &lt;xdrudis@tinet.cat&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
Reviewed-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt;
Tested-by: Jagan Teki &lt;jagan@amarulasolutions.com&gt; # rk3399, rk3328, rv1126
</content>
</entry>
<entry>
<title>phy: rockchip: naneng-combphy: Support rk3588</title>
<updated>2023-05-17T09:36:18Z</updated>
<author>
<name>Jon Lin</name>
<email>jon.lin@rock-chips.com</email>
</author>
<published>2023-04-27T07:35:35Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c5b4a012bca8e584615163ee1058d0f92ce94a26'/>
<id>urn:sha1:c5b4a012bca8e584615163ee1058d0f92ce94a26</id>
<content type='text'>
Add support for rk3588 phy variant.
The PHY clock is fixed at 100MHz.

Signed-off-by: Jon Lin &lt;jon.lin@rock-chips.com&gt;
[kever.yang@rock-chips.com: update pcie pll parameters]
Co-developed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
Signed-off-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
[eugen.hristev@collabora.com: squashed, tidy up]
Signed-off-by: Eugen Hristev &lt;eugen.hristev@collabora.com&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip: naneng-combphy: Add support for multiple resets</title>
<updated>2023-05-17T09:36:18Z</updated>
<author>
<name>Eugen Hristev</name>
<email>eugen.hristev@collabora.com</email>
</author>
<published>2023-04-27T07:35:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=d49dc884cb8e02b8640a5059a5e54facd80fe679'/>
<id>urn:sha1:d49dc884cb8e02b8640a5059a5e54facd80fe679</id>
<content type='text'>
Some variants of the PHY have more than just one reset.
To cover all cases, request the rests in bulk rather than just
the reset at index 0.

Co-developed-by: Ren Jianing &lt;jianing.ren@rock-chips.com&gt;
Signed-off-by: Ren Jianing &lt;jianing.ren@rock-chips.com&gt;
Signed-off-by: Eugen Hristev &lt;eugen.hristev@collabora.com&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip-inno-usb2: add initial support for rk3588 PHY</title>
<updated>2023-05-17T09:36:18Z</updated>
<author>
<name>Eugen Hristev</name>
<email>eugen.hristev@collabora.com</email>
</author>
<published>2023-05-15T09:59:49Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=cdf9010f6e173093d8dfeb4685063d78d35d7842'/>
<id>urn:sha1:cdf9010f6e173093d8dfeb4685063d78d35d7842</id>
<content type='text'>
Add initial support for the rk3588 PHY variant.
The lookup for the host-port reg inside the struct now does a do {} while()
instead of a while() {} in order to allow a first check for reg == 0.

Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
Co-developed-by: Frank Wang &lt;frank.wang@rock-chips.com&gt;
Signed-off-by: Frank Wang &lt;frank.wang@rock-chips.com&gt;
Signed-off-by: Eugen Hristev &lt;eugen.hristev@collabora.com&gt;
</content>
</entry>
<entry>
<title>drivers: use dev_read_addr_ptr when cast to pointer</title>
<updated>2023-05-06T09:28:18Z</updated>
<author>
<name>Johan Jonker</name>
<email>jbx6244@gmail.com</email>
</author>
<published>2023-03-13T00:32:04Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a12a73b66476c48dfe5afd2c3711153d09feda6c'/>
<id>urn:sha1:a12a73b66476c48dfe5afd2c3711153d09feda6c</id>
<content type='text'>
The fdt_addr_t and phys_addr_t size have been decoupled. A 32bit CPU
can expect 64-bit data from the device tree parser, so use
dev_read_addr_ptr instead of the dev_read_addr function in the
various files in the drivers directory that cast to a pointer.
As we are there also streamline the error response to -EINVAL on return.

Signed-off-by: Johan Jonker &lt;jbx6244@gmail.com&gt;
Reviewed-by: Simon Glass &lt;sjg@chromium.org&gt;
</content>
</entry>
<entry>
<title>drivers: phy: add Innosilicon DSI-DPHY driver</title>
<updated>2023-04-21T07:16:01Z</updated>
<author>
<name>Chris Morgan</name>
<email>macromorgan@hotmail.com</email>
</author>
<published>2023-03-24T18:53:06Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=bf57dd5889beae9ff871a657f43ed72345ab2e6c'/>
<id>urn:sha1:bf57dd5889beae9ff871a657f43ed72345ab2e6c</id>
<content type='text'>
Add support for the Innosilicon DSI-DPHY driver for Rockchip SOCs.
The driver was ported from Linux and tested on a Rockchip RK3566
based device to query the panel ID via a DSI command.

Signed-off-by: Chris Morgan &lt;macromorgan@hotmail.com&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
</feed>
