Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: sun4i-usb: add support for H6 USB2 PHY

The USB 2.0 PHY on Allwinner H6 SoC is similar to older Allwinner SoCs,
with some USB0 quirk like A83T and PHY index 1/2 missing.

Add support for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

authored by

Icenowy Zheng and committed by
Kishon Vijay Abraham I
ae409cc7 2659392e

+17 -2
+17 -2
drivers/phy/allwinner/phy-sun4i-usb.c
··· 115 115 sun8i_r40_phy, 116 116 sun8i_v3s_phy, 117 117 sun50i_a64_phy, 118 + sun50i_h6_phy, 118 119 }; 119 120 120 121 struct sun4i_usb_phy_cfg { ··· 296 295 return ret; 297 296 } 298 297 299 - if (data->cfg->type == sun8i_a83t_phy) { 298 + if (data->cfg->type == sun8i_a83t_phy || 299 + data->cfg->type == sun50i_h6_phy) { 300 300 if (phy->index == 0) { 301 301 val = readl(data->base + data->cfg->phyctl_offset); 302 302 val |= PHY_CTL_VBUSVLDEXT; ··· 346 344 struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy); 347 345 348 346 if (phy->index == 0) { 349 - if (data->cfg->type == sun8i_a83t_phy) { 347 + if (data->cfg->type == sun8i_a83t_phy || 348 + data->cfg->type == sun50i_h6_phy) { 350 349 void __iomem *phyctl = data->base + 351 350 data->cfg->phyctl_offset; 352 351 ··· 962 959 .phy0_dual_route = true, 963 960 }; 964 961 962 + static const struct sun4i_usb_phy_cfg sun50i_h6_cfg = { 963 + .num_phys = 4, 964 + .type = sun50i_h6_phy, 965 + .disc_thresh = 3, 966 + .phyctl_offset = REG_PHYCTL_A33, 967 + .dedicated_clocks = true, 968 + .enable_pmu_unk1 = true, 969 + .phy0_dual_route = true, 970 + .missing_phys = BIT(1) | BIT(2), 971 + }; 972 + 965 973 static const struct of_device_id sun4i_usb_phy_of_match[] = { 966 974 { .compatible = "allwinner,sun4i-a10-usb-phy", .data = &sun4i_a10_cfg }, 967 975 { .compatible = "allwinner,sun5i-a13-usb-phy", .data = &sun5i_a13_cfg }, ··· 986 972 { .compatible = "allwinner,sun8i-v3s-usb-phy", .data = &sun8i_v3s_cfg }, 987 973 { .compatible = "allwinner,sun50i-a64-usb-phy", 988 974 .data = &sun50i_a64_cfg}, 975 + { .compatible = "allwinner,sun50i-h6-usb-phy", .data = &sun50i_h6_cfg }, 989 976 { }, 990 977 }; 991 978 MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match);