Skip to content

Commit 65f3d44

Browse files
superna9999felipebalbi
authored andcommitted
usb: dwc-meson-g12a: Add support for USB on AXG SoCs
The Amlogic AXG is close to the GXL Glue but with a single OTG PHY. It needs the same init sequence as GXL & GXM, but it seems it doesn't need the host disconnect bit. Reviewed-by: Martin Blumenstingl <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Reviewed-by: Kevin Hilman <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent cdff2c9 commit 65f3d44

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

drivers/usb/dwc3/dwc3-meson-g12a.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ static const char * const meson_g12a_phy_names[] = {
127127
/*
128128
* Amlogic A1 has a single physical PHY, in slot 1, but still has the
129129
* two U2 PHY controls register blocks like G12A.
130+
* AXG has the similar scheme, thus needs the same tweak.
130131
* Handling the first PHY on slot 1 would need a large amount of code
131132
* changes, and the current management is generic enough to handle it
132133
* correctly when only the "usb2-phy1" phy is specified on-par with the
@@ -215,6 +216,19 @@ static struct dwc3_meson_g12a_drvdata gxm_drvdata = {
215216
.usb_post_init = dwc3_meson_gxl_usb_post_init,
216217
};
217218

219+
static struct dwc3_meson_g12a_drvdata axg_drvdata = {
220+
.otg_switch_supported = true,
221+
.clks = meson_gxl_clocks,
222+
.num_clks = ARRAY_SIZE(meson_gxl_clocks),
223+
.phy_names = meson_a1_phy_names,
224+
.num_phys = ARRAY_SIZE(meson_a1_phy_names),
225+
.setup_regmaps = dwc3_meson_gxl_setup_regmaps,
226+
.usb2_init_phy = dwc3_meson_gxl_usb2_init_phy,
227+
.set_phy_mode = dwc3_meson_gxl_set_phy_mode,
228+
.usb_init = dwc3_meson_g12a_usb_init,
229+
.usb_post_init = dwc3_meson_gxl_usb_post_init,
230+
};
231+
218232
static struct dwc3_meson_g12a_drvdata g12a_drvdata = {
219233
.otg_switch_supported = true,
220234
.clks = meson_g12a_clocks,
@@ -923,6 +937,10 @@ static const struct of_device_id dwc3_meson_g12a_match[] = {
923937
.compatible = "amlogic,meson-gxm-usb-ctrl",
924938
.data = &gxm_drvdata,
925939
},
940+
{
941+
.compatible = "amlogic,meson-axg-usb-ctrl",
942+
.data = &axg_drvdata,
943+
},
926944
{
927945
.compatible = "amlogic,meson-g12a-usb-ctrl",
928946
.data = &g12a_drvdata,

0 commit comments

Comments
 (0)