From patchwork Wed Sep 4 15:49:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13791154 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2059.outbound.protection.outlook.com [40.107.21.59]) (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 C48761DA608; Wed, 4 Sep 2024 15:49:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725464973; cv=fail; b=vBIkU5iEfHonvb6YbCcGwyMZlYv8kmMAkUyKymwj2NA+DAOCI9Nfbhc2GqOZcAgC+A21NQhnVm+0WithTmlbu+Oqci9GaFGSOsPe2OLQVm5xXKDaKmcjQT6cIWZxSr+qzoCDC0x0H+1jSdEjoaA1UFa33YLhHhtPn9JPJhJbXbs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725464973; c=relaxed/simple; bh=OPMEgo/PPVAH3sDsMsvf6tFyCZJh0Wh9SpXjFlyjVQQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=BKBR8apWEMpN91acl9+IXn0/xBqJ397xTLxO1D6UXs8uqZIIQu1cuhQo/W4aSfETv4I+PtxRPSlzw0t1ppdPLdKwljbUymnXevH+5RqazFzEPcIWLgVGL5BkgpgWmpTpU5m8JEcJtBKZO0n6fRGW9iEivKcKxarYmbyEvqXApuM= 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=YG8v9D4D; arc=fail smtp.client-ip=40.107.21.59 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="YG8v9D4D" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Dy1RoP8N1Jjz5oTPYfLoS/KyuBt8zI+851CVNzeiIDKJNdBykj1eHmvgCa04gf3PSYwNxQ4sU+JUuvccOMkh69dQ9GBi61Lal2ZeJduIBB+wIKSL8Pa5zME7zp791F9sBgNZaF5wLJZSio41HeR6n91n4MKrCEQr1q+xSSEma7YIu5JxB1KDoh7GtyrM1OK+IXcW/xLKjpakGeMe1SYkUtWxSXr8Dx7/jR5eo33DDfvrUeH/AAfAeqRYVJEDpuhazSkuPqTW6EbSemTET6jw9U1wltghuOZCsmCg0+BRjHbQVuGoXkZLu4Az16I3xdoOc5mevT0NQ6lHAdQ1j1p7qA== 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=5FGgaU9IlyBHq49XF9k5+aS5ZI1cv/6PvMPvqC36+xQ=; b=iv4JTg7FOu/RdGihKeFakwyLWiWLsttiQ47nmgynIiH0rOdg258eNFFPrDIgV21+4rWxaCsJmAwmqnTFtEWETzBGT0kC1AsQm2gth3snXPTOBB0ZHw6rMPyEwndfRhYToDTTJFIS49+RDuZnpT9nk3TgpPox07VJx4f8WwqljBwoqBn5/PvFHsdOq9YGovNlILM17NHyOM21doFUdL4xOyc5EsQH6eNtVqZx4aTmdQ6bPitYAyrcIj0ydwV0txIILJY09/oSrWd87r7TwDzJq1sGeDxNmxDvyDgLzTebARMZzzKWcif+OHsaO4j4MexiQT8ykFOBgAbP2RsubQv8iA== 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=5FGgaU9IlyBHq49XF9k5+aS5ZI1cv/6PvMPvqC36+xQ=; b=YG8v9D4Dldd7wErik2VtBC/vv0xfI7iEWBVn72DS9jkxmr8NUaQkKaaZrmxxCExQ+EZkW7LjqY7StwZu15XaKfDSd60FUU9bjwfVxDQDjKsqlME1IBEbE+WzEeGiRaXa0xNSrLaMT3h7XRlS9/TUIqhHSDs+KlYy3DqFTTaSP2hSmUT4gw1YOf2tbSqNwOKsh4vnm+oIkKLiyahvbgHpFibsWcCftSh+FKXCoRrpbOIq8wGOXX+TVWAJD4m+blATugCZLyRIMKZJEbDpOiJgyHgTcrzmnQG8aDzX3DS4hUw5AJlAxgfGYTUvF3udtWLCprEQ4MJ3A2LmYozik/WQFA== 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 VI1PR04MB9859.eurprd04.prod.outlook.com (2603:10a6:800:1d9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Wed, 4 Sep 2024 15:49:29 +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; Wed, 4 Sep 2024 15:49:28 +0000 From: Frank Li Date: Wed, 04 Sep 2024 11:49:02 -0400 Subject: [PATCH v3 1/3] usb: host: xhci-plat: Parse xhci-missing_cas_quirk and apply quirk Message-Id: <20240904-dwc-mp-v3-1-319947736ec0@nxp.com> References: <20240904-dwc-mp-v3-0-319947736ec0@nxp.com> In-Reply-To: <20240904-dwc-mp-v3-0-319947736ec0@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=1725464962; l=1035; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=OPMEgo/PPVAH3sDsMsvf6tFyCZJh0Wh9SpXjFlyjVQQ=; b=qw9gic8gN6R4qA5UgOfoKE83zy6veieKUzUqWclSB6QDNiN7WmzFitlDVNmX6wCCLYB/YRnxs pdwrLJMgwHYBJXqMU9UuQ8wIVTSCYE96oi9oEobiQANj4xGWkfyGBEO X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0008.namprd05.prod.outlook.com (2603:10b6:a03:33b::13) 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_|VI1PR04MB9859:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bc1af90-193c-428c-f120-08dcccf92913 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?3NjLfQy/34/SqJ3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jtPmnciiq3yc1pft8bFGoA1Vtj?= =?utf-8?q?Jexy390AloMhkFlCSG1zE/ZUn+NXTLMPh37Nn4jGtSirChDfSQnwMBzJ76HlBM4nX?= =?utf-8?q?L+YNOf4ElsD2yaomNA9U1PChW4/aDno7DfE5ltldN2GcPUvnJSURO2/XSfG5UUf4q?= =?utf-8?q?l5Hxda31n9/PeMyRk81ikacEhj6dwGqlBxSIr9E7k4418tZg5/bzwWSkrazoRBcND?= =?utf-8?q?gN+gyGzAFZ0d77+k2Pcnwu+jLCWBIz+r5DqwRW1qov9EugGSPVXNq7RXhSo989WXm?= =?utf-8?q?pzSgoZiOvLLUwjz1qj1lk/kXzY5G7n0K+WDRtddRvypH/MXuNjeu5LnpUHKuIQHd1?= =?utf-8?q?Fi/mWl2laF0vwQEF/d4qbr8dKyMkJ1MRGa9HzPtmAv2fb8UryYeXaPazNjEavpzPL?= =?utf-8?q?xmWlqW053IKqB8XbEW5vvYka7djRzCz/67V2eMbOgfIXze8kxiMaTaq9cAwGh3JoH?= =?utf-8?q?ow1uBjBSQZEWZdQumCfRpqL9fmIJlPULQA=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)(7416014)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?jUKQUcti7jsYAt36KpnxoU/qJdP9?= =?utf-8?q?T/j650D/rVH5KcWi+UHccnkY+V+tImnjo6jWyN0stk9jWDesX3UjC4jC65XYKFoQ9?= =?utf-8?q?NB4D+vuiRYZ1/yZxYJTVOBE1LuufIDuKbg3DZEWxR0PdZkdTB5SDYJeI7JbbNNCkC?= =?utf-8?q?251MTu4/ZrFADi2ZktxdAOP+acwcgtTZKNVlZZ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sKZM2y+Drt8xumAj8DnEKkLBL?= =?utf-8?q?/6uNkxKRm0/upIRuZkjM6i7OmdJdgV3aoR2lKe5Rj4b23IDcJX2SUH91n/hdE6Stm?= =?utf-8?q?nCkrXYyws7cRhsC88ug/K8qUJq/RUb6QtaMfkX6T/PadiCJGVELNcYvItVcaQSUde?= =?utf-8?q?otLtz49ZTBC9N75vJwjISKGhD3I8wrgFw0NML/+QmvwpjYvw+9ZPdF7obgXtC5Wqe?= =?utf-8?q?28jBxFJ8CkEUZ5VVhPI/JroqOANaeVueAjGbKPKmc9/LpZPywkzvhpWjGx0AIZKab?= =?utf-8?q?/H9xiU2zhS3+DaMdTkAZkfpyzNxN6Ggg71VHBtxkveDu9jz5u/mvnog841OA/E6hG?= =?utf-8?q?tlyusxtVb6GFGLNs3RlcVGTDFmnVt3Yd8G1jIAHTjNL07PhgaGnsbU5m+05ypr8Tw?= =?utf-8?q?h/GOP3cbMnyChvK6XIUswj4tgxSRJpkJ9NBK51w6gEesyQ/GA4avKzHci6WjyuxuY?= =?utf-8?q?f6tKlnu2ThiE?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bc1af90-193c-428c-f120-08dcccf92913 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2024 15:49:28.8934 (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: ylQP6n4ruqtx0NQTDBBMMxY2wmAXc7EneCeQMYEEwyIMRRuEl8YKrTg6g8dSgjM3VqLG/VEMUrWi3bzHpLb9zw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9859 Parse software managed property 'xhci-skip-phy-init-quirk' and 'xhci-skip-phy-init-quirk' to apply related quirk. It allows usb glue layer driver apply these quirk. Signed-off-by: Frank Li --- drivers/usb/host/xhci-plat.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 31bdfa52eeb25..ecaa75718e592 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -259,6 +259,12 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s if (device_property_read_bool(tmpdev, "write-64-hi-lo-quirk")) xhci->quirks |= XHCI_WRITE_64_HI_LO; + if (device_property_read_bool(tmpdev, "xhci-missing-cas-quirk")) + xhci->quirks |= XHCI_MISSING_CAS; + + if (device_property_read_bool(tmpdev, "xhci-skip-phy-init-quirk")) + xhci->quirks |= XHCI_SKIP_PHY_INIT; + device_property_read_u32(tmpdev, "imod-interval-ns", &xhci->imod_interval); } From patchwork Wed Sep 4 15:49:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13791155 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2059.outbound.protection.outlook.com [40.107.21.59]) (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 127EB1E0B9F; Wed, 4 Sep 2024 15:49:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725464976; cv=fail; b=oZPsHjgvgAOCmt7N/tv5un+vxS4+4MgJzilX5cW2VWaCsLNdKLKM2mDRQ+PH2FaGje6BH6BBogPDk3BiBL8pCsLH1XaMmPW0pm2UmBaemX3m9jBGwuWwRVt7u7vy9YWvcNvb0LgCGmGJQK7cchqsL+28rX6yGZI0Ssh5wyjbMFc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725464976; c=relaxed/simple; bh=SSBQqly1oyxDE2Ca0oLiGpwaCWTsOBymC3u7/XHMbO4=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=PAv3UuqCX9kvfpEyFMa2DdrFsx5jvyTydWnfNY5tZobk+mQzT+oYHbsdT37UQ3MzzCX5esvEBkTTNZllyPEThI7fOKi7N1O9f4cM+l90IEc5ABdbuQazIoNOjTZx/PkT5foRKDN7UYgMdTZN46z9cGy8mGqRgHwnjvJvG+/oxl0= 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=NnBUXOBW; arc=fail smtp.client-ip=40.107.21.59 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="NnBUXOBW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zIkltuCE29oY1sIEWRe/gVXif7sy4NGn0iUeE173OYCwp8LH/lLXBEL0QMc3fp4sg0pxyqer4yQMfjTV/ddiQ2LqE6uUYPvE5l5LApxQtOINfoMmfsGG+K9qotVx9Y2o3emfKzsqn99cIH17A7KblKQHT1H50wB45NpeSRJsPLLy4hZxPNWaEEG1IjhCakpVuKje2NpJQXHFOLfsFEUdivmuJjthe/+K/+PJNc5nXOi1vBOBId37boCmVm/gai9X2sGEN4eavCA2eLeZrxVVHaummaD7lh2c7uLZnmAz3HAynmemG2j2ig66mdqBec4TnpQt0S27UCp9GRUlK9DAJQ== 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=oh5rmW1fK+ikUT7LDb6WhkeuVrD+/rsoKDvoXvWDMc0=; b=t8eajuuwIHHDdiz9uhnNbYNOsEPXtG7FMpZlW+O9NrZwAa7YjO7ylbnWSbYjXKDdH+uNkwuyoD4OdPMQJUHPRQRv4koQVkk4HiyJz9z9uMyOa6WQuptGtdoddtKqbwPVbODD1rIscPTtoPSdxcVCALhNh6ScO5ImcDjs+UlQsSUYYdc17S9J+rrDL18KXGHmtkJZ6Rwihhbr48Bvh/EQd/PWPD9qQEbn2bfvllK9cwZItgc/ZwxH5y4SHGivmz5g1fXBu4yu6DTln1Uh3eTCbbp33W4HHtHe8FYPyVq2xvP04SeaUrECukseLP50KCFlBJwOxM0FYhWquu1fK5KtEA== 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=oh5rmW1fK+ikUT7LDb6WhkeuVrD+/rsoKDvoXvWDMc0=; b=NnBUXOBWBcrM6O8i83QPWKAjWBhfQv5tT+vq1BeW1f+l4OE8BOBSKTp89pbYjnUjlHMzOju6HQkMs4Y8174Jwx6adziQVx4ebYAOcoWd2GWB+HXvK+4q/mmpykLZ2qe3J+ILKj/YRVgSrQjWyHLXvHUOKgD0la5vsQnUNawahJlLPtVBL9zzHgQszip3F6EBEIcycBttNKPvmbjALRDGLutdEZSYncujx4j/h2p9h3FBUVnQAMp/XIz3nn10PedbnoR6OQlfwWex85JI0nGPYQX0E9gk0EqDr9AOqTJaljy7f8P4fgK5iW9LH45mn8yPyHo26o62WXRW6vlR8tWHng== 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 VI1PR04MB9859.eurprd04.prod.outlook.com (2603:10a6:800:1d9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Wed, 4 Sep 2024 15:49:32 +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; Wed, 4 Sep 2024 15:49:32 +0000 From: Frank Li Date: Wed, 04 Sep 2024 11:49:03 -0400 Subject: [PATCH v3 2/3] usb: dwc3: imx8mp: add 2 software managed quirk properties for host mode Message-Id: <20240904-dwc-mp-v3-2-319947736ec0@nxp.com> References: <20240904-dwc-mp-v3-0-319947736ec0@nxp.com> In-Reply-To: <20240904-dwc-mp-v3-0-319947736ec0@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=1725464962; l=1819; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=SSBQqly1oyxDE2Ca0oLiGpwaCWTsOBymC3u7/XHMbO4=; b=QF3lcAmlCf/msSXa0QMewUP3UY+m0xPAdXfEtj3CUT88dq1I9QU7B6EqTftF+1svkyz2I3t0g nNm8rS+P3/uCS1HNQxCLyILEid/GSR2214SnvfhHByPINWXAkd3t3q6 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0008.namprd05.prod.outlook.com (2603:10b6:a03:33b::13) 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_|VI1PR04MB9859:EE_ X-MS-Office365-Filtering-Correlation-Id: 305fa641-1dc4-481f-1341-08dcccf92b35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?qvXOzJ8IZsiaaKht/+3VqWUQoKE+Dj+?= =?utf-8?q?HQhYzYVfnt/WL6qgr1SwiO71prX0dRPdVc0LbB9CWWqWWEbbhA42HiSeRRZpcBe7z?= =?utf-8?q?Dx68/jWooTrY8Ly5gYOy2hSrluXOKWKkI/m0ti6Wyh0I4rem2POCQ4hCy4VkuszHB?= =?utf-8?q?BGSDh3Q525lwAfbuB9jcfj1pMaSKjiGZeLLpm6/UBgo5MfYEMWD7Y/4COpMCc9M4d?= =?utf-8?q?TX5pQKYH32Wyaj0+d6bztAN6zWg5cgQ6iVc2BvruD4O3vhmSe/OHKEtSD18FK5XK0?= =?utf-8?q?UA9WjDvqOd3eIl4bz5MkDRw7OwZCJJR+ezlcUqbKF7785x/VU+Bf4rPr1k+AUPxcm?= =?utf-8?q?vFvnxVzL2o6JLhryKxjNaNbhR4ZCHNyg+sU9sZWFu226jLMW2PPxiUUJW1XoZtT82?= =?utf-8?q?ZJUXGSgd4O8yL8RPibPRxfUnS9Rwn2hkZMLEgrSAmJ5VUPPGmvPXOZaGf4Mxb9NEp?= =?utf-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iorU5?= =?utf-8?q?fa9DinfsVl5dBkxYy9W1dyfu5yo4b3g+dA=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)(7416014)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?WcJRrttkKq/R/Om8UjCazOK8sjVL?= =?utf-8?q?cTElAg0+lQZ+a1DqhJ/lBvosmv4bJAvAQVde7aX2adfE8bhr8Y3HQwcN9zBzDOem6?= =?utf-8?q?CZNJEX6K68laDBQBGit0BgqgM/AHQGaQbZgmKpnMph2IZsbU95Uo9uCzzhk78dor3?= =?utf-8?q?wgHxBP8lZ6BIahZrafUg4uiQYgf8HO4/x7OzF797SJHGR5NWBtGiZx7ixhdr1Kmf9?= =?utf-8?q?8f5owj8KZENyxa4zYMcQLrmVVAoodE8xE9iUlsmkc3mLdssz+8fQmZOCjd3b55VGY?= =?utf-8?q?hMiTk8CTpCjmGqYoFXWqdx6p2DN5RrAekD92iKgC2Dc9Qg1EdlSHnY65WfK/69GcP?= =?utf-8?q?ioR75WHGWP2CE0/Z7qXXLbOQydlrOFK9b4Vo0NAbAARlLqsZHHLax4T33vQ9Fe3g4?= =?utf-8?q?XTtBSg0caCxwHAkVwYC35qSp+R/V1w/G+ZTe6SHURJcTG+sfsKaTgQd0bjHlInHo+?= =?utf-8?q?V46Y4RQLPg8N05A0F0wqMeor465MIs6Uqc3lwmrRWdAkn1migxI6biZP7c3Li/xD6?= =?utf-8?q?+OimsTG7DbbJohGlxyhbD8iSlC9SfYnvMjQTGhKDaTow41B5nw7MQm6i4+eZz2HAw?= =?utf-8?q?zAph92WdvB5qQDNru4fapt8jkX0bEoAj7h/vV6l7DCk50w1/e49yOf3Tw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LQo/2DH05bWoQdqAZg?= =?utf-8?q?sE4VdNiZb85o?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 305fa641-1dc4-481f-1341-08dcccf92b35 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2024 15:49:32.4584 (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: WwqYLs+odmds+CMXJ9RWxd+Bqe20X0CWg5/kqI/J66sWTdPhiWD4rx+yBh2PB2ZyW/pEBKZDBgxaGAefxtnMgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9859 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. Signed-off-by: Frank Li Acked-by: Thinh Nguyen --- 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index 392fa1232788c..bd6953246f42e 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -144,6 +144,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; @@ -226,6 +237,13 @@ static int dwc3_imx8mp_probe(struct platform_device *pdev) 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"); From patchwork Wed Sep 4 15:49:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13791156 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2057.outbound.protection.outlook.com [40.107.20.57]) (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 23D611E1A14; Wed, 4 Sep 2024 15:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725464981; cv=fail; b=C4QBTiZY4JOVXn6c7f2fUpFHLGNOLj2PyFQ8FEihtmBTCxbRN8qxUDli1rNPcE1GcGroTcHnOHPtGjbiRSfE0u4kC2T9+3y3utKADXz0gSc26cUohDuUIJMCmF3gjVZkW14iQ0x7gAw3nl3TjR5gADAdjhhJ8gjRd/KPL7hTCqE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725464981; c=relaxed/simple; bh=nEj/K1ERPksvYT9CUWSWEh7L//sN6UL3ybiMuxZKiIg=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=IkrwFG6OiBQM7KlGECg3Ju41i8/QjjaKLNqtBviUVm349k1qXoDsVBAIZHRzKXDiscj9c2tu959xUjySIVgN0jy83KUjN8MJNgOl+PpdSzcoLvKzXXx6NpE8M9IHvOj6geNM9glRruHgT8B8QPqTUXMRA6uYvMFwoIZDL2NyvQI= 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=T7DAbsvy; arc=fail smtp.client-ip=40.107.20.57 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="T7DAbsvy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uvhK3ssGnsZMijlsRa4ol250h+GZicJAWObiHIpR96slQuS0GvCOZXjKoVOPM+C4Q6/Y4iORgsx4h5a1D2xx8C1xI2g949MQIuDq/xg/7aG4pspB9Zh7l5hww9yKmrZ4i+n/z34sel0WzK97L9zrFr559PvTrCzXoLst2kEeMA9646Wld/v+e39JgwuwYx4QBPd2YmTLDTiCOoI97myZmjIuiPrU/4BfkFMCwg0dwcL1k+kzJ0tTktN0ftQlrIyFsoZ6NzZlYo6HRydYGCRyJ6mDb7ODo6JAYBaA7D3myGtNqpKRuLKbAm7fQqIXuawFoDdtvRc8ndGvwuds/g1bZQ== 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=tgm4R5uH4tZ7nv2R+bN4sepTZE/cef+kW8N7+irfSno=; b=nVdzU9A+CAU6duPfd61IiMrfJBYd7VNYirrUjVvay9bjrd8HfS0YnTbIEm65eOQBom0fOUDdaF6YQt9wRYu4g9l8r4OPWoyTLhEQ9J5tzT9Y5afUlI7xrMG5vXC6YVkz4MGTZoKIGEOrxWJDEPYiKyJRcBuxgqo8crxkBVfNp+fYGvRg05dfz+OGNUIw2axqXTDlQkPvlLth+sGrxljeIURTUJs+GLC/00w5iUMck4jqy8fCDLFDwBAsyfmNAPEoXtPcO6RKMpK3Gmi4mmhNuM8xmE+rk4t2ZTC0ogqwJcCliRfjuatbw5MGO1CKuqSNQTzagTVMzcKE9W/k3q4Q4g== 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=tgm4R5uH4tZ7nv2R+bN4sepTZE/cef+kW8N7+irfSno=; b=T7DAbsvyGsEcAuwpjvuuH0D6Y7OVPQwSY2omZKs04sLbXmU/OUoZcWmaNuyDyRg/ZikpJxYEswXQ4yKzw60zD+0d0knnGJ+m4Vt+eBL320fd6z8u4efNhVEj9Gv9oxVDZMQASVIpFtJOl/y0YkzhW5jirlyYFCQjUTa3MaQ9EXu0nmOfVJmSBJ1GNvec3khJaItILj7snQ1ujmGPGgQhfIYN+5u/qeM93aLzthXfr20gfZa/OoZbGzBdctonOhWMSIC0lQMR1FFGry0WJQRUsTjR3olqXy/LgceNs7c3NUHCZ9+G6PJbZxtAxKgCx7XbLBMV2aQws0z8qISOHQmJnQ== 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 VI1PR04MB9859.eurprd04.prod.outlook.com (2603:10a6:800:1d9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.25; Wed, 4 Sep 2024 15:49:36 +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; Wed, 4 Sep 2024 15:49:36 +0000 From: Frank Li Date: Wed, 04 Sep 2024 11:49:04 -0400 Subject: [PATCH v3 3/3] usb: dwc3: imx8mp: disable SS_CON and U3 wakeup for system sleep Message-Id: <20240904-dwc-mp-v3-3-319947736ec0@nxp.com> References: <20240904-dwc-mp-v3-0-319947736ec0@nxp.com> In-Reply-To: <20240904-dwc-mp-v3-0-319947736ec0@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 , Xu Yang X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1725464962; l=2128; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=5+IVkwBerM0rBDtlaz9W/KvOLIbVp8/vpBPWsSyKKOE=; b=99aFnmraoka2Wx+kQOgzshmrwvTcSyOaEC51xOBGH78f7+UGsCOoFgI7JKTeLsYUq6D536/DM J0w3y/00tzUACoEsb1pjOutjaz1ym7NwX6sXIEA1Y0l9JMNBpPsu/bh X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0008.namprd05.prod.outlook.com (2603:10b6:a03:33b::13) 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_|VI1PR04MB9859:EE_ X-MS-Office365-Filtering-Correlation-Id: ef20a551-ee3f-4d52-a244-08dcccf92d8c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?v85vhiSZJX4gG+1DDCwlvzS1k28ZZpy?= =?utf-8?q?GyXnx2bzYXU/63xzj3FOK0wgR++L/dk6e4yd8RdjgnakoICMaKfd/A+TGuXo7rB2r?= =?utf-8?q?+WoDGlYZHXMEDQ5pjBebb2Wg0ybI0x6yw2jWhx5P44+IgqDXBT6zRudwWByPPpgPv?= =?utf-8?q?T0Pa3fqMq5x+jUSPIlhtyF2c8a4uQeCQEKc0pRI3BoI0MIMCdTcpZBfLg+FC83YJC?= =?utf-8?q?LMh1p0E8Qc3TScyS/xQXkOIPEZLEU0RRDLZAzQHOcLKJ8P8mm7OSeBjWR0OdUh0Jm?= =?utf-8?q?WY6vpqzTpR8yjgK9+jdScARaaMBG2p+oaE9ZXo0oHpIMI2laje+ooG2rMqjUX+LvX?= =?utf-8?q?fQh3h8KQg/644H65ug08qZhl51O0DOYuTucwmcnRgwsUsT2aVHPxYvdqMuqiggjeP?= =?utf-8?q?bv38VAQ7VAEaqyHsHxq8odzVS5qJhTda4tfXyNYFuoJAaTX1+4pVM376sasT1kbaA?= =?utf-8?q?mWRUzjJssq7jgkletleJ9Lu4FcO2dDS5tAZlt382v7tUE7DTEUT7klhtkKuAkFYuz?= =?utf-8?q?LdsAm1Z2gFFPN7qt1v3J5fTxtBj2U7L1Wu1BpxmaeQOIFHtiXs9kL60p2RDIJZyGP?= =?utf-8?q?hzhPmNbU1MD8oRzUqiR2AUEqxczPr6q8a147n7x3JAUSRA95WiqSkT9reG/m00zwD?= =?utf-8?q?0Xhl+D2wVfKJuSyC+UT9rmJyyNJABiDoLtnJiZJAEQTxVymeYlM03fz1kv1q0Q+VH?= =?utf-8?q?GWkOkjuLZb6nF6WUGSQRStfCs48kXbHfA7r/fHQ3raxY4i5wgErbcajYr7LznN/tz?= =?utf-8?q?ZTbHGpPnilChoqru635nrBGR7w++RSuYUdqj5jBp49sJJckD4S4pgn/eMmukl2os7?= =?utf-8?q?lov3f0J3ZASYlmVO3bCNhQJHKt+70+vzqwHhdhbtzta7wBykX64N9WL8dwxUVaArm?= =?utf-8?q?8UjI+nL5xEJvQdpWSGP2qA/XtQ9YpdQj/GHotanu1YBtkki3zy0/riMMte7nhbI/0?= =?utf-8?q?mvPwf5IZlU9aL2yzMWA82JZ9+pRAshKMxiCKWnLosRMTKelMiqtwqeS0cjUZWoq1b?= =?utf-8?q?vwgdVtgEt0z0iQEI9Inifg9AzO27hKIcbRNKGHJPmRcPIX28VmBk54xOV9dMJbHze?= =?utf-8?q?fsWZY/yJG5jB+Oh5/E9i7WofRu6xmggfJaNzbZpLoafrYaCymWdzYh4fGmQBj59n7?= =?utf-8?q?8IyOClvb22f5q0VAmhiiMzZdIooEMwd2ffGXwGvDeqxgsK1yHFOVmtrJpLOkYhbT6?= =?utf-8?q?zWBx4L1Pa811ec8U0eV7Qh4ggkdD3qbU3WfU9arraIIw9sNgtyCEP9yACBviUystg?= =?utf-8?q?DhX1MlsEFgRNnNZZ1YBYVi8TVNOX1TT/xzBgUiecVTB2mAaLo8fIi6WMX1hQ1TZui?= =?utf-8?q?y/SmsZQjpkXCOELIh3dFjpNwlMczv58+bQ=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)(7416014)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?FbhnYGzDJ4uWODA4BGhDaNdEosiN?= =?utf-8?q?alYFszEPiLm03oc2hXwBysd6xNkLgMudf3rVmh/eGWr/sa9wcMVmbAs3JfeyQngrO?= =?utf-8?q?nTTGOzR5V/mPo0G7GIyjcWJDnWKnvJ/dMX0XsahqjivWYXaXPOUVrXBHxs+otKNpN?= =?utf-8?q?tD2nDygoV4Tmjv0GaArUW9t5f0OsN2+JpvrEn5eiVI6HbujYyRCs5y+cqK5eHEd3i?= =?utf-8?q?2SzEcK1BPSvAQ0ZvzkNvDpq+H+IP02EqUnjWQnFseOMryfhn5AGeEtoEEhMXpLrEd?= =?utf-8?q?3Z2qQA1tpKiO9IWX3j3ylH56MAyGgEmckjD/IzZ3Li032CilpkVCfM/WacBUIPBEj?= =?utf-8?q?8tILTcSvJri8BO8ajunsYFLyV+uPOmupAIkThIsJhcv7wt+A7Kyk6SUXTZ8NtQRtw?= =?utf-8?q?Aio8GulVxcNV96G/cfKAlaCOp1xHYaCZcgQUg/kN+PKNRdbFsl46TX6eA1R4YFI7S?= =?utf-8?q?KdVYqMOlTjyLEqx/Xo0cgrIw0zVIItKiLAvpRlFNE7p6rC5nqbKKajeYxSWQxJDC0?= =?utf-8?q?7dklO1TN8CD8XIttJwr6jU6lZQB23unCKmmlGqQfWFRhPLmUrB5GxcYn008Yzew41?= =?utf-8?q?6y9gR4hCyoapb6ZVsqHkALYuHnzf+9BhcU1F0ODsEsFtaQflbJFF0/dMihe+p8cUN?= =?utf-8?q?fl2hb0wutSXcZNG4c/XLDruqY+PRZXd1NaURfCYYFDZnGarZhJaAjO85OzFdB9wUD?= =?utf-8?q?TGsCZKTzd9WdT9b54IdNN/Lx1ktB+vHAIqLgoEmBFOziMKY9rCVNVsWsxloSW5KfH?= =?utf-8?q?4k641jv1VwY7HuNnqaz/GN02CeIdwTNyjO868vqfQVYXjI4817IUUF1FHbvMI0ZG+?= =?utf-8?q?dNr74aR+PCA9ulflSBz9UzVNDh3akfG9Gc3vJ49fIqjoxaj1NDsHsVP8vjqHt96fi?= =?utf-8?q?PHClfP3J8cqJlcF8ObBHuzw39ZZdWO10VzMCsTKaa60GfgwAFT5XNB9BG14gOfowL?= =?utf-8?q?2G3wyEFrqFUqG4t5RHKbwgvovP4gOQvL7q1msIgJFcQ3mezJDIf4Gng4tiXdosIvB?= =?utf-8?q?5m6a9ZSUnjhfe9r1dTEeLauhaw5JAnP0IVJXClLrTmlulzOlglkn141cIRxS/Etyo?= =?utf-8?q?3MIU1dOwIOtLKZRpoCAJOrzSzM5ss2hfMr/rDIL2lQDRsmuzXNSXSZFps/tqmzfCJ?= =?utf-8?q?uCnFlw7LUjVgga9HbT/uZo8dXQF5F3bBmmbxhuZzcHqZQon9+KHbiMbKShWP8xcsA?= =?utf-8?q?ox3Y3uIQ0CToeApp+PZePDPqI2xE6igCSG/CrR8dAcqXre+BCWwaqIQVjIm9KKQ+T?= =?utf-8?q?I3Z5LL1TPMj6MNznzaftM9ub1mJVJouQBygnEwczUdOagbpnrDZq3/DsUPJwYl4m1?= =?utf-8?q?ceGOtEx5BO71GcpVaUmPJ7156B0p2V+bn29UDzf6e+m29oxTfov/5Ld0fIVHM0Ido?= =?utf-8?q?/SeLws5mVnRHnUAo6KHiVzgjdE8K9k3VVua9ojVxtHPS59ArtU/VLqp/+gwyblOjs?= =?utf-8?q?LZYp0fWrHDcP4hgin1PYagl8aUoKP/hl/oQpEEmNkB88lwqt8t6onQuWSmSMqKige?= =?utf-8?q?FHJ2hx87OZI8?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef20a551-ee3f-4d52-a244-08dcccf92d8c X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2024 15:49:36.3740 (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: yvZBRkWRbeyB6SEgcK3aezGvL7RzRM82pHLfhdAoxI1P9HQ2g3Pn2ovVzUYwI8d6vccoV84v3Tktef3XuQhUhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB9859 From: Li Jun SS_CON and U3 wakeup need 'ref_clk' on. iMX8MP turn off it while system sleep, So disable these wakeup source and only enable DP/DM wakeup source for host mode. Reviewed-by: Xu Yang Signed-off-by: Li Jun Acked-by: Thinh Nguyen Signed-off-by: Frank Li --- drivers/usb/dwc3/dwc3-imx8mp.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-imx8mp.c b/drivers/usb/dwc3/dwc3-imx8mp.c index bd6953246f42e..02159cd820a10 100644 --- a/drivers/usb/dwc3/dwc3-imx8mp.c +++ b/drivers/usb/dwc3/dwc3-imx8mp.c @@ -96,7 +96,8 @@ static void imx8mp_configure_glue(struct dwc3_imx8mp *dwc3_imx) writel(value, dwc3_imx->glue_base + USB_CTRL1); } -static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx) +static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx, + pm_message_t msg) { struct dwc3 *dwc3 = platform_get_drvdata(dwc3_imx->dwc3); u32 val; @@ -106,12 +107,14 @@ static void dwc3_imx8mp_wakeup_enable(struct dwc3_imx8mp *dwc3_imx) val = readl(dwc3_imx->hsio_blk_base + USB_WAKEUP_CTRL); - if ((dwc3->current_dr_role == DWC3_GCTL_PRTCAP_HOST) && dwc3->xhci) - val |= USB_WAKEUP_EN | USB_WAKEUP_SS_CONN | - USB_WAKEUP_U3_EN | USB_WAKEUP_DPDM_EN; - else if (dwc3->current_dr_role == DWC3_GCTL_PRTCAP_DEVICE) + if ((dwc3->current_dr_role == DWC3_GCTL_PRTCAP_HOST) && dwc3->xhci) { + val |= USB_WAKEUP_EN | USB_WAKEUP_DPDM_EN; + if (PMSG_IS_AUTO(msg)) + val |= USB_WAKEUP_SS_CONN | USB_WAKEUP_U3_EN; + } else { val |= USB_WAKEUP_EN | USB_WAKEUP_VBUS_EN | USB_WAKEUP_VBUS_SRC_SESS_VAL; + } writel(val, dwc3_imx->hsio_blk_base + USB_WAKEUP_CTRL); } @@ -307,7 +310,7 @@ static int dwc3_imx8mp_suspend(struct dwc3_imx8mp *dwc3_imx, pm_message_t msg) /* Wakeup enable */ if (PMSG_IS_AUTO(msg) || device_may_wakeup(dwc3_imx->dev)) - dwc3_imx8mp_wakeup_enable(dwc3_imx); + dwc3_imx8mp_wakeup_enable(dwc3_imx, msg); dwc3_imx->pm_suspended = true;