[PATCH 2/3] usb: dwc3: add layerscape dwc3 support

Frank Li posted 3 patches 8 months, 1 week ago
There is a newer version of this series
[PATCH 2/3] usb: dwc3: add layerscape dwc3 support
Posted by Frank Li 8 months, 1 week ago
Add layerscape dwc3 support by using flatten dwc3 core library. Layerscape
dwc3 need set software managed property snps,gsbuscfg0-reqinfo as 0x2222
when dma-coherence set.

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/usb/dwc3/Kconfig           | 10 +++++
 drivers/usb/dwc3/Makefile          |  1 +
 drivers/usb/dwc3/dwc3-layerscape.c | 88 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 99 insertions(+)

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 310d182e10b50..13a86cf03b94b 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -150,6 +150,16 @@ config USB_DWC3_IMX8MP
 	  functionality.
 	  Say 'Y' or 'M' if you have one such device.
 
+config USB_DWC3_LAYERSCAPE
+	tristate "NXP Layerscape Platform"
+	depends on OF && COMMON_CLK
+	depends on ARCH_LAYERSCAPE || COMPILE_TEST
+	default USB_DWC3
+	help
+	  NXP LAYERSCAPE SoC use DesignWare Core IP for USB2/3
+	  functionality.
+	  Say 'Y' or 'M' if you have one such device.
+
 config USB_DWC3_XILINX
 	tristate "Xilinx Platforms"
 	depends on (ARCH_ZYNQMP || COMPILE_TEST) && OF
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index 830e6c9e5fe07..cd635b77902fb 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -54,6 +54,7 @@ obj-$(CONFIG_USB_DWC3_ST)		+= dwc3-st.o
 obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom.o
 obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom-legacy.o
 obj-$(CONFIG_USB_DWC3_IMX8MP)		+= dwc3-imx8mp.o
+obj-$(CONFIG_USB_DWC3_LAYERSCAPE)	+= dwc3-layerscape.o
 obj-$(CONFIG_USB_DWC3_XILINX)		+= dwc3-xilinx.o
 obj-$(CONFIG_USB_DWC3_OCTEON)		+= dwc3-octeon.o
 obj-$(CONFIG_USB_DWC3_RTK)		+= dwc3-rtk.o
diff --git a/drivers/usb/dwc3/dwc3-layerscape.c b/drivers/usb/dwc3/dwc3-layerscape.c
new file mode 100644
index 0000000000000..d093f178e1e35
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-layerscape.c
@@ -0,0 +1,88 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2020 NXP
+ */
+
+#include <linux/of.h>
+#include <linux/of_address.h>
+#include <linux/platform_device.h>
+#include <linux/usb/of.h>
+
+#include "core.h"
+#include "glue.h"
+
+struct dwc3_ls {
+	struct device *dev;
+	struct dwc3 dwc;
+};
+
+static int dwc3_ls_probe(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+	struct dwc3_probe_data probe_data = {};
+	struct property_entry props[2] = {};
+	struct device *dev = &pdev->dev;
+	struct resource *res;
+	struct dwc3_ls *ls;
+	int prop_idx = 0;
+	int ret = 0;
+
+	ls = devm_kzalloc(&pdev->dev, sizeof(*ls), GFP_KERNEL);
+	if (!ls)
+		return -ENOMEM;
+
+	ls->dev = &pdev->dev;
+
+	ls->dwc.dev = dev;
+
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
+		dev_err_probe(&pdev->dev, -ENODEV, "missing memory resource\n");
+
+	if (of_dma_is_coherent(np))
+		props[prop_idx++] = PROPERTY_ENTRY_U16("snps,gsbuscfg0-reqinfo", 0x2222);
+
+	if (prop_idx)
+		ret = device_create_managed_software_node(dev, props, NULL);
+
+	if (ret)
+		return dev_err_probe(dev, ret, "fail create software managed property node\n");
+
+	probe_data.dwc = &ls->dwc;
+	probe_data.res = res;
+	ret = dwc3_core_probe(&probe_data);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
+
+	return 0;
+}
+
+static void dwc3_ls_remove(struct platform_device *pdev)
+{
+	struct dwc3 *dwc = platform_get_drvdata(pdev);
+
+	dwc3_core_remove(dwc);
+}
+
+static const struct of_device_id of_dwc3_ls_match[] = {
+	{
+		.compatible = "fsl,ls1028a-dwc3"
+	},
+	{},
+};
+MODULE_DEVICE_TABLE(of, of_dwc3_ls_match);
+
+static struct platform_driver dwc3_ls_driver = {
+	.probe	  = dwc3_ls_probe,
+	.remove	 = dwc3_ls_remove,
+	.driver	 = {
+		.name   = "ls-dwc3",
+		.of_match_table = of_dwc3_ls_match,
+	},
+};
+
+module_platform_driver(dwc3_ls_driver);
+
+MODULE_AUTHOR("Frank Li <frank.li@nxp.com>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Freescale Layerscape USB3 Controller Driver");

