From patchwork Thu Jan 27 20:06:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 537530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A46A1C43219 for ; Thu, 27 Jan 2022 20:06:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240857AbiA0UGz (ORCPT ); Thu, 27 Jan 2022 15:06:55 -0500 Received: from mail-eopbgr80041.outbound.protection.outlook.com ([40.107.8.41]:8839 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231156AbiA0UGy (ORCPT ); Thu, 27 Jan 2022 15:06:54 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GHbV+wkSox5XfEXJgmgzH/KS3zKsQ0Z3/xxEdKWVDD+/avvNYE/Dt5UeT7VW1KBKyt9Nx4ojrHj6mWqMVinR0X+37hsnpQmpFwPnPYsI5Z0Ez+5rglkhAI8NBDQeUutMFxkkG+ggFxqsof1pCR7G59/mNsfoJz8OdU0kUdptAFCMUAnUSRc4nBUl1liqUd5+kJaX++uFneYwm9VsPBky9t3zD+hMDx8v0bP5UBqc1Vgfn1OY8KXtideGyAkS+9wrxW5TkYUbtQE7cLJcAXfeLpiVTGwvAJeYPU4Ymh8h59nh8sedsWUTW/y4vTR/Ei1vKtANoss43DOwnDE+VCKLvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=46Vm8bIeJhU1m0VRjX/9XSG/qzVTA39GNLwzLHVb1Mw=; b=GnROZ6WQ5IT+JTzgKFXNS3sd9hvU1Kl+zsz7m2W0A6d5K3EGcBYCbigdezd6BBqxUeieyn8gTWA3Xr+JAZ5TRZB2dWGJd+padYe/l8xflF4KfKo3EgQ8RN+CEzR4Yg6RLr/8Nkoldp2ZnL5jEmXG4zaXlHr6owUqEG3kQHPzsGVVDEjJyu6ic/6VwKi7weZVkUtvBaCLFbaP9WkTVslZphSN2Y/e5uO1QI6sUah0g+T9lB/55R3be3y8n/liQONUKLnoTDIwc69HNlx2ZXr3siM1RIsD8C0Bn/44gK73GcR2mrwaeG1/7jnCrvxXmf7DHdvMpg5jaHJLbHBHiTlD6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=46Vm8bIeJhU1m0VRjX/9XSG/qzVTA39GNLwzLHVb1Mw=; b=bNkvicjWjMVBrqoDv8hKoAzOrNbuCApT8vKOV4GHiSTibzrv22AdURYafFf0Zr+LwzKBvIN/o6B/dUkjABMDV/J5bpJ4sBADh63CIqtaruHN5OGUgEDtZeEzfowM6gndeXVeRJCVAh6KJtoxHtjkVZgIZHybDk6s69n9vjx15VJh3HzpTbD9t1KMufJoTAx+CwwL65dKtKNTJEg0Dsend/1I5qYFQPh39L2I5Kt1po2X5mHFvFEHhPKOlsIWxgHsCvmv91Msk5pA5dJw1bvLWIb+qoluxsVFodMEvgDy9o1qErqYBNjnN5ikzUea3SiZZVQyqfHzhro505ksP12bOA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by AM0PR03MB3747.eurprd03.prod.outlook.com (2603:10a6:208:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Thu, 27 Jan 2022 20:06:49 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95%6]) with mapi id 15.20.4930.015; Thu, 27 Jan 2022 20:06:49 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Hancock , Baruch Siach , Felipe Balbi , Thinh Nguyen , linux-kernel@vger.kernel.org, Balaji Prakash J , Sean Anderson , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v3 1/7] dt-bindings: usb: dwc3: Deprecate snps,ref-clock-period-ns Date: Thu, 27 Jan 2022 15:06:30 -0500 Message-Id: <20220127200636.1456175-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127200636.1456175-1-sean.anderson@seco.com> References: <20220127200636.1456175-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR12CA0030.namprd12.prod.outlook.com (2603:10b6:208:a8::43) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1c9f9522-0ada-4588-7550-08d9e1d08dac X-MS-TrafficTypeDiagnostic: AM0PR03MB3747:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5kCFidDosfHvSufI4Mbb+mrlcsk8bwiKCvO9f/a6l9b5/otLequub6XnKwr8zBuCKiw6s+dK5/NEBh8FFJMUM5WwFJoVbDbl7FSHBdwwIyhCDxL4NAEQpnbz2ydmZ/9jgDPKW2k/pQoK6OVRHSB3WrpK7IOyWDzM3nqU8Fb6RTTsTPzVx30eQATjjKB3bhz12j7T93piPtkr5G61iaBPkK/y5JEfwnJX6OxOPYfSkQGwk1RF7UepUT7yTpIfCt+D+6llG6x/Qp7JDmoPTW8Ld9s3UQhn8Cup34QC1THNu2xOvUsEetry7MKhXfJBHEU88KTldcYtSLRerdJCNao7ovFGm91VN4fMIScX+6YQcrNDn1MC9A71tM970Q2D+CIFOlWrNOMyaVAEbnU9Y7sUDLxxDLU9//FvaLWIxIbJYHoZh0yqGDLP3PR8KcroJVxUTDKV4WQj6icqwFNSqyrJQJywUBuwRwSr5uwj9u5GF3bLE0+PvKw4OfcXGXuNSKX4ra4gmFwskwwKQmU4gTpR4MdVrEBneud6N0KocKm8fXIjCnKuiGdaL9xnUxYpXbc41geKdpawErgdNDZA6To6hDq6rrd7GOshP7nwPFn2JZwILzZbcnl5KtmhU+BQqJH6g7HS9D8OZPEH4MqNVu2+HUPYGqeuGSXjTFHaNDMElJNv+A0wp9QRBmB9nda5MjtL5iU0PLOigJNbmoHJDbQFXL/JcrCsHvJj4+TWclDLs+f2dzKobN4Wd2ATaM/UZsfUmC8X16E6ee5IzeC+YTaSm3p9wI899MiYtWLXfamv1XI= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(52116002)(6666004)(6512007)(6506007)(2616005)(186003)(26005)(1076003)(5660300002)(38350700002)(38100700002)(66476007)(66556008)(66946007)(4326008)(8676002)(8936002)(2906002)(44832011)(7416002)(54906003)(86362001)(966005)(6486002)(316002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dg9i1cwKlWCGlGmv34bjA7XuhivQWRO5eFDzaamrkKP4sI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opL0LUHrsySOO7MuL/Ec7vQc+spzjbZ9bPcRiX196xEMVtufh5SbomT/tjTxd5+wPQBx4FTsW+Hff4ddXJMbj7RMRBTh3M0wETiWeinqj+AXuvdtCA3017WwqR8YxYpl2NZO2r/64Y/7XCQPS+k0Vjq9rPhCLX66kXybxof0Cy+3IFMeTJf4hzSNNv8wtLlK2mt2RkngRolT8gQLzj0Y8at+hrYldBO551rGAvf2zVEr3Ua3XqB7XzMgBVra5i0GYAHWNEviX6qb0g/yBjncvLrX42Td2kVI45u4LCpxqM6w3QxuhREOpe6SO3mQhLerPPTYUq+O0+deNwr+3bQ5EKF7Mw9f9h2cRvY8S6m3cWogFM879zmvsNnu+U2MY7vilVtcXDd98tdEAg2jKYnG5NBR6j2ZZ/f0ub0uYArQgSs6iATLRQX4HDGe9NMcTCsXMyvldL3YisWB15ESthn6MH6FB4t2mFpGr3E1x2ccpoB49GG8x1tra/eLg8= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c9f9522-0ada-4588-7550-08d9e1d08dac X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 20:06:49.8003 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mKUlRb58TOkKAs59Umczkh0Q1xOwojRx/g+Una0+EGVprL9GORLhwF9vN7CK9/yh+nD/jSpRKggYTOeH+5b7Cw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB3747 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This property is redundant because we can determine the correct value for REFCLKPER based on the "ref" clock. Deprecate it, and encourage users to provide a clock instead. This also restricts the minimum and maximum to the values documented in the register reference [1]. [1] https://www.xilinx.com/html_docs/registers/ug1087/usb3_xhci___guctl.html Signed-off-by: Sean Anderson --- (no changes since v1) Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml index d29ffcd27472..4f2b0913ad9f 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3.yaml @@ -263,8 +263,11 @@ properties: Value for REFCLKPER field of GUCTL register for reference clock period in nanoseconds, when the hardware set default does not match the actual clock. - minimum: 1 - maximum: 0x3ff + + This binding is deprecated. Instead, provide an appropriate reference clock. + minimum: 8 + maximum: 62 + deprecated: true snps,rx-thr-num-pkt-prd: description: From patchwork Thu Jan 27 20:06:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 537888 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1A6CC433F5 for ; Thu, 27 Jan 2022 20:06:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240274AbiA0UG5 (ORCPT ); Thu, 27 Jan 2022 15:06:57 -0500 Received: from mail-eopbgr80041.outbound.protection.outlook.com ([40.107.8.41]:8839 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232984AbiA0UGz (ORCPT ); Thu, 27 Jan 2022 15:06:55 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SFRxIK84Ydd0dyxTPiHbQd/u7vA4m267NWheVVc43ya6aaN9aeVQwcrKD9S7lWfXv9xvuRP1AMCDo/oKxsMTlSHXpnw4QcrKvBLRfyf8JObBGj264IzwmRuMUp3UebO97VHw7i8Jg0ArGYlm3y4PGq9AfMA3h6ZTtKoTinzkc8PTnPj6HT/aNsJOHil9k5rLgf/U70IczuhJEi6VtPl8u6mdbIIKrYMWFQ7jdJnGTlAMpfGwMtzKxSJEDuEa7t5ewFl2i+KRL04XL2Y4VrjF8uc+yDTZd+mfwNwXJnLHFDj23I4eIkdWcKNdYL1kAqpm9C8rTPiJN2MwMzNNJj2f0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=YzHP/x+dYHR6FvTXMK0BLZIhC37+aiehnMT9dxjDGf4=; b=ZmNyEUEhQbtkHd5BYaF5jlhZmjRubsQoBtxkCMCGSMFDc5/KAdIsbcmtHb1qNm7aoZ7LHcml4bR6D9BlVJ2JTwpJqg7tflNHen01GzOD/uglmpFQa1xGPUvehEWsOLa/uf3/zTUypZmBG+wXOzLbNbSYYZrCg55Z4rbhKK1Qq2xc72xuTc8BmP38AcYAu7HyQmm+CBIz0oa+18bMdI8vMsV2ymqw67zbfJDqLV2NQKQz7+8F5sLRIYyEbmK1hlo0hADxg962C84XZ86LOE7KsTrEkoBS0dy0AD3ciiHMzmJ9+o7XsA4GIExfbIg/BzKHm6M+NfIolpEcMQPxju3GyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YzHP/x+dYHR6FvTXMK0BLZIhC37+aiehnMT9dxjDGf4=; b=BErEmWjv5fZmi90Rqd1McUJwbcKNbz0ZEgaRjMHPGGyfU5gG526mnU+pICUNXixhbFCNAMgLR691ssjEv1AmH/qEWq25PPzP02P1276VJ1C/zJyk41SR3SptwsgHlkioGweAHelRZMcQxU7MVTtDYiVCoa78j4Jj6kBjXSBJIKr+gePd1xSAgMwNgYalKTrVFI/nz2QRmw1nXv5QvnOFUEPTxnn/+LvXbRlBK7wM4LFGy7EcOWQdXDrGYINgfS2bRfJcZMxlfDQhDdlLajTZCXrkt3k3tykIePWKdEg9JKr3DZDP6/6TbLq5c/TyY7pL+S0n76PiZm78dBdXR7hMfw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by AM0PR03MB3747.eurprd03.prod.outlook.com (2603:10a6:208:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Thu, 27 Jan 2022 20:06:51 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95%6]) with mapi id 15.20.4930.015; Thu, 27 Jan 2022 20:06:51 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Hancock , Baruch Siach , Felipe Balbi , Thinh Nguyen , linux-kernel@vger.kernel.org, Balaji Prakash J , Sean Anderson Subject: [PATCH v3 2/7] usb: dwc3: Get clocks individually Date: Thu, 27 Jan 2022 15:06:31 -0500 Message-Id: <20220127200636.1456175-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127200636.1456175-1-sean.anderson@seco.com> References: <20220127200636.1456175-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR12CA0030.namprd12.prod.outlook.com (2603:10b6:208:a8::43) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cf0f319d-b56e-42de-17e4-08d9e1d08e96 X-MS-TrafficTypeDiagnostic: AM0PR03MB3747:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XdjEH8OQJNMJ8X4C/wj3l+u60LS9xtZ3agBZ8mxCTsSSY8SBU6UhQsUnWUJrkT5W1YwRPUgOTecOExok5QyIGiTl2BtkcMCN+mfN99PaDSYqspaRb3IxGq9pR/6AW5o0OuFheAdPtSw8aTmgrpqEHRYhbTF0Sh2NkGYVubAxRcHcb5LI863v/Td51HOMHUoxcdc+N3WGS9KNi8hPweYJMnY13HzZRtAvEIv6tOIXOYReQUlfdCrRr7tI0yBlkhDzdDu0So9D1RR/idwq8kDTx2rli69e694U7ERQZ0iNvS9ofzY+AzzC2rRrzALQRh0Px8H/whnXDKAI9fvIuOafOeljQLv8x/5nHkqDoszHFYFb4g6GVZQ2cp+kBQRBiz7qws7feks4OkHoyMHGco1IM2dfA/RdfnLQgIhbDwa3ZECqVwfS1+N5h+dZySvOOvfsDeb9qlYjZnNdo4IrIUPfkUkREBd/l1cCOrPlD0v0CXN0BQury2Rkesw+1frzEz2wIRq89eHX3xCgH/SipBLauYkA0ZyGyCQL8RpOtXxdejcA+7q5PBhyP37FxzkV2dGaKV6jELkSLy4b/GrQYugHPoYzdVsxKbE+w41b3KrpJjRX/lWMKUsjMc7z5N3VoLkp4JQupuQp37UBzeh8Rj1tWP8jqcIiSF84AipYEcYVypnJwty/3gNlCGphxBNALOImYUEZsyn9I4/gZT4RvDJsdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(52116002)(6666004)(6512007)(6506007)(107886003)(2616005)(186003)(26005)(1076003)(5660300002)(38350700002)(38100700002)(66476007)(66556008)(66946007)(4326008)(8676002)(8936002)(2906002)(44832011)(54906003)(86362001)(6486002)(316002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tzyz9kM3xDiAagzo4Wi7XJxg5C5BYN1lIvy+JPi2LyDpbncZNmm9LqnAzsv/1PT/k/N8rX+gB7QpTGZPUw1sky6KACW1AR26WOfE88qeUCJ1wwdTP1H8s1JqnQXpD48T8u1Lz8YDmbUy2RK0I8mS4NFPuF8cL+XtcXTFjwYpht1qgUHwy/cvU9yeAsaT2ECZFk7dfjBHzXhbP9mutT4MkJzu+3VpowKBg3se5M0rOWD1BMuW64axSsNcy0DPTswOJHWvC7aManxneUq5dLTUJXgEruCPuXxDHYBtzyIeCnp+vetWVgN7pHhv+mhh6kzVoRr2SHMt2Umspm8OCfN9wt43wwyJb76G/wH1m6SZpdAvuGMt0lANTS6FS60kQC+y4sw1fKS9fRH7/T8skGOeVn8DAH1VRMb+UKkHQQcxIb483Au9MoFmQ6xQ1YyvHoeMRD5azcrmMr6N3/XsmpszcfNRy85m2plwwLdCI+QMc0S2pYCZhSGayqs7B5iS0u7LZTBI5WNmtWm9s/Rwuf/BP0ewpSsM2VOQuSGcw1cnuC89Z+2aL25tpdpLEpRe4/N9AWPmAcUyAw1oA96oMjTq2quUXm6MNCu6+HWTgH0Ibtcav/G7su3HS/hRYsELtpiju6XKS3DPvUhPP1EzDIoN+uuUpcTQMaqCpH2QdRuk3UKu+Mnj1sEZM1/k/71EAp9MbjrqZ80dm8X7Q0aHMsMFAPKMf1L8HKm0JCrnvFANp3uWBSHrcSlEJUmRQdoNxf+AplRMV+k3E12phDGjfAsB87/kCLnGwyx4tkpOohPNdAqpzEhXWFPv49XG1GHarwV1LWJvH2RFLg+rkbAMy6WUVAXzodjo5OOhA1T2+XeaO6PKhXesbjR8+1J3URdrJDsgdZGDPeF9SlwtxTFf7xxvyYuEoR/B9TTwqN3AP8q/OhDGb6NhRATGxyQyZ9XvCsHAXZulPVe3G9NssIFZF0iexcYhMtBM7Im4IiEpmNTYNhW2Z0kW8E9kF4P5kycNg3ops1902xMKFqgwJxb0nA7skL0dLmqiuVMiMYfC34pelPqH9cTpHsN4eSxOblOUVp5qVP7yncuhlxvpsFkx+j39x0S+y8mVI7cHg9DT2EGyhcnCvWjLPxeL1HdEHDh4BugKq23QNxxoTqUhB8S6JFPSTkLwiSvDe+mYxxyHD1DzzLKsJuSgLBTCn15VQtDEAyKlRFvHwf4K+MM9/GNAoqIKbNKVDebwmyRPkEnySMtSV8QypvEunBueDyMNOMGhj9cWYatjQ/mvopkKH1cIyJWnvZMuJ49wU1mj5VGY3pfPM8+8u4PlH3EKtO62OyfDriuqdOewA3MOV9GVBd1omGqTN1GQZhCvHxZxVjF3I7BBGJVV4gN1dDvTp2KBfjx1/mXXA5qlgyX0RIgJN7E0dtccjTzdbEh/Xuml/GcKxzrwZT23cFTAHd+1wA6qgRWubSt3bp4p4DkeDl59Uwjz3DbS40b9tSaNqb8/yWrh1UHvj7BqcbGFM7j+d8L+msY8pmBr+oCTyLBKc4SnCcxnDx5P9mJ4NpSoepuMNwcIcsWvVJ3S8s+XlTsv4WrLVfOd6xsdyvrxFa1cRAmZpMPLKS1Whiu1wAXN9vTXftyzikvGvW0= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf0f319d-b56e-42de-17e4-08d9e1d08e96 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 20:06:51.2221 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +KWIdU2qjwX4v5sGxjEGvumalowcjr6e1r//hAWk+etBKv9MVSpmYrZJgDmzObmd7xSUrTG8P2r4iVZcJJajSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB3747 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Instead of grabbing all clocks in bulk, grab them individually. This will allow us to get the frequency or otherwise deal with discrete clocks. This may break some platforms if they use a clock which doesn't use one of the documented names. Signed-off-by: Sean Anderson Reviewed-by: Robert Hancock --- (no changes since v2) Changes in v2: - Document clock members drivers/usb/dwc3/core.c | 62 +++++++++++++++++++++++++++++++++-------- drivers/usb/dwc3/core.h | 10 ++++--- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index f4c09951b517..699ab9abdc47 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -745,6 +745,38 @@ static int dwc3_phy_setup(struct dwc3 *dwc) return 0; } +static int dwc3_clk_enable(struct dwc3 *dwc) +{ + int ret; + + ret = clk_prepare_enable(dwc->bus_clk); + if (ret) + return ret; + + ret = clk_prepare_enable(dwc->ref_clk); + if (ret) + goto disable_bus_clk; + + ret = clk_prepare_enable(dwc->susp_clk); + if (ret) + goto disable_ref_clk; + + return 0; + +disable_ref_clk: + clk_disable_unprepare(dwc->ref_clk); +disable_bus_clk: + clk_disable_unprepare(dwc->bus_clk); + return ret; +} + +static void dwc3_clk_disable(struct dwc3 *dwc) +{ + clk_disable_unprepare(dwc->susp_clk); + clk_disable_unprepare(dwc->ref_clk); + clk_disable_unprepare(dwc->bus_clk); +} + static void dwc3_core_exit(struct dwc3 *dwc) { dwc3_event_buffers_cleanup(dwc); @@ -758,7 +790,7 @@ static void dwc3_core_exit(struct dwc3 *dwc) usb_phy_set_suspend(dwc->usb3_phy, 1); phy_power_off(dwc->usb2_generic_phy); phy_power_off(dwc->usb3_generic_phy); - clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks); + dwc3_clk_disable(dwc); reset_control_assert(dwc->reset); } @@ -1605,25 +1637,31 @@ static int dwc3_probe(struct platform_device *pdev) return PTR_ERR(dwc->reset); if (dev->of_node) { - ret = devm_clk_bulk_get_all(dev, &dwc->clks); - if (ret == -EPROBE_DEFER) - return ret; /* * Clocks are optional, but new DT platforms should support all * clocks as required by the DT-binding. */ - if (ret < 0) - dwc->num_clks = 0; - else - dwc->num_clks = ret; + dwc->bus_clk = devm_clk_get_optional(dev, "bus_early"); + if (IS_ERR(dwc->bus_clk)) + return dev_err_probe(dev, PTR_ERR(dwc->bus_clk), + "could not get bus clock\n"); + dwc->ref_clk = devm_clk_get_optional(dev, "ref"); + if (IS_ERR(dwc->ref_clk)) + return dev_err_probe(dev, PTR_ERR(dwc->ref_clk), + "could not get ref clock\n"); + + dwc->susp_clk = devm_clk_get_optional(dev, "suspend"); + if (IS_ERR(dwc->susp_clk)) + return dev_err_probe(dev, PTR_ERR(dwc->susp_clk), + "could not get suspend clock\n"); } ret = reset_control_deassert(dwc->reset); if (ret) return ret; - ret = clk_bulk_prepare_enable(dwc->num_clks, dwc->clks); + ret = dwc3_clk_enable(dwc); if (ret) goto assert_reset; @@ -1711,7 +1749,7 @@ static int dwc3_probe(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); disable_clks: - clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks); + dwc3_clk_disable(dwc); assert_reset: reset_control_assert(dwc->reset); @@ -1755,7 +1793,7 @@ static int dwc3_core_init_for_resume(struct dwc3 *dwc) if (ret) return ret; - ret = clk_bulk_prepare_enable(dwc->num_clks, dwc->clks); + ret = dwc3_clk_enable(dwc); if (ret) goto assert_reset; @@ -1766,7 +1804,7 @@ static int dwc3_core_init_for_resume(struct dwc3 *dwc) return 0; disable_clks: - clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks); + dwc3_clk_disable(dwc); assert_reset: reset_control_assert(dwc->reset); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index e1cc3f7398fb..45cfa7d9f27a 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -978,8 +978,9 @@ struct dwc3_scratchpad_array { * @eps: endpoint array * @gadget: device side representation of the peripheral controller * @gadget_driver: pointer to the gadget driver - * @clks: array of clocks - * @num_clks: number of clocks + * @bus_clk: clock for accessing the registers + * @ref_clk: reference clock + * @susp_clk: clock used when the SS phy is in low power (S3) state * @reset: reset control * @regs: base address for our registers * @regs_size: address space size @@ -1134,8 +1135,9 @@ struct dwc3 { struct usb_gadget *gadget; struct usb_gadget_driver *gadget_driver; - struct clk_bulk_data *clks; - int num_clks; + struct clk *bus_clk; + struct clk *ref_clk; + struct clk *susp_clk; struct reset_control *reset; From patchwork Thu Jan 27 20:06:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 537529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B309C433EF for ; Thu, 27 Jan 2022 20:06:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343746AbiA0UG6 (ORCPT ); Thu, 27 Jan 2022 15:06:58 -0500 Received: from mail-eopbgr80041.outbound.protection.outlook.com ([40.107.8.41]:8839 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231156AbiA0UG5 (ORCPT ); Thu, 27 Jan 2022 15:06:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JLuse11DLWB20rbK+3t6UfKo1YX0+HosN+3Y3iIW4Mz3HvXY6Djc3iRMGG5cn8lw9fTtQYUNQCKkRbEnIumZfxwV2lTf667rT2UyeKZu/eAAPssZdAUZ9P31/KyIHa31ccFMtVh9Hr1vqKnFfphP+gKsg7uvjBcvewudLO2Wu7eZ80zkfgpYgfTVHm0VrnwKD38KZUgqx2YNCWIMv2RpWYu4PMMAANbEGi4rPCTMpthzYXEO1aLcjDSaAKmZa2JV9Q+MgLG1zDFuVyatk6JxfWQBfdQgCHhvBxpbMk4bHToKmov4MXNnzF7fNjLPcRQibnfPwoJEcifbyU8BEAhw9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=VQ9q5vjkZjkiyqauylhlD5CDmI0n7NoRcRcreqp/J/Q=; b=NHbrVgWh5M6bpgH7OGZWI95KtbiJPHgERSjcJLHpfQiINMVRmgWEPBXdOTrYD/VbGKiOzd27nRdQAqm4HjLt5ileFyUsrNvLwtlKnN9p8Tz516hrV/QKXp60Yk3o4mTdsnr0ifk6ho2EfxvfH081rEzTBfMCTVJ7DOv+npAzC7u8cc1cdbBTJiWni7YR8iC83swBslz4C2MmEptVPKXzE6aBBPZo7ugWO/t0cZkwRwUkqVQ5ZSIJEUScd3BnQzXxfPxNh/laMbvkv5gwDnuzuWlY1szq7gObjIKY4h0hJ8Wc9cSyRFt6YrdOrMVN7RqHDkVZkDuFWrUgBTQi7UgMDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VQ9q5vjkZjkiyqauylhlD5CDmI0n7NoRcRcreqp/J/Q=; b=lwlTrpQWIuj0aI/dWfIna3A6VFFp1AdjziKKqy5QnPXjv2xC7C0vca4aGFvpQyMSl8ORm1F2TQPvZJ8sl50RpmzTVduLQ+QoPIotohG8tYMSXtNrCtjvET4ZJKMCvHTwb2CFAp/XPYbnWSGBl9vUI7yAFr12Lcw3o0xBrQkFTObL7K2zo0l/vqzZVoTu7O59y//wxm4QxT24jNXepfQVjisWsJsTGz35UT7V9zi1ygeoc+s+oLWsgPBxDX6BFuR4rV5eexs7LqRn7V3m7c0Mh0018ptgO/s6whoxHyUxv2rSlYKf7hT+OtdRhgaSPhKnTdPSDKam7MfpdcwJ5pDFWw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by AM0PR03MB3747.eurprd03.prod.outlook.com (2603:10a6:208:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Thu, 27 Jan 2022 20:06:53 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95%6]) with mapi id 15.20.4930.015; Thu, 27 Jan 2022 20:06:52 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Hancock , Baruch Siach , Felipe Balbi , Thinh Nguyen , linux-kernel@vger.kernel.org, Balaji Prakash J , Sean Anderson Subject: [PATCH v3 3/7] usb: dwc3: Calculate REFCLKPER based on reference clock Date: Thu, 27 Jan 2022 15:06:32 -0500 Message-Id: <20220127200636.1456175-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127200636.1456175-1-sean.anderson@seco.com> References: <20220127200636.1456175-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR12CA0030.namprd12.prod.outlook.com (2603:10b6:208:a8::43) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2cb61563-7f64-4717-0a54-08d9e1d08f6f X-MS-TrafficTypeDiagnostic: AM0PR03MB3747:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:949; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W5YlZA/EMLMQjqgUPRC7a75ACXTPg8jo8h1dNxfQ87RpH4u/enRQYe9vcI8AIrc2rVt/rSbxp//JcK5Fkv1Z5VQsup9jfX0Yor3YyztK6Bg5p5ZC8QAtqseMmKtNGDKz9MitdjGCVKJ6UCs7LV8qhnsmIBY7qSLfm0jJanyvoSugi6Hk/xzHnVTiNl8xNA1z/t7YQ5tAjh80Dhsp5gdgzwH+AWOsK2rjMlkQmUJ7OPRJo38qN22YQbvAZUMlNDax6Ujc+QDCjClIRxC7tv4Dn+YvCIe1QQd3e+qS7cJ5QVb3uO9fpSVzR55R+M6vIE/BC+htZhkChjFWAK7E8mxUEsuMf9RBEULZsYIgoPaX9/FyZNwor4njFQa5Fkgn6EK/w1gIdntLjJEJD5WTxRnLcHxHV3rHXsZWmGpS8D0flhFPWrVY5cYapxN3Zq+c5vvP/xUwIBbADDwNuWajQjCgAMqcEDLpQ/+BrvCxfIvGxuMx5h8VbkKELes0nktVWMN+wWorXApcddJpIAYKsHastPv0ffxh8YrHLP+srOApZOD3WXS1fco1k8G48jwjbJdjBfPAgZC0jJwYDfrmjEWLJmonpreYfG2FviPHvwpO2Hm9K+S9VAhW2knjXFM91AP4RIvuvVRPfr95YlPxwzCtW1iPngHQ6mXHp5Rv1TDa5+R6hOEx4EdqOw9aFDwqlpOG8nxFAEbCxOn10g3yuoJW8w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(52116002)(6666004)(6512007)(6506007)(107886003)(2616005)(186003)(26005)(1076003)(5660300002)(38350700002)(38100700002)(66476007)(66556008)(66946007)(4326008)(8676002)(8936002)(2906002)(44832011)(54906003)(86362001)(6486002)(316002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5QAo6ZazratIQXIReL/Z5mr5O6RLXvyeeE8wA3HjwELt8uGF0U53WwaQbKgg7qTYbgdJlU8hZBgp7mOhrlcuKJXtmyJg6GJQ3FwRsue89E4k/D3KbViyug71l4Uc8eMz8EGjLD9P63G3O/kB9on4NHAS/t0nqd/fC5uj1uSPTDy/RmKrMHTBEOnaSyEY9XmEznLBiNvY/GaR4B5nVqHBpYAJGfNYsrzdcVVakRdBOGTnvJiLgrnRVCRKQrd1HzAxWSvSf/n4bIRaiOgKEPVmyvDqde5canLph2UtkzXMDRdgtj5o3YAbQIt1UjE2guJi7+0SWAyHr/oDnsMLmR80VDBgqAdc+20jHPteX7PhGwMTkpk8/gB8QB8Bic8dktmGB8qTK20L0ZIAN7MH+QAMvz6sSZ1M4UDoPqBiuU4XFVqgJRnF2x2Npk0z/ZnPA5fA5NIQwymdVVORUKFjfw/AQRyuf09g6WZzKNqzj/LrS+lY2ly1B/VBLOIKOC+87wimHud9milnjPTNMK2HXIQl2R9t+ECLcskIXp3OOrKsN5gAk/9yCES5EwIO9cbEn09tAeh6izeOzWQ+wK/7Fl3gtqOgs6FWGoS7hlfWNbdzNUDMke9ywGhHAJq2192sfNZpbMvDzGM5HAffN6PKvrp/RCtcyZ2JJbuiXIj50JN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B4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 20:06:52.6595 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uS1cLZkDHDTfvvvNjpRjE5JU3SnJ/MiFPmsFG05H7vjcWpDkqWLDVruTOfKIB7nfgLrjaoNZOp5y+9oqBFyTTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB3747 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Instead of using a special property to determine the reference clock period, use the rate of the reference clock. When we have a legacy snps,ref-clock-period-ns property and no reference clock, use it instead. Fractional clocks are not currently supported, and will be dealt with in the next commit. Signed-off-by: Sean Anderson Reviewed-by: Robert Hancock Tested-by: Robert Hancock Reviewed-by: Thinh Nguyen --- Changes in v3: - Define each variable on its own line drivers/usb/dwc3/core.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 699ab9abdc47..38fef5c74359 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -347,14 +347,24 @@ static void dwc3_frame_length_adjustment(struct dwc3 *dwc) */ static void dwc3_ref_clk_period(struct dwc3 *dwc) { + unsigned long period; + unsigned long rate; u32 reg; - if (dwc->ref_clk_per == 0) + if (dwc->ref_clk) { + rate = clk_get_rate(dwc->ref_clk); + if (!rate) + return; + period = NSEC_PER_SEC / rate; + } else if (dwc->ref_clk_per) { + period = dwc->ref_clk_per; + } else { return; + } reg = dwc3_readl(dwc->regs, DWC3_GUCTL); reg &= ~DWC3_GUCTL_REFCLKPER_MASK; - reg |= FIELD_PREP(DWC3_GUCTL_REFCLKPER_MASK, dwc->ref_clk_per); + reg |= FIELD_PREP(DWC3_GUCTL_REFCLKPER_MASK, period); dwc3_writel(dwc->regs, DWC3_GUCTL, reg); } From patchwork Thu Jan 27 20:06:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 537887 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C9A8C433F5 for ; Thu, 27 Jan 2022 20:07:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343825AbiA0UHA (ORCPT ); Thu, 27 Jan 2022 15:07:00 -0500 Received: from mail-eopbgr80041.outbound.protection.outlook.com ([40.107.8.41]:8839 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229896AbiA0UG6 (ORCPT ); Thu, 27 Jan 2022 15:06:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bLcTp1T34HmDWx9XhFCI4i+H2GHIbfHAeYwOrIFrj+4KgQyg7uAnPyvzt8RCGWd/qpLXLw4612yTtTzlfEsDIOJpDCpQ9jTxWn5dzTDOsac95KfWPeHy4uSIA2u2yA2ctgzD+ApFc7axHFByehF2F3NPaMfu16eBpZKf+v5gVro75bsu08DGjljyNcw4FrxFVNnKgo5XiJws+2TUzBrcT/yri2nu/VqtuPEWmFjA3PiEP8j5wdEKpBss44UjtmYrTlIlOeqc7qedWpShZUxW2/zPIdD54d16+j0F9SSX74HL7GaHHppxnluXL4vTl2iaIWWGgTm5/2CGYJWOKs99DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=sQqbC9Cm9iNn+dOVl89ZLb/i1B9Eg7sRjcVDhjYIsQ0=; b=Rogd4cNbvUQZsTne0m0QFvkKVzlP7H49YQImKl3yROt9SP84o+tWophgEFFhKp4cxSFupECErFl+6EC/Z7pEIl6hxZl7p30DAHMMq0L7KxMT1WwGFzJ0GEy14Lqgl2UMoKHwxdGvwQgJe58klXzL2/ROs6pOlUvg96P22/bp5YDkU6/dUpdqyOtIhVQAvxfA9J80jkcKvLvinVRIeEN1aTY25GyUwxCXXz9oKd1PQhAdPkdxkU5zZE0d7ieVrGH11a3XnLm5m10V9GAG0vHAQ5j49f6RUSbDJBdKeQSnDANrn2pIU5TLoawDxwBVDp5+CjHVBX69ctmsSSB2kz48vQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sQqbC9Cm9iNn+dOVl89ZLb/i1B9Eg7sRjcVDhjYIsQ0=; b=1m/djmEA7RLx0OBiuHcdKqIgj+RbHOUczpGYdgqzDvtnIlmYrHJalG/JJ94nwzbXjrW1fA7ntI0Cz75GIssLr4P2DUV2jnDo9+g/tpXhSXfpvaptvJDeUjfYwz/jVqFqtPcIWldQWun68ideWJR+a6/fPFEn1EKwAiiOOAaL/GKRM/0tFbvRKuaJsgY8TRppJWeG1jUgnsyFWw0U1XqUjTRI0Ft5wkiLxS6kOBgGx+DWM0QO2RxkQPgabvAPdZgIMmN6o+lDzx8B1jF32A9b1rTukkPj3wDzPt1AwGpUmDbrb4rQacp/V4blSebp8U5qhBojjoC6X6bhr0lX0LvgLQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by AM0PR03MB3747.eurprd03.prod.outlook.com (2603:10a6:208:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Thu, 27 Jan 2022 20:06:54 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95%6]) with mapi id 15.20.4930.015; Thu, 27 Jan 2022 20:06:54 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Hancock , Baruch Siach , Felipe Balbi , Thinh Nguyen , linux-kernel@vger.kernel.org, Balaji Prakash J , Sean Anderson Subject: [PATCH v3 4/7] usb: dwc3: Program GFLADJ Date: Thu, 27 Jan 2022 15:06:33 -0500 Message-Id: <20220127200636.1456175-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127200636.1456175-1-sean.anderson@seco.com> References: <20220127200636.1456175-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR12CA0030.namprd12.prod.outlook.com (2603:10b6:208:a8::43) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4e08ba2-25db-4880-4a9e-08d9e1d09056 X-MS-TrafficTypeDiagnostic: AM0PR03MB3747:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1OJny+sQQrAlU2HGqPYaiJo34PYd5r22m4Nu5CUVcZv8ppPba1zGwECcllJZ2Bi9GvTdR58j2QSVTKhmBUkD7WbYdUnFUF7QKQ4r+GqCoJGBlTjqIb4S6DzK0w4NTrEKBJ2+1wVlzuXsDW9BbhotSJwmsPEyHMvtGbae8QTqbiezhTTBLSfiM19Ut25O7cdFE5OeA82jlDGnQy32r+s1rodiVG+22zHMpzJ6WtX4XuQ3E3HyB7JCt1+CHvH5AQTew5qL5fKN8uJ8GBzR2dRUqDqy1cPaze0pah3oWW6m0t8bY+NvOSL51uHKIrwlN+DwZ1MtnDMRdb7lERgTGMqTLxftdADe7rmOkeu8RwtORV8B5lwvotV++de67ntpywfP2SHcTl6580aCzRucIfWhXATnIDsUoP/GJUGLUZ1Lq+5bkoQWEhxfDTQ9St6Ur2Hkxp4rY5uZRj5mVYApGgsojl0SpNyh9Bf3Yxh0CXvf5//VSWDfkYvAmWAPcV/oTd3WzocvquXhAubnZAxDKQRz6j1MKrYScuerj+/mixsNu7GB9W1vCzPruI7NaSXhnyFFsS3tFn7UQVNrELGzk/j61OxTWsAhgXgrG30E1fD1UbkGooLpCOqba3ICbeIlOVtlu9A/9otkkGVIdmXjYQ+JRc0q08qFHA3ahvjU0/470ag5i6Jhrl1EaNyA7ethrGanuig6bQ/mc3W5NY81m7PyRg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(52116002)(6666004)(6512007)(6506007)(107886003)(2616005)(186003)(26005)(1076003)(5660300002)(38350700002)(38100700002)(66476007)(66556008)(66946007)(4326008)(8676002)(8936002)(2906002)(44832011)(54906003)(86362001)(6486002)(316002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QaXskUVVkM8zhDQSynMiKyeiEHG5OUo7L8Duo6N49BBk+05vHW6nXCSB/m8iS/Dfy+WoCt7kJdVIw4XYgWlnXP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IqQpf/CnidkRTuZj+9+slv9IwgLdr2QQMHnWi6vd8I5lIg6wZ8Q76oqCtkyM5n/2tCRyqnWChTLHM9AFST+P3UO9Sdr9nU81uPvlxNNSXSob2HiBlkIgCRqKSt5p/2iVTq6fmHosG181nlVeILqfdQ9n32dwn06UW7TvJlfyTETN89uRNMiV5aMcwccx7cmZO/2e9MHoGNdsGqs+ek9VBNd+GcTgvBUFvpYdL8zTsR7ojzHylXW6vO5ffOKG667gJSRRTulkCmqCm0NW0NnaleX4bAsJxr1/ztgdvzJ2P2OEXca2WVIu8Hml/js+15Ww1FQslOFqS0YA2nyuO5LQd3RU2jsqEFX4BaygWkkJ/Zr1P2Z2SG1K/Tlz9U7LvSGARLYI9cx9L1ekT5EE8aF85ACO8p8oaVoha3i/IebMvj+g/eRWRtsS5UQwse8xHS9fnQliZxfAF/FyyBCSrGRFjGoAHGPgVMzWhiKk= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4e08ba2-25db-4880-4a9e-08d9e1d09056 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 20:06:54.1438 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wj02t78SSqocJiMClGUq17WRkWsv/S8T5E4yiYHgAlM3hggH/ZNVN/FpSAWk5wwNcnn7aNT/7QAtsRlgkNgAYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB3747 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org GUCTL.REFCLKPER can only account for clock frequencies with integer periods. To address this, program REFCLK_FLADJ with the relative error caused by period truncation. The formula given in the register reference has been rearranged to allow calculation based on rate (instead of period), and to allow for fixed-point arithmetic. Additionally, calculate a value for 240MHZDECR. This configures a simulated 240Mhz clock using a counter with one fractional bit (PLS1). This register is programmed only for versions >= 2.50a, since this is the check also used by commit db2be4e9e30c ("usb: dwc3: Add frame length adjustment quirk"). Signed-off-by: Sean Anderson Reviewed-by: Robert Hancock Tested-by: Robert Hancock Reviewed-by: Thinh Nguyen --- Changes in v3: - Define each variable on its own line - Update comment to notes some things mentioned during review Changes in v2: - Also program GFLADJ.240MHZDECR - Don't program GFLADJ if the version is < 2.50a drivers/usb/dwc3/core.c | 39 ++++++++++++++++++++++++++++++++++++++- drivers/usb/dwc3/core.h | 3 +++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 38fef5c74359..18adddfba3da 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -348,6 +348,8 @@ static void dwc3_frame_length_adjustment(struct dwc3 *dwc) static void dwc3_ref_clk_period(struct dwc3 *dwc) { unsigned long period; + unsigned long fladj; + unsigned long decr; unsigned long rate; u32 reg; @@ -358,6 +360,7 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc) period = NSEC_PER_SEC / rate; } else if (dwc->ref_clk_per) { period = dwc->ref_clk_per; + rate = NSEC_PER_SEC / period; } else { return; } @@ -366,9 +369,43 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc) reg &= ~DWC3_GUCTL_REFCLKPER_MASK; reg |= FIELD_PREP(DWC3_GUCTL_REFCLKPER_MASK, period); dwc3_writel(dwc->regs, DWC3_GUCTL, reg); + + if (DWC3_VER_IS_PRIOR(DWC3, 250A)) + return; + + /* + * The calculation below is + * + * 125000 * (NSEC_PER_SEC / (rate * period) - 1) + * + * but rearranged for fixed-point arithmetic. The division must be + * 64-bit because 125000 * NSEC_PER_SEC doesn't fit in 32 bits (and + * neither does rate * period). + * + * Note that rate * period ~= NSEC_PER_SECOND, minus the number of + * nanoseconds of error caused by the truncation which happened during + * the division when calculating rate or period (whichever one was + * derived from the other). We first calculate the relative error, then + * scale it to units of 8 ppm. + */ + fladj = div64_u64(125000ULL * NSEC_PER_SEC, (u64)rate * period); + fladj -= 125000; + + /* + * The documented 240MHz constant is scaled by 2 to get PLS1 as well. + */ + decr = 480000000 / rate; + + reg = dwc3_readl(dwc->regs, DWC3_GFLADJ); + reg &= ~DWC3_GFLADJ_REFCLK_FLADJ_MASK + & ~DWC3_GFLADJ_240MHZDECR + & ~DWC3_GFLADJ_240MHZDECR_PLS1; + reg |= FIELD_PREP(DWC3_GFLADJ_REFCLK_FLADJ_MASK, fladj) + | FIELD_PREP(DWC3_GFLADJ_240MHZDECR, decr >> 1) + | FIELD_PREP(DWC3_GFLADJ_240MHZDECR_PLS1, decr & 1); + dwc3_writel(dwc->regs, DWC3_GFLADJ, reg); } - /** * dwc3_free_one_event_buffer - Frees one event buffer * @dwc: Pointer to our controller context structure diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 45cfa7d9f27a..eb9c1efced05 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -388,6 +388,9 @@ /* Global Frame Length Adjustment Register */ #define DWC3_GFLADJ_30MHZ_SDBND_SEL BIT(7) #define DWC3_GFLADJ_30MHZ_MASK 0x3f +#define DWC3_GFLADJ_REFCLK_FLADJ_MASK GENMASK(21, 8) +#define DWC3_GFLADJ_240MHZDECR GENMASK(30, 24) +#define DWC3_GFLADJ_240MHZDECR_PLS1 BIT(31) /* Global User Control Register*/ #define DWC3_GUCTL_REFCLKPER_MASK 0xffc00000 From patchwork Thu Jan 27 20:06:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 537527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF574C433EF for ; Thu, 27 Jan 2022 20:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343900AbiA0UHV (ORCPT ); Thu, 27 Jan 2022 15:07:21 -0500 Received: from mail-eopbgr80048.outbound.protection.outlook.com ([40.107.8.48]:8578 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1343902AbiA0UHH (ORCPT ); Thu, 27 Jan 2022 15:07:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=llf+gDyCWOIZHdj765edeAA4vG9tjagm+SseFz7bO9r+/Q5PVcoGPx7hiVDhfYc4YX+eNuisrhlw1158GxgRpIgIEJztelHVfa2/hUdfq4i+5Wt1D88xJ53TLatYHaMTrxsITrctHTp3GAwzOMn6g+wR6UYm5QoIbu4NYlO8adboobOPtJpf+lLNPyBP+4wVlP48aWB511PO5wnPR04n84hHShwb0eqgGyMewT3mzJFwcxO8V/mB4WLVtsjMxHR2nsVGtGRVFiSl+d2z1+o8tbGFhsY+8EP4+YVJ+XfSnXK/K+CsA55qD2klDLttsxkwl48NjmLHC4AmWkbZsLnkkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=wgBwSh0kQq7dSSkSCgEhzJKq5a2+wi2LkqjAXYiKt/M=; b=XIi7MG/SbNBq5KhUUKX5VhN1mxtH1TrE2dysERDoD09XQ8E5Bkq+ehTsFQ7bIGM/PgYgyjOP0oheHSJmqk+qzpCFbozPDxjLY8kCDKL+Qrp+Jj3XvPrnaFghnrS3mBVB18Kb3P4swczIaqNw6UnIxZs4xJpasq8ma90dCH3kDrm5DMK5+pZf42ygAr7cBeopVxtTc+CcczY3eohVdTS2k9Ym04foLE8nxMsiJ7ATOGD6oyWQRQrlDlwV+QMUinPZH72BHKjzciM/YTAxYReAOfVO4+G9g+qUo95HmXgwylesdShQTW5kuqUv3t0+3/KgzJHB4QnKxtiKVW8P6sYbvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wgBwSh0kQq7dSSkSCgEhzJKq5a2+wi2LkqjAXYiKt/M=; b=ZzKJk+e5MdHQhyHbk3fBpALA47vqqfLk1rCmNat7NjzVvu6sK0+WxKO3AGfA3X8MRKjZdHPVPrTjGBCfALexmnOHLOWE8MU04CaQHGelJ6viH4TiJ6pd+BUsAzGpbhgYJqJUb4zHaVgHFgHQCfvxGrt3QOrOe+RLEhS3E4fREKtlvvAB8OhibC2QuKUErPDaVoneFPVKBzS1yQOr1vK7h4fFuQj/vTSnuiMhYEhgzSP7x2z41dZueQxlEKSohxUUgQeMjH1AsJJbjmMpwOO1TNgIQDQsOiK2WgomJgsqeBdlNiJDnHweueZ8npT81fA09FkZKe1HGoQUAAudNtJK9A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by AM0PR03MB3747.eurprd03.prod.outlook.com (2603:10a6:208:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Thu, 27 Jan 2022 20:06:55 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95%6]) with mapi id 15.20.4930.015; Thu, 27 Jan 2022 20:06:55 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Hancock , Baruch Siach , Felipe Balbi , Thinh Nguyen , linux-kernel@vger.kernel.org, Balaji Prakash J , Sean Anderson Subject: [PATCH v3 5/7] usb: dwc3: Add snps,ref-clock-frequency-hz property for ACPI Date: Thu, 27 Jan 2022 15:06:34 -0500 Message-Id: <20220127200636.1456175-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127200636.1456175-1-sean.anderson@seco.com> References: <20220127200636.1456175-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR12CA0030.namprd12.prod.outlook.com (2603:10b6:208:a8::43) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99d50b98-d9b6-48fe-b3e5-08d9e1d09125 X-MS-TrafficTypeDiagnostic: AM0PR03MB3747:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /dspQIfBrcZ0gBLHUVNBkjCwK9+B5iTJRKZr2y1H1PXwFHayDa52BqXdvzdcgYALQ2BdWMajA+qgr/WOYDTt1IDpmRie3VRROXhqi3Pch76mKLzu8BxOxY9d1SMDsv2ge1f0wzk89qJUy+kPzXU8JzxLaFyVr8ACMSBG0sqOWh2nphZyBbMLPq8seZ6bZnusouo8SB7DQf+DmtntHYo+/h91df1PeOH16/qoB239tus8SOkwOjb4ERKhALtCvWAjwFSuMxYgWS/6KDIY2X0m7ib9HYIHiBpq1AUaQq3rdhwkYQQmZXj2SSBXrBMSqlayfxiap1h3XHXd3Ksie5K1s79J9bJd5H7kPvOrWEx2iizd53uGWa46S22kVmrSpqui+u0cHrq6AyI808bVUkwb+Ud2D7m9MSCAnA5FQsp3odoDizZQZUZrF1QaMmBHbMtNKnJWaWuZEG69I138MOPQnlAM5I3stuLn6PCjP+XFVUffo51cnqw/XUK8zinMVUoE/fmGbLjhMTBzY2h/K7E2VUfQbYzthrPexcMfqEcZGxWemaUuOODdOCeMFYNNMon83dYcm3qVkO2YkKpCQDPtOtG/5tuwM8hm4zi4zEzzgiTao11lz02N7stbqE8F/a+pINwaWZgiUlE8lYcCc7FePdZgLzYNl0ZPBpihALKkvjX4PYKCTHtuRg93RnzDHcZrtF776isZdrSae66bmYg0Pw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(52116002)(6666004)(6512007)(6506007)(107886003)(2616005)(186003)(26005)(1076003)(5660300002)(38350700002)(38100700002)(66476007)(66556008)(66946007)(4326008)(8676002)(8936002)(2906002)(44832011)(54906003)(86362001)(6486002)(316002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mZgAfBxBiDZxwFaMqTz1YSIg51R5P/SXNhZPsS35CkCks+l1KLnjKePC/MAy0RvPfF7HcajHUcRMdQ8h9j3bq1zNDdMRmAnpNy+0zeSgokjZ8J0V+wdrsJptsVHsPd1TneV5qThQ7Jx1J5kFKGxhBCIhd8zEaB8NtfSH4ZylHZaBEyvQcdBR1jEEa7Kia9ZHtAkpIX72wVjozzOa71cYFfBdKfhqz4mNDIs6JUn/6P2Fl8EY/h3mWSgNQHYt7hFFa/wbLps8KnUGpYCV6mj07F0ULNvkMZi5rbFfDc7+6qnWoyKJHUx3SOO/hzXZmVzyFuq8X+aVDJiFkwFv0yns6Qvcatq925SdaramsaZGvrv4qsN1pOyK8t8VYP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hpxmuANxf3i73XJezQ/5zwe7jqqAKqsbG5WlkJzfLi+n9a2BaRHZF9CaF3rCm93Q/6tP5LAFkEPClKNP6DBQ1RCkURXW9cQiwYVAUTESAqkqnOTPjwffIrS8JejlEZFMhjkM2gVGRD5St1+aay9iF+FNFqt8rD+4jmAViQFKP681YVKnUzOjvKxP8= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99d50b98-d9b6-48fe-b3e5-08d9e1d09125 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 20:06:55.6593 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /MJVvwmRkoryj2stIr66PPEFCdjUPMU5807mCr7gvcGabCjEgZ2U6a4WKABj5Kk8FWjp5LAqSwLhK4c0+IeLZA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB3747 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This property allows setting the reference clock frequency properly for ACPI-based systems. It is not documented under dt-bindings, since it is not intended for use on DT-based systems. DT-based systems should use the clocks property instead. Frequency is preferred over period since it has greater precision when used in calculations. Signed-off-by: Sean Anderson Reviewed-by: Thinh Nguyen --- (no changes since v2) Changes in v2: - New drivers/usb/dwc3/core.c | 6 ++++-- drivers/usb/dwc3/core.h | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 18adddfba3da..c1b045121672 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -353,8 +353,8 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc) unsigned long rate; u32 reg; - if (dwc->ref_clk) { - rate = clk_get_rate(dwc->ref_clk); + if (dwc->ref_clk || dwc->ref_clk_freq) { + rate = clk_get_rate(dwc->ref_clk) ?: dwc->ref_clk_freq; if (!rate) return; period = NSEC_PER_SEC / rate; @@ -1497,6 +1497,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) &dwc->fladj); device_property_read_u32(dev, "snps,ref-clock-period-ns", &dwc->ref_clk_per); + device_property_read_u32(dev, "snps,ref-clock-frequency-hz", + &dwc->ref_clk_freq); dwc->dis_metastability_quirk = device_property_read_bool(dev, "snps,dis_metastability_quirk"); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index eb9c1efced05..00a792459fec 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -988,7 +988,8 @@ struct dwc3_scratchpad_array { * @regs: base address for our registers * @regs_size: address space size * @fladj: frame length adjustment - * @ref_clk_per: reference clock period configuration + * @ref_clk_per: reference clock period; deprecated in favor of @ref_clk_freq + * @ref_clk_freq: reference clock frequency to use if @ref_clk is missing * @irq_gadget: peripheral controller's IRQ number * @otg_irq: IRQ number for OTG IRQs * @current_otg_role: current role of operation while using the OTG block @@ -1171,6 +1172,7 @@ struct dwc3 { u32 fladj; u32 ref_clk_per; + u32 ref_clk_freq; u32 irq_gadget; u32 otg_irq; u32 current_otg_role; From patchwork Thu Jan 27 20:06:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 537528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36067C4332F for ; Thu, 27 Jan 2022 20:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343919AbiA0UHH (ORCPT ); Thu, 27 Jan 2022 15:07:07 -0500 Received: from mail-eopbgr80048.outbound.protection.outlook.com ([40.107.8.48]:8578 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1343798AbiA0UHB (ORCPT ); Thu, 27 Jan 2022 15:07:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R/NVJggK82hS0kT+92BTxUsi5+ZX+FbPLPlHsemhHk3K4zANBaUdSVcM2xRnI0DpVI/VT/3Csl/0fWT7tV6GUx10GGu/SjlxS5CERC7/PvywEVCW7S4TyxGm0Dj6u9WdSPnQVYsXBsfLM5decLB/7ahU50uVKSSUPHb36iYcJ92jGY6VosfrLCo+zyotKi5/nIzfgVT2RRZh6j+gzW6NbR00/KiPHa4CiLEu9/VribDsE1uQTbD1yXf9VFT4dGnu8j8cCnxyom/w9Q4O26JWfUhL6f7E6tzIph45oieETusLC585LbAZ3qvLwp42aA7z4r3kREKfLimKaMvRwGN2Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=CjmO1aJ02YXPHvIBw2dQ4CZxCglLwtE81S5gVBri/f4=; b=WaETHt5m42PwnQI8XLgBMsJ50FoiwqkpUDJ1lYEzacXCnQq2C+gcXr1UXxW/4QLWyH+df1FfT+sZapjyGA0KoqWmpM2VfGYOYGjT9mhdMU1w/aE9dSjHkuDdFbMwnnR+dthLV7+8/ff5MRUjeouH2kEh0cWkHApO30gMaQDVR9FDHjwBqZSR7xKqKr9s9IhLePuk66de9SDMPYERJIil/AY6gVzMY2WkeUVpZzpG647CCqVcysbm6mBzZN+J2iZXy0loYuCAZe3x21LSKa3TxTTLLIKWZftOzucBSLhkflYS7fKL0I0+hJhVJJPl+Jdu+7VSKjgqPQsTEWiSysqEXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CjmO1aJ02YXPHvIBw2dQ4CZxCglLwtE81S5gVBri/f4=; b=KktodpScVguZ2T7yJ2e/M+JZgMEVoivSq2SCkkUIkcz0uq6Sax2nWnuE8JkhPzyfXKnAZGI2q0n62G6EKzgsxon0jJeW68zQS/vaPPNWJni7t8gmD1s4n19r4PaEF0xdEvdXe90oBrF6bleOAQk2Ey6tnsHjWvFTUxMzwio9y6udRynntJKtLqcqhCQutaH3XukNfPI1iXQysYphoOo++vsdprnjjJdSPAg41/NbleyQctu5Nm8OH9JoMaYlHcBKPWraJzwv7gOJtaJGMSWuZzZ2ghi7RW/lqL2NOfhyoMLwxDvMPq3lzGU/tnzKsYlf+5qghivbEduCLpWsFxDMWw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by AM0PR03MB3747.eurprd03.prod.outlook.com (2603:10a6:208:4f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Thu, 27 Jan 2022 20:06:57 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95%6]) with mapi id 15.20.4930.015; Thu, 27 Jan 2022 20:06:57 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Hancock , Baruch Siach , Felipe Balbi , Thinh Nguyen , linux-kernel@vger.kernel.org, Balaji Prakash J , Sean Anderson , Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 6/7] arm64: dts: zynqmp: Move USB clocks to dwc3 node Date: Thu, 27 Jan 2022 15:06:35 -0500 Message-Id: <20220127200636.1456175-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127200636.1456175-1-sean.anderson@seco.com> References: <20220127200636.1456175-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR12CA0030.namprd12.prod.outlook.com (2603:10b6:208:a8::43) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9d0d9533-6908-44af-f042-08d9e1d0924a X-MS-TrafficTypeDiagnostic: AM0PR03MB3747:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1923; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GMvZHa8AolUXDJkqeXZ5Q+9v+aFAzZw5AT8aasZVKKioUHEcKWB0rZOxBwf0MEpuAel+tO2ibOL3ebCjmHL7GFV+a6rIL+c6JhiYcGyDhJ2QVnK3SWl1NSP92gDu9TTpdptReBv4Biejq+4ZGrMpdS1mR8WcFud8mUZeEd8+zhEpqYM5dnwZVELSkAJotwY+hBQEGAxKY/ZjfnBwmxDmSGLEUOc3wEsXt73+nINEE3cIWf7nsZ59coFBksTKOJyhzfFr47d/Rmiyv7mECcHn6c1pIzTg48ooZizrGcTsOqm4iSJze1a0MhEriValVpPWcG0dIZp0Ih6YCiTmGXxOibJOfAbTwEBCygLhRz7/yTcB/S7XlUWkrv6eNAhROduLJD8KcrPnqM3ZjuWWcWDyyKfXI0jZu5EzMmTjB08SPU41Se74G5eRpuYkNgSLznFbPjYoLobHLZhb9dCXGpbLwiSCGxWe9HlwnqFZF5CVOTeN0mXp+GS7WVsJbSo8+xC/cp7Y437py2PbqNjucMUFGHcgRh+FZmy/fHcTKhmJ7UdTWytW2J0W/ykol2TJGw1HbMyYFxnBIuuI6AbN1AXJ8lxjh//O18AclNMWbyl+y81a10ScyDps6PGOf3Iq49OhOSvJpFEG1KQjApyPTv9vD772LSrqiIA1vv4UMwcOhviD48FkW9Bq/h+T97ZuSCg3QaEnJPNrUD0xLn3jHXYeqw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(83380400001)(36756003)(52116002)(6666004)(6512007)(6506007)(2616005)(186003)(26005)(1076003)(5660300002)(38350700002)(38100700002)(66476007)(66556008)(66946007)(4326008)(8676002)(8936002)(2906002)(44832011)(7416002)(54906003)(86362001)(6486002)(316002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Had5sFbY71h2jma+E3it2v/hshjy19GUP/Pby98Y8luly5B63M+vSOHYHU90mQIuni8c68RpgvxWYAW2PSz3K60NHUVD51EelwtiU2jN4gRu3N3pfd1EY5zm5WIwmYp2oB/jgQjJ53kwUJ04ya9K5vfwgjxDTUfyhtVzG4PltwD63v7hacxlQWGzaxEzbpCgaYDbVVAcms/5/ANNX4nVy+tSJQlk/6kM/8SzoLkILg4XzopbM9qznRGFU5cqqfLQi42VAu/FXsqZfZQmNyjeqpB+Y9KDrbHWbYIoQqvTd2R7ukk6u8KhzLMx+UiUtfJcwJ2ChpKZC/q5q+5wwlHkaD6/b2c7I6EqS/7aeY8YmuGtbc8fvsuDLBllVg4dc7hkYPWAflmnEUDbf/vVQi6OKQpvBnYbQV67POYzT0yzdKdftN6fg8khC4u77k1nKyb9mpUmys3KlVpDrVS9dnp0cjAlqBLmk9y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2IlG+xCSGbR0YQ8RYXOkGvzPrw4rqTJK/JJiE4wSMfrr5INOnFb2lE+KfNQj2JsUVMwUBoFGSnlN67BCtLjmt3LoVGLFk8jSe4QKU= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d0d9533-6908-44af-f042-08d9e1d0924a X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 20:06:57.5186 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JizCKAbbeQ1d8t7PbUH/3sU3HaTC8X2WDQfcOdmOCV4j+yY2F3Wby70tT8I/++d0JEnH0hXzEsIRN39sezOkuw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR03MB3747 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org These clocks are not used by the dwc3-xilinx driver except to enable/disable them. Move them to the dwc3 node so its driver can use them to configure the reference clock period. Signed-off-by: Sean Anderson Reviewed-by: Robert Hancock Tested-by: Robert Hancock --- (no changes since v1) arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi | 4 ++-- arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi index 1e0b1bca7c94..8493dd7d5f1f 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi @@ -223,11 +223,11 @@ &uart1 { clocks = <&zynqmp_clk UART1_REF>, <&zynqmp_clk LPD_LSBUS>; }; -&usb0 { +&dwc3_0 { clocks = <&zynqmp_clk USB0_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>; }; -&usb1 { +&dwc3_1 { clocks = <&zynqmp_clk USB1_BUS_REF>, <&zynqmp_clk USB3_DUAL_REF>; }; diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi index 74e66443e4ce..ba68fb8529ee 100644 --- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi +++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi @@ -811,7 +811,6 @@ usb0: usb@ff9d0000 { status = "disabled"; compatible = "xlnx,zynqmp-dwc3"; reg = <0x0 0xff9d0000 0x0 0x100>; - clock-names = "bus_clk", "ref_clk"; power-domains = <&zynqmp_firmware PD_USB_0>; resets = <&zynqmp_reset ZYNQMP_RESET_USB0_CORERESET>, <&zynqmp_reset ZYNQMP_RESET_USB0_HIBERRESET>, @@ -825,6 +824,7 @@ dwc3_0: usb@fe200000 { interrupt-parent = <&gic>; interrupt-names = "dwc_usb3", "otg"; interrupts = <0 65 4>, <0 69 4>; + clock-names = "bus_early", "ref"; #stream-id-cells = <1>; iommus = <&smmu 0x860>; snps,quirk-frame-length-adjustment = <0x20>; @@ -838,7 +838,6 @@ usb1: usb@ff9e0000 { status = "disabled"; compatible = "xlnx,zynqmp-dwc3"; reg = <0x0 0xff9e0000 0x0 0x100>; - clock-names = "bus_clk", "ref_clk"; power-domains = <&zynqmp_firmware PD_USB_1>; resets = <&zynqmp_reset ZYNQMP_RESET_USB1_CORERESET>, <&zynqmp_reset ZYNQMP_RESET_USB1_HIBERRESET>, @@ -852,6 +851,7 @@ dwc3_1: usb@fe300000 { interrupt-parent = <&gic>; interrupt-names = "dwc_usb3", "otg"; interrupts = <0 70 4>, <0 74 4>; + clock-names = "bus_early", "ref"; #stream-id-cells = <1>; iommus = <&smmu 0x861>; snps,quirk-frame-length-adjustment = <0x20>; From patchwork Thu Jan 27 20:06:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 537886 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87399C433FE for ; Thu, 27 Jan 2022 20:07:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343945AbiA0UHJ (ORCPT ); Thu, 27 Jan 2022 15:07:09 -0500 Received: from mail-eopbgr40070.outbound.protection.outlook.com ([40.107.4.70]:55685 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1343771AbiA0UHC (ORCPT ); Thu, 27 Jan 2022 15:07:02 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y/dH1L7M5oHWFt2np+IwFAdbr8HAEJ9YZznAChWhzkOCz12YPoyPC84aUIbqR4res68Jt3DgS+1sObWsXLlqGwHPgsu+fWKWhNqu54eI9TgIwhGCGKQNzlQuyqrW6QQiPmaJaHj5pC27aLc6XLmrl2xXnUYwcWOQrKO63vB7wk9ATm8sakP2cP8nrjS/bYSoD7TbJsuo2H+NxjjKw6WHveOSiuvP+35DwA/sD3KYpvItJu7eISra5FsNH00X3dat7qdRC+tGETS79uVAgge1Tq+qPFJbHzbOT7MZpqwHEKaEqh3OQFGBvPBXZKVltmqKGHq2rqO64+UnrHP0rWk2Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=3iTbNcgMHKQDn2UQ5Q4s8qZrx9GE3+86V4LoAq9OCT8=; b=EcR4e+HTN3XD7nK8XvN0+dCvAgrkLnOUwTZbQniHr850JsJneqnEs6KkfY6D1tK8zuch+IZ/0+DdHl5xwp8OGI9kqAPbWtyg28PBZtn5+USXFWImOx0GK6MBmC8no2ouV6ZOihEj+0bAHPT2cvbiLT4SXxXhdGoHte7jVF6D9YlSZ0+EyJWjPTiMyCTkKgZ/sWhEVfLeHwQ9sKq3KM/Xxy4Z74SJrlq9CKINKTF1fpPd5+/uz4gNHGB3Z7dNhaQ34WmLFLO0X0rV4K952rHKYGg+gJdoKVsq4Oxf/yrq6T/son59mj/LWRdq9ztZxLmMhCln02kAHbn3GN5g0Gv9Yg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3iTbNcgMHKQDn2UQ5Q4s8qZrx9GE3+86V4LoAq9OCT8=; b=ofWqgLpIm5IBi4sdAlHuU6SlRpRFsSy+mBr7pbzTe7PZZIBqxklSSWv9O0HcvtbR6fiowjE+WUI1qoUgljZLeNHzXIkbWHAiIqQ+b0XpT4a1fvTA+WeHkDaE7k+9ZnpuLhRD0eWGBdSsDRw1097gqyG+F0odhSIRP2xaPPabPS/S/sp4Bj+9aXKVjoIq7P5ep2jD98Lhn8EzHMgQFTDsshTA7hyhp0EHvl1sbctWEgQoxDVBoA1fGmmsGQWgnGjBsgFX1Gq90OYtc9n6uHHGC5XQksI7xRmxrGQaPUmqID6Oavm72Xo+BDizf9V7iQGok800yzhAMX+bgm5K6NIPLg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) by PA4PR03MB8158.eurprd03.prod.outlook.com (2603:10a6:102:2a1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.17; Thu, 27 Jan 2022 20:06:59 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::2d1f:654e:f946:1a95%6]) with mapi id 15.20.4930.015; Thu, 27 Jan 2022 20:06:59 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Robert Hancock , Baruch Siach , Felipe Balbi , Thinh Nguyen , linux-kernel@vger.kernel.org, Balaji Prakash J , Sean Anderson , Andy Gross , Bjorn Andersson , Rob Herring , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v3 7/7] arm64: dts: ipq6018: Use reference clock to set dwc3 period Date: Thu, 27 Jan 2022 15:06:36 -0500 Message-Id: <20220127200636.1456175-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220127200636.1456175-1-sean.anderson@seco.com> References: <20220127200636.1456175-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR12CA0030.namprd12.prod.outlook.com (2603:10b6:208:a8::43) To DB7PR03MB4523.eurprd03.prod.outlook.com (2603:10a6:10:19::27) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0bb5a1d-bfd0-43a7-2ca6-08d9e1d09370 X-MS-TrafficTypeDiagnostic: PA4PR03MB8158:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ohq+/+qv55S2m2TaDdx+ErPAjnC9Lf8Jxq9QH6MLqNsX66V0KAS6AfCWVJ6A5/S2FVyZ8FxMHrKTS4VdDCqJtbMCE5M9aX9/oFXXR4YCAlejWiONGUN6by7GgtinYTix+YMzDXrPm9I5fUZxQAlKkimQOWHctNIMOOOgGalmlm3T9RzMF8xQeJycs+A6n1wABI+hEHzVLVlrzQfIvm+FYEzApqmzrupnVBqM3TTW3qtGHQPtdF52MvGqVFY+3znR+ovb1gBfl/BSks4veA5tRzd8b/kMiMGa1uIN5oWGiYEbmc7MTxkLAUj1UzEJN8z5tg+5tnVSIOu9btFSr9Z74zBehamE3lH3KNEovHk29Tff5Gz5um9z6rCfRda+v8fMocNkEQt/GiksAKP8vKj9jF4D8PXYD/ZmSWgJf0Y6mwpA88z2/2POn+rtmEiSP5B7eoD8pLu9BOwaPYI7ZQB3lPpTBNlt/H+xqiaNsY8iFJryBCOW7ty7Mx6r25UhE73NpIc44CAFPyamvvihBe11lujB8WTH8IztH1QOOVGMTLj8SRxu598wq1Vm+qwCUTX4ZUGb2lygTqL0DfC1X7SCgHxNYhP2t/C8GfmFYzQVKFkzRu/GLKHednyuGHyCHMyRBDg7Yi5aiZBRM5S0tT1vxrpe/qFtO+dRUtoPKL+JlSU+L9/CE1Eng7SDGtPMgZ/HpC1EKW2zu8IbVsyKZk4GXQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR03MB4523.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(186003)(36756003)(6512007)(86362001)(2906002)(52116002)(8676002)(8936002)(6666004)(6506007)(83380400001)(66556008)(66946007)(66476007)(44832011)(508600001)(2616005)(316002)(6486002)(4326008)(38100700002)(1076003)(38350700002)(26005)(7416002)(5660300002)(54906003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: V5WJRXL12av9C2EtNvlRZqYapFR9OwNU+dwr99XSvXkc/lazya6ZcOGCT2p/Y8/c7SoYDnjiaVCun5dtSHB+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fVb/WrjUPkWs0D0bReFMuoVW4qDOLwARHrQv0HxxIT6xWKmY1y7KDHDNcqYLy2swAagxVhiNHduENRzbFNZ4tXXGDd1sI8LwCF1geXIvvGavbsQHEWzFxS1DdqxTla2TxF0Hh3euCQWQ7oPOpCZ0oz2DGF9q1Hx3fBQ0WwByrbnPCWQvVKe/U5WFn596cIzODtN3v21t2fcpVlNOT6TxmB/j9HmewdAuabnTlouXdk50nV5307ea9kfsXopX2eKZ8lPOLWSzZ2fecfLTJRvJ9570U/dNnEPbVT6DcnVigJGU4BmG4STC0XizUcEF8rr2W0ho5hscEVte+Au5ntl1XJn+adY57+TrEZ/MDD2+IBOsQEpt3jXGU0VCIwYS8rbiHNDDpJULBpmNKIpsmsD3OKc5mBMTMA3c8TQr1Hwy7ph99VQ4mscvpFA2Vxa96x+TJXzZ1jzw/q0bS6eHUrKNrKpFUKdTL5c0hI= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0bb5a1d-bfd0-43a7-2ca6-08d9e1d09370 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jan 2022 20:06:59.5185 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BSl/+SIB4QP5kL9VptxEG1rZuT6a/DV4TT2eTxhnpUIkgxOcp5CvRh9rpQ8SSqWb+JQ8/i3a4zI7V+jdV5ioTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR03MB8158 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Instead of manually setting snps,ref-clock-period-ns, we can let the driver calculate it automatically from the "ref" clock. I haven't reviewed this board's schematics, so please let me know if this is the wrong 24MHz clock to use. Signed-off-by: Sean Anderson --- (no changes since v1) arch/arm64/boot/dts/qcom/ipq6018.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi index 66ec5615651d..a614b9f73e2c 100644 --- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi +++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi @@ -743,12 +743,13 @@ dwc_0: usb@8A00000 { interrupts = ; phys = <&qusb_phy_0>, <&usb0_ssphy>; phy-names = "usb2-phy", "usb3-phy"; + clocks = <&xo>; + clock-names = "ref"; tx-fifo-resize; snps,is-utmi-l1-suspend; snps,hird-threshold = /bits/ 8 <0x0>; snps,dis_u2_susphy_quirk; snps,dis_u3_susphy_quirk; - snps,ref-clock-period-ns = <0x32>; dr_mode = "host"; }; };