On 5/24/25 00:58, Stephen Boyd wrote:
Coreboot already initializes the USB3 controller and PHY on Qualcomm
devices. Skip fixing up the USB node on platforms that are a coreboot
payload. This provides a working USB-A port on device like Lazor.

Signed-off-by: Stephen Boyd <[email protected]>
---
  arch/arm/mach-snapdragon/of_fixup.c | 22 +++++++++++++++-------
  1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-snapdragon/of_fixup.c 
b/arch/arm/mach-snapdragon/of_fixup.c
index 1ea0c18c2f27..fd4aa3ba7055 100644
--- a/arch/arm/mach-snapdragon/of_fixup.c
+++ b/arch/arm/mach-snapdragon/of_fixup.c
@@ -41,13 +41,6 @@ static int fixup_qcom_dwc3(struct device_node *glue_np)
debug("Fixing up %s\n", glue_np->name); - /* Tell the glue driver to configure the wrapper for high-speed only operation */
-       ret = of_write_prop(glue_np, "qcom,select-utmi-as-pipe-clk", 0, NULL);
-       if (ret) {
-               log_err("Failed to add property 'qcom,select-utmi-as-pipe-clk': 
%d\n", ret);
-               return ret;
-       }
-
        /* Find the DWC3 node itself */
        dwc3 = of_find_compatible_node(glue_np, NULL, "snps,dwc3");
        if (!dwc3) {
@@ -92,6 +85,21 @@ static int fixup_qcom_dwc3(struct device_node *glue_np)
                return ret;
        }
+ /*
+        * Coreboot already initialized USB to the point that USB SuperSpeed
+        * works, don't tell the glue driver to only use high-speed.
+        */
+       if (gd->arch.coreboot_table)
+               return 0;

This is missing an #ifdef, fixed it while applying.> +
+       /* Tell the glue driver to configure the wrapper for high-speed only 
operation */
+       ret = of_write_prop(glue_np, "qcom,select-utmi-as-pipe-clk", 0, NULL);
+       if (ret) {
+               log_err("Failed to add property 'qcom,select-utmi-as-pipe-clk': 
%d\n", ret);
+               return ret;
+       }
+
+       /* Tell the core driver to configure for high-speed only operation */
        ret = of_write_prop(dwc3, "maximum-speed", strlen("high-speed") + 1, 
"high-speed");
        if (ret) {
                log_err("Failed to set 'maximum-speed' property: %d\n", ret);

--
Casey (she/they)

Reply via email to