-- 
2.34.1
Re: [PATCH 2/3] usb: dwc3: add layerscape dwc3 support
Posted by Thinh Nguyen 8 months, 1 week ago
Hi,

On Mon, Jun 02, 2025, Frank Li wrote:
> Add layerscape dwc3 support by using flatten dwc3 core library. Layerscape
> dwc3 need set software managed property snps,gsbuscfg0-reqinfo as 0x2222
> when dma-coherence set.
> 
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  drivers/usb/dwc3/Kconfig           | 10 +++++
>  drivers/usb/dwc3/Makefile          |  1 +
>  drivers/usb/dwc3/dwc3-layerscape.c | 88 ++++++++++++++++++++++++++++++++++++++
>  3 files changed, 99 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> index 310d182e10b50..13a86cf03b94b 100644
> --- a/drivers/usb/dwc3/Kconfig
> +++ b/drivers/usb/dwc3/Kconfig
> @@ -150,6 +150,16 @@ config USB_DWC3_IMX8MP
>  	  functionality.
>  	  Say 'Y' or 'M' if you have one such device.
>  
> +config USB_DWC3_LAYERSCAPE
> +	tristate "NXP Layerscape Platform"
> +	depends on OF && COMMON_CLK
> +	depends on ARCH_LAYERSCAPE || COMPILE_TEST
> +	default USB_DWC3
> +	help
> +	  NXP LAYERSCAPE SoC use DesignWare Core IP for USB2/3
> +	  functionality.
> +	  Say 'Y' or 'M' if you have one such device.
> +
>  config USB_DWC3_XILINX
>  	tristate "Xilinx Platforms"
>  	depends on (ARCH_ZYNQMP || COMPILE_TEST) && OF
> diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
> index 830e6c9e5fe07..cd635b77902fb 100644
> --- a/drivers/usb/dwc3/Makefile
> +++ b/drivers/usb/dwc3/Makefile
> @@ -54,6 +54,7 @@ obj-$(CONFIG_USB_DWC3_ST)		+= dwc3-st.o
>  obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom.o
>  obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom-legacy.o
>  obj-$(CONFIG_USB_DWC3_IMX8MP)		+= dwc3-imx8mp.o
> +obj-$(CONFIG_USB_DWC3_LAYERSCAPE)	+= dwc3-layerscape.o
>  obj-$(CONFIG_USB_DWC3_XILINX)		+= dwc3-xilinx.o
>  obj-$(CONFIG_USB_DWC3_OCTEON)		+= dwc3-octeon.o
>  obj-$(CONFIG_USB_DWC3_RTK)		+= dwc3-rtk.o
> diff --git a/drivers/usb/dwc3/dwc3-layerscape.c b/drivers/usb/dwc3/dwc3-layerscape.c
> new file mode 100644
> index 0000000000000..d093f178e1e35
> --- /dev/null
> +++ b/drivers/usb/dwc3/dwc3-layerscape.c
> @@ -0,0 +1,88 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2020 NXP
> + */
> +
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
> +#include <linux/usb/of.h>
> +
> +#include "core.h"
> +#include "glue.h"
> +
> +struct dwc3_ls {
> +	struct device *dev;
> +	struct dwc3 dwc;
> +};
> +
> +static int dwc3_ls_probe(struct platform_device *pdev)
> +{
> +	struct device_node *np = pdev->dev.of_node;
> +	struct dwc3_probe_data probe_data = {};
> +	struct property_entry props[2] = {};
> +	struct device *dev = &pdev->dev;
> +	struct resource *res;
> +	struct dwc3_ls *ls;
> +	int prop_idx = 0;
> +	int ret = 0;
> +
> +	ls = devm_kzalloc(&pdev->dev, sizeof(*ls), GFP_KERNEL);
> +	if (!ls)
> +		return -ENOMEM;
> +
> +	ls->dev = &pdev->dev;
> +
> +	ls->dwc.dev = dev;
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!res)
> +		dev_err_probe(&pdev->dev, -ENODEV, "missing memory resource\n");
> +
> +	if (of_dma_is_coherent(np))
> +		props[prop_idx++] = PROPERTY_ENTRY_U16("snps,gsbuscfg0-reqinfo", 0x2222);
> +
> +	if (prop_idx)
> +		ret = device_create_managed_software_node(dev, props, NULL);
> +
> +	if (ret)
> +		return dev_err_probe(dev, ret, "fail create software managed property node\n");
> +
> +	probe_data.dwc = &ls->dwc;
> +	probe_data.res = res;
> +	ret = dwc3_core_probe(&probe_data);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
> +
> +	return 0;
> +}
> +
> +static void dwc3_ls_remove(struct platform_device *pdev)
> +{
> +	struct dwc3 *dwc = platform_get_drvdata(pdev);
> +
> +	dwc3_core_remove(dwc);
> +}
> +
> +static const struct of_device_id of_dwc3_ls_match[] = {
> +	{
> +		.compatible = "fsl,ls1028a-dwc3"
> +	},
> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, of_dwc3_ls_match);
> +
> +static struct platform_driver dwc3_ls_driver = {
> +	.probe	  = dwc3_ls_probe,
> +	.remove	 = dwc3_ls_remove,
> +	.driver	 = {
> +		.name   = "ls-dwc3",
> +		.of_match_table = of_dwc3_ls_match,
> +	},
> +};
> +
> +module_platform_driver(dwc3_ls_driver);
> +
> +MODULE_AUTHOR("Frank Li <frank.li@nxp.com>");
> +MODULE_LICENSE("GPL");
> +MODULE_DESCRIPTION("Freescale Layerscape USB3 Controller Driver");
> 
> -- 
> 2.34.1
> 

