The Amlogic AXG is close from 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.
The Glue driver reuses the already implemented GXL & GXM work.
The USB2 PHY driver needs a slight tweak to keep the OTG detection working.
Neil Armstrong (5):
phy: amlogic: phy-meson-gxl-usb2: keep ID pull-up even in Host mode
dt-bindings: usb: amlogic,meson-g12a-usb-ctrl: add the Amlogic AXG
Families USB Glue Bindings
usb: dwc-meson-g12a: Add support for USB on AXG SoCs
arm64: dts: meson-axg: add USB nodes
arm64: dts: meson-axg-s400: enable USB OTG
.../usb/amlogic,meson-g12a-usb-ctrl.yaml | 22 +++++++-
.../arm64/boot/dts/amlogic/meson-axg-s400.dts | 10 ++++
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 51 +++++++++++++++++++
drivers/phy/amlogic/phy-meson-gxl-usb2.c | 3 +-
drivers/usb/dwc3/dwc3-meson-g12a.c | 17 +++++++
5 files changed, 101 insertions(+), 2 deletions(-)
--
2.22.0
In order to keep OTG ID detection even when in Host mode, the ID line of
the PHY (if the current phy is an OTG one) pull-up should be kept
enable in both modes.
This fixes OTG switch on GXL, GXM & AXG platforms, otherwise once switched
to Host, the ID detection doesn't work anymore to switch back to Device.
Signed-off-by: Neil Armstrong <[email protected]>
---
drivers/phy/amlogic/phy-meson-gxl-usb2.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
index 43ec9bf24abf..6e862ea60d8f 100644
--- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c
+++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
@@ -158,7 +158,8 @@ static int phy_meson_gxl_usb2_set_mode(struct phy *phy,
U2P_R0_DM_PULLDOWN);
regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_DP_PULLDOWN,
U2P_R0_DP_PULLDOWN);
- regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_ID_PULLUP, 0);
+ regmap_update_bits(priv->regmap, U2P_R0, U2P_R0_ID_PULLUP,
+ U2P_R0_ID_PULLUP);
break;
case PHY_MODE_USB_DEVICE:
--
2.22.0
Neil Armstrong <[email protected]> writes:
> The Amlogic AXG is close from the GXL Glue but with a single OTG PHY.
minor grammar nit: s/close from/close to/ (also in patches 2 & 3).
Otherwise..
Reviewed-by: Kevin Hilman <[email protected]>
Kevin
> It needs the same init sequence as GXL & GXM, but it seems it doesn't need
> the host disconnect bit.
>
> The Glue driver reuses the already implemented GXL & GXM work.
>
> The USB2 PHY driver needs a slight tweak to keep the OTG detection working.
>
> Neil Armstrong (5):
> phy: amlogic: phy-meson-gxl-usb2: keep ID pull-up even in Host mode
> dt-bindings: usb: amlogic,meson-g12a-usb-ctrl: add the Amlogic AXG
> Families USB Glue Bindings
> usb: dwc-meson-g12a: Add support for USB on AXG SoCs
> arm64: dts: meson-axg: add USB nodes
> arm64: dts: meson-axg-s400: enable USB OTG
>
> .../usb/amlogic,meson-g12a-usb-ctrl.yaml | 22 +++++++-
> .../arm64/boot/dts/amlogic/meson-axg-s400.dts | 10 ++++
> arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 51 +++++++++++++++++++
> drivers/phy/amlogic/phy-meson-gxl-usb2.c | 3 +-
> drivers/usb/dwc3/dwc3-meson-g12a.c | 17 +++++++
> 5 files changed, 101 insertions(+), 2 deletions(-)
>
> --
> 2.22.0
On Wed, Sep 9, 2020 at 6:04 PM Neil Armstrong <[email protected]> wrote:
>
> In order to keep OTG ID detection even when in Host mode, the ID line of
> the PHY (if the current phy is an OTG one) pull-up should be kept
> enable in both modes.
>
> This fixes OTG switch on GXL, GXM & AXG platforms, otherwise once switched
> to Host, the ID detection doesn't work anymore to switch back to Device.
>
> Signed-off-by: Neil Armstrong <[email protected]>
Reviewed-by: Martin Blumenstingl <[email protected]>