From nobody Wed Oct 1 22:35:18 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEDF027A12C; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758910788; cv=none; b=UESGor2U/JYsPDPoTz1uipqzkyfOmE6tss6I3KPh5sW31YLOnlB8/99KZomeU/iMWdWvP8rwhmaDB4DJzrb/j4+0DOyFxEVdivrECLHWYv9a/NcOh81VXvTP0dvfuoy45p7lEA6UNHDXyBy6iGQwxFjsvEjnXy22Bcb48WH0Jc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758910788; c=relaxed/simple; bh=eSfv/94BXfVINtY1Gd87gaCX40bgQegXNivKn8K8/wA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QRnAHk28d7e0jN44hfbEMPNyDA8zHXmm02sHdW2+4CeeKQDuyCUUZaY9KKR3gMehXT4Dni1NOnmNFzGs/lPXI8GX04PHbH7wHc/gfqMDwOOadXWxxQWJ8dvaFDPQStfRXePNi7IfZMyXi2bEauoxWbDpWAx9VF5peVP9UBb3w4M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eA9dIvt3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eA9dIvt3" Received: by smtp.kernel.org (Postfix) with ESMTPS id 811F7C116B1; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758910788; bh=eSfv/94BXfVINtY1Gd87gaCX40bgQegXNivKn8K8/wA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=eA9dIvt3vE+KnL8TN/1khNLMa1tjc/IJFcYvdbzJcAEudbwke+l2TOCkLzpOdcUnY bLvdCC5wl4xQ7rWtACHPYPhY6OIrnGPui6ilnqSP2uZXAFS5Kk4vG8ZcRFLl9mkVZs DfuHN5TrZCAVMkwkclYsUELCYubvoIDF4EjT7Zrtshy5Q4nZW1+C57iBfHHhq0L+Bv 0VBV63qGZX+OLIoudcfS4xV8Mpr9p63m3wIdPkcDD2vGjtqAgydwis3IQOWFkWibhX 69YNUuQmygoR45+a152ZlZrDEd0yfZGcTyNYRV5iBmliBHMfmUGxABH5v3qXV8THFc 9oMD4TvFlt/5Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 580D9CAC5B8; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) From: Frank Li via B4 Relay Date: Fri, 26 Sep 2025 14:19:40 -0400 Subject: [PATCH v4 1/4] dt-bindings: usb: add missed compatible string for arm64 layerscape Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250926-ls_dma_coherence-v4-1-21e9c6bdb5cb@nxp.com> References: <20250926-ls_dma_coherence-v4-0-21e9c6bdb5cb@nxp.com> In-Reply-To: <20250926-ls_dma_coherence-v4-0-21e9c6bdb5cb@nxp.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thinh Nguyen , Shawn Guo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bjorn.andersson@oss.qualcomm.com, imx@lists.linux.dev, Frank Li , Ze Huang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758910787; l=2369; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=xECP3rJgzFVmUgwO2Q0SoMn/hJcv7uPuVA3P1+7dxKA=; b=ihVrKU/QKLhhdbQULjuiZ91XkMApIntlRtjBuERXvfxnVIj5c3BFkIqber7bGljsF1GxkQ6KR Bfgt7U3yFMCAj6hKQNU9RXgqfXcXe4SEEVE92LcG8Lk7VFexIRsEZA+ X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-Endpoint-Received: by B4 Relay for Frank.Li@nxp.com/20240130 with auth_id=121 X-Original-From: Frank Li Reply-To: Frank.Li@nxp.com From: Frank Li Add missed compatible string for arm64 layerscape platform. Allow these fallback to fsl,ls1028a-dwc3. Remove fallback snps,dwc3 because layerscape dwc3 is not full compatible with common snps,dwc3 device, a special value gsburstcfg0 need be set when dma coherence enabled. Allow iommus property. Change ref to snps,dwc3-common.yaml to use dwc3 flatten library. Reviewed-by: Rob Herring (Arm) Signed-off-by: Frank Li --- change in v2-v4 - none --- .../devicetree/bindings/usb/fsl,ls1028a.yaml | 33 ++++++++++++------= ---- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/fsl,ls1028a.yaml b/Docum= entation/devicetree/bindings/usb/fsl,ls1028a.yaml index a44bdf391887f9c7d565c01d2c3aede99c4a9fc3..4784f057264ac7b18cbc8b41a40= 5f9c9268605bb 100644 --- a/Documentation/devicetree/bindings/usb/fsl,ls1028a.yaml +++ b/Documentation/devicetree/bindings/usb/fsl,ls1028a.yaml @@ -9,21 +9,19 @@ title: Freescale layerscape SuperSpeed DWC3 USB SoC contr= oller maintainers: - Frank Li =20 -select: - properties: - compatible: - contains: - enum: - - fsl,ls1028a-dwc3 - required: - - compatible - properties: compatible: - items: - - enum: - - fsl,ls1028a-dwc3 - - const: snps,dwc3 + oneOf: + - items: + - enum: + - fsl,ls1012a-dwc3 + - fsl,ls1043a-dwc3 + - fsl,ls1046a-dwc3 + - fsl,ls1088a-dwc3 + - fsl,ls208xa-dwc3 + - fsl,lx2160a-dwc3 + - const: fsl,ls1028a-dwc3 + - const: fsl,ls1028a-dwc3 =20 reg: maxItems: 1 @@ -31,6 +29,11 @@ properties: interrupts: maxItems: 1 =20 + iommus: + maxItems: 1 + + dma-coherent: true + unevaluatedProperties: false =20 required: @@ -39,14 +42,14 @@ required: - interrupts =20 allOf: - - $ref: snps,dwc3.yaml# + - $ref: snps,dwc3-common.yaml# =20 examples: - | #include =20 usb@fe800000 { - compatible =3D "fsl,ls1028a-dwc3", "snps,dwc3"; + compatible =3D "fsl,ls1028a-dwc3"; reg =3D <0xfe800000 0x100000>; interrupts =3D ; }; --=20 2.34.1 From nobody Wed Oct 1 22:35:18 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CED8A27877B; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758910788; cv=none; b=kq7gG270wzbcC0BbK8ugcj5QjB3B+IUAPG34kzmJMlX0+10i8YOrHNWcANPck7rFU7g9T72x1gvi6UTw0q9OBeMksnK/mBcZlDGtgYsqQ4/jUbbP/qCXLBk5bUwgWJ8v331bK41BB29hCV+dtKvPYbezXrMYox9HbJkJGMSWbxU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758910788; c=relaxed/simple; bh=Y47BmXQKGcY7pVuayUBb2urB3tQN1uchsdVE/aFIOuk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GODhwUTg7VJrOuJrJKcM0z+LMPhIMYydzCGsSII49GJoxGGKoldEe8fGgT0nWQoTju1wBooGs601E3CTNmH0yqc3gwYBqVvbuOKyO+KlS7eLs2JOrQpDmriuSpwt3UsCkb1u7BC2AFXum5A+avrR5EMKTKN/Q4xV9QB0u5gx3qA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pt86/lUg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pt86/lUg" Received: by smtp.kernel.org (Postfix) with ESMTPS id 7BA09C4AF0B; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758910788; bh=Y47BmXQKGcY7pVuayUBb2urB3tQN1uchsdVE/aFIOuk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pt86/lUgJUIXh12EKHP9nb2/CGaVRq1ccohCi7OxQF944mgTDzlpSwy3HEm50NoAT x3QXGsniE8yKEE0+sNJ5wWAIyP+fVpvBiQ4+mT4TcZmUIedUu4mkZvbgV6ql9nLb86 YLSLYLCVpiNtwLbuDTuFkF2Qs0aXlhAtqcTx2/fuh9YbYjZBxLfSW7Uo968WqGZ+1k FPhpMVlbY9HpVCGFbWpdfrtDHaiXyqlNo8L2BmlV3SkJpfsVmaBludrSc/kfuUbSJL w3yXikRARWge6sWunrpvgGWdFoQE/M1AsY61HgLGumxnmEf+APMQjgrSZmeSthnvm+ 9Csmamfyy50QA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B65DCAC5BD; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) From: Frank Li via B4 Relay Date: Fri, 26 Sep 2025 14:19:41 -0400 Subject: [PATCH v4 2/4] usb: dwc3: Add software-managed properties for flattened model Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250926-ls_dma_coherence-v4-2-21e9c6bdb5cb@nxp.com> References: <20250926-ls_dma_coherence-v4-0-21e9c6bdb5cb@nxp.com> In-Reply-To: <20250926-ls_dma_coherence-v4-0-21e9c6bdb5cb@nxp.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thinh Nguyen , Shawn Guo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bjorn.andersson@oss.qualcomm.com, imx@lists.linux.dev, Frank Li , Ze Huang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758910787; l=4644; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=foY7RCWiRMtd/hyGD7tQIhJ37+tlwQcoJoyShx+cdpA=; b=4ZuMRKtOLSVANqLsRHaHl5UTKt5HhOR82FNIgvuL5TsDXCivTvcTVaosT3LQWN/QzeqFtGn2Z 1NsApUMpANKDwXAA7gQTvPhma8qDt9cXw6IngPPw0AlSVIfE/wlPCYG X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-Endpoint-Received: by B4 Relay for Frank.Li@nxp.com/20240130 with auth_id=121 X-Original-From: Frank Li Reply-To: Frank.Li@nxp.com From: Frank Li Add software-managed properties for the flattened model, which does not need to use device tree properties to pass down information to the common DWC3 core. Add 'properties' in dwc3_probe_data and set default values for existing users (dwc3-qcom, dwc3-generic-plat). No functional changes. Signed-off-by: Frank Li Acked-by: Thinh Nguyen --- change in v4 - new patch --- drivers/usb/dwc3/core.c | 12 ++++++++++-- drivers/usb/dwc3/dwc3-generic-plat.c | 1 + drivers/usb/dwc3/dwc3-qcom.c | 1 + drivers/usb/dwc3/glue.h | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 805cd22f42e0961252b0371da9b16cc804e49342..35f9c566358886c106d360dea84= f2e6f1ac19688 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1668,7 +1668,8 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc) dwc3_set_prtcap(dwc, DWC3_GCTL_PRTCAP_DEVICE, true); } =20 -static void dwc3_get_software_properties(struct dwc3 *dwc) +static void dwc3_get_software_properties(struct dwc3 *dwc, + const struct dwc3_properties *properties) { struct device *tmpdev; u16 gsbuscfg0_reqinfo; @@ -1676,6 +1677,12 @@ static void dwc3_get_software_properties(struct dwc3= *dwc) =20 dwc->gsbuscfg0_reqinfo =3D DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED; =20 + if (properties->gsbuscfg0_reqinfo !=3D + DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED) { + dwc->gsbuscfg0_reqinfo =3D properties->gsbuscfg0_reqinfo; + return; + } + /* * Iterate over all parent nodes for finding swnode properties * and non-DT (non-ABI) properties. @@ -2208,7 +2215,7 @@ int dwc3_core_probe(const struct dwc3_probe_data *dat= a) =20 dwc3_get_properties(dwc); =20 - dwc3_get_software_properties(dwc); + dwc3_get_software_properties(dwc, &data->properties); =20 dwc->usb_psy =3D dwc3_get_usb_power_supply(dwc); if (IS_ERR(dwc->usb_psy)) @@ -2358,6 +2365,7 @@ static int dwc3_probe(struct platform_device *pdev) =20 probe_data.dwc =3D dwc; probe_data.res =3D res; + probe_data.properties =3D DWC3_DEFAULT_PROPERTIES; =20 return dwc3_core_probe(&probe_data); } diff --git a/drivers/usb/dwc3/dwc3-generic-plat.c b/drivers/usb/dwc3/dwc3-g= eneric-plat.c index d96b20570002dc619ea813f4d6a8013636a0f346..af95a527dcc27a7a14d38dcc887= f74a888ed91e6 100644 --- a/drivers/usb/dwc3/dwc3-generic-plat.c +++ b/drivers/usb/dwc3/dwc3-generic-plat.c @@ -75,6 +75,7 @@ static int dwc3_generic_probe(struct platform_device *pde= v) probe_data.dwc =3D &dwc3g->dwc; probe_data.res =3D res; probe_data.ignore_clocks_and_resets =3D true; + probe_data.properties =3D DWC3_DEFAULT_PROPERTIES; ret =3D dwc3_core_probe(&probe_data); if (ret) return dev_err_probe(dev, ret, "failed to register DWC3 Core\n"); diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index ded2ca86670c0bd7ceadd3cba3fa5ecf9e7e02b5..9ac75547820d978b4a32e570e5f= 59a2807be68a2 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -704,6 +704,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) probe_data.dwc =3D &qcom->dwc; probe_data.res =3D &res; probe_data.ignore_clocks_and_resets =3D true; + probe_data.properties =3D DWC3_DEFAULT_PROPERTIES; ret =3D dwc3_core_probe(&probe_data); if (ret) { ret =3D dev_err_probe(dev, ret, "failed to register DWC3 Core\n"); diff --git a/drivers/usb/dwc3/glue.h b/drivers/usb/dwc3/glue.h index 2efd00e763be4fc51911f32d43054059e61fb43a..300260e11adecb0e5b581bfe2b6= 1c2c6928e874f 100644 --- a/drivers/usb/dwc3/glue.h +++ b/drivers/usb/dwc3/glue.h @@ -9,17 +9,31 @@ #include #include "core.h" =20 +/** + * dwc3_properties: DWC3 core properties + * @gsbuscfg0_reqinfo: Value to be programmed in the GSBUSCFG0.REQINFO fie= ld + */ +struct dwc3_properties { + u32 gsbuscfg0_reqinfo; +}; + +#define DWC3_DEFAULT_PROPERTIES ((struct dwc3_properties){ \ + .gsbuscfg0_reqinfo =3D DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED, \ + }) + /** * dwc3_probe_data: Initialization parameters passed to dwc3_core_probe() * @dwc: Reference to dwc3 context structure * @res: resource for the DWC3 core mmio region * @ignore_clocks_and_resets: clocks and resets defined for the device sho= uld * be ignored by the DWC3 core, as they are managed by the glue + * @properties: dwc3 software manage propertyies */ struct dwc3_probe_data { struct dwc3 *dwc; struct resource *res; bool ignore_clocks_and_resets; + struct dwc3_properties properties; }; =20 int dwc3_core_probe(const struct dwc3_probe_data *data); --=20 2.34.1 From nobody Wed Oct 1 22:35:18 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC4B52F60CC; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758910789; cv=none; b=FtQzqfO9L7gDbkEyjKsrjEsaoIaeHBnPFP8N1uWhbpXaw4IqCY+OuIJScgFgcCoX4IGylSwHmK0324AI6BF1CeVM6ApYRKnrjKfs8uYbNfL20huKNKlTq/pj26OLcGxYsRv6obn2hq+p1+lr75dZWZgHzyO35xVGIdx0WpuTpbE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758910789; c=relaxed/simple; bh=lYVqTM5HGwA9Xf9f5r70Ei4he25vltCACwgM1SXxA1Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CGmPmvcwjqmd98ZtCnjlfacNgjqGdEMMfMZvNcaoudl9BwklAJV5QwcM6A8+e8wh4lCogJ1X2GI57WgZCm17RTNOLl3Y3bRCkrNe3XxWOSG2RhmQDHgMbu+XZrA4J8CoGPVomxxow2eh929QO7bOGTutRisW0xxioCP9jFcAyh4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D8RvxJGN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D8RvxJGN" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8F05DC4CEF7; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758910788; bh=lYVqTM5HGwA9Xf9f5r70Ei4he25vltCACwgM1SXxA1Y=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=D8RvxJGN2EJb8fp2WswI1IxOP/pZOwR9SpLXITBjUXoKPP0zF7zYV7w/EFCmj09P7 SQo6pIc6LRr7CVALcT2z9Wzp6XC17QPLKSQoTdfPeHnPXhx7wtu81Lck0p2H1AwoKF bDeE/ho2zKA4IyvMvLwgIuKeBG5CnpgCpQGOcHPPQuiFZ1PyOWWgUyfd2BPi5Q6iJe aHJe7bon7UjqbdCNcM8vH0V6jTZGWjbbqtHGz0sBOzmJq/7vk4hlZcpowEPTQEl93O ukg9iyFr0pEUQs1m/hKVC1iWpjZFLj3RXpKsIG0d5hJcSJQhsZMGDjVxiNFMjMhCXZ 8ujOt5mgX6rxA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C188CAC5BE; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) From: Frank Li via B4 Relay Date: Fri, 26 Sep 2025 14:19:42 -0400 Subject: [PATCH v4 3/4] usb: dwc3: dwc3-generic-plat: Add layerscape dwc3 support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250926-ls_dma_coherence-v4-3-21e9c6bdb5cb@nxp.com> References: <20250926-ls_dma_coherence-v4-0-21e9c6bdb5cb@nxp.com> In-Reply-To: <20250926-ls_dma_coherence-v4-0-21e9c6bdb5cb@nxp.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thinh Nguyen , Shawn Guo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bjorn.andersson@oss.qualcomm.com, imx@lists.linux.dev, Frank Li , Ze Huang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758910787; l=2222; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=x/YV7GviRuKrxoFTMOltiDCmXq8scFHKV8v3SyDackg=; b=zZv6x5+g8lfoX1KRaaggYbBkew2o/+XvY0hrd96Jjw8UPPJxQY0NRQWt4cPlSUCLsW32ifK71 nSDr3kZJ75IA3vYcn4qGZcMwlwp0IBo4XbvweePGgD892OhcCvN/iaI X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-Endpoint-Received: by B4 Relay for Frank.Li@nxp.com/20240130 with auth_id=121 X-Original-From: Frank Li Reply-To: Frank.Li@nxp.com From: Frank Li 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 --- chagne in v4 - rename gsbuscfg0 to gsbuscfg0_reqinfo - use flatten core's properties. change in v3 (skipped) --- drivers/usb/dwc3/dwc3-generic-plat.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-generic-plat.c b/drivers/usb/dwc3/dwc3-g= eneric-plat.c index af95a527dcc27a7a14d38dcc887f74a888ed91e6..cfcefeffd7ad6c0a21ccc9aaa44= 83b9acb9dc4e0 100644 --- a/drivers/usb/dwc3/dwc3-generic-plat.c +++ b/drivers/usb/dwc3/dwc3-generic-plat.c @@ -8,6 +8,7 @@ */ =20 #include +#include #include #include #include "glue.h" @@ -29,6 +30,7 @@ static void dwc3_generic_reset_control_assert(void *data) =20 static int dwc3_generic_probe(struct platform_device *pdev) { + const struct dwc3_properties *properties; struct dwc3_probe_data probe_data =3D {}; struct device *dev =3D &pdev->dev; struct dwc3_generic *dwc3g; @@ -75,7 +77,13 @@ static int dwc3_generic_probe(struct platform_device *pd= ev) probe_data.dwc =3D &dwc3g->dwc; probe_data.res =3D res; probe_data.ignore_clocks_and_resets =3D true; - probe_data.properties =3D DWC3_DEFAULT_PROPERTIES; + + properties =3D of_device_get_match_data(dev); + if (of_dma_is_coherent(pdev->dev.of_node) && properties) + probe_data.properties =3D *properties; + else + probe_data.properties =3D DWC3_DEFAULT_PROPERTIES; + ret =3D dwc3_core_probe(&probe_data); if (ret) return dev_err_probe(dev, ret, "failed to register DWC3 Core\n"); @@ -146,8 +154,13 @@ static const struct dev_pm_ops dwc3_generic_dev_pm_ops= =3D { dwc3_generic_runtime_idle) }; =20 +static const struct dwc3_properties fsl_ls1028_dwc3 =3D { + .gsbuscfg0_reqinfo =3D 0x2222, +}; + static const struct of_device_id dwc3_generic_of_match[] =3D { { .compatible =3D "spacemit,k1-dwc3", }, + { .compatible =3D "fsl,ls1028a-dwc3", &fsl_ls1028_dwc3}, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, dwc3_generic_of_match); --=20 2.34.1 From nobody Wed Oct 1 22:35:18 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC3EC27A931; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758910789; cv=none; b=A8OMI/MtTJSbqTmB6XqucE6Z2tjAnoSjAw5+Oh4qQpts5IEFx/2lHEuqBxbe9fcuWGOfWZbE/KbY1erDxd021QXsBfVJutwAbmH38dsIP8lPSzePzdQGfM5oMiiuSwGIPZ+M4VIlRH3IT3Sw+XxKgbrJuEtNExTqpaPPpWV3Cts= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758910789; c=relaxed/simple; bh=sm6pk3CdQrw44U2GOQJ7ecMtffanxNcl0ayW6p8ibWQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ENQp6TuQKr6UIwXw36uFL4po+dMzw5y+rpzCKB5/hbouCbuMfke2HJzInLjOcvU3W+HMx3h5cxQjxTGwrR+uAsvcNItxSLwhWPMKmT263sDo3LRk2L3tWH0+YOQGdTNe7bGhBANdP6oE0eUss4W+lYFh7fVEaw7Tl6hnxm5FtKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W7qk1OZa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W7qk1OZa" Received: by smtp.kernel.org (Postfix) with ESMTPS id 9C5F2C113CF; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1758910788; bh=sm6pk3CdQrw44U2GOQJ7ecMtffanxNcl0ayW6p8ibWQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=W7qk1OZaaWme7MPrEnSHLc57hBBoK5kRFT2R0Z6Zgh2YDNWADeocsEDUju0YKl+Lb pD08+W3Bst7G45EsJCcZXelR8bb7fRJC0/ggI3gmf/Lh6+5IkPHUxKlL3YuZyJEa8L KJVR/GNIQX/TFm5obTc3RBxoPm58StM8sj23XT3mxsjjgeKo7KVROs/HHWX7WkF9OW kRtj6DF+BiiDrxYZTVaGTL6Lqg1osCXscw1c81kWKfpKz6RtwblXetDFPv1Hfe+g6q Rs7dsFotjhn5k5EXaVhUxO25tOx6SuNB1rBLvj2vP9qL6E7SEckqIHwRWLYIzXpeSY FMmO05Pno4O8w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BF8CCAC5BB; Fri, 26 Sep 2025 18:19:48 +0000 (UTC) From: Frank Li via B4 Relay Date: Fri, 26 Sep 2025 14:19:43 -0400 Subject: [PATCH v4 4/4] arm64: dts: layerscape: add dma-coherent for usb node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250926-ls_dma_coherence-v4-4-21e9c6bdb5cb@nxp.com> References: <20250926-ls_dma_coherence-v4-0-21e9c6bdb5cb@nxp.com> In-Reply-To: <20250926-ls_dma_coherence-v4-0-21e9c6bdb5cb@nxp.com> To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Thinh Nguyen , Shawn Guo Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, bjorn.andersson@oss.qualcomm.com, imx@lists.linux.dev, Frank Li , Ze Huang X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1758910787; l=8726; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=3lvyIi6EPuFI5jSKT6nJyBbhpNULKOOS4uIt6qtJysI=; b=leGYfUfAQDlehredD7ypAlfeodCvH+h1hzmW0R6jOyeA4ftCQip3BgvkhsWNIW0p6DCmMpb0u RzTx4OEwQqLBnUVKwzKc7g3Cwnz9IGxXL0CpM8q8RLyQduJD34Nh/Ox X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-Endpoint-Received: by B4 Relay for Frank.Li@nxp.com/20240130 with auth_id=121 X-Original-From: Frank Li Reply-To: Frank.Li@nxp.com From: Frank Li Add SOC special compatible string, remove fallback snps,dwc3 to let flatten dwc3-layerscape driver to be probed and enable dma-coherence for usb node since commit add layerscape dwc3 support, which set correct gsbustcfg0 value. Add iommus property to run at old uboot, which use fixup add iommus by check compatible string snsp,dwc3 compatible string. Signed-off-by: Frank Li --- change in v3 - v4 - none --- arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 3 ++- arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 8 ++++++-- arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi | 9 ++++++--- arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 9 ++++++--- arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 8 ++++++-- arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi | 8 ++++++-- 6 files changed, 32 insertions(+), 13 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi b/arch/arm64/bo= ot/dts/freescale/fsl-ls1012a.dtsi index fc3e138077b86cd5e3cf95c3d336cb3c6e1c45ef..ef80bf6a604f475c670e2d626a7= 27e94fcb2a17a 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi @@ -493,10 +493,11 @@ QORIQ_CLK_PLL_DIV(4)>, }; =20 usb0: usb@2f00000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1012a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x2f00000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi b/arch/arm64/bo= ot/dts/freescale/fsl-ls1028a.dtsi index 7d172d7e5737c4b6e42ee88676c5763fa7415260..e7f9c9319319a69d8c70d1e2644= 6b899c3599f95 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi @@ -613,9 +613,11 @@ gpio3: gpio@2320000 { }; =20 usb0: usb@3100000 { - compatible =3D "fsl,ls1028a-dwc3", "snps,dwc3"; + compatible =3D "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3100000 0x0 0x10000>; interrupts =3D ; + iommus =3D <&smmu 1>; + dma-coherent; snps,dis_rxdet_inp3_quirk; snps,quirk-frame-length-adjustment =3D <0x20>; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; @@ -623,9 +625,11 @@ usb0: usb@3100000 { }; =20 usb1: usb@3110000 { - compatible =3D "fsl,ls1028a-dwc3", "snps,dwc3"; + compatible =3D "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3110000 0x0 0x10000>; interrupts =3D ; + iommus =3D <&smmu 2>; + dma-coherent; snps,dis_rxdet_inp3_quirk; snps,quirk-frame-length-adjustment =3D <0x20>; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/bo= ot/dts/freescale/fsl-ls1043a.dtsi index 73315c51703943d9ee5e1aa300c388ff6482423f..50d9b03a284a2aa4e13aa3323c2= 5bbc5fe08f3d0 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi @@ -833,10 +833,11 @@ aux_bus: bus { dma-ranges =3D <0x0 0x0 0x0 0x0 0x100 0x00000000>; =20 usb0: usb@2f00000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1043a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x2f00000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; usb3-lpm-capable; @@ -845,10 +846,11 @@ usb0: usb@2f00000 { }; =20 usb1: usb@3000000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1043a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3000000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; usb3-lpm-capable; @@ -857,10 +859,11 @@ usb1: usb@3000000 { }; =20 usb2: usb@3100000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1043a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3100000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; usb3-lpm-capable; diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/bo= ot/dts/freescale/fsl-ls1046a.dtsi index 770d91ef0310d971d044a1f55cc5e2cb738acc47..22173d69713d1bd2abca986e766= 68ad437dd34e4 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi @@ -749,10 +749,11 @@ aux_bus: bus { dma-ranges =3D <0x0 0x0 0x0 0x0 0x100 0x00000000>; =20 usb0: usb@2f00000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1046a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x2f00000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; @@ -760,10 +761,11 @@ usb0: usb@2f00000 { }; =20 usb1: usb@3000000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1046a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3000000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; @@ -771,10 +773,11 @@ usb1: usb@3000000 { }; =20 usb2: usb@3100000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1046a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3100000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/bo= ot/dts/freescale/fsl-ls1088a.dtsi index 9d5726378aa015eff10578bf095908a58b9d9eee..b2f6cd237be046123de9342e216= 7aa32248a8a16 100644 --- a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi @@ -489,10 +489,12 @@ esdhc: mmc@2140000 { }; =20 usb0: usb@3100000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1088a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3100000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + iommus =3D <&smmu 1>; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; @@ -500,10 +502,12 @@ usb0: usb@3100000 { }; =20 usb1: usb@3110000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,ls1088a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3110000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; + iommus =3D <&smmu 2>; + dma-coherent; snps,quirk-frame-length-adjustment =3D <0x20>; snps,dis_rxdet_inp3_quirk; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; diff --git a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi b/arch/arm64/bo= ot/dts/freescale/fsl-lx2160a.dtsi index c9541403bcd8239a48d4ef79c7c4f9e3b607b556..d899c0355e51dd457a4e7259709= cea98a488f557 100644 --- a/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi +++ b/arch/arm64/boot/dts/freescale/fsl-lx2160a.dtsi @@ -1094,24 +1094,28 @@ ftm_alarm0: rtc@2800000 { }; =20 usb0: usb@3100000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,lx2160a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3100000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; snps,quirk-frame-length-adjustment =3D <0x20>; usb3-lpm-capable; + iommus =3D <&smmu 1>; + dma-coherent; snps,dis_rxdet_inp3_quirk; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; status =3D "disabled"; }; =20 usb1: usb@3110000 { - compatible =3D "snps,dwc3"; + compatible =3D "fsl,lx2160a-dwc3", "fsl,ls1028a-dwc3"; reg =3D <0x0 0x3110000 0x0 0x10000>; interrupts =3D ; dr_mode =3D "host"; snps,quirk-frame-length-adjustment =3D <0x20>; usb3-lpm-capable; + iommus =3D <&smmu 2>; + dma-coherent; snps,dis_rxdet_inp3_quirk; snps,incr-burst-type-adjustment =3D <1>, <4>, <8>, <16>; status =3D "disabled"; --=20 2.34.1