Is this something that can be enhanced in dwc3-generic-plat glue from Ze
Huang:

https://lore.kernel.org/linux-usb/20250526-b4-k1-dwc3-v3-v4-3-63e4e525e5cb@whut.edu.cn/T/#u

Thanks,
Thinh
Re: [PATCH 2/3] usb: dwc3: add layerscape dwc3 support
Posted by Frank Li 8 months, 1 week ago
On Tue, Jun 03, 2025 at 01:23:03AM +0000, Thinh Nguyen wrote:
> Hi,
>
> On Mon, Jun 02, 2025, Frank Li wrote:
> > Add layerscape dwc3 support by using flatten dwc3 core library. Layerscape
> > dwc3 need set software managed property snps,gsbuscfg0-reqinfo as 0x2222
> > when dma-coherence set.
> >
> > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > ---
> >  drivers/usb/dwc3/Kconfig           | 10 +++++
> >  drivers/usb/dwc3/Makefile          |  1 +
> >  drivers/usb/dwc3/dwc3-layerscape.c | 88 ++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 99 insertions(+)
> >
> > diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> > index 310d182e10b50..13a86cf03b94b 100644
> > --- a/drivers/usb/dwc3/Kconfig
> > +++ b/drivers/usb/dwc3/Kconfig
> > @@ -150,6 +150,16 @@ config USB_DWC3_IMX8MP
> >  	  functionality.
> >  	  Say 'Y' or 'M' if you have one such device.
> >
> > +config USB_DWC3_LAYERSCAPE
> > +	tristate "NXP Layerscape Platform"
> > +	depends on OF && COMMON_CLK
> > +	depends on ARCH_LAYERSCAPE || COMPILE_TEST
> > +	default USB_DWC3
> > +	help
> > +	  NXP LAYERSCAPE SoC use DesignWare Core IP for USB2/3
> > +	  functionality.
> > +	  Say 'Y' or 'M' if you have one such device.
> > +
> >  config USB_DWC3_XILINX
> >  	tristate "Xilinx Platforms"
> >  	depends on (ARCH_ZYNQMP || COMPILE_TEST) && OF
> > diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
> > index 830e6c9e5fe07..cd635b77902fb 100644
> > --- a/drivers/usb/dwc3/Makefile
> > +++ b/drivers/usb/dwc3/Makefile
> > @@ -54,6 +54,7 @@ obj-$(CONFIG_USB_DWC3_ST)		+= dwc3-st.o
> >  obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom.o
> >  obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom-legacy.o
> >  obj-$(CONFIG_USB_DWC3_IMX8MP)		+= dwc3-imx8mp.o
> > +obj-$(CONFIG_USB_DWC3_LAYERSCAPE)	+= dwc3-layerscape.o
> >  obj-$(CONFIG_USB_DWC3_XILINX)		+= dwc3-xilinx.o
> >  obj-$(CONFIG_USB_DWC3_OCTEON)		+= dwc3-octeon.o
> >  obj-$(CONFIG_USB_DWC3_RTK)		+= dwc3-rtk.o
> > diff --git a/drivers/usb/dwc3/dwc3-layerscape.c b/drivers/usb/dwc3/dwc3-layerscape.c
> > new file mode 100644
> > index 0000000000000..d093f178e1e35
> > --- /dev/null
> > +++ b/drivers/usb/dwc3/dwc3-layerscape.c
> > @@ -0,0 +1,88 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Copyright (c) 2020 NXP
> > + */
> > +
> > +#include <linux/of.h>
> > +#include <linux/of_address.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/usb/of.h>
> > +
> > +#include "core.h"
> > +#include "glue.h"
> > +
> > +struct dwc3_ls {
> > +	struct device *dev;
> > +	struct dwc3 dwc;
> > +};
> > +
> > +static int dwc3_ls_probe(struct platform_device *pdev)
> > +{
> > +	struct device_node *np = pdev->dev.of_node;
> > +	struct dwc3_probe_data probe_data = {};
> > +	struct property_entry props[2] = {};
> > +	struct device *dev = &pdev->dev;
> > +	struct resource *res;
> > +	struct dwc3_ls *ls;
> > +	int prop_idx = 0;
> > +	int ret = 0;
> > +
> > +	ls = devm_kzalloc(&pdev->dev, sizeof(*ls), GFP_KERNEL);
> > +	if (!ls)
> > +		return -ENOMEM;
> > +
> > +	ls->dev = &pdev->dev;
> > +
> > +	ls->dwc.dev = dev;
> > +
> > +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > +	if (!res)
> > +		dev_err_probe(&pdev->dev, -ENODEV, "missing memory resource\n");
> > +
> > +	if (of_dma_is_coherent(np))
> > +		props[prop_idx++] = PROPERTY_ENTRY_U16("snps,gsbuscfg0-reqinfo", 0x2222);
> > +
> > +	if (prop_idx)
> > +		ret = device_create_managed_software_node(dev, props, NULL);
> > +
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "fail create software managed property node\n");
> > +
> > +	probe_data.dwc = &ls->dwc;
> > +	probe_data.res = res;
> > +	ret = dwc3_core_probe(&probe_data);
> > +	if (ret)
> > +		return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
> > +
> > +	return 0;
> > +}
> > +
> > +static void dwc3_ls_remove(struct platform_device *pdev)
> > +{
> > +	struct dwc3 *dwc = platform_get_drvdata(pdev);
> > +
> > +	dwc3_core_remove(dwc);
> > +}
> > +
> > +static const struct of_device_id of_dwc3_ls_match[] = {
> > +	{
> > +		.compatible = "fsl,ls1028a-dwc3"
> > +	},
> > +	{},
> > +};
> > +MODULE_DEVICE_TABLE(of, of_dwc3_ls_match);
> > +
> > +static struct platform_driver dwc3_ls_driver = {
> > +	.probe	  = dwc3_ls_probe,
> > +	.remove	 = dwc3_ls_remove,
> > +	.driver	 = {
> > +		.name   = "ls-dwc3",
> > +		.of_match_table = of_dwc3_ls_match,
> > +	},
> > +};
> > +
> > +module_platform_driver(dwc3_ls_driver);
> > +
> > +MODULE_AUTHOR("Frank Li <frank.li@nxp.com>");
> > +MODULE_LICENSE("GPL");
> > +MODULE_DESCRIPTION("Freescale Layerscape USB3 Controller Driver");
> >
> > --
> > 2.34.1
> >
>
> Is this something that can be enhanced in dwc3-generic-plat glue from Ze
> Huang:

