From nobody Wed Apr 1 09:48:06 2026 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11011024.outbound.protection.outlook.com [52.101.62.24]) (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 CB1EA1E8320; Mon, 30 Mar 2026 19:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.24 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774897409; cv=fail; b=tRjrFasPxr9tU/KxSM9d+leVtIIOfDIsTJy/aJUoT4fKgAyK+abycAVg4QMn2k2iZ1xxSEPonPuotv6+I+mtSLwS3I5ybcWcZEcQE5z3yxf7IUYTxiSLRPYbrqv5oWieTA2Ah67wXGQogHSIhu784lLhsgBZ71ZSfr2OSiBq+d0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774897409; c=relaxed/simple; bh=GInqhSjoSHcI54yLOj+I81FLDhZPDjcBIkLugRul7wc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Avt8q5vK6OiOfwfra/99k1lx1A+AgzD0dRLKalCXPQzhAEe4oIQ7/dgEb1QeruK851QLerTmM/BNIPwdFd0ZxJKcq7WRvheXdVrHjH2MwGmsqa1EJKQwXJ/Kt/V829/n46SUv013MVOHpMvkAOpWDfFK75YkmMvYdr1UwaOftTg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ZnzBQu+J; arc=fail smtp.client-ip=52.101.62.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ZnzBQu+J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IdG2XZ5P/TWWBVyN7MTGp6SCscycrD1k5OAHc11aJynBkS5uuUHdFu3w2bnBGgWUw0ry5l31VeBtVchqPSrPwHVWcFKyQQjLzN5d31xIz5Gcyvult25dGdSfsdUNV9cR4rQUUyvM95tJUSiNuCRusZ+4BOUlFGNGYCPo1/o1bL8fOnC+kbNZ64Kr9qNc6TOFjPTqQtnV2B/iXbXlC7+VU3NHQTmsZKAgIifqAKR6ays7S+ziI0IsCq86wjJmFPCo63AZiW4jgp+J7nx10Csu81u4Eww9qNZj3RU34bJZQL3Kgb80kRxjmTqNCN+Bl/j1Zt7lIorRvWahk7HCPqOFLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OIe3YeRpKPz7xGobM3LJTVOQYxBT7tQR2DBNsHDoPiQ=; b=H9Y6mniJ8+vXj8XBjbrz1uQY1T8FqRkUdfv5opBJXEO3OXBRe8iSpypZBl/jitrcM3/5ijNZ6t2o6++9E6BW9Lpii0fbFsNa1updwUFlE00kw2ITQ7ounFh0BEcjIMX1OMZ++/3kTGNiDXZyas7kMsq97nvu+zcu0howT5P7y1z4OJCVF8HJdeER16PIvNcMwV1t8U3QfuZw6xurqW5wOyvTCH1ROoqQeNGOrIeBJa4aUCJF9sN3LXOS8qi8Zaxhp3JQETFS3pu61jz5lywzwuyxQP3vfoSqzeRLh6HXY9O/zT4TcbBYUxGZwh9CZCcYVVthnjiH4iAQ7PN8zdmMBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OIe3YeRpKPz7xGobM3LJTVOQYxBT7tQR2DBNsHDoPiQ=; b=ZnzBQu+JB4rgvb1cQ8QkEisJFooOrRbha67NwR2FIrtbXyfcfpI4R3wIvolQzJe+gDWMUdMzbMRktfkQlQnKWaVUgn392LQRck79KTKaMNbzVkMYUgXbvNACk2aMN/odm8nFJnQWzZFdxq5IoSgccEJ83v3z0+b4SRpVj4bfXwc= Received: from SJ0PR03CA0065.namprd03.prod.outlook.com (2603:10b6:a03:331::10) by PH7PR12MB6884.namprd12.prod.outlook.com (2603:10b6:510:1ba::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Mon, 30 Mar 2026 19:03:22 +0000 Received: from SJ5PEPF000001CA.namprd05.prod.outlook.com (2603:10b6:a03:331:cafe::50) by SJ0PR03CA0065.outlook.office365.com (2603:10b6:a03:331::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.28 via Frontend Transport; Mon, 30 Mar 2026 19:03:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ5PEPF000001CA.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Mon, 30 Mar 2026 19:03:22 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.17; Mon, 30 Mar 2026 14:03:21 -0500 Received: from satlexmb08.amd.com (10.181.42.217) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 30 Mar 2026 14:03:19 -0500 Received: from xhdradheys41.xilinx.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Mon, 30 Mar 2026 14:03:16 -0500 From: Radhey Shyam Pandey To: , , , , , , CC: , , , , , Radhey Shyam Pandey Subject: [PATCH v2 1/4] dt-bindings: usb: dwc3-xilinx: Add MMI USB support on Versal Gen2 platform Date: Tue, 31 Mar 2026 00:33:01 +0530 Message-ID: <20260330190304.1841593-2-radhey.shyam.pandey@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260330190304.1841593-1-radhey.shyam.pandey@amd.com> References: <20260330190304.1841593-1-radhey.shyam.pandey@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: radhey.shyam.pandey@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CA:EE_|PH7PR12MB6884:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e1ae28e-3e3c-4cb3-1fa3-08de8e8f03c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700016|7416014|1800799024|18002099003|22082099003|56012099003; X-Microsoft-Antispam-Message-Info: QE+hGPu5wHov/XqgiyPMNP5Sn/I6/vxPcf/+5EEC6NtMpC0RjnIPU9nVR1MgsxY5QKxoPjtIFEVrVVEhlufMHRV9GtrJYesA72KhiQnWjj5r773ybNCKuNfMNsKT0hNaSZewmHrKLBWS8qHQw7UacqJyL7ow5DuwOSUaqdQ+WxOGu6+h3Q+0B6Y3INXZdXNSaFIAuRhl//jP7A8WvSKv0F/dLYUx8wVGLaqVCzI4D4PZH2zwd5AhRhh1XHdo+ct9XlOk0TxtxZoM1yeCFHRCDi6nwfrVTeH+AEPm7P6Vt0scN7SKaVVvjI5Dw5GwPKZu2f/qveEVaqH2Uz9kRWx3ApNopM0uORWZWjcVDQvrhw8CiAkQK2ZNFmLnUFzDoq/nyubiQakDdaVTF8STXQl0qaEOYxs9lkvH4MVhSm3J/vbF5/78HIaZP8XNlN2oJz0WzepdkPZhYq004AGgPMqNTNjaCgA5AyYCUMYWsfKAb3f5pVMvSFae1OejcAbAgedzW8c90FdEUMvTahrn40WHgEpaF44/3iKEi52uoT+BbXp2yidpW/W3A5BtfvSiWTGibyWyN6UdMFSwDjBN9HjnGEwzZSmGM6pMzj1Vwh4whiNt9p9S3arxigrJuDAjcyUBUux4DX9Ul9e1tNLKigeOlmrlpffOOw855wTVur+ri9H8K1M9EEoDRbEbn8guiXgX4YeXlYd3MLY/fM5Jug+bUZgZfw2SQOJDA6Wn+hdikFysA8T3bF69DFCgBa/1tkxSC2A+ntZw5Arpl6O+J+CpjA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700016)(7416014)(1800799024)(18002099003)(22082099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HNic2G6Z86+/8jLXdNCgnh+9j5mht3l6WzwCnDhO5BiNYRd8VM0Em4ClZKhYn5PntYtvNoaPqqwr9NTv/wl+2YMr8g0jMLE2xUaMPX1ILVZfhG46AXNhKiWcqD47UhBPh3PB273mJAEBbrb5SZHz04XkINDiB+ibGGVMdS2FSO/nX+ZzSDAcj5JD1g+DLQFI1nshR+nPh1QsiMOMv2e4jcDw62WVgemq6OJVF+tlAzpvtsOpWxZNMT+jRpqZynRaBTdD/IFyUrOiMTcwqkSvBz90klNk2Krmd71SnOQCnzpLhBkdSuLRFM3j4Qa8tODLSHBFRZbom1L1iRcxh1w+MPBi5SeLocDZzk1JRtlQLyUkhYA+7XKExUFQWSSelV1lReLDxTrejU0w4N0sn0u1SihW6dQRZvcJ123Yv+e6fnXlBG98jJLcosdRHkKGlpbf X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2026 19:03:22.6993 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e1ae28e-3e3c-4cb3-1fa3-08de8e8f03c8 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6884 Content-Type: text/plain; charset="utf-8" Versal Gen2 platform multimedia integrated (MMI) module has a USB3.2 Gen 2x1 Dual Role Device IP. Introduce a new compatibility string to support it. The USB wrapper registers reside in the MMI UDH system-level control registers (SLCR) block, so instead of a dedicated reg property, add xlnx,usb-syscon phandle with four cells specifying register offsets for USB2 PHY, USB3 PHY, USB DRD, and USB power configuration within the SLCR. Signed-off-by: Radhey Shyam Pandey --- Changes for v2: - Add blank line after compatible as suggested by Krzysztof. - Retain the mmi suffix in the compatible string, as this USB 3.2 Gen2 IP from Synopsys is part of the dedicated Multimedia Interface. The Versal Gen2 platform also includes a separate USB 2.0 controller, and the mmi suffix uniquely distinguishes between the two USB controllers. MMI is an independent subsystem particularly targeted for deployment in Multi-Media related applications. The MMI block include following submodules: UDH: USB3.2 Gen 2x1 Dual Role Device, DisplayPort Transmit Controller, Security Module (ESM) for DisplayPort and HDMI Controllers, DP AUX-I2C PHY. - For MMI USB define parent address space i.e UDH block. - Fix inconsistent MHz spacing to use SI convention with spaces. - Move description before $ref and items in xlnx,usb-syscon property. - Restore original zynqmp-dwc3 example, add new versal2-mmi-dwc3 example. - Use 'usb' node name (without unit address) for versal2 example since it has no reg property. - Use 1/1 address/size configuration in versal2 example, use lowercase hex in syscon offsets. --- .../devicetree/bindings/usb/dwc3-xilinx.yaml | 70 ++++++++++++++++++- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml b/Docum= entation/devicetree/bindings/usb/dwc3-xilinx.yaml index d6823ef5f9a7..5e31b961aff7 100644 --- a/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml +++ b/Documentation/devicetree/bindings/usb/dwc3-xilinx.yaml @@ -15,6 +15,8 @@ properties: - enum: - xlnx,zynqmp-dwc3 - xlnx,versal-dwc3 + - xlnx,versal2-mmi-dwc3 + reg: maxItems: 1 =20 @@ -37,8 +39,9 @@ properties: A list of phandle and clock-specifier pairs for the clocks listed in clock-names. items: - - description: Master/Core clock, has to be >=3D 125 MHz - for SS operation and >=3D 60MHz for HS operation. + - description: Master/Core clock, has to be >=3D 156.25 MHz in SSP + mode, >=3D 125 MHz for SS operation and >=3D 60 MHz for HS + operation. - description: Clock source to core during PHY power down. =20 clock-names: @@ -79,6 +82,20 @@ properties: description: GPIO used for the reset ulpi-phy maxItems: 1 =20 + xlnx,usb-syscon: + description: + Phandle to the MMI UDH system-level control register (SLCR) syscon + node, with four cells specifying the register offsets for USB2 PHY, + USB3 PHY, USB DRD, and USB power configuration respectively. + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to MMI UDH SLCR syscon node + - description: USB2 PHY register offset within SLCR + - description: USB3 PHY register offset within SLCR + - description: USB DRD register offset within SLCR + - description: USB power register offset within SLCR + # Required child node: =20 patternProperties: @@ -87,7 +104,6 @@ patternProperties: =20 required: - compatible - - reg - "#address-cells" - "#size-cells" - ranges @@ -104,6 +120,7 @@ allOf: contains: enum: - xlnx,versal-dwc3 + - xlnx,versal2-mmi-dwc3 then: properties: resets: @@ -117,6 +134,26 @@ allOf: reset-names: minItems: 3 =20 + - if: + properties: + compatible: + contains: + enum: + - xlnx,zynqmp-dwc3 + - xlnx,versal-dwc3 + then: + required: + - reg + + - if: + properties: + compatible: + contains: + const: xlnx,versal2-mmi-dwc3 + then: + required: + - xlnx,usb-syscon + additionalProperties: false =20 examples: @@ -156,3 +193,30 @@ examples: }; }; }; + - | + #include + #include + #include + usb { + #address-cells =3D <1>; + #size-cells =3D <1>; + compatible =3D "xlnx,versal2-mmi-dwc3"; + clocks =3D <&zynqmp_clk 32>, <&zynqmp_clk 34>; + clock-names =3D "bus_clk", "ref_clk"; + power-domains =3D <&zynqmp_firmware PD_USB_0>; + resets =3D <&zynqmp_reset ZYNQMP_RESET_USB1_CORERESET>; + reset-names =3D "usb_crst"; + phys =3D <&psgtr 2 PHY_TYPE_USB3 0 2>; + phy-names =3D "usb3-phy"; + xlnx,usb-syscon =3D <&udh_slcr 0x005c 0x0070 0x00c4 0x00f8>; + ranges; + + usb@fe200000 { + compatible =3D "snps,dwc3"; + reg =3D <0xfe200000 0x40000>; + interrupt-names =3D "host", "otg"; + interrupts =3D <0 65 4>, <0 69 4>; + dr_mode =3D "host"; + dma-coherent; + }; + }; --=20 2.43.0 From nobody Wed Apr 1 09:48:06 2026 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011013.outbound.protection.outlook.com [52.101.52.13]) (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 ADB392C21D0; Mon, 30 Mar 2026 19:03:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.52.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774897413; cv=fail; b=crF7wDvCyT2SA60YUxVL3y9jdP4PPqjVSTmw6joqt83GVv48BgziwUp2pSmP2/cTf9yM6JiRp/GB1xlFOuxL7xPXtecd8HcZ+IjAjuVN0mptrxymyg1RHi9OfbGdQniucqLQrda80Bmdzbuf8jKyUrnCyNZJWvxxq3OHCSixGkY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774897413; c=relaxed/simple; bh=xBPggGNMdiLnypBQGe+xcJFXEii+OVcD6Uuhauf5Kr4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PAcEZNqtobSwzCp5+hqpsa3XYaKcmBpX+aEsRu7hYr1nuKmZI/+yXfN/fMNLbzwZ9OdDhCuhkAbRBkYM/RcueQsJOeMIuwzVxAnWtm8f5DIppDBwEfB2TLn3G4+Ub5ZBZUjXVZfM9Y1Gcg4QsSlgO2nUnB/SPhUm6kXIiIet0xw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Z4ebTpj4; arc=fail smtp.client-ip=52.101.52.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Z4ebTpj4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Zuu+n4ltUg78Qusm8u+cYaRqF8QQoHUS/9s0KK8AKa5TDo5EDSYgSehu0v4KXQUKE9ri9MNqPjSbkRCORlT7p0icMwv0YepWOkHwU0KZ0Pjsk4y7/SXp7Dv4VONs+hoSfaRp1QYkzssys5tIx1RwYsVjheTrCAtkR9eqoiyaP08JHRH5gTt4tFGlgwqmOQeY/4E7EvjxeRXn4pWK2U6Zswm8KAjeIwtsoGxmf00gkHB/7A1Ykt6aV6Flo4VuczpmHQleFsyyZEFGR3G5kHka4absHMLi6/mPHu2kplnAJr+pzXHERCmtfXotUQD7t3uhUMbEy2Mr6EG53gLSVTrhXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yUpBIcHcTeVFOavUv/A92xychCX0F2lmdoJrnrbc6VM=; b=BThRQ+EhnwIPYB8YWCYmwb/Jw32pD6U4lDEwqzMBlpOjVy4YujoDl9wtxwU+rK1BcV12kP2O0FlrMgoE5fJ0FNdbj6ugJNPNmowf9MHJd7Y2NgfeWNM8mIfKNaE3lltUYmedx3kgnDRP4WTSAT9Ey0eK4TbrCQ7W1jHNuUX2fbLShTwdrxE+wa+RaUVq9J/1mb1Tk9qaFRFZ92giBHEvSnCr5J0HbJFHNbuS4zDA1xGaP1hnH9t2TJ9ZE5tqqMZuwdyTo329zo7Fdt5z+83vHvgUIqHSdS9X9hknKGrUjvxcS2U+6jWusB3y04JY0Ua2VecDRPP57ed5SxH9RqMtdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yUpBIcHcTeVFOavUv/A92xychCX0F2lmdoJrnrbc6VM=; b=Z4ebTpj4gVNEjI7hDKuWN/T7Pu5w7CwdK8VSsgy7hG6x4SaxAnIWHiTM/2gPDCEgySSaopeJqRFSXwJSiadW73Hd5Fv58ON9P33wyczhNzCFXrku0vKPQQlvgWjNbyMlGbFXbp7ZvYugPhE+M5jCtsqmCAW0iLedJgFaL221Ffg= Received: from BLAPR03CA0109.namprd03.prod.outlook.com (2603:10b6:208:32a::24) by MW4PR12MB5642.namprd12.prod.outlook.com (2603:10b6:303:187::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Mon, 30 Mar 2026 19:03:25 +0000 Received: from BL02EPF0001A106.namprd05.prod.outlook.com (2603:10b6:208:32a:cafe::36) by BLAPR03CA0109.outlook.office365.com (2603:10b6:208:32a::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.28 via Frontend Transport; Mon, 30 Mar 2026 19:03:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by BL02EPF0001A106.mail.protection.outlook.com (10.167.241.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Mon, 30 Mar 2026 19:03:24 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.17; Mon, 30 Mar 2026 14:03:24 -0500 Received: from satlexmb08.amd.com (10.181.42.217) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 30 Mar 2026 14:03:23 -0500 Received: from xhdradheys41.xilinx.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Mon, 30 Mar 2026 14:03:20 -0500 From: Radhey Shyam Pandey To: , , , , , , CC: , , , , , Radhey Shyam Pandey Subject: [PATCH v2 2/4] usb: dwc3: xilinx: Introduce dwc3_xlnx_config for per-platform data Date: Tue, 31 Mar 2026 00:33:02 +0530 Message-ID: <20260330190304.1841593-3-radhey.shyam.pandey@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260330190304.1841593-1-radhey.shyam.pandey@amd.com> References: <20260330190304.1841593-1-radhey.shyam.pandey@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: None (SATLEXMB04.amd.com: radhey.shyam.pandey@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A106:EE_|MW4PR12MB5642:EE_ X-MS-Office365-Filtering-Correlation-Id: 9216567d-ecc5-48ea-a3d0-08de8e8f051a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|7416014|36860700016|1800799024|56012099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: Q/GPcoUJbPjgtobti3vG+n7TYI2UWSVl8VKd1gNe9+hYu2OjYLXQUNmkDI+i9ttZ4sQxc6br2EbiT7fFXV7g0PEo7FFJoFw55IOOmj3Zv/bnkE0PqUTybKq7KAewg9iyrc8AY+LK7HffYLy1v0DpcFonYioyBLtyG7ttlIHFWlOz7JrPOF4nHCOqARJdm4gFhi/GrtXNBrKBRulPgBciZ7cxPhxzBGM5gnqix2rSfXADJ2ougmkgqwd3iWt/wObWJOYnB1HWxqSXFBX4oNfwvh//LJ5l8srLm8R6osCZ2F5/b8YS/Vh5YO0IsDdVVqnfgRat4P6UQHyeCqdmQu3pa7neLW+VFPI4Z8TgMNCLAknzVFl19GF+K62UxjKvaxqD0RB/a2Om9AO1iBHa8Jd5z84rGP9qKRJD4Z+T9Lc3VVBUTy8oAf5liWDXwBrlV8Fxv7BNkSq1WvymZX2vhR7PPzo3JB/QFgNQRfN2Pol5uSMw46aO8kZA8X1yb9FVLaYrGtZKdfcWPv0Bnx9JRLAkSCKYcmazMfVual7kBuSOWvrPSp0J+I82j7w8tL5yZf5W/cUYKGyaMs5IdzwNnxVee/1DLt57y6aAVEDH20uWDk0cZYgHObZIVisCiygkGiNHHXWglfx7+J5NRz+Xxw5O4ECc76I6LwQQ0Pd/PahFQBNMh5hPxZroAKC5MU9yU+2oJu9RLulTHpxx+XC7Y89iMp+dVUYBSWhhOHvi0vECYE4VMaTE8RwTUNHwTj+MOeqEASLbxf63J2MwhXh/432rkA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(7416014)(36860700016)(1800799024)(56012099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tnYQHmWQOfySXRMnAOgBqCyKaclExl7luV4aBl1INwT8SKjLAwRCV1fTLMrcrU+aCOPZSgF2PSHf/mGrNU6hSp5AtjI0D6zhseUKDiVTzMr+yn8UD1ZEnBhG3mRSw+RaYhz1j+4HMhHN9LzIbT1gYbv4ZJAwm5VoJx0vdUUzP2DpP2nj1XtZcX2OmfI7YyfdBWZPCfioCE17O5jx/+9vMFSQtaviJE5P6gLJ+w+pIylToixSYXyi8cE+Nsg2ihdV0X2Y+0ca8N+NdZJSON5JBFbJU5/8YET+vcabfpkaH5xgHmAitNMCTGkycYK1GlyLN280rcJtwxaSrDSP6EDclwxOAdQQoqi03wP65spRMJLV5cOj/eP07rMQeq6rVeTj6SVrviHlQGtl7pVyAbMnxb8D3K/TzaAj+eyxD7ipGpSIabyLKUWgpoDyokJxG2I7 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2026 19:03:24.9833 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9216567d-ecc5-48ea-a3d0-08de8e8f051a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A106.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB5642 Content-Type: text/plain; charset="utf-8" Replace the direct pltfm_init function pointer in struct dwc3_xlnx with a const pointer to a new struct dwc3_xlnx_config. This groups per-platform configuration in one place and allows future patches to add platform-specific fields (e.g. tx_deemph) without growing dwc3_xlnx. While at it, switch from of_match_node() to device_get_match_data() to simplify the match data lookup. Signed-off-by: Radhey Shyam Pandey --- Changes for v2: - New patch, split from "Add Versal2 MMI USB 3.2 controller support". - Use device_get_match_data() instead of of_match_node(). --- drivers/usb/dwc3/dwc3-xilinx.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c index f41b0da5e89d..bb59b56726e7 100644 --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -41,12 +42,18 @@ #define XLNX_USB_FPD_POWER_PRSNT 0x80 #define FPD_POWER_PRSNT_OPTION BIT(0) =20 +struct dwc3_xlnx; + +struct dwc3_xlnx_config { + int (*pltfm_init)(struct dwc3_xlnx *data); +}; + struct dwc3_xlnx { int num_clocks; struct clk_bulk_data *clks; struct device *dev; void __iomem *regs; - int (*pltfm_init)(struct dwc3_xlnx *data); + const struct dwc3_xlnx_config *dwc3_config; struct phy *usb3_phy; }; =20 @@ -241,14 +248,22 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *pr= iv_data) return ret; } =20 +static const struct dwc3_xlnx_config zynqmp_config =3D { + .pltfm_init =3D dwc3_xlnx_init_zynqmp, +}; + +static const struct dwc3_xlnx_config versal_config =3D { + .pltfm_init =3D dwc3_xlnx_init_versal, +}; + static const struct of_device_id dwc3_xlnx_of_match[] =3D { { .compatible =3D "xlnx,zynqmp-dwc3", - .data =3D &dwc3_xlnx_init_zynqmp, + .data =3D &zynqmp_config, }, { .compatible =3D "xlnx,versal-dwc3", - .data =3D &dwc3_xlnx_init_versal, + .data =3D &versal_config, }, { /* Sentinel */ } }; @@ -284,7 +299,6 @@ static int dwc3_xlnx_probe(struct platform_device *pdev) struct dwc3_xlnx *priv_data; struct device *dev =3D &pdev->dev; struct device_node *np =3D dev->of_node; - const struct of_device_id *match; void __iomem *regs; int ret; =20 @@ -296,9 +310,7 @@ static int dwc3_xlnx_probe(struct platform_device *pdev) if (IS_ERR(regs)) return dev_err_probe(dev, PTR_ERR(regs), "failed to map registers\n"); =20 - match =3D of_match_node(dwc3_xlnx_of_match, pdev->dev.of_node); - - priv_data->pltfm_init =3D match->data; + priv_data->dwc3_config =3D device_get_match_data(dev); priv_data->regs =3D regs; priv_data->dev =3D dev; =20 @@ -314,7 +326,7 @@ static int dwc3_xlnx_probe(struct platform_device *pdev) if (ret) return ret; =20 - ret =3D priv_data->pltfm_init(priv_data); + ret =3D priv_data->dwc3_config->pltfm_init(priv_data); if (ret) goto err_clk_put; =20 --=20 2.43.0 From nobody Wed Apr 1 09:48:06 2026 Received: from BL0PR03CU003.outbound.protection.outlook.com (mail-eastusazon11012038.outbound.protection.outlook.com [52.101.53.38]) (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 DA4A03DFC7B; Mon, 30 Mar 2026 19:03:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.53.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774897418; cv=fail; b=rqq2ItpPVzFAhYROceM8JZ3/muk0SLEnoAC/SoCdeoILUY/lx1GNRCFxxsd6DnUbetZGtvXGBAuRJHXInK4O53/CzlmAci/mRZ8fgOpo21ubvP5iFK7yN43ltlSWPQf2gCdwAFWAtJKXUZeS/YDaj7HYF79sGsHiXUXAmPqepAc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774897418; c=relaxed/simple; bh=jFeDid0ngcMk5Owpm0IGXgmj9egbLWxIGMdqwsb9OBA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PhHQTLqidCiDkxOTgVb9vIXkhmJHoIWl2eavFfnJtBeTWS34Gddh4DZGxsmhaAH4Pvl8byi+62vG8ulKI2ranRoeA/nJPDAfnrH4vpsgUuI92IDuIa5RiMUkmqa5+k9XKXjJAsQpMR4S2+0p2XoZ3HmafQRqMi45LLhVZHsyW5Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Q11s4+Kl; arc=fail smtp.client-ip=52.101.53.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Q11s4+Kl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EqghGuoQMO9MNi/LPXp42Geh3TWrF8hld5Wm8TSmv73Rm1epIgFMW3xXdp8kLWpSLLh2EZfuP8Z6t3Zswzn8nRhDCOMS2hwO687+PptUIkXuZ9Ety2NgYmJqYq2pFaFb4f7C1g2Otev2ATAmZ9rRLbU8PA92lHkWtkKIzA2LAXRwL7+Omx4T2U4NRVl7/Xbg1SQDp+Y69CrZ1VztMv7cWy8x95lpLG0rWSweTH5dbTErAJWm6XgfH9E07MrI2Af+5aY2UoEEMLIJdCZMjSIEk/bdrz2qzOZ5+p4l1/HJk0uHQh3RBNA4zRrNFr7g2hFqGksV4mbN2xNvJNJ04loNWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Rfjt+/Nac1Cypu0qPqtp3MMvLDOEJvWIzqEKaR++luk=; b=sQgZwrqBuWN8A0uoUgePITnlBDNMhC3LgMDl4upqQgydXjJWghm0RhB/ccihkBjZI9TPrdCCrqIkLwn8a16vjsnM9waeB11r/B1viD0ew4qOQIjY5ejCuZcBETXXm0Dr4SFNmSAGCkAqNjvqNT6O+75jwxSq/EDO6cfVL0reZ+NgF8cdEOolsBZouq3R6UjAE+lXRIAOsGGtGQcXZIHmwtPOGYqFtK6jX5AjkQ407K0smDvhHxGvmIyXyv/bfSHeVY1pFaCa8/JIKJf8IcC6iHUTsd2Rfl7WK1t8W/GAGR8XJT9hwKpXm4Uu/s5Qll47ybs9LD0tB78KvFy5JdQhZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rfjt+/Nac1Cypu0qPqtp3MMvLDOEJvWIzqEKaR++luk=; b=Q11s4+KlSOkNwLhD7lAeD1RMNUI4IGPtTBXQqj3F/KEyJ2+E0r8HU/i+3lOUcyVx7T4QKK/N7vj7TsPo4RKYTuR7m8t20kPR2vj7qREN9Qcxa58pdyu9Hi131KUzKVJ5O3lIr46/WTE7VSR9VpI83zpOrzcWeifHw2w/1Rsl4V4= Received: from SJ0PR03CA0331.namprd03.prod.outlook.com (2603:10b6:a03:39c::6) by CH8PR12MB9838.namprd12.prod.outlook.com (2603:10b6:610:270::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Mon, 30 Mar 2026 19:03:29 +0000 Received: from SJ5PEPF000001CD.namprd05.prod.outlook.com (2603:10b6:a03:39c:cafe::6e) by SJ0PR03CA0331.outlook.office365.com (2603:10b6:a03:39c::6) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.28 via Frontend Transport; Mon, 30 Mar 2026 19:03:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ5PEPF000001CD.mail.protection.outlook.com (10.167.242.42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Mon, 30 Mar 2026 19:03:28 +0000 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 30 Mar 2026 14:03:26 -0500 Received: from xhdradheys41.xilinx.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Mon, 30 Mar 2026 14:03:23 -0500 From: Radhey Shyam Pandey To: , , , , , , CC: , , , , , Radhey Shyam Pandey Subject: [PATCH v2 3/4] usb: dwc3: xilinx: Add Versal2 MMI USB 3.2 controller support Date: Tue, 31 Mar 2026 00:33:03 +0530 Message-ID: <20260330190304.1841593-4-radhey.shyam.pandey@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260330190304.1841593-1-radhey.shyam.pandey@amd.com> References: <20260330190304.1841593-1-radhey.shyam.pandey@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CD:EE_|CH8PR12MB9838:EE_ X-MS-Office365-Filtering-Correlation-Id: 187c7c3b-97fe-49d3-918e-08de8e8f073d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700016|7416014|376014|18002099003|22082099003|56012099003; X-Microsoft-Antispam-Message-Info: Cb5bvisdnrmPQW6xqER0k3LVD2CtTZhPMe8HVk/oT+v7NYq5uwH5NyYUbDim4u2BI+OhCFDTlewkmLPJ8MjQm1hYrDZ2FMjkAI1t4aMyP4OykEpYDfido1z/AmZtdv85cRka2mH6MAVA+p7zY36BQ/kWbEF3xScVbzzz34k6V41r1NXnLZ9+s6T6THWRqUSU+ouU8bEkPhxEa8wM3DrsO9SJRYnG5EifAMbaywqLEzxFhFSQBJzmGiP90fVRwpY+19axv3/RtVJ/1X+Q4R0pSbDNHUm3zwt2F0oHXudkm4+YzIPSjo0Hp48++GMkMrn6cxfzorgVmKeLVloeWTZv10QBl8adbog0LN/WK5iUIWDnM7vMv+HieU3caw/9WAu2MpCut1mBIvaj0ICw8i8Tp95SXdI40TF7cIqInEpA4A4oNnOQAwgB4boDpCcXp0fb6nEXRSNG+I5kuQ5t4gFUly7DFr06wXdwyRNHMr5kXJo8opjsICS5EozIN+C4VC0dgzmLIxAH1LhzOIXhvfB/tIDY4lXXcwvpiWLBBHIVBC6oxS4QLaZddCh6T3EkRzX0MIUFwXPwm6ttoQu7vEJ3ycujjZQxVNhPEvuwcC/o97KuA8VuGdeZVSJuWQsaiPAh2X5FjITrrUvqDDs6DLLXTSsUGBxNFs+ckOYwFFVtComnEH5vBQnA/lCbETmCxWRqSabwGRkf2yOOJOClCe39EyFuzJAGxSix3fhJSX0JYlF306Im/aPcmeUfli+KqYdSM0fcbnBi4IA2Yi8Yfzbe4Q== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(7416014)(376014)(18002099003)(22082099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: spjZCYU+pffOZzLQdTGa0wLMfnCAnd5i0WBkq0VxxqLkX2YIAcX9EgvYWvjoMUOf2rkeZh2+Q4O9nAe1cSfjson2I46DZmoJFXHrzGS0DXoROoXJ2rgS6Bg1M9dOhnsmec6Pk6z/Nu+Av3V+jkTOxZV/N/vGpFVAuf0DE3pVFqPBhD1Og0N4JLb+JCGSM4Yx4Qfh+zP7DzkNf4Zzy9PYPr5t4S00B4Tf9WyjEv3mN1cr6VxGNvJdkW8mhsKjfDLjOu8Bw7hQONqCoHUfj5aqRchr8kp5fOekzlzc1jDQkCKKNWsnmKt2V2i/Th58i4/NXzdUYqOBd9GUhzy5TXWFU5NsokooQZOJezrRzyv087Ep1mCLtTUpDkbfCvuX1jK+72/nkdJJBIOHPW0FC/fry0USa5xEjUhkE1RVcpsgWVMFYnGYLZw04LSpQHvMKhmy X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2026 19:03:28.5017 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 187c7c3b-97fe-49d3-918e-08de8e8f073d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CD.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH8PR12MB9838 Content-Type: text/plain; charset="utf-8" Multi-media integrated (MMI) USB3.2 DRD IP is usb3.1 gen2 controller which support following speed SSP (10-Gbps), SuperSpeed(5-Gbps), high-speed(480-Mbps), full-speed(12-Mbps), and low-speed(1.5-Mbps) operation modes. USB2 and USB3 PHY support Physical connectivity via the Type-C connectivity. The MMI USB controller does not have a dedicated wrapper register space, so ioremap is skipped via the map_resource config flag. The driver handles clock and reset initialization. In this initial version typec reversibility is not implemented and it is assumed that USB3 PHY TCA mux programming is done by MMI configuration data object (CDOs) and TI PD controller is configured using external tiva programmer on VEK385 evaluation board. Tested host mode with mass storage device. Signed-off-by: Radhey Shyam Pandey --- - Introduce xlnx,usb-syscon phandle to access UDH address space which is wrapper subsystem IP for USB, DP and HDCP. - Split config struct refactoring into separate patch (2/4). - Remove unused regmap/syscon fields and parsing code; defer to patch that first consumes them. - Fix error message capitalization to lowercase ("reset", "deassert"). --- drivers/usb/dwc3/dwc3-xilinx.c | 50 ++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c index bb59b56726e7..f2dee28bdc65 100644 --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -46,6 +46,7 @@ struct dwc3_xlnx; =20 struct dwc3_xlnx_config { int (*pltfm_init)(struct dwc3_xlnx *data); + bool map_resource; }; =20 struct dwc3_xlnx { @@ -93,6 +94,29 @@ static void dwc3_xlnx_set_coherency(struct dwc3_xlnx *pr= iv_data, u32 coherency_o } } =20 +static int dwc3_xlnx_init_versal2(struct dwc3_xlnx *priv_data) +{ + struct device *dev =3D priv_data->dev; + struct reset_control *crst; + int ret; + + crst =3D devm_reset_control_get_optional_exclusive(dev, NULL); + if (IS_ERR(crst)) + return dev_err_probe(dev, PTR_ERR(crst), + "failed to get reset signal\n"); + + /* assert and deassert reset */ + ret =3D reset_control_assert(crst); + if (ret < 0) + return dev_err_probe(dev, ret, "failed to assert reset\n"); + + ret =3D reset_control_deassert(crst); + if (ret < 0) + return dev_err_probe(dev, ret, "failed to deassert reset\n"); + + return 0; +} + static int dwc3_xlnx_init_versal(struct dwc3_xlnx *priv_data) { struct device *dev =3D priv_data->dev; @@ -250,10 +274,16 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *pr= iv_data) =20 static const struct dwc3_xlnx_config zynqmp_config =3D { .pltfm_init =3D dwc3_xlnx_init_zynqmp, + .map_resource =3D true, }; =20 static const struct dwc3_xlnx_config versal_config =3D { .pltfm_init =3D dwc3_xlnx_init_versal, + .map_resource =3D true, +}; + +static const struct dwc3_xlnx_config versal2_config =3D { + .pltfm_init =3D dwc3_xlnx_init_versal2, }; =20 static const struct of_device_id dwc3_xlnx_of_match[] =3D { @@ -265,6 +295,10 @@ static const struct of_device_id dwc3_xlnx_of_match[] = =3D { .compatible =3D "xlnx,versal-dwc3", .data =3D &versal_config, }, + { + .compatible =3D "xlnx,versal2-mmi-dwc3", + .data =3D &versal2_config, + }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, dwc3_xlnx_of_match); @@ -299,19 +333,23 @@ static int dwc3_xlnx_probe(struct platform_device *pd= ev) struct dwc3_xlnx *priv_data; struct device *dev =3D &pdev->dev; struct device_node *np =3D dev->of_node; - void __iomem *regs; int ret; =20 priv_data =3D devm_kzalloc(dev, sizeof(*priv_data), GFP_KERNEL); if (!priv_data) return -ENOMEM; =20 - regs =3D devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(regs)) - return dev_err_probe(dev, PTR_ERR(regs), "failed to map registers\n"); - priv_data->dwc3_config =3D device_get_match_data(dev); - priv_data->regs =3D regs; + + if (priv_data->dwc3_config->map_resource) { + void __iomem *regs; + + regs =3D devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(regs)) + return dev_err_probe(dev, PTR_ERR(regs), + "failed to map registers\n"); + priv_data->regs =3D regs; + } priv_data->dev =3D dev; =20 platform_set_drvdata(pdev, priv_data); --=20 2.43.0 From nobody Wed Apr 1 09:48:06 2026 Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11013032.outbound.protection.outlook.com [40.93.201.32]) (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 8837A3DFC88; Mon, 30 Mar 2026 19:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.201.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774897419; cv=fail; b=Jpnkmdgz1eye3HEfOlboUxGQNBRpV1mXh3O4hzkk1Ytg11XdVfgBV5rnZVqnTUrHoBBNG8hd5qt0tKE2U0297ENmfXL7A1AOeBIeNRuyxUIm0kqTN/Gl8o8oWCXEys9qkuCWrK0U6ZI+y+XA5R+wDqk4gFkCUwij/QBngkRXu1k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774897419; c=relaxed/simple; bh=F3NTYImDUX8G3LXiXRzrcWw8y/rUeSUny1FV9yqI9nA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pzXdZ20W7PDVRApJ88O9t+8lFUUxkOc/hGiqGP4WIiBlNjCNX+qEzjcM3Ybv6PYai1HhfJKSVkdjQvTGUSggk4rLU+J/k1x+tXr1SyBhIBmyLWbuGLSEO7C4b7KOUilGBFueLSf4v++6PQwh2LtBM3iEecCa9oymQunkArZfIkQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=uTCAnKM2; arc=fail smtp.client-ip=40.93.201.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="uTCAnKM2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zUTylB2Nw97vv1RXtL0ShNKsj1qJsEh6nwFB6oxFqFKTrnj0YVx0nyIXtcMnwz2H1aU4L3dC+RPBeSQ5czVW/HrLRyKcS2pYp0x56wQR1v8w3ZtM2hjAJk8tgB3gYR+RQuqledxI6Nxs54g1792KqYtThIUprIbB/YiOrzvoev8gDrL8MZk0wf0QaCJ2FC0kXAQJh1cZozMLw9dhom2sc6stZZ3JIXaIwys0IexTn8IS0x//vnQSb7W4wiNzipxdJjTL1iHG10jdoJz0qgjrZJukuO4E6ZLSae7VH0Ez60vks7OF/MvyQJfWB8S/Eq8UuTiSEIQkFvhpQBcRZ/FVog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qqThKNqYOVQKAqf/aI1IdmPVydfb4qZEgbbbLWMT9QY=; b=i3dmn8PVv4ZzTxccqq5Vmo/T8vGl0S9S2NVsbKOPvrXt9KDUrD5G1Y2dMmfAsSzB8catCpe8qC4YdNSyNT3t0eNXqRQjtTHDW9aPlwLiC9ug2iFd69XujyjtMDj5E+GiL3e9Fb4t+HsgQ1DryxsS3qiUl/mUvXxp7GXKqUMR30oU0zn8SuF84H6yO1rTvrZY4//nNO9FXCQ7T3NajedaJMg055Y5Gqs7yVfRgSf0OVA5KPKfw/Gvf3J9HlrNfHPJJhLQw2/vjH4t9e5DHGYNiBJoTPeP/nRuYzJo0Vbt0Lh7PLsjPGY0MVLaZFkzzsA07rGkQX2MVFORMQXA1Ls7Bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linuxfoundation.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qqThKNqYOVQKAqf/aI1IdmPVydfb4qZEgbbbLWMT9QY=; b=uTCAnKM2LYQqIGgTBdO+VStxBN2VZpJ2oSJ96Ok5Ser27CUhXq1FhTqh8JQExFXNmn9HW2VWC5My9+JjjSIRQMdpnKHS1RtvEc+3SZmw/2R70fq9rVj0siN77YoMSReZFzDaWbrnG/8rEQUun7NrbZlHgy4vApCkQTBoIkSK7pM= Received: from BL1PR13CA0418.namprd13.prod.outlook.com (2603:10b6:208:2c2::33) by DS7PR12MB6238.namprd12.prod.outlook.com (2603:10b6:8:96::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.15; Mon, 30 Mar 2026 19:03:31 +0000 Received: from BL02EPF0001A101.namprd05.prod.outlook.com (2603:10b6:208:2c2:cafe::d2) by BL1PR13CA0418.outlook.office365.com (2603:10b6:208:2c2::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9745.28 via Frontend Transport; Mon, 30 Mar 2026 19:03:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by BL02EPF0001A101.mail.protection.outlook.com (10.167.241.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9745.21 via Frontend Transport; Mon, 30 Mar 2026 19:03:31 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 30 Mar 2026 14:03:31 -0500 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 30 Mar 2026 12:03:30 -0700 Received: from xhdradheys41.xilinx.com (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Mon, 30 Mar 2026 14:03:27 -0500 From: Radhey Shyam Pandey To: , , , , , , CC: , , , , , Radhey Shyam Pandey Subject: [PATCH v2 4/4] usb: dwc3: xilinx: Add support to program MMI USB TX deemphasis Date: Tue, 31 Mar 2026 00:33:04 +0530 Message-ID: <20260330190304.1841593-5-radhey.shyam.pandey@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260330190304.1841593-1-radhey.shyam.pandey@amd.com> References: <20260330190304.1841593-1-radhey.shyam.pandey@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A101:EE_|DS7PR12MB6238:EE_ X-MS-Office365-Filtering-Correlation-Id: 6baa8181-d5c3-4b2c-d899-08de8e8f0911 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700016|7416014|18002099003|22082099003|56012099003; X-Microsoft-Antispam-Message-Info: Sq25gHh3iZKo50IEtXMaThlqu3spJb7e1vObB7H8RT2TskFGyYraY4Jv9GbAyO4YA7USE91/X6kBbtfdje7GRa68nXHy7zcDhwlrjHlj1xf3azF6eOk7J6H06TBsY5paM98nbRNMKCdb9Gr2AKp4nRkZef2txz2z6PR+zdoi78kOJPzWWB7Pc5jYRbYK8LYbZqAUE9rntRmlQ8PJDqeWKOtKWcfqvmeZZs50cajUoCDxe1BNx8EwPcoxS6c++rR4Ia4t7g+U/hS2OkVNtm6kfxyHimTs5kTryV+T84uHvYQnzMxkpDtfIH7IxwPlL8bi3xnNOW1TAR2kyI3tubfqNZzqv9TlUG1Yu+5Ei0N2RL6qxA62PTfEJgConCoI0ftxULSiurl2e504HwSvJHWbXRin87tBHkYTqPFEmyyx+aqBi4wL8B447C7s1gLGq7IToMFXqWdDYe36X2p7MDxuIm1iwQBz6Z3fQl38+ArHt0bGPtkFYHfEy/4JMEEWPEyfPqg3RXzKLkIKcVhZw/a5nmf676fC3BHJryK7tQFa9CSHVTATeByhXg9D9DgODdJKHbCLuvc5TbgwrB1QgSex0cRyJNc+tAlmBXvPSP8bHYlv/MepJh1O1DvzY880HoAF75u3nSADiIplGt0vCbIN/Wy1CHi1IJDQsqemFEfoSDS79DK+WJtZ3Ta7J9HytzU03hinUiPK66eRBb92URNnAdUcfiNCdP725cf6E2rN33RUSFWgjk9ZD896Ublb3m2wfnLLpcoZLy9javimmdTNYg== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700016)(7416014)(18002099003)(22082099003)(56012099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9zL13n5YiHzPW3+DvGsFkm6RY/JxG69L7ctiVk+pV0jIt1ts4T3jjCOqiDWe8K1iBVTDdzsXNssMFCobR8I1tNAGl0mCTbZ+s5FozcQXVeRgVLhxnxRtcE8c4CoQHaCfUtgI3aADR1edVi6kQaItvHMgDhUc1FjBs4Lv9imj6y5KwySD+Db7dOF9aVBQOX1PUc0pQXo9OLMrIk1mDwL/6XAw76beowlruCRqy1F0WvKY41ywje2gp87vG2lYdQ4e2q8NR+5vE3VZDGh0eAZqp5Bt/9ykAlRQoshpt8FC64/gRG2pCt0h+sFh8gisSwreoufupj4/DuEdaO0xNmrttel+9eaifPVe2IIFlB1XFIdfSlAnBEc5kik+JxXbxcPdl4scHJurJVXDK0MD06ZDRzL4vkFzLQneevReEf2eHfn0/sFbbHi+np3nZLSEV3xs X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Mar 2026 19:03:31.6378 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6baa8181-d5c3-4b2c-d899-08de8e8f0911 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A101.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6238 Content-Type: text/plain; charset="utf-8" Introduces support for programming the 18-bit TX Deemphasis value that drives the pipe_TxDeemph signal, as defined in the PIPE4 specification. The configured value is recommended by Synopsys and is intended for standard (non-compliance) operation. These Gen2 equalization settings have been validated through both internal and external compliance testing. By applying this setting, the stability of USB 3.2 enumeration is improved and now SuperSpeedPlus devices are consistently recognized as USB 3.2 Gen 2 by the MMI USB Host controller. Signed-off-by: Radhey Shyam Pandey --- Changes for v2: - Don't use compatible check for deemphasis programming. - Rename property "snps,lcsr_tx_deemph" to "snps,lcsr-tx-deemph" (hyphens per kernel convention). - Fix double space in LCSR_TX_DEEMPH register comment. - Add blank line between register offset define and "Bit fields" section. --- drivers/usb/dwc3/core.c | 17 +++++++++++++++++ drivers/usb/dwc3/core.h | 8 ++++++++ drivers/usb/dwc3/dwc3-xilinx.c | 15 ++++++++++++--- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 161a4d58b2ce..e678a53a90b3 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -646,6 +646,15 @@ static void dwc3_config_soc_bus(struct dwc3 *dwc) reg |=3D DWC3_GSBUSCFG0_REQINFO(dwc->gsbuscfg0_reqinfo); dwc3_writel(dwc, DWC3_GSBUSCFG0, reg); } + + if (dwc->csr_tx_deemph_field_1 !=3D DWC3_LCSR_TX_DEEMPH_UNSPECIFIED) { + u32 reg; + + reg =3D dwc3_readl(dwc, DWC3_LCSR_TX_DEEMPH); + reg &=3D ~DWC3_LCSR_TX_DEEMPH_MASK(~0); + reg |=3D DWC3_LCSR_TX_DEEMPH_MASK(dwc->csr_tx_deemph_field_1); + dwc3_writel(dwc, DWC3_LCSR_TX_DEEMPH, reg); + } } =20 static int dwc3_core_ulpi_init(struct dwc3 *dwc) @@ -1671,11 +1680,13 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc) static void dwc3_get_software_properties(struct dwc3 *dwc, const struct dwc3_properties *properties) { + u32 csr_tx_deemph_field_1; struct device *tmpdev; u16 gsbuscfg0_reqinfo; int ret; =20 dwc->gsbuscfg0_reqinfo =3D DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED; + dwc->csr_tx_deemph_field_1 =3D DWC3_LCSR_TX_DEEMPH_UNSPECIFIED; =20 if (properties->gsbuscfg0_reqinfo !=3D DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED) { @@ -1693,6 +1704,12 @@ static void dwc3_get_software_properties(struct dwc3= *dwc, &gsbuscfg0_reqinfo); if (!ret) dwc->gsbuscfg0_reqinfo =3D gsbuscfg0_reqinfo; + + ret =3D device_property_read_u32(tmpdev, + "snps,lcsr-tx-deemph", + &csr_tx_deemph_field_1); + if (!ret) + dwc->csr_tx_deemph_field_1 =3D csr_tx_deemph_field_1; } } =20 diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index a35b3db1f9f3..99874ad09730 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -181,6 +181,8 @@ =20 #define DWC3_LLUCTL(n) (0xd024 + ((n) * 0x80)) =20 +#define DWC3_LCSR_TX_DEEMPH 0xd060 + /* Bit fields */ =20 /* Global SoC Bus Configuration INCRx Register 0 */ @@ -198,6 +200,10 @@ #define DWC3_GSBUSCFG0_REQINFO(n) (((n) & 0xffff) << 16) #define DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED 0xffffffff =20 +/* LCSR_TX_DEEMPH Register: setting TX deemphasis used in normal operation= in gen2 */ +#define DWC3_LCSR_TX_DEEMPH_MASK(n) ((n) & 0x3ffff) +#define DWC3_LCSR_TX_DEEMPH_UNSPECIFIED 0xffffffff + /* Global Debug LSP MUX Select */ #define DWC3_GDBGLSPMUX_ENDBC BIT(15) /* Host only */ #define DWC3_GDBGLSPMUX_HOSTSELECT(n) ((n) & 0x3fff) @@ -1180,6 +1186,7 @@ struct dwc3_glue_ops { * @wakeup_pending_funcs: Indicates whether any interface has requested for * function wakeup in bitmap format where bit position * represents interface_id. + * @csr_tx_deemph_field_1: stores TX deemphasis used in Gen2 operation. */ struct dwc3 { struct work_struct drd_work; @@ -1417,6 +1424,7 @@ struct dwc3 { struct dentry *debug_root; u32 gsbuscfg0_reqinfo; u32 wakeup_pending_funcs; + u32 csr_tx_deemph_field_1; }; =20 #define INCRX_BURST_MODE 0 diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c index f2dee28bdc65..44008856ee73 100644 --- a/drivers/usb/dwc3/dwc3-xilinx.c +++ b/drivers/usb/dwc3/dwc3-xilinx.c @@ -41,11 +41,13 @@ #define PIPE_CLK_SELECT 0 #define XLNX_USB_FPD_POWER_PRSNT 0x80 #define FPD_POWER_PRSNT_OPTION BIT(0) +#define XLNX_MMI_USB_TX_DEEMPH_DEF 0x8c45 =20 struct dwc3_xlnx; =20 struct dwc3_xlnx_config { int (*pltfm_init)(struct dwc3_xlnx *data); + u32 tx_deemph; bool map_resource; }; =20 @@ -284,6 +286,7 @@ static const struct dwc3_xlnx_config versal_config =3D { =20 static const struct dwc3_xlnx_config versal2_config =3D { .pltfm_init =3D dwc3_xlnx_init_versal2, + .tx_deemph =3D XLNX_MMI_USB_TX_DEEMPH_DEF, }; =20 static const struct of_device_id dwc3_xlnx_of_match[] =3D { @@ -303,10 +306,12 @@ static const struct of_device_id dwc3_xlnx_of_match[]= =3D { }; MODULE_DEVICE_TABLE(of, dwc3_xlnx_of_match); =20 -static int dwc3_set_swnode(struct device *dev) +static int dwc3_set_swnode(struct dwc3_xlnx *priv_data) { + struct device *dev =3D priv_data->dev; + const struct dwc3_xlnx_config *config =3D priv_data->dwc3_config; struct device_node *np =3D dev->of_node, *dwc3_np; - struct property_entry props[2]; + struct property_entry props[3]; int prop_idx =3D 0, ret =3D 0; =20 dwc3_np =3D of_get_compatible_child(np, "snps,dwc3"); @@ -320,6 +325,10 @@ static int dwc3_set_swnode(struct device *dev) if (of_dma_is_coherent(dwc3_np)) props[prop_idx++] =3D PROPERTY_ENTRY_U16("snps,gsbuscfg0-reqinfo", 0xffff); + if (config->tx_deemph) + props[prop_idx++] =3D PROPERTY_ENTRY_U32("snps,lcsr-tx-deemph", + config->tx_deemph); + of_node_put(dwc3_np); =20 if (prop_idx) @@ -368,7 +377,7 @@ static int dwc3_xlnx_probe(struct platform_device *pdev) if (ret) goto err_clk_put; =20 - ret =3D dwc3_set_swnode(dev); + ret =3D dwc3_set_swnode(priv_data); if (ret) goto err_clk_put; =20 --=20 2.43.0