<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/phy/rockchip, branch v2024.01</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=v2024.01</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/phy/rockchip?h=v2024.01'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2023-10-07T02:23:12Z</updated>
<entry>
<title>phy: rockchip: naneng-combphy: Use signal from comb PHY on RK3588</title>
<updated>2023-10-07T02:23:12Z</updated>
<author>
<name>Jonas Karlman</name>
<email>jonas@kwiboo.se</email>
</author>
<published>2023-08-02T19:41:22Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b37260bca1aa562c6c99527d997c768a12da017b'/>
<id>urn:sha1:b37260bca1aa562c6c99527d997c768a12da017b</id>
<content type='text'>
Route signal from comb PHY instead of PCIe3 PHY to PCIe1l0 and PCIe1l1.

Fixes use of pcie2x1l0 on ROCK 5B.

Code imported from mainline linux driver.

Fixes: c5b4a012bca8 ("phy: rockchip: naneng-combphy: Support rk3588")
Signed-off-by: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip: snps-pcie3: Add support for RK3588</title>
<updated>2023-10-07T02:23:12Z</updated>
<author>
<name>Jonas Karlman</name>
<email>jonas@kwiboo.se</email>
</author>
<published>2023-08-02T19:04:32Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=50e54e80679b4ab45c84687c77309aebc6f7b981'/>
<id>urn:sha1:50e54e80679b4ab45c84687c77309aebc6f7b981</id>
<content type='text'>
Add support for the RK3588 variant to the driver.

Code imported almost 1:1 from mainline linux driver.

Signed-off-by: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip: snps-pcie3: Add bifurcation support for RK3568</title>
<updated>2023-10-07T02:23:12Z</updated>
<author>
<name>Jonas Karlman</name>
<email>jonas@kwiboo.se</email>
</author>
<published>2023-08-02T19:28:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1ebebfcc25bc8963cbdc6e35504160e5b745cabd'/>
<id>urn:sha1:1ebebfcc25bc8963cbdc6e35504160e5b745cabd</id>
<content type='text'>
Configure aggregation or bifurcation mode on RK3568 based on the value
of data-lanes property.

Code imported almost 1:1 from mainline linux driver.

Fixes: 6ec62b6ca698 ("phy: rockchip: Add Rockchip Synopsys PCIe 3.0 PHY")
Signed-off-by: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip: snps-pcie3: Refactor to use a phy_init ops</title>
<updated>2023-10-07T02:23:12Z</updated>
<author>
<name>Jonas Karlman</name>
<email>jonas@kwiboo.se</email>
</author>
<published>2023-08-02T19:04:30Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6cacdf842db5e62e9c26d015eddadd2f2410a6de'/>
<id>urn:sha1:6cacdf842db5e62e9c26d015eddadd2f2410a6de</id>
<content type='text'>
Add a phy_init ops in preparation for upcoming support of a RK3588
variant in the driver.

Signed-off-by: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<entry>
<title>phy: rockchip: snps-pcie3: Refactor to use clk_bulk API</title>
<updated>2023-10-07T02:23:12Z</updated>
<author>
<name>Jonas Karlman</name>
<email>jonas@kwiboo.se</email>
</author>
<published>2023-08-02T19:04:29Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3b39592e8e245fc5c7b0a003ac65672ce9cfaf0f'/>
<id>urn:sha1:3b39592e8e245fc5c7b0a003ac65672ce9cfaf0f</id>
<content type='text'>
Change to use clk_bulk API and syscon_regmap_lookup_by_phandle to
simplify in preparation for upcoming support of a RK3588 variant.

Signed-off-by: Jonas Karlman &lt;jonas@kwiboo.se&gt;
Reviewed-by: Kever Yang &lt;kever.yang@rock-chips.com&gt;
</content>
</entry>
<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>
</feed>
