From patchwork Thu Sep 5 20:06:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 826906 Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013021.outbound.protection.outlook.com [52.101.67.21]) (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 4CB691A01C1; Thu, 5 Sep 2024 20:06:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.67.21 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725566805; cv=fail; b=bi0CDFGJBf6Sbg9RCuq9hZyuFqEMeQcM9+Lz/Az/BSmsX7phi2dd+3vq3GgJGvG0SwQ90w/NyPY7p4gnyo0F2IMVJkaTS3ORt5KaflI3xwSYhdNNYz1XfgUYEW3M1phIqpN87IUsuUKmDk/hvTHzn4XGwhTlhrwk65+e952RbJs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725566805; c=relaxed/simple; bh=CnUCYtJpFgxDlRdwMDi1lTVA9hZVdAmvmi8iysk172U=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=qInTgaKQVJ8ictpC98pZvLKYUceOObSpfuhiD98pyCNN6Pqb7WyH2K+GCCoQY0Bf7WiZVbmTHVHbTm8kR9bgcmR+djd5nUqg0SadjyxeKEMjmRJ7Pa0XXoduhTMlHTEz+EYS3vKbsYHxA5ce8OXgCfhgX4p3iONRLVci+LXf7Zs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=BAv5aUoX; arc=fail smtp.client-ip=52.101.67.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="BAv5aUoX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NfjUWRR/y+m5JXwpksAJ38+0VxQ9nteLUZT6yu/C3OmED7lRRt8/lQeD/zeRiY5UfGPVlm+vtkxxzjzOHJbAI36wZmmVdXwYjZTRByG2rwcy0/w54fWFxeOwNAQoBvEGv1XDMO/0roRQwavmz5ge8AeqTAmI0hFKWswAbbj2eWFB6/+j3340MdgVpH9b3im/vyE+bi5G/isp3yNiUSee7AvN6mu4iihs6d9ZCZVThnQBxUjLMI7vDET5sPBreJA9VgBrvE5dToeJ36/gnsCrkILdQQB3G5CJAsYzOuQ6plFjGa0JuY+k42CkCp4s9SwG3/W+mFt3B+ekhqm49Ws4Dw== 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=h77DnQeqNcdMIKEC1tpJuVU06z31B8AeAik+xegFNg4=; b=jO3HN5IFTC2IDnUpBT60bUotNnP8euGrtJrQphiXsVTghgnm/v0MvoWKruuCC0O0GlHRwOr7ma0dQ6BdUdZYwgbEGaFgM4wD/Tudsy1bCTbZUKLnO4kb+J4Vy0z9UPQZEEOYh0BQT7Emch4xx8Fp59DJN9JLDeBmdnRWI+7gwb9+cMhqs/jVebrSluocW8MJscx8Xkb3OvMEj+gOUnJvEKI3+K3oopwVmhSX8hO2F9PkpX5XpA+d5+QkHWayUH+8RElLyCMLRwTpWafp/sAt2m8BkyGWwrUOZAwCP1F4aR+YQutQ2Wn6NqL5Pg0TrGB5R2yX4Jxi/Xe08DvSnYrgPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h77DnQeqNcdMIKEC1tpJuVU06z31B8AeAik+xegFNg4=; b=BAv5aUoX4iSU5a5BknqErVC7MdBXQZxSuEyeZdqX+sFRkALpcQd68BlJzVFn/1CgEDOIZpHL4WWjrV/3oDOTo341Y0dmq07FKo+LlxGojO1FvzPWoBNQ04XvumBecwCUVORU2wKkNqqJ/4zyFlktJgLZV69UZL2z7PggbUek9SK0PkU9GQULkMxOiOFSuHlp5I1xlC2ucm2X6CBkVkngTwvZ/6AL4l4rwj/XNUcQwWkU+kf68f8tmTUFVyjO2yYcsl41AP13OQ+g6cZ/PpekM7aA6gv5bhkcWVfca8lN2j5t6+RbcUZ3gAYfEYEP3L0xCOQvkFHvY9Pn0IyzlK8FCg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by AM9PR04MB8423.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.28; Thu, 5 Sep 2024 20:06:40 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7918.024; Thu, 5 Sep 2024 20:06:40 +0000 From: Frank Li Date: Thu, 05 Sep 2024 16:06:20 -0400 Subject: [PATCH v4 2/3] usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode Message-Id: <20240905-dwc-mp-v4-2-aedaeacf0556@nxp.com> References: <20240905-dwc-mp-v4-0-aedaeacf0556@nxp.com> In-Reply-To: <20240905-dwc-mp-v4-0-aedaeacf0556@nxp.com> To: Mathias Nyman , Greg Kroah-Hartman , Thinh Nguyen , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, jun.li@nxp.com, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1725566789; l=2068; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=CnUCYtJpFgxDlRdwMDi1lTVA9hZVdAmvmi8iysk172U=; b=yglSI41unccvsj7IcMiZ+i3X6/p0CwebkPdlDdNU6ZQ/UbxpapjCQXEnntyB7B8NdHU6zi9ed BDK2mK4YRyUBtxGidLpgB5W17OFuLhQ6zbiVfZmPV3a0efYXtEJusWo X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: BYAPR05CA0105.namprd05.prod.outlook.com (2603:10b6:a03:e0::46) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AM9PR04MB8423:EE_ X-MS-Office365-Filtering-Correlation-Id: 2141d74b-de21-4e01-d315-08dccde64161 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|52116014|376014|366016|7416014|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?61qudbLxk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4A675YPo/ayLy8crEhyVTgLqReb?= =?utf-8?q?wmh4AM7rMYG+1DYaVgEDmYOxjqSaGcnJW7xoxlscv6v5VQwUlhqAIGrEg5ididfsK?= =?utf-8?q?8mzs0XUdPlyJ9cCQ0n5RRFVYu7f/MZr+JhOm0gHWoT4xgBTHR/u20zJQVaOSI3nos?= =?utf-8?q?F3jRxBGxEYSM4NlssoEl7TTsJTZv9oaZXhtl/qf29FJ4zF03Ym7sAQzngDcmYKGdi?= =?utf-8?q?CVyDZLNqaJ736ZQLXe3KOQumr2lZoJ49devb+/RvbOPWU0VfDpR/P6h/YCL6sjmbZ?= =?utf-8?q?eYVzfsPpY97fZ+wdQu7QBa7cE5isHClo8gBU4wrE7BWZofq1AUuXgt9XPYx99O2ka?= =?utf-8?q?tU6BPlJ0rc8YFY+PODNesyHV/Q5FHv0DSVxsa3cI3fvYnUWmti1ycvNo6PsZ1IyqM?= =?utf-8?q?egIcFO3OkeUcWL5Ub4oDlT+CX+Qm8SFpzQKMf9BvEC37rZUEvui9xvE4j6hXSp/qc?= =?utf-8?q?dHFhN7PsWPnN9JQnNeSlyyqhAwOaccd5DQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9642.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(52116014)(376014)(366016)(7416014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?J7ca0+nTZjIKQ54/OnYLKtysLSj9?= =?utf-8?q?pk5BDcpnffaTZ70B23yGO3svRbdsKY8XhfYbSmIvSPGWe/k9qhfCk04Nxim1Mo4t8?= =?utf-8?q?9n/xCckE/BItonukR41c5ju0GF/uj+jt1g3G7mgF7aHu5eRtk21y0KK1qxR6xPw8u?= =?utf-8?q?QfF6PK50Z+uU3fLlZNpD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cZ6ljU9yCXNpTiBEl6ZrfssDDoFEuYbWKVvg?= =?utf-8?q?MqO+vxU1dL/eq2SbC0w1IVF1SCDu/VXzisyJDaJYJTKr2cHPl7WwoCarB1c40moAi?= =?utf-8?q?2OnQagjVHDZ7fWxjfAgSShkaTIS/zSwxXDOIYF5M6d122pC9VcLGXZBRi5eDBmNUO?= =?utf-8?q?+owx8JJOwu11xktKwkxJBP+uqSuLJa8V7S4cH0d4gCYylTkviTTWOnKu3toyOsZoA?= =?utf-8?q?Hvbqthl+0QP3/nZfoQfSG1MeKK3lTKQ7AehM7Fyb+xl/IADeB4Rf3lfXecV9aCkbO?= =?utf-8?q?5FsFStOx4HUSLYi3BiMxAVBzwtOWj8NKr89WbIqLlYknLR+Y9zhPSPr/kXI1OupwT?= =?utf-8?q?9pDyiJnS1JfbyLDq2UXCPCPFEvQ+G5ZQYE+FwQRHUSRJSJ9bfqM/SGOP+8EwYPkVi?= =?utf-8?q?HL3vN55eTzUn1xs+Ui0ngHyx4chJrB7ZvFAJD/4I1T4xqAf+inGar7VxJUImjGjeE?= =?utf-8?q?ytr4nedIfW6h?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2141d74b-de21-4e01-d315-08dccde64161 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2024 20:06:40.3948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rzUNMBPZqd/5vdpTLSyYWJVwAndB7LUWAg39hW5aIXZ7LxIpyl1mDKbIM57WSnFC52i2Zw5yFghyyIj0tU8evQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8423 Add 2 software manage quirk properties (xhci-missing-cas-quirk and xhci-skip-phy-init-quirk) for xhci host. dwc3 driver have PHY management to cover both device and host mode, so add xhci-skip-phy-init-quirk to skip PHY management from HCD core. Cold Attach Status (CAS) bit can't be set at i.MX8MP after resume from suspend state. So set xhci-missing-cas-quirk. Acked-by: Thinh Nguyen Signed-off-by: Frank Li --- Change from v2 to v3 - rework commit message to descript why need set quirk. Change from v1 to v2 - use {0} --- drivers/usb/dwc3/dwc3-imx8mp.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index 8b88649b569fe..f62f6f960e501 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -145,6 +145,17 @@ static irqreturn_t dwc3_imx8mp_interrupt(int irq, void *_dwc3_imx) return IRQ_HANDLED; } +static int dwc3_imx8mp_set_software_node(struct device *dev) +{ + struct property_entry props[3] = { 0 }; + int prop_idx = 0; + + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-missing-cas-quirk"); + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk"); + + return device_create_managed_software_node(dev, props, NULL); +} + static int dwc3_imx8mp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -207,6 +218,20 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev) if (err < 0) goto disable_rpm; + dwc3_np = of_get_compatible_child(node, "snps,dwc3"); + if (!dwc3_np) { + err = -ENODEV; + dev_err(dev, "failed to find dwc3 core child\n"); + goto disable_rpm; + } + + err = dwc3_imx8mp_set_software_node(dev); + if (err) { + err = -ENODEV; + dev_err(dev, "failed to create software node\n"); + goto disable_rpm; + } + err = of_platform_populate(node, NULL, NULL, dev); if (err) { dev_err(&pdev->dev, "failed to create dwc3 core\n");