phy: rockchip-inno-usb2: Add support for RK3588 PHY
Subsystems (2)
PATCH 1/1 phy: rockchip-inno-usb2: Add support for RK3588 PHY
Add support for the RK3588 PHY variant.
Signed-off-by Alexander Shiyan <[email protected]>
--- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 66 ++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-)
drivers/phy/rockchip/phy-rockchip-inno-usb2.c +64 -2
@@ -416,13 +416,13 @@ static int rockchip_usb2phy_probe(struct device *dev)/* find out a proper config which can be matched with dt. */ index =0 ; -while (phy_cfgs[index].reg) { +do {if (phy_cfgs[index].reg == reg) { rphy->phy_cfg = &phy_cfgs[index];break ; } ++index; - } + }while (phy_cfgs[index].reg);if (!rphy->phy_cfg) {dev_err (dev,"no phy-config can be matched\n" );
@@ -971,6 +971,67 @@ static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = { }, {/* sentinel */ } }; + +static const struct rockchip_usb2phy_cfg rk3588_phy_cfgs[] = { + { + .reg =0x0000 , + .num_ports =1 , + .clkout_ctl = {0x0000 ,0 ,0 ,1 ,0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG ] = { + .phy_sus = {0x000c ,11 ,11 ,0 ,1 }, + .ls_det_en = {0x0080 ,0 ,0 ,0 ,1 }, + .ls_det_st = {0x0084 ,0 ,0 ,0 ,1 }, + .ls_det_clr = {0x0088 ,0 ,0 ,0 ,1 }, + .utmi_ls = {0x00c0 ,10 ,9 ,0 ,1 }, + } + }, + }, + { + .reg =0x4000 , + .num_ports =1 , + .clkout_ctl = {0x0000 ,0 ,0 ,1 ,0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG ] = { + .phy_sus = {0x000c ,11 ,11 ,0 ,0 }, + .ls_det_en = {0x0080 ,0 ,0 ,0 ,1 }, + .ls_det_st = {0x0084 ,0 ,0 ,0 ,1 }, + .ls_det_clr = {0x0088 ,0 ,0 ,0 ,1 }, + .utmi_ls = {0x00c0 ,10 ,9 ,0 ,1 }, + } + }, + }, + { + .reg =0x8000 , + .num_ports =1 , + .clkout_ctl = {0x0000 ,0 ,0 ,1 ,0 }, + .port_cfgs = { + [USB2PHY_PORT_HOST ] = { + .phy_sus = {0x0008 ,2 ,2 ,0 ,1 }, + .ls_det_en = {0x0080 ,0 ,0 ,0 ,1 }, + .ls_det_st = {0x0084 ,0 ,0 ,0 ,1 }, + .ls_det_clr = {0x0088 ,0 ,0 ,0 ,1 }, + .utmi_ls = {0x00c0 ,10 ,9 ,0 ,1 }, + } + }, + }, + { + .reg =0xc000 , + .num_ports =1 , + .clkout_ctl = {0x0000 ,0 ,0 ,1 ,0 }, + .port_cfgs = { + [USB2PHY_PORT_HOST ] = { + .phy_sus = {0x0008 ,2 ,2 ,0 ,1 }, + .ls_det_en = {0x0080 ,0 ,0 ,0 ,1 }, + .ls_det_st = {0x0084 ,0 ,0 ,0 ,1 }, + .ls_det_clr = {0x0088 ,0 ,0 ,0 ,1 }, + .utmi_ls = {0x00c0 ,10 ,9 ,0 ,1 }, + } + }, + }, + {/* sentinel */ } +}; +static const struct of_device_id rockchip_usb2phy_dt_match[] = { { .compatible ="rockchip,rk1808-usb2phy" , .data = &rk1808_phy_cfgs }, { .compatible ="rockchip,rk3128-usb2phy" , .data = &rk312x_phy_cfgs },
@@ -980,6 +1041,7 @@ static const struct of_device_id rockchip_usb2phy_dt_match[] = { { .compatible = "rockchip,rk3368-usb2phy", .data = &rk3368_phy_cfgs }, { .compatible = "rockchip,rk3399-usb2phy", .data = &rk3399_phy_cfgs }, { .compatible = "rockchip,rk3568-usb2phy", .data = &rk3568_phy_cfgs }, + { .compatible = "rockchip,rk3588-usb2phy", .data = &rk3588_phy_cfgs }, { .compatible = "rockchip,rv1108-usb2phy", .data = &rv1108_phy_cfgs }, { } };
Signature · 1 line
2.38.2
Sascha Hauer
AppliedQuoted 3 lines · Alexander Shiyan
Add support for the RK3588 PHY variant.
Applied, thanks!
[1/1] phy: rockchip-inno-usb2: Add support for RK3588 PHY
https://git.pengutronix.de/cgit/barebox/commit/?id=d6bf37c2f146 (link may not be stable)
Best regards,
Signature · 1 line
Sascha Hauer <[email protected]>