summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2023-01-31 10:15:39 -0500
committerTom Rini <[email protected]>2023-01-31 10:15:39 -0500
commit095d909cf101356cc36a12ec447a862b2477842d (patch)
tree2c13cfb82252f80ec4250e98ad46988e36e94fe7 /drivers
parent30db474704405be823259851cbb76fa05366c8af (diff)
parent8f5e9de121003bfd9a64a5b3a503c0fbd02af823 (diff)
Merge tag 'u-boot-amlogic-20230131' of https://source.denx.de/u-boot/custodians/u-boot-amlogic
- jethub j100: add rescue boot from microSD - move meson sm command to cmd/meson and add efusedump sub-command - switch dwc2 otg to DM for G12A, GXL & AXG - Add new boards: - Odroid Go Ultra - Odroid-N2L
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc3/dwc3-meson-g12a.c18
-rw-r--r--drivers/usb/dwc3/dwc3-meson-gxl.c18
2 files changed, 36 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
index 90418ddc1da..c62e42de73f 100644
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -455,6 +455,22 @@ static int dwc3_meson_g12a_remove(struct udevice *dev)
return dm_scan_fdt_dev(dev);
}
+static int dwc3_meson_g12a_child_pre_probe(struct udevice *dev)
+{
+ if (ofnode_device_is_compatible(dev_ofnode(dev), "amlogic,meson-g12a-usb"))
+ return dwc3_meson_g12a_force_mode(dev->parent, USB_DR_MODE_PERIPHERAL);
+
+ return 0;
+}
+
+static int dwc3_meson_g12a_child_post_remove(struct udevice *dev)
+{
+ if (ofnode_device_is_compatible(dev_ofnode(dev), "amlogic,meson-g12a-usb"))
+ return dwc3_meson_g12a_force_mode(dev->parent, USB_DR_MODE_HOST);
+
+ return 0;
+}
+
static const struct udevice_id dwc3_meson_g12a_ids[] = {
{ .compatible = "amlogic,meson-g12a-usb-ctrl" },
{ }
@@ -466,6 +482,8 @@ U_BOOT_DRIVER(dwc3_generic_wrapper) = {
.of_match = dwc3_meson_g12a_ids,
.probe = dwc3_meson_g12a_probe,
.remove = dwc3_meson_g12a_remove,
+ .child_pre_probe = dwc3_meson_g12a_child_pre_probe,
+ .child_post_remove = dwc3_meson_g12a_child_post_remove,
.plat_auto = sizeof(struct dwc3_meson_g12a),
};
diff --git a/drivers/usb/dwc3/dwc3-meson-gxl.c b/drivers/usb/dwc3/dwc3-meson-gxl.c
index 6c6d463203c..d56f2747b63 100644
--- a/drivers/usb/dwc3/dwc3-meson-gxl.c
+++ b/drivers/usb/dwc3/dwc3-meson-gxl.c
@@ -408,6 +408,22 @@ static int dwc3_meson_gxl_remove(struct udevice *dev)
return dm_scan_fdt_dev(dev);
}
+static int dwc3_meson_gxl_child_pre_probe(struct udevice *dev)
+{
+ if (ofnode_device_is_compatible(dev_ofnode(dev), "amlogic,meson-g12a-usb"))
+ return dwc3_meson_gxl_force_mode(dev->parent, USB_DR_MODE_PERIPHERAL);
+
+ return 0;
+}
+
+static int dwc3_meson_gxl_child_post_remove(struct udevice *dev)
+{
+ if (ofnode_device_is_compatible(dev_ofnode(dev), "amlogic,meson-g12a-usb"))
+ return dwc3_meson_gxl_force_mode(dev->parent, USB_DR_MODE_HOST);
+
+ return 0;
+}
+
static const struct udevice_id dwc3_meson_gxl_ids[] = {
{ .compatible = "amlogic,meson-axg-usb-ctrl" },
{ .compatible = "amlogic,meson-gxl-usb-ctrl" },
@@ -421,6 +437,8 @@ U_BOOT_DRIVER(dwc3_generic_wrapper) = {
.of_match = dwc3_meson_gxl_ids,
.probe = dwc3_meson_gxl_probe,
.remove = dwc3_meson_gxl_remove,
+ .child_pre_probe = dwc3_meson_gxl_child_pre_probe,
+ .child_post_remove = dwc3_meson_gxl_child_post_remove,
.plat_auto = sizeof(struct dwc3_meson_gxl),
};