Permalink
Browse files

meson GXL USB device support - WiP

WiP - split into separate patches, add detection logic, ...

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
  • Loading branch information...
xdarklight committed Oct 28, 2017
1 parent c112914 commit 390d83dd7b9838984350ba71097fc71384fce417
@@ -177,3 +177,7 @@
&usb0 {
status = "okay";
};
&usb1 {
status = "okay";
};
@@ -51,7 +51,6 @@
compatible = "amlogic,meson-gxl";
soc {
usb0: usb@c9000000 {
compatible = "snps,dwc3";
#address-cells = <1>;
@@ -82,6 +81,23 @@
};
};
};
usb1: usb@c9100000 {
compatible = "snps,dwc2";
reg = <0x0 0xc9100000 0x0 0x40000>;
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc_AO CLKID_AO_CEC_32K>;
clock-names = "otg";
resets = <&reset RESET_USB_OTG>;
reset-names = "dwc2";
phys = <&usb2_phy1>;
phy-names = "usb2-phy";
dr_mode = "peripheral";
g-rx-fifo-size = <192>;
g-np-tx-fifo-size = <128>;
g-tx-fifo-size = <128 128 16 16 16>;
status = "disabled";
};
};
};
@@ -104,6 +120,8 @@
compatible = "amlogic,meson-gxl-usb3-phy";
#phy-cells = <0>;
reg = <0x0 0x78080 0x0 0x20>;
phys = <&usb2_phy1>;
phy-names = "usb2-phy";
status = "okay";
};
};
@@ -88,6 +88,7 @@
struct phy_meson_gxl_usb3_priv {
struct regmap *regmap;
struct phy *usb2_phy;
};
static const struct regmap_config phy_meson_gxl_usb3_regmap_conf = {
@@ -144,6 +145,20 @@ static int phy_meson_gxl_usb3_probe(struct platform_device *pdev)
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);
priv->usb2_phy = devm_phy_optional_get(dev, "usb2-phy");
if (IS_ERR(priv->usb2_phy))
return PTR_ERR(priv->usb2_phy);
#if 1
// TODO / FIXME: move this to some kind of detection logic
phy_set_mode(priv->usb2_phy, PHY_MODE_USB_DEVICE);
regmap_update_bits(priv->regmap, USB_R0, USB_R0_U2D_ACT,
USB_R0_U2D_ACT);
regmap_update_bits(priv->regmap, USB_R4, USB_R4_P21_SLEEP_M0,
USB_R4_P21_SLEEP_M0);
#endif
phy = devm_phy_create(dev, np, &phy_meson_gxl_usb3_ops);
if (IS_ERR(phy)) {
dev_err(dev, "failed to create PHY\n");

0 comments on commit 390d83d

Please sign in to comment.