Skip to content

Commit 5c0bb71

Browse files
pgwipeoutmmind
authored andcommitted
soc: rockchip: set dwc3 clock for rk3566
The rk3566 dwc3 otg port clock is unavailable at boot, as it defaults to the combophy as the clock source. As combophy0 doesn't exist on rk3566, we need to set the clock source to the usb2 phy instead. Add handling to the grf driver to handle this on boot. Signed-off-by: Peter Geis <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Heiko Stuebner <[email protected]>
1 parent 2a872dd commit 5c0bb71

File tree

1 file changed

+17
-0
lines changed
  • drivers/soc/rockchip

1 file changed

+17
-0
lines changed

drivers/soc/rockchip/grf.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,20 @@ static const struct rockchip_grf_info rk3399_grf __initconst = {
108108
.num_values = ARRAY_SIZE(rk3399_defaults),
109109
};
110110

111+
#define RK3566_GRF_USB3OTG0_CON1 0x0104
112+
113+
static const struct rockchip_grf_value rk3566_defaults[] __initconst = {
114+
{ "usb3otg port switch", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(0, 1, 12) },
115+
{ "usb3otg clock switch", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(1, 1, 7) },
116+
{ "usb3otg disable usb3", RK3566_GRF_USB3OTG0_CON1, HIWORD_UPDATE(1, 1, 0) },
117+
};
118+
119+
static const struct rockchip_grf_info rk3566_pipegrf __initconst = {
120+
.values = rk3566_defaults,
121+
.num_values = ARRAY_SIZE(rk3566_defaults),
122+
};
123+
124+
111125
static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
112126
{
113127
.compatible = "rockchip,rk3036-grf",
@@ -130,6 +144,9 @@ static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
130144
}, {
131145
.compatible = "rockchip,rk3399-grf",
132146
.data = (void *)&rk3399_grf,
147+
}, {
148+
.compatible = "rockchip,rk3566-pipe-grf",
149+
.data = (void *)&rk3566_pipegrf,
133150
},
134151
{ /* sentinel */ },
135152
};

0 commit comments

Comments
 (0)