From patchwork Wed Jan 19 00:24: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: 12717019 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 C8DAFC433F5 for ; Wed, 19 Jan 2022 00:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350448AbiASAZA (ORCPT ); Tue, 18 Jan 2022 19:25:00 -0500 Received: from mail-eopbgr80059.outbound.protection.outlook.com ([40.107.8.59]:23461 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1350435AbiASAY6 (ORCPT ); Tue, 18 Jan 2022 19:24:58 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mlg1J0KHSQqJ8SdrjcPc5hsJS5a9+AXLO6bmyZEaNRJcz9nDmNrjTHLzrHBNkB/jKfEjpbodWcNYOL6n9m9l8H8oZWMXRRT8w8XBR2o+OJBY+3R3NhG4d4LAaFvZSEq0hYuFTg1iwAdpwIqt49aWilfTcjnAsoj7unKNhWl53Vs6fI+gmbYGVuvEt/ezYshWP3ke0l6CQ96ErtJ8bsWnWr8ecm7wOj1Tj0ByvurxMuRl+BCxAKnBzG7pUiO+B7EMqSYMRpA82aUYkPNU0a+fIQ46Jo0n53q3ZciO43pqXUsWDBnioqWq+m314U6gusIvqVxca5LwBwau4J45MfyNvQ== 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=HlbNzM4C7QwL1HRp8TWfHWVbXiXc+6r1apJpQD0XUX49ttev7X9PyKGofmN2r+Ww5KQlVUGTj+LQsUzjGrCE/Mc+X+55QeUIMdTlTiPpgcnXO64Cf4Zr7LDnzq1aw5bgGsWLVFTSwsj8TWhQp7YGG9+zWvpauSiU9DdHVRWdZi6GnGWP3ePb4V1AeyVVUGV+hokMQZIPQOc6zzSPppOZli/2GOvXYtc22DWYIuY66VxAz59e5t3lfgoaMr/Rnq3XhzzkZTRdo23BjGe60CtbOXymId8693yrwqb1kqsZwLk3snyRJ1YPpiofY5tMwwYK4B8sYHvIRtmDuhto+mge0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=46Vm8bIeJhU1m0VRjX/9XSG/qzVTA39GNLwzLHVb1Mw=; b=Ci6yFIuDjqVlBFZnx9XjBlWhW5n1ZTZtToYIvs2HHJton8TDUc/ijPjF0t/n9yQsFbwFdZFNpX8UfpYuvdZzpc/rImCRXRQOoRfFcwSm8In7IZv746pYa0DWeYHPBGYF2i82nJESheUozP5MqVaFb7I+nMtT3O6soofB4UAkd/xIk8oww/A0Ex57kghg8M2iwTNnEM3nyIK7JqCUXiYkrUu4+FLmjUS1RZhb+MI9rRvB1JhUXpqw14BltOnfEj1n3vEqCdJpLXNwOyeABHsw2hYuy9izvWFHFBC5w5A3W2hwrSkIHbd9UXU9l1Y3E0TizF8RWDjVv3/KI02NrUIIBg== 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 AM6PR03MB4373.eurprd03.prod.outlook.com (2603:10a6:20b:10::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 00:24:54 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005%4]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 00:24:54 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Felipe Balbi , Thinh Nguyen , Balaji Prakash J , linux-kernel@vger.kernel.org, Robert Hancock , Baruch Siach , Sean Anderson , Rob Herring , devicetree@vger.kernel.org Subject: [PATCH v2 1/7] dt-bindings: usb: dwc3: Deprecate snps,ref-clock-period-ns Date: Tue, 18 Jan 2022 19:24:31 -0500 Message-Id: <20220119002438.106079-2-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119002438.106079-1-sean.anderson@seco.com> References: <20220119002438.106079-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0025.prod.exchangelabs.com (2603:10b6:208:10c::38) 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: 0d212ab5-b766-4b7d-5f39-08d9dae21d55 X-MS-TrafficTypeDiagnostic: AM6PR03MB4373: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: pX/kuZmSwmLQegHaJ4vFcgJerSWN2Z8IpiYGwBibjSMX5ViKAX1n4cOeIb48v+E/Zac6wWmb73sz/4+r95DAJTUExTcC3ZjUT9QcaVMfBpR20S2edfT6zL702sYAdcS2qKLZ1QHDe5QmsdvXM9xiPFQItszZMqLzPKdASNr1/+tthhzdOXuJunqZZMMuOPbCf3uzq8W9KS2TnEQW43PNJvh3MFWTqB1ojI5AOwLa+pvCM5AX4Q32AJacd3WX87fZ3TgoxR9J3S7ZX+/26z2LmROUdhuqIIU6M1IlKXq/pFl2cCJMVzLOCc1WPKpszDfBvZcnyp+jNI6kYCpGjEwpoF939RezIVENNVolI8eNcod3xFeXUCg2KrQjwVHYex7gIbSPwoi53LzkusOBsIdoJy4u/eTck27ZYb6SWLguOMcRbOSvLrvV0GshCGazTDJXbpmXxaPuT0t0OQDUR5b+XUR/NYOBPJ4aj4K5I0t+iyWklb9vbp3DtR19btaFZnYasyQKswJNHr+VigiA1GaYBoMhu9k7VSD7IRXMMKNW9/d83XlWokeLUIH75umSsNPhriUw0R/tmoWMn1q1nLEt1IvhbVmOvryCrjwHHANgsJpHSrDS+FFEAYjwAW0/PV0Vwy/eXSidbbyWD5j/hF9BAZpbcUX2xDlbRw+qR11ZLEzRSdsN9NoGww7cy3md58llzwkYN547V7koOIt2EyNDpgPTAyfkODj+1o+3hHGuCs6D6pnRwVZJCD7EZQvZwribIkeifQ259htIJF8S7/X69HBjHuZqptFLo+4g2oi8DrQ= 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)(316002)(6666004)(5660300002)(186003)(4326008)(6512007)(44832011)(6486002)(6506007)(38100700002)(2616005)(1076003)(966005)(7416002)(66556008)(38350700002)(52116002)(54906003)(66946007)(8936002)(508600001)(2906002)(83380400001)(36756003)(26005)(8676002)(66476007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZBJLFTncstfL1xRcnYprMidb/Rj0uSPQ2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yxHdRi4Qgl2a20Ayd5VrnlKb3CAQYAX5GvNut12Hz9mFZS1FxvHRGGGGXLqWuld/WFBLN89o0ohiiA4D7s2pUPLmvWNKbGgZNSHwI0IpQDeX5WmJkoXUZfnSQOI3RFbo2s0ds9inUm6Wbcf/d3ew93bwqzZ/nvecQqywkcH04wAHxBdtauHgLniLn2yv1QW+IQxlm+joGJnIYqC7GetxR6thOyoby342Ab2S7tY7enuRenotbincQ2Q7iKaCdiP5upNmacNfX0hs47aJ/d54uDkkY/M1se84L2njAFBbGU1nTESmEYXc5hcz/9U3i3+GKxjLC0LbMettnyW5UVjbmDujZ8fskQ+wHoKctjlM/av5HFtZSzDWj3oyRKgwi0P19BKR5fJc8quJIXrVLdkMyGOihhGxy8KIuk+eEirFhNLVrhqVe6IQcKRwvQLoG4jCVGTzXNQhpbzco9C1GFnR+tIIho8mT0P5I7aL6MTBik74R96ZA+0+TMqzpSopiCKR8AfiWclDpqamsEAyk= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0d212ab5-b766-4b7d-5f39-08d9dae21d55 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 00:24:54.1421 (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: u2APtoGJoztPSOcuVQz1qPWHi5SR+6ktAt1EXWLj18eOoUq/KoxMUcdY/4TzEyMrHcSjQIufnTsyuAu3U9nv/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4373 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 Wed Jan 19 00:24: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: 12717020 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 F39BCC433F5 for ; Wed, 19 Jan 2022 00:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350470AbiASAZC (ORCPT ); Tue, 18 Jan 2022 19:25:02 -0500 Received: from mail-eopbgr80059.outbound.protection.outlook.com ([40.107.8.59]:23461 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S244782AbiASAY7 (ORCPT ); Tue, 18 Jan 2022 19:24:59 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dHqAMhRMpW92YAls31wwEyiFoja8GIP6lHQ18eYlJOkkwGfvIN/5nii+fEGZLhbMmgt144QeDWX/74uG3lZ9czzlQaNn3UiB/Su9xakaFWyYKEZKj/iwy9hcrF1WHWBtIoQdkLKoRa+skj3EUlaubtAkax57Emu0rOqEKpZaovP+mkGb/m7D50wxj3pMGzK7m784xIkSxDIx3T8C+JZBPTrwuFCx4XLjO3SemtI3V+5RNdBLpKw8mL8ij3CJcFHywc+XsHOHeSldu7HoK0TuRtMMW3XncHYmDTI5e7GytuJZ8N85MVvmAjKxi1uZX4pRjdTZqgqcBN5fE71dmGHpXg== 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=v1wzgHxMee1sqsmiL1o13ZkzRDifJobPMhYkv72TIZA=; b=KHjQELW4DSzV7aFFA4Su7Mxt6ZcmbpMZ7SzDfWNatY7Pa9MdE30trhdBBsqo//fUVwj1/5GoQTJj+gxA363dscqPjaGtdqq6pVSTQ8vm/+JPN3hqW8nN1etP3lrFxxShkXGe9MVAHtvzFK5/UFyAT30kl2gyqPWlKbKdUkeKMZh53k9zsnNSyoVh+3W/4uYAyXStfgmVmDD1DHP0r0vjaV6yubUS26rCm1bKPYr8f/qNwZ/LKhY8PqjJq2zHztsSoQeMEeJ0uV5sX5zMDXvSnxH9ECcaHB/erwwApflM8pe84HbRQXEjEtMnFx7mg695cDAacWrjCeVr/b+OkIe5Gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v1wzgHxMee1sqsmiL1o13ZkzRDifJobPMhYkv72TIZA=; b=qdUhLX74FEghxeJDjLJ9ZTfHkSMv3zmR6sMwSlb0kvLr5jibqEdv+jXdI6kQoNKIFe91/HMypFN0ntWGwMv2V9dtqfBzJ3ZZUOMpGoJ3HjFa+FylT/Wq4xKR4GnULJqBeAtrYWG4NQq7hL1BqbsxS5eFHyhI5ILs5sZlrFUO8r42tB0BBtJ4XX6MkclssVVnoMbUCG2QNeXfDW82sDf1W+tnGPQsmyO44NDJYNIn0qPN33N0zbZO7X3BYgwlEC51mQ1mHocQNF6suC0PDAFiNLXdjvpWhGYlRurFy1w3YufGeJqI8xV+5KsKFXSCOP1xwUsWlDNiuI4G/JeO+MT+Ng== 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 AM6PR03MB4373.eurprd03.prod.outlook.com (2603:10a6:20b:10::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 00:24:55 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005%4]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 00:24:55 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Felipe Balbi , Thinh Nguyen , Balaji Prakash J , linux-kernel@vger.kernel.org, Robert Hancock , Baruch Siach , Sean Anderson Subject: [PATCH v2 2/7] usb: dwc3: Get clocks individually Date: Tue, 18 Jan 2022 19:24:32 -0500 Message-Id: <20220119002438.106079-3-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119002438.106079-1-sean.anderson@seco.com> References: <20220119002438.106079-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0025.prod.exchangelabs.com (2603:10b6:208:10c::38) 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: b139ed45-4227-409f-b3fd-08d9dae21e30 X-MS-TrafficTypeDiagnostic: AM6PR03MB4373: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: n7Q37EAl3y+BoqVC5YQYAOKm+P3iIxxcZLM5LQ+NvQ9SuyYHkkFus2KA0e2sDVyKRrHZKoDGBbIxxh7fGWetIKvaijbT8lklcANXjqr2G29tnMkyyKGbzNY4F1qW9QNs+J27Zf4PP3gOPl/GnQgYwfVSFUpir3RW8A72bcuBXo4kMleJUNL+2az/FpvYJ1zWrMA3wmcFGjogSopCSj93B8qX8YMaHMW1gxbjqdWsn63Zag5YfD61OOsjHYfJS5hn/VYvE7AtNXwjBvEbewHuiLmLvGEELX0RuJtD3F4TibltYZib6eC2NSV6tpFtrK8InDFI7O6YhvK7QbRPch65SAXngqvMG0tfyWSCfQP0GA6GQ7UOoZpFmrzGMs5i6ySVIUGvKBu13uZKjK6g2xCfw5gaaonAxM3MyOQAAQmZjf7mnhNeVFnkKp+7x9CFWY5+f8xYYxHCQZdiJVvwSVh5+m3i1S63lPBBjPFphDe291std0GIqs4CgdtHnviz0byK0N7Ojw0fEAFAopSRl75ekykK4Eg6tJBLQigkLEQYiyBdMxuMGJQodvTbEzPWlsVonDnKKBVtkREFgMxPbY0AZwd6ABkr4IDQ00TyF2rRyS729PDntBQi3ElMbVvm/Z2VD7Wal164CNCaT2CwSYx2amPgTH810uF52WYZhS8cb2FPPGgDstjUbt5lbT6z0eoZnVYIzrAZHBJ4cK/vgtmCVg== 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)(107886003)(316002)(6666004)(5660300002)(186003)(4326008)(6512007)(44832011)(6486002)(6506007)(38100700002)(2616005)(1076003)(66556008)(38350700002)(52116002)(54906003)(66946007)(8936002)(508600001)(2906002)(83380400001)(36756003)(26005)(8676002)(66476007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JJW//faSsHrt6qOVuMSjlrFF4J8zhb2y/mh2RUSsXy9TEPjh0q+K6cNn4QOhhENb02O0YMvC4sEV738WDorx3teIcszCGsR1aGHh1wA4iLcn3ciI1Du5xA2NgqYORNbYsVBGGQPYecgYY8x2o3JC/lDY9UojS6eL5WQ65kg7Z2WC4dpTUjwDxs1jNDv1f8YcjcjSBO8Gup0NkBcqTgiNCqiMPJxGjWA6BTUKPZfnJakIh4X4g6Xbo9I2567GiEQTBx5slgbAqybfQQwawdge5zfyzCV7K1YDLmuLY5M06OmlzDE8ko21GauhC69mTezMiXIPvAV7+cZMH8UV61COva2BbKGYXFVPCMGYhTIZfXUJoGd2O5kmYenJRxy3cICpLG6WL+RMEMiQVknrfZe2LfWiati7tzNdk78p98DNnPIZNNjFKXOHdGGuN59HMJvp2lQlyq4gDTCtMjA+VBq39OqmyKPh6aVH4qxD1A4lUXgnOgtUzfcOBg53zSx3Cc0mKv1aDYD5iwihwNTQAWx4Gvv8BGiT58xMBTRrtbc4QnQprn4gHOB6XpkK+HQLXeMsavmrSZgW6gQgbcru7ROQcnoNgx229hGvyomYzaZWFSWC1g3fVtHA6th2FKTeqqGrKHY5NUdIChZZzOmwbP0hWjIRQhXmdBBfRQoTbLYqo0uD0Ggap3zX415LOosagXiMRh7nFhUmsX3wC9cLQf66KxVOc47DjGPAeTas6yABJ2hEeRmW3igRa1KLNSyHWSkxFyu43ZgF1ZDrdPblfTh9Qj77XN3MxptZnyVi+sMWNdpzbj87r1vnUIelwB80b+jzKQ86dszQW9ppR80xdj5YoppGcc3heqlMBinEz+3fDH9+n++kk15zM1gLhTxPqOJ/2S7X7FTHrVmArvauukGNYzuoeum1ddGVBS0mXasobNmqEHP62pHjPzXkvgiZdmMoTGOzfzYLFLA0B7G5v8ixOJrxBTeu9LbPWEiA/fUCx3ByPrbtnMJVoCwDOCbb05aXnmiicQ2eZhKBwmBUyvJP9LmNi8gfjs6ed9nehnekG1k0OdQtdeDgZB6KJ1vvw70tYdWDINzpmOoMEfj1HUuROi6VC08AtFQAy7jCzcF9SIJowIC4T1P6S3A5wEBAyWQhmwTjhFF0ybeHEPuDwgSqkaXNSfxum4U9HPNjNH5YXep5OU6fRwzl1UI27Z/wF4kWJYqsuNik9hf6uA3XDBNQj2o+sJ2jUyI4ooQBDUGGfOrG2dqUNel2YfGsjLqMVXuyLFXZEEv3ycssm/PpI4Bl3C52xwgexHeemVel9z8kv7ITpGdnVtVXCcXHA3uNXbg/h3QuMBe/JbaLHBeqN2NyXRUguVGNWKpLMdvicY6CqEHVgOElonzYiwQ+5DHeIuOKhNSrQzQUgLoLT9wCGdOY14UEyLxk9W5cMMvO9E8yBGqGudyz27hzsVS4Y0XlwAdltUHITyDG1k2o74a606Su+EwIknaauM49VhNKc1Lq/nmwoo8jSu38Kc139W0kgdlqBiz7aUq4H484cIqWD5onYQTblFeWACrIAUyjAIb9vs5f/vQ+vfZlEBoSrof+DUr9h+lDp9egZpIN7chOk4Jv+VeJC+q/s7L0uOKKIpm+0rU= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: b139ed45-4227-409f-b3fd-08d9dae21e30 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 00:24:55.5326 (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: MspnLRClLlkuMTFjbNf62/tF5tVyCDiOZuLeCGDQ1Nr3CvDrdb9hynncloZQUf60DCXI+v6H/cu1ZyR/roy4gQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4373 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 --- 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 Wed Jan 19 00:24: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: 12717021 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 10107C4332F for ; Wed, 19 Jan 2022 00:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350476AbiASAZE (ORCPT ); Tue, 18 Jan 2022 19:25:04 -0500 Received: from mail-eopbgr80059.outbound.protection.outlook.com ([40.107.8.59]:23461 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1350444AbiASAZA (ORCPT ); Tue, 18 Jan 2022 19:25:00 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y7gh8hL/vFaogHzoq9+7SmzATNVgWTDU5kXFv8aHArwvC0ilLf2x+y6hkCT4KOWAvxwjWvhX3pNgPyb4c77yOTBjWhSh1Uy0cCQpveOiebPUYUAG0FvnuDoRmcoWm6Ud79mLYByzQQCoI08KIBf1Ic7ofcbj9Mr3sORgV3x0RUu73kx9M10NUMiWWeME5YQwik+sdD5finPJM+/seoKTrv6RDNMqhNHRslRngruwkOV2m14QSnV1oWH+89ObGraD65mqp6lYbKaBX1gYAbVOr7230LFhZTJdoHritHdc3NxqiTNiIU4FqPzI7RQR8TkBF34jIl8705gyekd+G3+y7w== 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=QoG04zDC/PgCcp+9nUwNyJjCUUziUhCyFKJdNwmrwhg=; b=eRaM0Sqvp2JMtGbWN9FVcTvflcKmcf1a8hGWfXk1qYvIGi2Z24AmsUMiFW6ZhHdA7+oRLoYleCCcmVrkKp9B7CkZ77vNmYokOPBOpnLZOg5Czpu9IqZ0PLt1MTBlE09fFkf/QiLlwlEwW/XeGV2oVZyBcneE778zBGCykddpo3kegwSo1/nwV9eIe2saqIYUIatgpbeytp32unnVCJwyeL/djDItodH/Q8lRrsYVBVBX1EacKz1Gjgopn4t6kHVCupLQD6EyFF/YEjkZrkf7H1DUPzV478nMNnMMnKArZthDH9t/bIpBJB8i//gMYWNNIzh1wbvpb5t5MrHm3sXU2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QoG04zDC/PgCcp+9nUwNyJjCUUziUhCyFKJdNwmrwhg=; b=d5PvtazyItBCdwwup8rEbx4/yHUlfth6uJzxquQSTjL+H7KGuOsyt/VusoPspTku+YWpcht3IW0ql6Nf6jP5J54GWSKoHa/FZC6sDnegS0s9Qiz4172HTupO1oIDCb8Vscfsj/Uwf1v0YQ6g3G55NR8t4Hwg2VKaYHR0IBagYac+qt88Zjou0lTm8BAw6nUEXdhhuu9sKAzHQEAG933OaBpQmTLE0ekiyHeBTHoiH1J1dkRXONuWing8GoT5zoe+d8ElGqL7zMhzix2FTvAJYzAEFkfdsM/uTskEMEEP2z63tUmkxCBN6LgphjZ3AIOLHI6Z5uYiLe6vzKPPApFDjw== 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 AM6PR03MB4373.eurprd03.prod.outlook.com (2603:10a6:20b:10::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 00:24:57 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005%4]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 00:24:57 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Felipe Balbi , Thinh Nguyen , Balaji Prakash J , linux-kernel@vger.kernel.org, Robert Hancock , Baruch Siach , Sean Anderson Subject: [PATCH v2 3/7] usb: dwc3: Calculate REFCLKPER based on reference clock Date: Tue, 18 Jan 2022 19:24:33 -0500 Message-Id: <20220119002438.106079-4-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119002438.106079-1-sean.anderson@seco.com> References: <20220119002438.106079-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0025.prod.exchangelabs.com (2603:10b6:208:10c::38) 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: 6dfba06b-bda3-4d5d-08c7-08d9dae21f0c X-MS-TrafficTypeDiagnostic: AM6PR03MB4373:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:655; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rSpBeDeHRCOEzU9iZVl4+7ADjENtzrS1g9GK0dMiCKF/7K8/U5HmndrgM3AepK9rvzlFl3HlWFCn5OWIGTRjEf9R3CB5hME2Wp866zfA/bVtzTUUBZhu+r41aqbCCs8ZgHIHemRIemkMIOlAQl+oni2aA6WSELXgQdk/qC0YswcZBd/ivH46MISJkcT+Tft2OI2Ug6PA2SR3Iv8lyu82KQU9HHBhCVZ0TNGoLcARxTBuPkYSaa53ghb1nkLj+AMc+K70D3ii51zopC73uPtRq3xxEseMQOmmcU56NsoCVlM/EvLm3tSfVg7Pe1oNwsuhikjmEssN/glFdf7FVdX3N8VgeMkRrLxuEeMRULJtY7PnsF0RTSw5lcpj6lh9IWYRCGAbuwhywIXcOfn0Qx8+fS9yQD9bX0DuFATrwvJBQiOJTsK6DVt3r4yqNRp86cZiE61axO9Xekot42NPu0GdoZrpq5CuIfErnvShmP5uIjlrTiTzkzQtpB7XX8xIJ7gYPo9JDRvHLjUi+pXyDjrP5c86tvxLh3iu+I4oYDY88tnE8HCCoo++J+XQGce/ojRBG7QsSQ8lD4xWH6itiS6pUVzQGaeawlT5qomR1TybYX95L5/bYoXNzG5MtWHYp+1ZzQ70CUv0uuarNDPk4JMopJgzeeIX4Y3N1/aoBLfRVXE9dwQ1mTXQqsgRvTOyowFSxmipTngHOr+xQ2MCSWko+w== 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)(107886003)(316002)(6666004)(5660300002)(186003)(4326008)(6512007)(44832011)(6486002)(6506007)(38100700002)(2616005)(1076003)(66556008)(38350700002)(52116002)(54906003)(66946007)(8936002)(508600001)(2906002)(83380400001)(36756003)(26005)(8676002)(66476007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EwKc/4ifuQV0Ks51L3IYTD2O+TA7aQlye01eXVvnmw4ASx7yBn1H/sHG7XYWI6zhnbYiuagygfBnJdVjxN0z7dEh+1f4Abg9fey/8aJt7xObiDpyNGMo83JigxL2RZtKrs1TdnysG7Z8+AMtyET2FDC1HhPjWtSasBPgRd5rkHX9Er6oquKvNMYtvKkYbM/vvvJdm49GGMLRiW+lm76kdEloPI27Hmg1yuambH5ks4zNtTXfr3SxMj/StX8NC/Jj+ATuv09OYpwNDAkgu7D2XPdXSPsIk0sewDL0LHLwcVEcgU7b8EZgAEDmBUaRwqqvUNnK3Vayx4HsnUlGao+Krz9J6Z430Hv+PM9q4qlrNzPOyRgiOck5jwKSvcO3eoputEm+Bg9xihON0FxvvyKP4pQy24nv4IihNYbtBbj/Jv/5xtPQp+JvLJHmDYXQRowLdnTk0z6UiTIllbg3d6FSzSwxr4crnbXMxsY8XMqxuVKKVVW+m8QFbUXAW4dOkNFgs4iZO32k3ryUCqw6FWFEPogAy5hpwMJprkbGxH+WdbhEpzIHKNMx+myF0TZ1ajeBATjvLm8s35gMJ8GzDMY0P+UfvF1vkdncVDSF38KY3fuyT/8yX/CEazN5+AC3zqB6SmJaS7fzaLkpjEG0hQAaR7bFpu+7KvJ9EshLOnBi7FYwodA3yfELe/MZMbhX2QDv5I1Z7/3RRbhdSG/FWMOQJxh7yG96F9HMEKfrgXR1wRYtBu4/DPqGJRN8as0i9W4uCgDInwcUOjznTGJ0lnM+tu+X2G7JZOZco4MHnMtndvn2hqJqYHEGbfbRRb/8XXLd6DAwN8piTnDRGmeQquUG8pkf8PJTKjqPXjr/we9CgX1iXvG11jW9JHFfDBL85X3K4gH7w/6eoBPJ75kYuYRTsHzAGNoE8sW7SyW2NPAwUOKRCQOwGzwnL5O6dZvQrNxR7c1MADaxQzO4qRTQs7bbNetmHIU9frNWPx+71wqUwAmSqNdA6g2P50XzKpkXOfXaUval/DhZ9oyZX93ByHuulKIw42zwqbi1i+H0jLE7DlUD430ziMuK0iidS+fakJ7ApVcZpBcry7M/NWiR9e25TFaHkJt5pkSRYMU4YzS+fepLZY4f063jDBCEFSrpEs5CqiC9TlUDLXsnp5ehrD4Pati0Fr4laiUtGhgj0qYcdPOWdYfUKDLiUAUc7KLn8KcYnlr6XVYFS/gt9XnxPx5/OUOGDhq6Xnaq191QuCRxhT0di3TIDfbjUvViw62TpZiWcXsLoFS7CLKiP1EhvCWNK/gNw4KV25pBby127eEco9SbS0eBmfHk8tZV4BXx8Fcpjw7zuEex6SGOx8DznJKTsG3KGMpwISlPcCsfGKn4Xb0awAq5ND9BV+ySdwfNeCFjfT1wSEJBtrBvoZjOqja0PA3vF+ke68p0bcyyfmmc9pVZQ/luBDryfrgWwDV6BDaJL4lZ+AJxIkzeTqLBewLBXNFcJpkf1OLZ3o0c9+wyHt+JDWGaQL4b2nDcrTCoCtc8WUXHW+sHERPGyLPa9xyb/7MRfJTY3BopLC1cBtxbtkXfUwcoa7kF3i2LvAkZsoYPxnJDvFcksf3uhLM+F6Y20yQpTSvpSJMd77yhGkN5u58= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6dfba06b-bda3-4d5d-08c7-08d9dae21f0c X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 00:24:57.0950 (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: oSiOWwVK6m1C6m7X3dLFLGhrWNSSPjaG1TXc5HH2t9gaz6mC4IO9P/8i8jKTPQg9Rh08Fl/ciu0uOM1+2162uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4373 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 --- (no changes since v1) drivers/usb/dwc3/core.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 699ab9abdc47..5214daceda86 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -348,13 +348,22 @@ static void dwc3_frame_length_adjustment(struct dwc3 *dwc) static void dwc3_ref_clk_period(struct dwc3 *dwc) { u32 reg; + unsigned long rate, period; - 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 Wed Jan 19 00:24: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: 12717022 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 BE496C433F5 for ; Wed, 19 Jan 2022 00:25:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350493AbiASAZG (ORCPT ); Tue, 18 Jan 2022 19:25:06 -0500 Received: from mail-eopbgr80059.outbound.protection.outlook.com ([40.107.8.59]:23461 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1350450AbiASAZB (ORCPT ); Tue, 18 Jan 2022 19:25:01 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FVjU+nfHxNqzIExzRKsItBIck3Pac8Lugn1yxviRqtnB+G7AJVYA6swEJO0ASS1+XxBKp0MXYw0lrmJcCX8k1iV1ZX96BxwgD0bJpQJJ2FHBnYkXonjvDLpBlCe1IGcKgTbkAQ1oZDgqfklSmKcOVlUsqHtYoPHuFeDayD3gVkeXTGo3dWmq8SWXT/eH3L8iwADuVHozxrQk+R88xfAM8rb5DLvsQXakK+JYOISIqhmrXTQOPpeaOrMpx1tNxnJawdFuDGtNIPgfEdy9Ey6AXk8zIA3WqZmURl2avtHMiqqRtpLvCIXNJscelaG5BMnexlYSwgieMQFscac+xnjIZA== 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=bE241Yshef72O6Pj1+srVoD9tf2ZCPrsGlJHpsR5UFI=; b=Lj13yyqUvjjHgWNJrwqrZzODTb2xO6YFAU9OyYM2MTntvMOEnvdp8iPm5pfjx4Mv2wqctXId+3j5rRt1nyKmjvZCx/4KtwGmGUpFpSmp//v5DVPOMUOjsorJ1dYAxJT1V3LOhQsiCsiQoGBKBBMGJeBZaQGkKyoVRPBEBIsbkv9crfhIPWdDIERIsBwucYm9O9draiIVf5cVHle2CRmQbdJK3GyEuxVPeQ+kanvxUr6FcUl10H2+a5U5SQEsiKewIYyiBbw0ZYtO6UiRRY2XVyy4RQX/cveGfjAnIUqfN90ra7PGJAZGoSbcZrW91W4f6o/ie9lBSGO+UFpMzTwkBw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bE241Yshef72O6Pj1+srVoD9tf2ZCPrsGlJHpsR5UFI=; b=COCh3nFhVLfULGpVYHeH1ecnpG8SZziSZlpU5DLhTxlfqAb0sazGOuq5K/RqFkQDpQLx2QtpdGv8Dv07gwyo479EU2HskvCrZhPQWh2Sr68kiuq2+WfzcuF4rmZ3IHyCOKRoX3rPlwSmMvWTH280GvAFmAS2sSLf8m8q/f5d/NhGQuVCx/FVptV5Src9Apa813UEnkc19hRJlopw8/DQ9mSnFgA1Dz7B6LIpZrQko9dJP9yRH95X6ACYt1CSMWIf70pfeYEw1U59IzVDKOm7PFQLaLUjduBjlPiwYUeVYB+zK+K86VOLQyXzaygvHWkkwVWqLGDnteQdPRmxx4Bq+g== 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 AM6PR03MB4373.eurprd03.prod.outlook.com (2603:10a6:20b:10::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 00:24:58 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005%4]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 00:24:58 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Felipe Balbi , Thinh Nguyen , Balaji Prakash J , linux-kernel@vger.kernel.org, Robert Hancock , Baruch Siach , Sean Anderson Subject: [PATCH v2 4/7] usb: dwc3: Program GFLADJ Date: Tue, 18 Jan 2022 19:24:34 -0500 Message-Id: <20220119002438.106079-5-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119002438.106079-1-sean.anderson@seco.com> References: <20220119002438.106079-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0025.prod.exchangelabs.com (2603:10b6:208:10c::38) 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: 274f3359-2ded-481c-ab68-08d9dae21ff5 X-MS-TrafficTypeDiagnostic: AM6PR03MB4373: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: p58fd8NyE7vIj0crbA0V+qPuqz8gNJytfczIMtqmJld1HYypy1wFID1x9UbqS6odWvZIGJTKclCaGCB4akCYiEuf+4kEKHiRztIYXtoWT82ZtyZRj/Kb85yOgUrUaUBGzSNDx+gFs8eLsX4YMgbkzoMxrDB+0QS6LLIYYCQc1AOJpN9ESkeb7DAyYgPSDGySYJYx53WhQ17mycQzXObu8lGdIUom/Rsb5xspB4pRHzw/JzmLEFJ3FUNCpQogUXB1wkj8d1255nYu6bH1G2uq7+BCVsSZtyxUvDIxnklsyR0jwoPuZ81rHuNeKYqCR8n5N6QBeSsqxMUpE5PyOiEpQtBmH8caANJ2FudqKXg4UFeJB7S2sJdLH8v6KMNfeJy3rZOE+NTtwvsAEAvRlCV/Zws5h9lisYdHPLewPBSx0tACfkWOWE1ngvrNjnbOX5LahEvFngEu4qaNK5GzCW9+mBuRtmEpTjFKe0x2J1TrYbshN9BxtjjTlQ1Ivz2aJwMhm4984bqWsYTA6W96EohWEd2wYSfjjlrv2H1E1OL+QLS5z97r+9OnSt5mo/exA4ux2LgV6j5+9rROvuO7JEkXdzdiHBo27iL3mW7aPGGb2y5DkW93p0g4UColY1AEScy98aSbtRZrLctB3TgyZDU0mP35G2J1hKP2iDNSuE7Iqc13Yt11hN62lLFzEmQ039K9pd/4FWunp3dAdB541bHYXw== 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)(107886003)(316002)(6666004)(5660300002)(186003)(4326008)(6512007)(44832011)(6486002)(6506007)(38100700002)(2616005)(1076003)(66556008)(38350700002)(52116002)(54906003)(66946007)(8936002)(508600001)(2906002)(83380400001)(36756003)(26005)(8676002)(66476007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AQUsAobo9SHPtt4jG6ScIZR5VSNTt89VwE2AhopE5Sxk0hyhwZqDkfRFS69I2o5T3lm5JGtOrAMl64zizYdI4DzegsCjOKN5iUnUYPHXq3XM1TzgW9MP7tCpFnIramVJADeb1K/QkshsKpR5P0kvMFJA61Ks9naAOgRdsaiy6dEQz8H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hZSXdH+KGmg4QA9WhnnkbrI8WYvg9Fbz5B5kkVnBvPaItRxOfLdOwCymfzU87HxUbMFCN364Izdu6ysowFjy7NTUQ9e/fOAG4XbqS40GWWFgjYacFAFNbzcF3p83h7LQZ4LMsFdiRMZbV9pJNJuUGNjVLyNjRa1bbpwV5WlIpDRtMmuMWps88KmMTfQhrIlJZhs517NJ/slLfaUILROqpjY0djrilRdi3dTMtOrVX3VEqojeAqEq5Jq58MCsvSpR/AVUxWkdhCoxIa+ac7pGh1VRURolw52p8tYBK3PQ4KMi17/cErUq61BiuK1yQAq/47vd0Mx+LJ1qo0n/dkZ34baxfK6efSqJQoXS2JPIdgiciXqOf4tO+fBCAnq4bpl8Em+2jVzlBpXjt8= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 274f3359-2ded-481c-ab68-08d9dae21ff5 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 00:24:58.4231 (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: onBhUn08DcrWGpHrO1qB2aLcpyoXjvuu41+avzRgatsUyihqfmKYEuukHnMFsHZAq3zEJ8kRCg2Hauf+xGKWwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4373 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 --- Changes in v2: - Also program GFLADJ.240MHZDECR - Don't program GFLADJ if the version is < 2.50a drivers/usb/dwc3/core.c | 37 +++++++++++++++++++++++++++++++++++-- drivers/usb/dwc3/core.h | 3 +++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 5214daceda86..883e119377f0 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -348,7 +348,7 @@ static void dwc3_frame_length_adjustment(struct dwc3 *dwc) static void dwc3_ref_clk_period(struct dwc3 *dwc) { u32 reg; - unsigned long rate, period; + unsigned long decr, fladj, rate, period; if (dwc->ref_clk) { rate = clk_get_rate(dwc->ref_clk); @@ -357,6 +357,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; } @@ -365,9 +366,41 @@ 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. + * + * 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 0.08%. + */ + 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 Wed Jan 19 00:24: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: 12717023 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 6E840C433EF for ; Wed, 19 Jan 2022 00:25:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350502AbiASAZI (ORCPT ); Tue, 18 Jan 2022 19:25:08 -0500 Received: from mail-eopbgr80059.outbound.protection.outlook.com ([40.107.8.59]:23461 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1350472AbiASAZD (ORCPT ); Tue, 18 Jan 2022 19:25:03 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OrGUc4yj9iAg+6LGDdaS66ZeB6Ccht0I3eoS6eYz8Vpo5we3dTOtYHLAf6lT+gP63E2O3tgeSZdznUNDYcSnlFvhlD6anQqUeJsc2htyWMsZOj6RCEXXD3o46OyyVSIcY4qEVGgHCIogjU6OW/Xa9pJrSFnzPKMJzjbOfArg2DveuNWDdbqzCGgwY3Kr5JOKKKQCKnFuwa/taBsk7UlHET8WlHxWzvyV0oDCH3uDiVv3whydywrn4ZdW8pnDsv1HKGxnlGnHhK5WPD0bc9P3CSeENz/jEFUT8XQPYuQHCRnPaF2B161U4rJWQi60qSG7dOeHVK/5U/C5UDSDojJNWA== 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=7gJ3tpUO4xPO7qmzqGirDI10WApIHJjpOAdy6x/QlVI=; b=KA2gAB+CB/MVVqxIz3+ClidtEZmPv0bobz3sS/bCqoo7JGFEOcpTfkMg+63YO0J4NnlzpxZwOSz88ipVNV3z4bqTw2ATvsElWlWFkqdce/ERMIKx3eGrz6qhxfj5eNjorBdKdWVxSDZgBLIrKMI1HsKawqaO5dcc3CTpBeH5guA5SktvmxOYSvR2Bb3CXZejSW+EYR67FpXe/VUvP9z1QfHmai5ibyjQrhIZiTOG/HB5hlH/iQncUovnPrRohXserHUoZ36RO5sQ9FV8ZW7FbsDLRqJ+YcpGCDGdSG889W/DFvrheFVrN5G21Zra9MtfXX7v0t/hsxJ7OrD/vtxtNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7gJ3tpUO4xPO7qmzqGirDI10WApIHJjpOAdy6x/QlVI=; b=reTXIWNEXUZvXDcnpzemsfBWFSESpl77CvDvvH85/zvcs8x4LDYd6c8rlypJpPqd06aNASKPqi2p8FKe/m82JdsPL4vtXrZf5ibUtWqrrbUBb0XCJ8NLRojfcER0e1XtDYwlnDfbfXXT7tjOdf5i9SGS74jH84yYUqs4N8NJOCcjzUThXxZALIUQRUMtBxFjcup3hw1Jm8X2bfv105lbKfT0Foyym0mPN/xKdfHCIvaQ8T93xvv74x1hXDAb33QuVa+FM5ujnUotJ1i61fOAUAbUV1IJfVlKAyB6Yp/CBgcIyXE5TJiHGi0yE5ExGG1zUujZlEstHi2VzPX7hyIxUQ== 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 AM6PR03MB4373.eurprd03.prod.outlook.com (2603:10a6:20b:10::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 00:24:59 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005%4]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 00:24:59 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Felipe Balbi , Thinh Nguyen , Balaji Prakash J , linux-kernel@vger.kernel.org, Robert Hancock , Baruch Siach , Sean Anderson Subject: [PATCH v2 5/7] usb: dwc3: Add snps,ref-clock-frequency-hz property for ACPI Date: Tue, 18 Jan 2022 19:24:35 -0500 Message-Id: <20220119002438.106079-6-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119002438.106079-1-sean.anderson@seco.com> References: <20220119002438.106079-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0025.prod.exchangelabs.com (2603:10b6:208:10c::38) 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: 9c5531ff-3ed2-4788-b262-08d9dae220c2 X-MS-TrafficTypeDiagnostic: AM6PR03MB4373: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: Am1Lyj33n2oHMlpdqDaknHfi66HSdZImKGhU9+IngzDugSY3JNMNfjiU9NqjmVcLaezv42/oEIF4AKBYwoqFD/fAjeiYNCQolR6zbeYPwi4lJIC5DMoh9k8c+w8nbRNHJtfbsTWmJcf05R0aHgtuWTondEJxP9Dufcj8tgOhJXDKkv47DieQP2j/9MrsMl5TyzCqCmZc15zjHMSdOQGVWyTK4n1dVXvRUDtefgrUWnqzWHBNR7P5DF3XFkt75kL73Hzg70pMFjQCk9Ev4dDZYzWBvg1DKJf4osFJlyk4djvVb+ioWUHJI5Ccw3ZbbA2h+U0o1eBVNRC5O8M3hhoIOAiu7mCy157wZIX7G21inXbDp9hYwLeD8fR3IIOhE7Zhk+jvlEmiVvnG+a4fzJpvjja+uwt0rPlaNkJzTC4f4x6Hn9dpYzS4IIxe+u0koZ6EL93ONhDOlDS273vrZLmmsRgFsO+oaLPAAtLW59+BsUQ8WigQ8hrPR7YKipg75qcFOExIbUSmTUkVD3RtIaTLFY01TDmpZZks1fm+y8expDz4WF+gkDDNmRXBgvCsP6RoN5j5OgVxNUAVe8+3tl0pTTePGL35Cis1A72AFeKXe4iHL9d982NiTqi8LB+uPPqkqcrfVQbqy0Qxq5uYBzrl7riqDys4TO+XHK9dGnB5VXpFelW5ItCoJoWdxktq1NWI8uD2PNL1kOGUcrMsdV6lVw== 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)(107886003)(316002)(6666004)(5660300002)(186003)(4326008)(6512007)(44832011)(6486002)(6506007)(38100700002)(2616005)(1076003)(66556008)(38350700002)(52116002)(54906003)(66946007)(8936002)(508600001)(2906002)(83380400001)(36756003)(26005)(8676002)(66476007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1JJdG7maIBUXCbtZSBGlcJBggO3DqWm0JlxKxkHEyN0Wm5QC8Akt0gEF/fIXXWEPIn086TREPWbCF4gRMLSDIFLno0TLonP/4cpXHDT4SA7itKEi9gmyejzD8OgJwwoebiXaKROTO3fpEHSIDzexzDtQpyHFUKEOR0Rd4M0b2Ba4lIeJY0pE9/Fi7bZ/3fsqwJPpkQoW1cqFY2yVrVbNvsBUhopmBDmeJH7RpKMT1aJeG/j0Crs7ROfTv7k8Fi1nI3pp+U5r4Q0mjaambBM3l3fvv24kobRw5I1w5KYyfprrENA6+gMv6hQqaqIxxHAXnJcYW7V0ND3M8vURh9fVplHqGi4nRLVaAbHARRW9nOUQsJ9qHalMMV7b5Nle1pmpilPL7F8l8v7+4Ul0JofnobDm63wS4xbMQLLidBoFue4nN9n1yesXuO9/FDjpFnKk3yfPD/TwDzrWF05RuKKAhpb1j2tCnO77X4PuWB4XYNpNK3S50ODjfYcB3GU4i8KNuNIilDy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CueHVOEKvggFYCYAgk9YlhZM0H6UvNBEYqU= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c5531ff-3ed2-4788-b262-08d9dae220c2 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 00:24:59.7980 (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: UWM0qZ6YI1a4IIWHkNdAnEkRJbsBF8pJiMq2TzSmSr6lKXmvkix6r8Ftxcw2WnMCd+FKD/X9XWm3S26gofkvEA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4373 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 --- 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 883e119377f0..5f3dc5f6cbcb 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -350,8 +350,8 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc) u32 reg; unsigned long decr, fladj, rate, period; - 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; @@ -1492,6 +1492,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 Wed Jan 19 00:24: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: 12717024 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 E8B3AC4332F for ; Wed, 19 Jan 2022 00:25:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350522AbiASAZJ (ORCPT ); Tue, 18 Jan 2022 19:25:09 -0500 Received: from mail-eopbgr80059.outbound.protection.outlook.com ([40.107.8.59]:23461 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1350435AbiASAZF (ORCPT ); Tue, 18 Jan 2022 19:25:05 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J3kBK7elVWJTlCIcBmMKrmf2FX6dpR+p4NaQRhJvBdPtNabpB1erIsZXTIo3IpLjC6JfNH4ZVf7w1WPRBZbaDdEJd2m9+Ll+i4v+kkIUmmjQSMUYP6o2oC7QyyWiNrhSw195v4KG1pW0ktyXzYBJlh/p3WvBUoLJYpB3eHfnPvHvJYrMagIxZLcbP1B8MU3SWxsVzZNY8C3oOou5vr4frKS7GPEDOEeMKzvd3pOWqWNnWqNVh6Nwm+yKhqDiHewwhME0Py6QS0HG1Rguos6mpuxwMjUrxWZViO2MhE14MiB/R1fZ9BzSNZlF2/TYRGp66MLPWLfu76ogkxhitcwJyw== 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=XE4ms0mJkGD4q+RsaVntUx4tenjq0pg6AafjxL5m3UU=; b=enmo53Cl2kGRLmq/gP8PYmFaOSHX2Pm8sSV/1jKBixFiDj5JzUNvcVa3TNG/tXfw8HSvrVVWw4i8s3JCc+WeSsSwUHyzx2uG0J5FySAYSEvemdjgfundVWaNfzPgow9DStCCKoums6DL4Jc1yJ59i88Ysqwy01DRE9pYlxchmupzh2lbv6ZntmF9iE3j0ETEgU0lIMSJ710kmLPuPEkLTV2whxJeMKunwfxGh96Xqs1+PLgRSToy3wKKrUsUruMGRpcH5JgSMeln/C42oZvB7XWpQUv0AfL81dBv1h4Dp3NDMdPISRgPrnvnPqNgYuECNuDMwhVoiHFN93o2BDyWzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XE4ms0mJkGD4q+RsaVntUx4tenjq0pg6AafjxL5m3UU=; b=SW6KC+vJpiY2td3abRj8/sgGvOnjwV7CuApWg71zvhYXbM+kGLIbcvMda8FrjPwT65qA5TkQSGsgPvK7smEuv3+ENV1Ia3qI4rTbPan2xV4ER2w6ulG829xrUBWJIxTZ0evSSqp4MkxoBAnVeJuxAw15rbMEr6L/N3ty24OrIyJAtDpJV9Z9qLVRwgPsorEH/7zwpOPlIp4rFgGoy42po2g3wodQF0cEx98lvuRJZbyT96FXVF5SRtVZDPr9ZvXvzyDquT0Hvit8wmOc5gmyi+6PH3I5kdw8dy2WkDtg1a096eCyf5cEHHsbqqc23SH4K50R3kplTqvy9t811BkKkA== 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 AM6PR03MB4373.eurprd03.prod.outlook.com (2603:10a6:20b:10::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 00:25:01 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005%4]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 00:25:01 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Felipe Balbi , Thinh Nguyen , Balaji Prakash J , linux-kernel@vger.kernel.org, Robert Hancock , Baruch Siach , Sean Anderson , Michal Simek , Rob Herring , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 6/7] arm64: dts: zynqmp: Move USB clocks to dwc3 node Date: Tue, 18 Jan 2022 19:24:36 -0500 Message-Id: <20220119002438.106079-7-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119002438.106079-1-sean.anderson@seco.com> References: <20220119002438.106079-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0025.prod.exchangelabs.com (2603:10b6:208:10c::38) 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: 46af0496-dea4-4967-8e6d-08d9dae221c6 X-MS-TrafficTypeDiagnostic: AM6PR03MB4373: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: lPxnidMQ1O7UuFznybNWEtZflzcDVDgrUJmWo8QVOhN+bC9GFSsIGto1VJ3HHjldqNMD8gCvvEwUk+ecSaBxu/DbIJO76i6BOzLCroDqj0kCOpvVh+599sFPIjrxhM1UD13uUKEYxo5s8jM6VkG0FC4bb+B6YiaCHfkog1daRLJqYJei3XddiRclK6rV6Fi9EfICLtVALjXvuh/XoFvtS0nIjdGNQaSd4KO4M+4djvtrVfZ2sJi6lK05rr2HVJyIPLrm6KuQ0NxdbH6zc5XELXTrwF8H1VhnTUVvyCBUluVGrlB0f3Eh2o6ZDqk843nZwMFuoZptl5VDm9KH6SpF1w9brslm7B9gofyoXVvPU2Hj0Wc5YZAAKtmUftsaWHzGr7boWI7+Od3tMuOJDBZXsEUE1SpCNTXGSwZUTTGYxG+ejCMeEIbZisLGuuG90bDiQRq2y2x94NQNwfQingn7aGmg8FswlL944fYBzAGpeYGBio2DQjS/6nlwJEc7YqF1XxKsD1fMKMubU7aWGlYSHQQKLUcp77KdaIilqUksikMPDPIrlu8d6AUMx5XjwL0DOkChFtemFS5CKaZ/R/sl0YC5sMNosMKLZ6nrHqa3pw/eOoexYP9h4lWttBV3T8FpaIoPKij8Itip1e+eAbJNSVNRbya3HEvJZXrWmCBWsHR7JaldYIQ/eEK2DPnN/yqMhZoTKK34E2XO6qR0pdEkhg== 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)(316002)(6666004)(5660300002)(186003)(4326008)(6512007)(44832011)(6486002)(6506007)(38100700002)(2616005)(1076003)(7416002)(66556008)(38350700002)(52116002)(54906003)(66946007)(8936002)(508600001)(2906002)(83380400001)(36756003)(26005)(8676002)(66476007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 2aNxkiX7Npt/egBfY3DpFrLOYg4zm7po0df3PvDP/ywqiajluhi8/VDn6wCEUeR6cOc0TpZdO92FaXxefNRWWTwOnKbDLjkpxOJW/74YV6ETiGZtcgL9wurTChk2NUOger3XmwrN7Vc24G25FCvtPKUWvP2hRV6LywHONhuFubVHq38+2gbdkrRNUTnPneEDr6B01ZnBUyt4A8naA4S+F6ptfvs+BqVIRiy0CrBbkujyVKlgi5kzYYUOpEKA1xjzmiEJaYOKG1dt4rquw81VcoSoHV84xiBG3ykr9carFjkSeRwH1iIDor7LuM2VocLjMAXRVSUJ2ux6aZfVxMuQ+li6xAOWQflr/GZkFYgBx15lIgbBdQZmZPoxdpIN2T/X8O7jLGU0AhB2ec6RWSOouU11u4LrvqPx5J3BKxWa3bgnoqYzlZpue9vpt3JSi+7Tfyo9GCc4oeextVOqi71WrWEgOP91VcV0cl2IK5+/DYPlmU3WF8xgMICXAMZlV2fdSY8a1Ed7cKJgiKtkfi6r4a2H4zY8nIWREm/TBXhBi5zi2IZHvnr7B+WR/8jbNqKlwS0JICrH1M0pHn4qw3f647yM+otvPIcVaBpLM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-dea4-4967-8e6d-08d9dae221c6 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 00:25:01.4698 (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: 4mPRm9AEXhMR8LeHIX/fJ27NOQgbJyWvSvWuq4gXgp1FGS65l3Nsff2lKESz2ydOXBHoSzJFQsS2XaMp3Ot8mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4373 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 Wed Jan 19 00:24:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12717025 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 9EFE6C433FE for ; Wed, 19 Jan 2022 00:25:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350560AbiASAZP (ORCPT ); Tue, 18 Jan 2022 19:25:15 -0500 Received: from mail-eopbgr80059.outbound.protection.outlook.com ([40.107.8.59]:23461 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1350483AbiASAZH (ORCPT ); Tue, 18 Jan 2022 19:25:07 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nvLaxc7BvVf+xev5u41wCc2WBwaqo4iURwhQqGxT7K+e1Y5tDPx+ZfnynsfCvzAFBE+XUiWUmpQ9iG8Wng1EYbH1DP6Vo2mb4msMY4UNr75wOPIy97f/NIb3wJP4eWe60vFg6eCAzsMsvYhU85m2VtIBua4mJPU2RygpRRdW+RONoLfTJ/DXPpfG/TO9p+2mUZENxevxuEfTSg1yvP8mSVLZoyqmQY1bme59vhBhsCx8r60VePYGTRlRj9bqGoDwE0BPslkmQ+n0UuuVrYrfPbrOlItLjwqFPlhx4KpyvxoGOD5mIXy3BSgrw21dZ7x1aS7rC8q4L4IWmJUWKIETEA== 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=QQsF3n236BkxMIvrdwA5uT/3JZlBE+UQQfGKpbGTs5w0QrwrTXqmfheJXbdDRqXPybb4Mj0ieq18RIIfDOqp4ND1wIpmEIk8iBuGltRE7+2S3kwTvvOMhz4n1a/ed90avceqTH94zZo6sDMsEGYYUUDSR58heeUDiBlzwhGth4Sb+rJSpJO011tLx/Hpf+9cx2MerdyfX35UG4DfTkwCBAA9ZfWnfV326xILt2KWcNXqUUkUfXa9yk42L1g3l1bYoPXLUnSy3qQtnAAUhMQL50/ELzQVZZymRbIrAyafrUAZqVnsmfdF7mpbkLcL0NRO7+vcrEQHNc9RleBOKHcljA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3iTbNcgMHKQDn2UQ5Q4s8qZrx9GE3+86V4LoAq9OCT8=; b=jj+ue/MVo79U3u/bjRZUS9q/xNtBLBOvRiRgXFZjs5hZzuqrXsQLFm3CBLhdESxh+ZNW5IGtn0Gy0AOUtJgD/awxVNxJaxLx05zR+oLq2tli9cXiWp1y7EVlPgO92pI9d3+K9RP/096qSR16OWK4Mop+U2Jngz6b3BWbIdOClb2+GYpMpgo/ee9bAHpZpEbvFyv+1/JvaQ81jRJjq26e6LXSSSyOic+2U4eKCTbbIQyHB9QTDDzKBLzXGTHkgbsU28xotM04sI04+9et5yQmMkcY3tXDf2SkbNibsfxWWZ03m0EtyAoU3ImCYEPmKSA6j+K3vES1mLSuW1+2VeZH8w== 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 AM6PR03MB4373.eurprd03.prod.outlook.com (2603:10a6:20b:10::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Wed, 19 Jan 2022 00:25:03 +0000 Received: from DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005]) by DB7PR03MB4523.eurprd03.prod.outlook.com ([fe80::d47e:81b0:256:3005%4]) with mapi id 15.20.4888.014; Wed, 19 Jan 2022 00:25:03 +0000 From: Sean Anderson To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Felipe Balbi , Thinh Nguyen , Balaji Prakash J , linux-kernel@vger.kernel.org, Robert Hancock , Baruch Siach , Sean Anderson , Andy Gross , Bjorn Andersson , Rob Herring , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH v2 7/7] arm64: dts: ipq6018: Use reference clock to set dwc3 period Date: Tue, 18 Jan 2022 19:24:37 -0500 Message-Id: <20220119002438.106079-8-sean.anderson@seco.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220119002438.106079-1-sean.anderson@seco.com> References: <20220119002438.106079-1-sean.anderson@seco.com> X-ClientProxiedBy: MN2PR01CA0025.prod.exchangelabs.com (2603:10b6:208:10c::38) 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: 3d7dffc1-b60e-48c8-0838-08d9dae222c8 X-MS-TrafficTypeDiagnostic: AM6PR03MB4373: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: xDEjDsNFGNR1HZbz9XUBE0r/M9lUHyKdPO5IbVXZDzVT5O4f6k+Ew6Bk2rK7hFf2WYDCTLObexqgovjExEeASkSRLl2qgHnu3eFQJiewl8jsBdBNrckHsm1SnhHAqSYjrdOmxmuaPQxYH+tg6cZffIasIwPgww8Ko3KTsqOGUlaTZwCPdC0JuI+IdBU0SEuNVtYZ6UUdduly9LgqzMXMKhwZQglg+I+m4aoKgrtLkJ/m3s7TJFdkEZbpfP5ld3eGgfyDQ1DP09T7tsstsfQ4qbXmAiI1+q6D0aXFf9J5LokPrXUb7kt6ymSjlSUyosiAxtY6pnh4hoVldaeEUjsM1M9be77nN7KPCjkyBdIo8CqFyfD8XEa/DoS276EHhXrUgJ0sGsl3G05uqotBN6JV/lBz+GgCVmxVCxjnrngW179Sf1+SBSJIcPY7KQ2IwSjX9fW3ZLXvvmBxMVIFHOgW/OSCuCHB/TEovzy7I4y9pufxgHDZvkt0TmMa97fJhBu3pheH6eD9cgwqjSfkrvVzVU7AYiAFzTZKKTaqI6YxOZKVDrntKbDyjDB/Pvv3YbaT6REYDtTe5OK9oMpopJsAsmm0J4RXqymjZODQw+cR/2OjZDUK9cuBpvNA9UrMGe3kaZodVZ9WUqG09HhjpiJTTdtdSPDyZjKaIyfbls1rr1SQtGNDmNLSIhOl8nS0P90JXa0kxfMKmGXS65wSJYCqgw== 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)(316002)(6666004)(5660300002)(186003)(4326008)(6512007)(44832011)(6486002)(6506007)(38100700002)(2616005)(1076003)(7416002)(66556008)(38350700002)(52116002)(54906003)(66946007)(8936002)(508600001)(2906002)(83380400001)(36756003)(26005)(8676002)(66476007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: T7nlWPx7Fbw7DQ5iBvqa7M71A+ZpE8cN33M3MnnjXBjzTS4On8/Uh6FHMLptVaslftwYzqwMBKjp7rtYz/nubaLZeRgHiFWRZ7MUK2gCyUQd1LRvxZW+G5b9rYLFBFAbsZfT2Is4YyMy/w2MDwqgbkuyfzkYerVvsAn55so3y0KMGaOCKvXZ7s8NqfgJDfJSXvp/WkOGWXP0qFatsKwomO/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iVnx9IXFrhcPEspfDNJIh/ClpSRysJ3pmjtqBOKw86SgckwA9A8wQFot48pZw+xn46wh7E7HTq5C6L3NFyL/Te57Eh7yCqR0Po6HTlHr3wxtPzL4FxGNRKFdxXfvBDL878QrYMz0LO379Ly+nf23VjdN/XkiGkYqwBWFWSEnqg8jn+W4+2rMEcyus/E4cr3B62OetVctMPN70ihQXfmhz9jsDXt5PraeYMq54Ffli+td2xjRlEkzKiMXxzi4TQxUPWjuSewrVpoSfKFVokLK5HGppoPSPt4P8XnRPknJ6COsGVwRvIh5n+07I71CZkpyNE905uBspF3r1sCH9e6MFjV1nZOw4= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d7dffc1-b60e-48c8-0838-08d9dae222c8 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4523.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 00:25:03.3134 (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: 37h3oD5KSX9LcoI0jw4j5/8S5D68Quho4R+zNFO821dzA4nHmhwL44pAdSZPaHSAx7+dyez48+YOZTsblR+rLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR03MB4373 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"; }; };