Yes, I can base on Zehuang's work with little modify. Please let me know
when his patch merged.

Frank

>
> https://lore.kernel.org/linux-usb/20250526-b4-k1-dwc3-v3-v4-3-63e4e525e5cb@whut.edu.cn/T/#u
>
> Thanks,
> Thinh
Re: [PATCH 2/3] usb: dwc3: add layerscape dwc3 support
Posted by Thinh Nguyen 4 months, 3 weeks ago
On Tue, Jun 03, 2025, Frank Li wrote:
> On Tue, Jun 03, 2025 at 01:23:03AM +0000, Thinh Nguyen wrote:
> >
> > Is this something that can be enhanced in dwc3-generic-plat glue from Ze
> > Huang:
> 
> Yes, I can base on Zehuang's work with little modify. Please let me know
> when his patch merged.
> 

Greg picked up Zehuang's changes[*] on his usb-next branch.

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-next&id=e0b6dc00c701e600e655417aab1e100b73de821a

Thanks,
Thinh
Re: [PATCH 2/3] usb: dwc3: add layerscape dwc3 support
Posted by Frank Li 4 months, 3 weeks ago
On Fri, Sep 19, 2025 at 09:17:04PM +0000, Thinh Nguyen wrote:
> On Tue, Jun 03, 2025, Frank Li wrote:
> > On Tue, Jun 03, 2025 at 01:23:03AM +0000, Thinh Nguyen wrote:
> > >
> > > Is this something that can be enhanced in dwc3-generic-plat glue from Ze
> > > Huang:
> >
> > Yes, I can base on Zehuang's work with little modify. Please let me know
> > when his patch merged.
> >
>
> Greg picked up Zehuang's changes[*] on his usb-next branch.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-next&id=e0b6dc00c701e600e655417aab1e100b73de821a

