]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
usb: dwc3: dwc3-generic-plat: Add layerscape dwc3 support
authorFrank Li <Frank.Li@nxp.com>
Mon, 29 Sep 2025 14:24:16 +0000 (10:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Oct 2025 07:11:51 +0000 (09:11 +0200)
Add layerscape dwc3 support by using flatten dwc3 core library. Layerscape
dwc3 need set gsbuscfg0-reqinfo as 0x2222 when dma-coherence set.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20250929-ls_dma_coherence-v5-3-2ebee578eb7e@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-generic-plat.c

index af95a527dcc27a7a14d38dcc887f74a888ed91e6..770fedc16bb80dff95ff12c9506728df5ca4b831 100644 (file)
@@ -29,6 +29,7 @@ static void dwc3_generic_reset_control_assert(void *data)
 
 static int dwc3_generic_probe(struct platform_device *pdev)
 {
+       const struct dwc3_properties *properties;
        struct dwc3_probe_data probe_data = {};
        struct device *dev = &pdev->dev;
        struct dwc3_generic *dwc3g;
@@ -75,7 +76,13 @@ static int dwc3_generic_probe(struct platform_device *pdev)
        probe_data.dwc = &dwc3g->dwc;
        probe_data.res = res;
        probe_data.ignore_clocks_and_resets = true;
-       probe_data.properties = DWC3_DEFAULT_PROPERTIES;
+
+       properties = of_device_get_match_data(dev);
+       if (properties)
+               probe_data.properties = *properties;
+       else
+               probe_data.properties = DWC3_DEFAULT_PROPERTIES;
+
        ret = dwc3_core_probe(&probe_data);
        if (ret)
                return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
@@ -146,8 +153,13 @@ static const struct dev_pm_ops dwc3_generic_dev_pm_ops = {
                       dwc3_generic_runtime_idle)
 };
 
+static const struct dwc3_properties fsl_ls1028_dwc3 = {
+       .gsbuscfg0_reqinfo = 0x2222,
+};
+
 static const struct of_device_id dwc3_generic_of_match[] = {
        { .compatible = "spacemit,k1-dwc3", },
+       { .compatible = "fsl,ls1028a-dwc3", &fsl_ls1028_dwc3},
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, dwc3_generic_of_match);