U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/12] Add Rockchip USBPHY DM driver
@ 2026-05-31 20:58 Johan Jonker
  2026-05-31 21:01 ` [PATCH v3 01/12] rockchip: configs: compile rk3066 SPL with SPL_OF_REAL Johan Jonker
                   ` (11 more replies)
  0 siblings, 12 replies; 19+ messages in thread
From: Johan Jonker @ 2026-05-31 20:58 UTC (permalink / raw)
  To: kever.yang
  Cc: sjg, philipp.tomsich, trini, hl, jernej.skrabec, w.egorov, jagan,
	heiko, jonas, michael, lukma, marex, u-boot, upstream

The Rockchip SoCs with an USB node and compatible = "snps,dwc2" can be
HOST or OTG while the PHY driver is hard coded and initiated in the
board.c file. Above construction is not very U-boot DM alike.
This is an attempt to decouple the USBPHY into a DM driver.

On older Rockchip SOCs an usbphy DT node is placed under a SYSCOM node.

grf: grf@20008000 {
	usbphy: usbphy {

		usbphy0: usb-phy@17c {
		};

		usbphy1: usb-phy@188 {
		};
	};
};

The usbphy node does not show up in the DM tree to be found by the
generic_phy_get_by_index() function. Only by manual transfer to the DT root
is gets detected.

=> dm tree
 Class     Seq    Probed  Driver                Name