Thank you very much. Let me work on layerscape base on that.

Frank

>
> Thanks,
> Thinh
Re: [PATCH 2/3] usb: dwc3: add layerscape dwc3 support
Posted by Thinh Nguyen 8 months, 1 week ago
On Tue, Jun 03, 2025, Frank Li wrote:
> On Tue, Jun 03, 2025 at 01:23:03AM +0000, Thinh Nguyen wrote:
> > Hi,
> >
> > On Mon, Jun 02, 2025, Frank Li wrote:
> > > Add layerscape dwc3 support by using flatten dwc3 core library. Layerscape
> > > dwc3 need set software managed property snps,gsbuscfg0-reqinfo as 0x2222
> > > when dma-coherence set.
> > >
> > > Signed-off-by: Frank Li <Frank.Li@nxp.com>
> > > ---
> > >  drivers/usb/dwc3/Kconfig           | 10 +++++
> > >  drivers/usb/dwc3/Makefile          |  1 +
> > >  drivers/usb/dwc3/dwc3-layerscape.c | 88 ++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 99 insertions(+)
> > >
> > > diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
> > > index 310d182e10b50..13a86cf03b94b 100644
> > > --- a/drivers/usb/dwc3/Kconfig
> > > +++ b/drivers/usb/dwc3/Kconfig
> > > @@ -150,6 +150,16 @@ config USB_DWC3_IMX8MP
> > >  	  functionality.
> > >  	  Say 'Y' or 'M' if you have one such device.
> > >
> > > +config USB_DWC3_LAYERSCAPE
> > > +	tristate "NXP Layerscape Platform"
> > > +	depends on OF && COMMON_CLK
> > > +	depends on ARCH_LAYERSCAPE || COMPILE_TEST
> > > +	default USB_DWC3
> > > +	help
> > > +	  NXP LAYERSCAPE SoC use DesignWare Core IP for USB2/3
> > > +	  functionality.
> > > +	  Say 'Y' or 'M' if you have one such device.
> > > +
> > >  config USB_DWC3_XILINX
> > >  	tristate "Xilinx Platforms"
> > >  	depends on (ARCH_ZYNQMP || COMPILE_TEST) && OF
> > > diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
> > > index 830e6c9e5fe07..cd635b77902fb 100644
> > > --- a/drivers/usb/dwc3/Makefile
> > > +++ b/drivers/usb/dwc3/Makefile
> > > @@ -54,6 +54,7 @@ obj-$(CONFIG_USB_DWC3_ST)		+= dwc3-st.o
> > >  obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom.o
> > >  obj-$(CONFIG_USB_DWC3_QCOM)		+= dwc3-qcom-legacy.o
> > >  obj-$(CONFIG_USB_DWC3_IMX8MP)		+= dwc3-imx8mp.o
> > > +obj-$(CONFIG_USB_DWC3_LAYERSCAPE)	+= dwc3-layerscape.o
> > >  obj-$(CONFIG_USB_DWC3_XILINX)		+= dwc3-xilinx.o
> > >  obj-$(CONFIG_USB_DWC3_OCTEON)		+= dwc3-octeon.o
> > >  obj-$(CONFIG_USB_DWC3_RTK)		+= dwc3-rtk.o
> > > diff --git a/drivers/usb/dwc3/dwc3-layerscape.c b/drivers/usb/dwc3/dwc3-layerscape.c
> > > new file mode 100644
> > > index 0000000000000..d093f178e1e35
> > > --- /dev/null
> > > +++ b/drivers/usb/dwc3/dwc3-layerscape.c
> > > @@ -0,0 +1,88 @@
> > > +// SPDX-License-Identifier: GPL-2.0
> > > +/*
> > > + * Copyright (c) 2020 NXP
> > > + */
> > > +
> > > +#include <linux/of.h>
> > > +#include <linux/of_address.h>
> > > +#include <linux/platform_device.h>
> > > +#include <linux/usb/of.h>
> > > +
> > > +#include "core.h"
> > > +#include "glue.h"
> > > +
> > > +struct dwc3_ls {
> > > +	struct device *dev;
> > > +	struct dwc3 dwc;
> > > +};
> > > +
> > > +static int dwc3_ls_probe(struct platform_device *pdev)
> > > +{
> > > +	struct device_node *np = pdev->dev.of_node;
> > > +	struct dwc3_probe_data probe_data = {};
> > > +	struct property_entry props[2] = {};
> > > +	struct device *dev = &pdev->dev;
> > > +	struct resource *res;
> > > +	struct dwc3_ls *ls;
> > > +	int prop_idx = 0;
> > > +	int ret = 0;
> > > +
> > > +	ls = devm_kzalloc(&pdev->dev, sizeof(*ls), GFP_KERNEL);
> > > +	if (!ls)
> > > +		return -ENOMEM;
> > > +
> > > +	ls->dev = &pdev->dev;
> > > +
> > > +	ls->dwc.dev = dev;
> > > +
> > > +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > > +	if (!res)
> > > +		dev_err_probe(&pdev->dev, -ENODEV, "missing memory resource\n");
> > > +
> > > +	if (of_dma_is_coherent(np))
> > > +		props[prop_idx++] = PROPERTY_ENTRY_U16("snps,gsbuscfg0-reqinfo", 0x2222);
> > > +
> > > +	if (prop_idx)
> > > +		ret = device_create_managed_software_node(dev, props, NULL);
> > > +
> > > +	if (ret)
> > > +		return dev_err_probe(dev, ret, "fail create software managed property node\n");
> > > +
> > > +	probe_data.dwc = &ls->dwc;
> > > +	probe_data.res = res;
> > > +	ret = dwc3_core_probe(&probe_data);
> > > +	if (ret)
> > > +		return dev_err_probe(dev, ret, "failed to register DWC3 Core\n");
> > > +
> > > +	return 0;
> > > +}
> > > +
> > > +static void dwc3_ls_remove(struct platform_device *pdev)
> > > +{
> > > +	struct dwc3 *dwc = platform_get_drvdata(pdev);
> > > +
> > > +	dwc3_core_remove(dwc);
> > > +}
> > > +
> > > +static const struct of_device_id of_dwc3_ls_match[] = {
> > > +	{
> > > +		.compatible = "fsl,ls1028a-dwc3"
> > > +	},
> > > +	{},
> > > +};
> > > +MODULE_DEVICE_TABLE(of, of_dwc3_ls_match);
> > > +
> > > +static struct platform_driver dwc3_ls_driver = {
> > > +	.probe	  = dwc3_ls_probe,
> > > +	.remove	 = dwc3_ls_remove,
> > > +	.driver	 = {
> > > +		.name   = "ls-dwc3",
> > > +		.of_match_table = of_dwc3_ls_match,
> > > +	},
> > > +};
> > > +
> > > +module_platform_driver(dwc3_ls_driver);
> > > +
> > > +MODULE_AUTHOR("Frank Li <frank.li@nxp.com>");
> > > +MODULE_LICENSE("GPL");
> > > +MODULE_DESCRIPTION("Freescale Layerscape USB3 Controller Driver");
> > >
> > > --
> > > 2.34.1
> > >
> >
> > Is this something that can be enhanced in dwc3-generic-plat glue from Ze
> > Huang:
> 
> Yes, I can base on Zehuang's work with little modify. Please let me know
> when his patch merged.
> 

Sure thing.

BR,
Thinh