-----------------------------------------------------------
 root          0  [ + ]   root_driver           root_driver
 nop           1  [ + ]   rockchip_usbphy       |-- usbphy
 phy           0  [ + ]   rockchip_usbphy_port  |   |-- usb-phy@17c
 phy           1  [ + ]   rockchip_usbphy_port  |   `-- usb-phy@188

Changed V2:

Add grf function that binds the usbphy driver to the grf syscom driver.

=> dm tree
 Class     Seq    Probed  Driver                Name
-----------------------------------------------------------
 syscon        9  [ + ]   rk3066_syscon         |-- grf@20008000
 nop           0  [ + ]   rockchip_usbphy       |   `-- usbphy
 phy           0  [ + ]   rockchip_usbphy_port  |       |-- usb-phy@17c
 phy           1  [ + ]   rockchip_usbphy_port  |       `-- usb-phy@188

Changed V3:
rebase
compile rk3066 SPL with SPL_OF_REAL
add SCLK_OTGPHYx enable and disable
make drivers available in SPL
enable USB in SPL for MK808

Johan Jonker (12):
  rockchip: configs: compile rk3066 SPL with SPL_OF_REAL
  rockchip: clk: rk3066: add SCLK_OTGPHYx enable and disable
  rockchip: clk: rk3188: add SCLK_OTGPHYx enable and disable
  rockchip: clk: rk3288: add SCLK_OTGPHYx enable and disable
  phy: rockchip: add phy-rockchip-usb2.c
  usb: phy: remove rockchip_usb2_phy.c
  rockchip: reset: make reset-rockchip available in SPL
  rockchip: phy: make phy-rockchip-usb2 available in SPL
  usb: make dwc2_usb available in SPL
  rockchip: spl-boot-order: add usb boot option
  arm: dts: rockchip: add USB required properties in SPL for mk808
  rockchip: configs: enable USB in SPL for mk808

 arch/arm/dts/rk3066a-mk808-u-boot.dtsi        |  18 +
 arch/arm/mach-rockchip/board.c                |  28 --
 arch/arm/mach-rockchip/rk3066/syscon_rk3066.c |  26 ++
 arch/arm/mach-rockchip/rk3188/syscon_rk3188.c |  27 ++
 arch/arm/mach-rockchip/rk3288/syscon_rk3288.c |  27 ++
 arch/arm/mach-rockchip/spl-boot-order.c       |   3 +
 configs/chromebit_mickey_defconfig            |   2 +-
 configs/chromebook_jerry_defconfig            |   2 +-
 configs/chromebook_minnie_defconfig           |   2 +-
 configs/chromebook_speedy_defconfig           |   2 +-
 configs/evb-rk3288-rk808_defconfig            |   2 +-
 configs/firefly-rk3288_defconfig              |   4 +-
 configs/miqi-rk3288_defconfig                 |   4 +-
 configs/mk808_defconfig                       |  18 +-
 configs/phycore-rk3288_defconfig              |   3 +-
 configs/popmetal-rk3288_defconfig             |   3 +-
 configs/rock-pi-n8-rk3288_defconfig           |   2 +-
 configs/rock2_defconfig                       |   3 +-
 configs/rock_defconfig                        |   3 +-
 configs/tinker-rk3288_defconfig               |   4 +-
 configs/tinker-s-rk3288_defconfig             |   4 +-
 configs/vyasa-rk3288_defconfig                |   2 +-
 drivers/Makefile                              |   3 +-
 drivers/clk/rockchip/clk_rk3066.c             |  12 +
 drivers/clk/rockchip/clk_rk3188.c             |  34 ++
 drivers/clk/rockchip/clk_rk3288.c             |  40 ++
 drivers/phy/rockchip/Kconfig                  |  38 +-
 drivers/phy/rockchip/Makefile                 |   5 +-
 drivers/phy/rockchip/phy-rockchip-usb2.c      | 371 ++++++++++++++++++
 drivers/reset/Kconfig                         |   9 +
 drivers/reset/Makefile                        |   4 +-
 drivers/usb/common/Makefile                   |   2 +-
 drivers/usb/host/Kconfig                      |  11 +
 drivers/usb/host/Makefile                     |   2 +-
 drivers/usb/phy/Kconfig                       |   3 -
 drivers/usb/phy/Makefile                      |   1 -
 drivers/usb/phy/rockchip_usb2_phy.c           | 113 ------
 include/usb/dwc2_udc.h                        |   1 -
 38 files changed, 646 insertions(+), 192 deletions(-)
 create mode 100644 drivers/phy/rockchip/phy-rockchip-usb2.c
 delete mode 100644 drivers/usb/phy/rockchip_usb2_phy.c

--
2.39.5


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2026-05-31 22:17 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-31 20:58 [PATCH v3 00/12] Add Rockchip USBPHY DM driver Johan Jonker
2026-05-31 21:01 ` [PATCH v3 01/12] rockchip: configs: compile rk3066 SPL with SPL_OF_REAL Johan Jonker
2026-05-31 21:01 ` [PATCH v3 02/12] rockchip: clk: rk3066: add SCLK_OTGPHYx enable and disable Johan Jonker
2026-05-31 21:02 ` [PATCH v3 03/12] rockchip: clk: rk3188: " Johan Jonker
2026-05-31 21:02 ` [PATCH v3 04/12] rockchip: clk: rk3288: " Johan Jonker
2026-05-31 21:02 ` [PATCH v3 05/12] phy: rockchip: add phy-rockchip-usb2.c Johan Jonker
2026-05-31 22:00   ` Jonas Karlman
2026-05-31 21:03 ` [PATCH v3 06/12] usb: phy: remove rockchip_usb2_phy.c Johan Jonker
2026-05-31 21:28   ` Jonas Karlman
2026-05-31 21:03 ` [PATCH v3 07/12] rockchip: reset: make reset-rockchip available in SPL Johan Jonker
2026-05-31 22:07   ` Jonas Karlman
2026-05-31 21:03 ` [PATCH v3 08/12] rockchip: phy: make phy-rockchip-usb2 " Johan Jonker
2026-05-31 22:12   ` Jonas Karlman
2026-05-31 21:03 ` [PATCH v3 09/12] usb: make dwc2_usb " Johan Jonker
2026-05-31 22:17   ` Jonas Karlman
2026-05-31 21:04 ` [PATCH v3 10/12] rockchip: spl-boot-order: add usb boot option Johan Jonker
2026-05-31 21:18   ` Jonas Karlman
2026-05-31 21:04 ` [PATCH v3 11/12] arm: dts: rockchip: add USB required properties in SPL for mk808 Johan Jonker
2026-05-31 21:04 ` [PATCH v3 12/12] rockchip: configs: enable USB " Johan Jonker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox