From patchwork Fri Apr 23 03:33:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 12219489 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C05BDC433ED for ; Fri, 23 Apr 2021 03:34:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 89634613B8 for ; Fri, 23 Apr 2021 03:34:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231639AbhDWDfU (ORCPT ); Thu, 22 Apr 2021 23:35:20 -0400 Received: from mail-eopbgr140042.outbound.protection.outlook.com ([40.107.14.42]:28856 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231261AbhDWDfU (ORCPT ); Thu, 22 Apr 2021 23:35:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cfC1CZSjQqSHbZtNCTUbOVKJJznYGr6+8bmDCwBA80CJ8EQ34idIy1ByW90a9T1arYOinYCmyeJtpFEQzN9Z29MDnawNHiAX0PbzwrHzcQWLY+WsRlxIljtzlA/cP0BrsiT8RG3CedzwcTjPWjcGi94kCZUMuk7zRid+Vl/yyxBJRwGDOlGsRsM2ADhtNV2grcvvDKvTiVLgsjnGl1QGhB1+m9AGEbC6GhgpjxF2q97z+m+/2e8EE//bokhsd1jV8igad8iXDwxrMo93aUZIEuMtdCq3I8LMweePp0hneuAbZe8VC7ffnNZgNB16jAZXTkgJoapJzuc3H39kBOzfzQ== 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-SenderADCheck; bh=1nteAchaYpm1H/MPgQlQ6J9zj6eqDjOuAItGP9fQAt4=; b=hCMeqPvigQW3amXaiPnhjknOX70Y7dnsG0NrFkYAOtbiwmyzoU6lBA/r+VUdoMbuyiZQk6+dWV9WZ6D/uQ9XIjPJU7nIoJoeFgK3Oc5yElieteAIjHo+h02qIsPlZNK3sMrykyQ3SayOMgS7zkOURv+qHnNoQrs9nKaATx8LozH7QDGhMAZYegGwz8FC0Q3l3qqU2zyhaDSNT6AtIzrh1Mbv6e9bhd0i5W93EKKn1GowxLbdrNK1AK+x8IYeS1WLT10EHtUZv3cEwDSM9CJr1n/gJyV7EloQeCLQz46YLQXB3ZIFkX+DQzm6XXkkqipAG1kmWSAwT6E7Ne2MPwwVCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1nteAchaYpm1H/MPgQlQ6J9zj6eqDjOuAItGP9fQAt4=; b=iKxnYngWk+o+irqnQf6+yUFDJmiRlSCRqnoNpdUVGAD0qTmi3NvfQtFEmY8YHa4wVvs1tFuEK05H74q7BullEhocr7KurwjuP9icGWRx9OzLpnWJk2kfHOQFkgkQms7S8MfHWqLKruNo3geDqmx56II8WJIHbFw5FLyRr/vAKNM= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) by AM6PR04MB5079.eurprd04.prod.outlook.com (2603:10a6:20b:4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 03:34:40 +0000 Received: from AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b]) by AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b%2]) with mapi id 15.20.4065.023; Fri, 23 Apr 2021 03:34:40 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, abel.vesa@nxp.com, sboyd@kernel.org, Dong Aisheng , devicetree@vger.kernel.org Subject: [PATCH 1/6] dt-bindings: arm: imx: scu: fix naming typo of clk compatible string Date: Fri, 23 Apr 2021 11:33:29 +0800 Message-Id: <20210423033334.3317992-1-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) To AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.10 via Frontend Transport; Fri, 23 Apr 2021 03:34:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9415a7e2-c6bb-478c-3344-08d90608ba2b X-MS-TrafficTypeDiagnostic: AM6PR04MB5079: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RpzNYjZO+phtzONyPh+Xh//y3sIMgx98dmpG4cW+mXrIjWsLxI71hlviAUFNFwyrnkFPyS9vWJnQvn8FjnvWwoWxFWt9kUZaqkPexjvRxWu01rCcHRMPspw0KK0iOaBRK8eWHLsB559BzIbf1Q6UiyDHY6esYQqtymdKhfAPsy6OGD3eLB1+2n2ZPFXNAQXq5L93GgmLOfeXr8nTdmMd3g38EHZ1PpJM1334PxXkz0DR4BwODquxlbkn9zxHTDHk8dDSlwhMFuRR8PtsrqKRjymjc+1ooi6Tr1ikYMTnsT2P8jBooZ6Ke7vnJ0EqOJlA90l1Q4oX6MveCYsSSOxx0RD1RTtt7FQRyar614MLnqSclXixn1BHfEb8prqfFuHgtXesv6b4TGqAq5EZ/yVJ5RWxrjflkOd7pcp/Q6TQKwTC7mLCRJChCT+1BGjisnAbx2WERxGTaeI4ScBnkz+ZPC/JF8kPD1x5eSR+ig9UwTKwFC9QpWboknu2Wbqs4gG7tGaQvKlUyst4KyUO/oZZjBJGt+WTP1SS3l2QaCrlItswXc1Nf96bqvNRz9MxPNwFJYtNwYT1E6y4al7ruCVC82pB7gcMf1Yp3kd54cB9VSIouWwBk7faTvw7yY97EezYSlYihwnrZFmUoV9X/dvUHQwcVVEBr7ITqTzSifnfcy6v+He6GpMVHiY6FOraAWSWAYWbgTfIrXp3VXscO8iBcQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4966.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(346002)(366004)(376002)(39860400002)(16526019)(2906002)(8936002)(6512007)(316002)(38350700002)(8676002)(52116002)(38100700002)(4326008)(66556008)(26005)(86362001)(66946007)(478600001)(36756003)(1076003)(2616005)(956004)(6666004)(5660300002)(6486002)(6506007)(186003)(66476007)(83380400001)(69590400013)(21314003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 1sWxzdrWf+le9CZSaDkbyNZBSoeepjNvQGA5DUh99SzIWKlJ+JWxZmVgulXb0omQNapbi4D35kGnPfOvm4w7N+fjIOXhd0mIOfsPrGk2uUlqJl5pBPbLvwFJGGiGZOBHLZ4VUfX9FqiVuwc8VMSp0G7DvJxpomKbxEQoSgsWt9D8EJQEvucH/1Do9/d/EmAGzNZoWTGhN9Z+Xph3K4zkI2BOCZEb2Co0G6bAGnUkeWTOBR3x5lYWZ9GnmjBSLhBcfETb8tYFkXgirAC/02zfEGQ7MxfHIPdCXuUlbdk7aPaDmq8Ko3UPcZBw/VuGvLqlvP5UTGdD4HmO0bfAxDBCNBxdmwjA6LpIYzn3pStuWHhmsAHbk6j0y25TOZHJ+RMEYMqo38Q3aSSMXjF/onSJLrkepBzllzyUtsHPFMNE2oQ/OBzY5Qe2+gyYIYbzI9ksDMyou1ZclrtiSROG7xb1Qn1kqW29z29CFopkWWi7f6ZEA+pSwoFQUBxy8T0aYy+yUBX+e/m9FSTYaYWhTRUDfC/jKIqCgMiKv3h9DYSgnICIgaFyKjkRAl36kvpdYY7PIxKn+yj7dNgBoRhTdEhezpb3gDZba8LtsKuR5f0E7nBnvG9zsiMzzegVvIIirNn6zuwy+p/2MkTbzyUKCozO7OVgGTsK53hFnKSesf3LdR/8JCkLROnq8B0TwaKrqzpmJ5LTOSyeetJ3jAamHIBbJRcm+7vmAPn4hpD9tpkEvWOEC+l5NhMM5VQnaF6NtNVCqqKPvNw8zhp4zwIuJi2+h7MMJGQixwYG4vnVVu0oIa6DZwqhl4LRFM8+4tVIFfh9qf6ZCgTc+Ft8qZuH+wTxFjggriUEgdwjDTBMobTW/si1ttpfQzffCkY1/+IEwLc44RYTtHaWWeiw7ym6RCiNh4MtRDDDbCRn5NZmk1WYgHznciNzI0ptfWvf3KrgrgygxDJENLOLt88qUcAv3vInP+VXyztBCoAmrfMQSuZvZLJiSwQ9w+0nqQfnwOCeAtT/tPrOwJPx0rzAC57rm8vgvx4geNPgmnNHiyhGPiIgbDTJBYW6PVVYAIkYgrf3LyiyXkmwD8Y8TkMZMx+nY0IiaFXRZTHFaP8ADS/vlw4Xq4p55hKBQ0TGP90TsckMdUenbVUsyZbv+mF1XkiqNqjBNGNtj0WZz7CIUxsz7uiB9VaFjwTKbaA1vMsVSd/IoHNmOAxtsU5wudGDsnfwT36O3gt3cpBSbiIE5xyhExvZ2d7TaoXL7iZV8XTkf9x10YhEC2s0hFP3gXcyFfSXd/l6eIpc5T0+i8s3ef2+6uEiXJSMN8eR24o8rN8q4S8I17U3 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9415a7e2-c6bb-478c-3344-08d90608ba2b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4966.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2021 03:34:40.6871 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: f3cW2fmHJpsmS1VGZl6unyaAMeg2lS2Bp3l7UQoZSgsPfsIyOh4PTvulaCunSSQsf4DQCJByr4DWrR+APeY7tQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5079 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org There is a typo in binding doc that the name of compatible string of scu clock should be "fsl,xxx-clk" rather than "fsl,xxx-clock". In reality, both example and dts using "fsl,xxx-clk", so fixing the doc is enough. Cc: devicetree@vger.kernel.org Signed-off-by: Dong Aisheng Acked-by: Rob Herring Reviewed-by: Abel Vesa --- Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt index 395359dc94fd..3adf3f6f2beb 100644 --- a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +++ b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt @@ -86,8 +86,8 @@ This binding uses the common clock binding[1]. Required properties: - compatible: Should be one of: - "fsl,imx8qm-clock" - "fsl,imx8qxp-clock" + "fsl,imx8qm-clk" + "fsl,imx8qxp-clk" followed by "fsl,scu-clk" - #clock-cells: Should be either 2: Contains the Resource and Clock ID value. From patchwork Fri Apr 23 03:33:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 12219491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F8DC43460 for ; Fri, 23 Apr 2021 03:34:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 452646128D for ; Fri, 23 Apr 2021 03:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236141AbhDWDfW (ORCPT ); Thu, 22 Apr 2021 23:35:22 -0400 Received: from mail-eopbgr140054.outbound.protection.outlook.com ([40.107.14.54]:62689 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231261AbhDWDfW (ORCPT ); Thu, 22 Apr 2021 23:35:22 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iDkMvoTVSwvK6kdTtEPhtH27CrZGlR4rS2SxnvJhvyguGnRUFr5lUBiMLwOkCX6Oy9oiplRDPSVH725fuHNU7DMJFNA0Oc/cnDg+r3P3lJf8ej3gdZC5ESgJt99sICzfrbz2HSM7VtK4pFi0MoC8gTNrgf7G3Hnu4668Alcg8phzSjPTWYD9Z+D3zeUzrm6PLVmfwvX9I3YaL3Ay3+Td1Wxv4OSE40knu1zRsu0BL3tWekXUfwtVbRxIouG4p9lNhEKjAOZcczFCJD8uQTJSzfJ0mir8pbWxlpmCSkjxPpluAZyjt3DQewKp0Gb9SVatPzA9GngGja9rWnBcnrYjRA== 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-SenderADCheck; bh=gYg0RiNQRkmwCazlZ43jXQfbmNqrDswceCa3c5gu1xQ=; b=SYB8U/y6299OgNW3egx1Y/4o7RT/aizkSkUNgoUuwZ8eUIESZrEf6qRuMcB0zuI3VCJH2IfVTOxrqUwI1qsjSY9GjUn9+J+Cu1sk3mc3OhqoIkAl5O8SRASajSZ8yPD6VpH4ah3BJ3Bwp3j0pjBYrC1jDLqMGQmjh/b1ZuWC3dhYoOy6J6ucT5BR2jp6DcLu0FJ9disQq1MbQQmQBwZXGgUNiiQF0i79jWXAGUUGgSnE8cf3jNRWlFSkTgcr8stvahXrJsNmbJV7HBrRDLee7JZdrPHayDt1lOWKZoE8dHNuYP97FJF5ftBirdQdOOTQLpXSbLu3VVewBEZgKu1v4Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gYg0RiNQRkmwCazlZ43jXQfbmNqrDswceCa3c5gu1xQ=; b=GIVvwmezyvS9s2K8hzvPkPSpvDAOqcaQmE0tAxQVKvSqCymyaZ70XLQMpmGVTUItyzhFGAT5oE/7Tqe98/1gpzfd4xI6dIooy6xrVLGiSuHx5xh9/2NiASf7RYcFifIChmvEHzQxqLhU4iqaeDdnrwG6FREvQa4CDHDyeehbNzA= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) by AM6PR04MB5079.eurprd04.prod.outlook.com (2603:10a6:20b:4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 03:34:44 +0000 Received: from AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b]) by AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b%2]) with mapi id 15.20.4065.023; Fri, 23 Apr 2021 03:34:44 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, abel.vesa@nxp.com, sboyd@kernel.org, Dong Aisheng , devicetree@vger.kernel.org Subject: [PATCH 2/6] dt-bindings: arm: imx: scu: drop deprecated legacy clock binding Date: Fri, 23 Apr 2021 11:33:30 +0800 Message-Id: <20210423033334.3317992-2-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210423033334.3317992-1-aisheng.dong@nxp.com> References: <20210423033334.3317992-1-aisheng.dong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) To AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.10 via Frontend Transport; Fri, 23 Apr 2021 03:34:41 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d1cd393a-be29-48db-40f5-08d90608bc41 X-MS-TrafficTypeDiagnostic: AM6PR04MB5079: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tgDxnGF4dU1CyVbYTkFtT2A4qQaUwR2ktR8axGiwUmxm4GgY2+WABIaPCn1XmXUTe/lsPL/AMPrh0M2MOM7HjvQ6UXMhis7eHH0TqCP9xl4/KPDp0iMXm3Pq2x1HOOIC3vOBChkzqFwa5vP3RE7iF9TnHKnYEpiDcds789t87cOGHEnCtni4ptNmY2o0iwj5OeUrgIfHgdNxkGF2foGcKiJDscCqzoccJcNqK0mDHKs7mbbao8Kh7O7OC/6+R4051WGvQC4BD8YmOHTSZE1ksbyEpv68RunO/wozdEWP9dTfZ4Mz4iSr6s8O1BkwwRpiXNjizLLfdb2i0xQza7Cu5wYFZm2h2hZiz5dm2tvmb95Y9nnLkMUlHE3UPEIDa0pEHP5aFNXB4fYOR+TU8dQKei5bF7PEREBR5Gd4na9dqDo4Vos+O7Efohhec2M/Wg5FM/QdIiKyiFWEN5/YE/kW5nPnJfx/htRKFDBCFX9VqPT5IdcRqUlhLR3Jdv1Zm7lYJssRzQGchGEBk/o67qdc/TVetLoazURjzc91ptaQD2tlf3g9dOggF7DWZLr5xeXPfaT9FoRCUfAMhcaMlEYNDlEJ0/6xJpNBmqm2btz+1Zl9RAgsI5Pc69JbDcX+ZS7wGaSIeuH9i9PN3BZNaHpc7DWcIxbu6wAIYAobnleFejXO2jQoyhMGhMjeGk2oVvhS X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4966.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(346002)(366004)(376002)(39860400002)(16526019)(2906002)(8936002)(6512007)(316002)(38350700002)(8676002)(52116002)(38100700002)(4326008)(66556008)(26005)(86362001)(66946007)(478600001)(36756003)(1076003)(2616005)(956004)(6666004)(5660300002)(6486002)(6506007)(186003)(66476007)(83380400001)(69590400013);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: lEjxeRzhK32JSAQVGV9qPjIUf2ePpL7irKoiZOjq5FC7awRzYYs3OxtjEff3iv7uIx09F9GDRS+UeG2f96Fy2KBC0sCFPvVjcSUk9A4qvFjAoq/NnJCCcvw/oA9P3Bho+HBghMRY7X2AKmpdsHuZI4yfi6zAQC7ll5ob+lADYvE0vKtU1cknwEnLuwmyrAGKpHXFjLMHY9qDxgbZsrAa32MJN0Ud94wj3peVBtde7gAHzf1A3tY6dfnYcFNUjRSwbLOUIrIlL9d6vBzGs/sEQLGH54cdE1gP0Tssb8bjYtxKdm6/sNy+q/Cz1SbKqtxJ/+KUd3aFM8MkyTpN/uXE0k9Uu1F5sDV5Vb9GUD8Yzzw+CrYqH3CbxWyqfRPKhKZIQrN7c87iVvAgKPYIijRRfl7SwXUQylMNHQ+anyfyJCyOg2L8UEvK0KDPZl5JDUg9Vv+QvXHGaKHGyzil0D5E3d7trLPeD1oD7XpXAG+s05FpGuWwgfAss6kuz2e4sDJoqUX/gnMRAAsLfEDjnW0T6dOwP+39qUtb2DYqBk0IeXxon6tcSYNWDjjjNR65nAULNOmjTOe0REntrTdSlhefZWwarot3A2TVzYuvq2CHcvQdfrojcF2cTTJZOl5KbNSSWRWfKDkurcaEDnKFs4mSBMCBHIqFT7RKjuKTFJWp//pLOF6adLITbLYJU8xYwu17M8+9PpXrQLg6e+rLkY2wGBISaTCHx4yoox7HfxWtr7/6YsAlh8easHFUb9Y6UlCyVRu48AtM8Kuv0T8uUic+1cdQ5jc2QX7fZjYz6RPoreWQ8Su/PeB02kDbXnG+YFNVo4CuahwRzCX4+Vfv43ZvZoJxQVVr+Q5Qi0V2QPWbu7/Xrho+x46QDVxlTASVzp+D9hXwPIuK2sOwT92fC+JnC4UtLs5/Oa4tTD7lvh7S5i4AWBfkJiga5PRJ06uW84VN6GVB96l1jW076Rs65hDfgN2aOc6gwxxYN+ZoXUF8tXUp37XbuvSHj6gEx4PdpPel4sFudSujGid681ydd3C7QQ1YGVVz9xMDhFqIHbtt7v9q1NDOXnqoqxa5sbIgTIzlwyb3rZK/WBiTa8kSQ+g7pMFrVkaYQNZ1z95PHgFpgSqvGM9WPJPSYT3hFOD1In/Y2aAzoCzzxZ4tbPtt+vDohvFqGu6+IgrOM2ioINHIGSkotl4xZO7p8reuhzjw7UvXj+5M5XtoWi9v7y8at4qm/tPvNONK2V2lllK7WjIY3+1xAVpYEOD6OQk9hQ8CtkUqDNeBTbnL6UH1cZtVszQ781DoAH3LWgV9nT/Lx4Dx2n2C7s7vpPV2docAfiZUuf7m X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1cd393a-be29-48db-40f5-08d90608bc41 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4966.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2021 03:34:44.0842 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yVe+3bT5XjoxcEiZ97mNcjZsQ2i2TgyEvDwoQIJGEYrQ+DgC3Qudl/1OQHrxfkylE7PuYCTFnzNU6fkM8b3Ndg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5079 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org The legacy clock binding are not maintained anymore. It has only a very preliminary supported clocks during initial upstream and meaningless for users. So drop it from binding doc now. Cc: devicetree@vger.kernel.org Signed-off-by: Dong Aisheng Acked-by: Rob Herring --- Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt index 3adf3f6f2beb..fd0061712443 100644 --- a/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt +++ b/Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt @@ -89,10 +89,8 @@ Required properties: "fsl,imx8qm-clk" "fsl,imx8qxp-clk" followed by "fsl,scu-clk" -- #clock-cells: Should be either - 2: Contains the Resource and Clock ID value. - or - 1: Contains the Clock ID value. (DEPRECATED) +- #clock-cells: Should be 2. + Contains the Resource and Clock ID value. - clocks: List of clock specifiers, must contain an entry for each required entry in clock-names - clock-names: Should include entries "xtal_32KHz", "xtal_24MHz" From patchwork Fri Apr 23 03:33:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 12219493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0BEAC433B4 for ; Fri, 23 Apr 2021 03:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 961C66137D for ; Fri, 23 Apr 2021 03:34:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231261AbhDWDf0 (ORCPT ); Thu, 22 Apr 2021 23:35:26 -0400 Received: from mail-eopbgr30043.outbound.protection.outlook.com ([40.107.3.43]:54018 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S237143AbhDWDf0 (ORCPT ); Thu, 22 Apr 2021 23:35:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YPJ7q4HRQPwOGfmzIQ8e06Ik8igIiWX0/dQIad7YtFZNX0gocYyybTRzs0wfgGT0Ap7C0YzRh/sLG7O2TWfQUFmynuLkBDbdxXtkJwtn55+CXus28t+B/wbZZCS5IC4aVYkOzRIBm1TPAu4OEMY1togM9AJjrRDPI1ONIoDaH7g24V20KtUtqqYH0ZlTX5sRcbPT05fJrHO3Q1ldv6EpunppqDJmJtLE3o9AKSJqMKnnQ39phUuoI3iphPKEu9L68hhl3I5VEIfDO09J55F00Xs8l0SA0xxLx9r1wnXZO5ls8DzF6PzosQnbfd/Er2VF6hQJ6L5QWGqLJjBs++W0rg== 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-SenderADCheck; bh=dpJtdLdIcZJyHnf+XWH2aeuE71jYFop2iBtcb6cz3+Y=; b=HZ0LlQFK/fVa7PMgeFepi7KZIWKZrk2T7hoULHLirtwB06qQrrpajEDqWD0HmByRb7vjIIsO+orXRNMb+Oi76Jm6gnXcThjB7Hy2AQHhqIWNr9AIb26PQDz2v+7sbQDKjK6XA+5zrQnTnj9yu9NJB22a2PqiyqizmQu6atHlmg+pXSPZetrDEgXWIvuOr6CxYa5P/DNBqYOo2mwvwviZ7Tky+aPKlqFeLtCF89anmZVcgOmNGVT5wRMzfgdjqj3UXtD4YNHXznU3N3evcpURPGuAy1bDCrbDbcGKE23j0PdBa9sdWMH+sjR69PMHxCRe2t0FnzRJYvnlrmOHATywLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dpJtdLdIcZJyHnf+XWH2aeuE71jYFop2iBtcb6cz3+Y=; b=X7iawXXLsGrUtQunujGQ2YQSLSiBPc7oMD2tRjXq5+sKC/1IfCr4BaaQ4egN6knAdN+Z5T0A8SE65LqGer9TN79eqG3hFaoV9gFp5awezDCciKb98jVvo7hOdcWLI7ar1Ctg8VKqxqdjgjPu6vwyrJxyCIJt76QN3Kg+PBEZYdA= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) by AM6PR04MB5079.eurprd04.prod.outlook.com (2603:10a6:20b:4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 03:34:47 +0000 Received: from AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b]) by AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b%2]) with mapi id 15.20.4065.023; Fri, 23 Apr 2021 03:34:47 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, abel.vesa@nxp.com, sboyd@kernel.org, Dong Aisheng Subject: [PATCH 3/6] clk: imx: scu: remove legacy scu clock binding support Date: Fri, 23 Apr 2021 11:33:31 +0800 Message-Id: <20210423033334.3317992-3-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210423033334.3317992-1-aisheng.dong@nxp.com> References: <20210423033334.3317992-1-aisheng.dong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) To AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.10 via Frontend Transport; Fri, 23 Apr 2021 03:34:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ad2cda74-aa0f-4887-a8dc-08d90608be26 X-MS-TrafficTypeDiagnostic: AM6PR04MB5079: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1417; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UwXX9E0ixtF66e9F861JVdXwI0d1GltNHQ933eaIWXjFUvXCyqvT6B76FhtG2Mr/qJIfTm+o9edgArq3q5PJJCburbW/XHXTnnXZtRVV9qe7LOshs9gvbZCnnsrWsWi2dknkKWt03wOwVHpzXNSj4bTgqNvoFfIbZcgEFEGB7Ty1aOHOajHyqY0nro+58sXIJBhoKMmZdoBW12pGoqtnW1sOGOluLnMgn7JRX1gIsw/2CTbbF6eKeqhp/1Mtw0hPP1VE2EHz5VdTmtRRB4zAwmNyn2yNoDnMXhiDStEkzAPYcl1CFaCrZIKNXKuj759Wa2nh8vNW/A7kLIGsIbkyvcdXID9OJ207oXGoqQNNKS5RASxitK3/gYXcu5EJYRphYcmaHjeK247wKRSVQJy5K6+XWReumlJkDA14DEp5p/6X74CwEajvOhLlga2QtzyBTbbJzURUdDhoTFn1VnSQJErtFr/B2a9sgYPqtnvb5KkIsJOv2D1H8ZLTOjFtYDEsPZ7kTgHMO61Ri1gCH55uHmW7p+S8wIwDWtnt7v5VccPdY2lfskjvhXxVXn7f9R1s6KGarTgKTPHXyuNvZICKIU7GZhc+TzznjEQx8egMhAu7D+LrjuF1nGS+MqdyJN4bF7s97xXg4UwOa7aaNRjEDnDrfY+5RhKVstoCXl1GfCULHUyVz9Cx2IJ2o4HnLVs1 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4966.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(346002)(366004)(376002)(39860400002)(16526019)(2906002)(8936002)(6512007)(316002)(38350700002)(8676002)(52116002)(38100700002)(4326008)(66556008)(26005)(86362001)(66946007)(478600001)(36756003)(1076003)(2616005)(956004)(6666004)(5660300002)(6486002)(6506007)(186003)(30864003)(66476007)(83380400001)(69590400013);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: f8C1/8z2keHq075nnIAAFxASSruQVs0F5V6/E8u9WLJqiJukRN6DtytUatV6e74eCtFz/uqhVSO0p94l1YYtfvE00MUF1zfYRW83rcVqpBLBkZfFUDCtPn+hngqdj0WiffGnYPihmCxHQnyr1xX+DPD0znLoLJcdTy26Jh3w8iVX6/Y2jFt8b3P+aJzpM2EmuizZ50fmjObh3HN1HIqdozAFoUaXHHQQeN2a0di0PHfs0VfNo2dXMlkPSBSfSQJs6C7tyFbeWT6Q2kItwzmSCKvVeTVzvgI1N1cnbOtbLLIrzBAm2C0V1+t4dnwzPpD34azSUjtRaFFC3PfatPqEcD+S3wHhtSt5rbSi/qUYnYvZ4avQq5fFlkd+2s0KpvfpHlZid3On3PzLTojc3Xm0JWLRrGZceuByP2SN+vZuSfoGDFHwiWNjDgMj2T6sSXBiK0ldVM3f1/IY9guuTYbWb3ewSdQjiWM8P1zCUBD46yyMZQ89xRtSd9BHI65AXAmuRGqHgBZ+27v9umM5G4roRgSxBYmAYHWWVZdwRI7bBP5stnZS7b2RLy6wxor6yMZXwlvoEPdMWdpkcH8hAese0yHQVbeXEv6V7rJgsL+SEI1Plw/0lcGB7L/Ks4nz4zrBLQx+axR7KkeEoR+O8e7YIYh6ZnWR3m8qJwCy4W8DTUvKAGuBkCK+upg/b6fZ9S+tph4ki5XQFEGOjMRkU2daCbYv+hb8c66XRNIwJGwpq8oiVNfi2OepC+kTv0NrC5KuI9sYGtOD5u84Eg7GQ8fC4SotfewMG0u6yaz14xsyaWXxNSWy4AvdOQIcy17VgQr9We/dEa6GONOaynWhzRRBKMGkSV7yWO597McKB/Cm7BKdYJPUh9MHmhOqcTmdo7kHxm3U7GsfJBIbYfckJNMlCneeWpfFRqH1yVBgNidVNHU7TEiaTWcZZmlu0OjipuEMkIKtpy/65pFzu7hylk2ygK0rjugNJK8bnIIQtzxxAMIrt9bcG750cSVw6vzYqBLfDXYDjHE6n+ytuo+hILGSBRaL+ePw84kIi3xQ7CR10myWmh0iNmNVcJS2GlaCAoz3yQ8OGXFtQy6g7pURXHV6oxwDNJ8Kpk6CzP+4QNuAz3hmIbivhF+PUf1++tleKbC8KLsd29DhXF4FpTnaOfTKO3+hL88JW0wxULPKWuV9kQGlXNKP4qh9h6Is3M15uZ3Q9fTZwNsdW5Ni5NB/dW4kCuTQiJyAEjAts+WJ1AwWfCnuaJZ+cOWgVbh0hRiYvH/iRpSudeW8Xl3QlCGYFtKwM6sQILgfiYagCxwFj6vJvDshZ0OYeb0CKqrEWpWvcRBC X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad2cda74-aa0f-4887-a8dc-08d90608be26 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4966.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2021 03:34:47.2563 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /4uLrhORuS+FcB80pnghaIZZZavifpa6TO21Hi9+Eo10wwN8hswwmqJmSgKa4huUWDo4FiLd1xJrYLbzKjeb8A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5079 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Legacy scu clock binding are not maintained anymore, it has a very limited clocks supported during initial upstreaming and obviously unusable by products. So it's meaningless to keep it in kernel which worse the code readability. Remove it to keep code much cleaner. Signed-off-by: Dong Aisheng Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-imx8qxp.c | 201 ++++++++++--------------- drivers/clk/imx/clk-scu.h | 15 +- include/dt-bindings/clock/imx8-clock.h | 128 ---------------- 3 files changed, 81 insertions(+), 263 deletions(-) diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c index fbf1170c09ed..d17b418ac577 100644 --- a/drivers/clk/imx/clk-imx8qxp.c +++ b/drivers/clk/imx/clk-imx8qxp.c @@ -14,7 +14,6 @@ #include "clk-scu.h" -#include #include static const char *dc0_sels[] = { @@ -28,149 +27,103 @@ static const char *dc0_sels[] = { static int imx8qxp_clk_probe(struct platform_device *pdev) { struct device_node *ccm_node = pdev->dev.of_node; - struct clk_hw_onecell_data *clk_data; - struct clk_hw **clks; - u32 clk_cells; - int ret, i; + int ret; ret = imx_clk_scu_init(ccm_node); if (ret) return ret; - clk_data = devm_kzalloc(&pdev->dev, struct_size(clk_data, hws, - IMX_SCU_CLK_END), GFP_KERNEL); - if (!clk_data) - return -ENOMEM; - - if (of_property_read_u32(ccm_node, "#clock-cells", &clk_cells)) - return -EINVAL; - - clk_data->num = IMX_SCU_CLK_END; - clks = clk_data->hws; - - /* Fixed clocks */ - clks[IMX_CLK_DUMMY] = clk_hw_register_fixed_rate(NULL, "dummy", NULL, 0, 0); - clks[IMX_ADMA_IPG_CLK_ROOT] = clk_hw_register_fixed_rate(NULL, "dma_ipg_clk_root", NULL, 0, 120000000); - clks[IMX_CONN_AXI_CLK_ROOT] = clk_hw_register_fixed_rate(NULL, "conn_axi_clk_root", NULL, 0, 333333333); - clks[IMX_CONN_AHB_CLK_ROOT] = clk_hw_register_fixed_rate(NULL, "conn_ahb_clk_root", NULL, 0, 166666666); - clks[IMX_CONN_IPG_CLK_ROOT] = clk_hw_register_fixed_rate(NULL, "conn_ipg_clk_root", NULL, 0, 83333333); - clks[IMX_DC_AXI_EXT_CLK] = clk_hw_register_fixed_rate(NULL, "dc_axi_ext_clk_root", NULL, 0, 800000000); - clks[IMX_DC_AXI_INT_CLK] = clk_hw_register_fixed_rate(NULL, "dc_axi_int_clk_root", NULL, 0, 400000000); - clks[IMX_DC_CFG_CLK] = clk_hw_register_fixed_rate(NULL, "dc_cfg_clk_root", NULL, 0, 100000000); - clks[IMX_MIPI_IPG_CLK] = clk_hw_register_fixed_rate(NULL, "mipi_ipg_clk_root", NULL, 0, 120000000); - clks[IMX_IMG_AXI_CLK] = clk_hw_register_fixed_rate(NULL, "img_axi_clk_root", NULL, 0, 400000000); - clks[IMX_IMG_IPG_CLK] = clk_hw_register_fixed_rate(NULL, "img_ipg_clk_root", NULL, 0, 200000000); - clks[IMX_IMG_PXL_CLK] = clk_hw_register_fixed_rate(NULL, "img_pxl_clk_root", NULL, 0, 600000000); - clks[IMX_HSIO_AXI_CLK] = clk_hw_register_fixed_rate(NULL, "hsio_axi_clk_root", NULL, 0, 400000000); - clks[IMX_HSIO_PER_CLK] = clk_hw_register_fixed_rate(NULL, "hsio_per_clk_root", NULL, 0, 133333333); - clks[IMX_LSIO_MEM_CLK] = clk_hw_register_fixed_rate(NULL, "lsio_mem_clk_root", NULL, 0, 200000000); - clks[IMX_LSIO_BUS_CLK] = clk_hw_register_fixed_rate(NULL, "lsio_bus_clk_root", NULL, 0, 100000000); - /* ARM core */ - clks[IMX_A35_CLK] = imx_clk_scu("a35_clk", IMX_SC_R_A35, IMX_SC_PM_CLK_CPU, clk_cells); + imx_clk_scu("a35_clk", IMX_SC_R_A35, IMX_SC_PM_CLK_CPU); /* LSIO SS */ - clks[IMX_LSIO_PWM0_CLK] = imx_clk_scu("pwm0_clk", IMX_SC_R_PWM_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_PWM1_CLK] = imx_clk_scu("pwm1_clk", IMX_SC_R_PWM_1, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_PWM2_CLK] = imx_clk_scu("pwm2_clk", IMX_SC_R_PWM_2, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_PWM3_CLK] = imx_clk_scu("pwm3_clk", IMX_SC_R_PWM_3, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_PWM4_CLK] = imx_clk_scu("pwm4_clk", IMX_SC_R_PWM_4, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_PWM5_CLK] = imx_clk_scu("pwm5_clk", IMX_SC_R_PWM_5, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_PWM6_CLK] = imx_clk_scu("pwm6_clk", IMX_SC_R_PWM_6, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_PWM7_CLK] = imx_clk_scu("pwm7_clk", IMX_SC_R_PWM_7, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_GPT0_CLK] = imx_clk_scu("gpt0_clk", IMX_SC_R_GPT_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_GPT1_CLK] = imx_clk_scu("gpt1_clk", IMX_SC_R_GPT_1, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_GPT2_CLK] = imx_clk_scu("gpt2_clk", IMX_SC_R_GPT_2, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_GPT3_CLK] = imx_clk_scu("gpt3_clk", IMX_SC_R_GPT_3, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_GPT4_CLK] = imx_clk_scu("gpt4_clk", IMX_SC_R_GPT_4, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_FSPI0_CLK] = imx_clk_scu("fspi0_clk", IMX_SC_R_FSPI_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_LSIO_FSPI1_CLK] = imx_clk_scu("fspi1_clk", IMX_SC_R_FSPI_1, IMX_SC_PM_CLK_PER, clk_cells); + imx_clk_scu("pwm0_clk", IMX_SC_R_PWM_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("pwm1_clk", IMX_SC_R_PWM_1, IMX_SC_PM_CLK_PER); + imx_clk_scu("pwm2_clk", IMX_SC_R_PWM_2, IMX_SC_PM_CLK_PER); + imx_clk_scu("pwm3_clk", IMX_SC_R_PWM_3, IMX_SC_PM_CLK_PER); + imx_clk_scu("pwm4_clk", IMX_SC_R_PWM_4, IMX_SC_PM_CLK_PER); + imx_clk_scu("pwm5_clk", IMX_SC_R_PWM_5, IMX_SC_PM_CLK_PER); + imx_clk_scu("pwm6_clk", IMX_SC_R_PWM_6, IMX_SC_PM_CLK_PER); + imx_clk_scu("pwm7_clk", IMX_SC_R_PWM_7, IMX_SC_PM_CLK_PER); + imx_clk_scu("gpt0_clk", IMX_SC_R_GPT_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("gpt1_clk", IMX_SC_R_GPT_1, IMX_SC_PM_CLK_PER); + imx_clk_scu("gpt2_clk", IMX_SC_R_GPT_2, IMX_SC_PM_CLK_PER); + imx_clk_scu("gpt3_clk", IMX_SC_R_GPT_3, IMX_SC_PM_CLK_PER); + imx_clk_scu("gpt4_clk", IMX_SC_R_GPT_4, IMX_SC_PM_CLK_PER); + imx_clk_scu("fspi0_clk", IMX_SC_R_FSPI_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("fspi1_clk", IMX_SC_R_FSPI_1, IMX_SC_PM_CLK_PER); /* ADMA SS */ - clks[IMX_ADMA_UART0_CLK] = imx_clk_scu("uart0_clk", IMX_SC_R_UART_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_UART1_CLK] = imx_clk_scu("uart1_clk", IMX_SC_R_UART_1, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_UART2_CLK] = imx_clk_scu("uart2_clk", IMX_SC_R_UART_2, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_UART3_CLK] = imx_clk_scu("uart3_clk", IMX_SC_R_UART_3, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_SPI0_CLK] = imx_clk_scu("spi0_clk", IMX_SC_R_SPI_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_SPI1_CLK] = imx_clk_scu("spi1_clk", IMX_SC_R_SPI_1, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_SPI2_CLK] = imx_clk_scu("spi2_clk", IMX_SC_R_SPI_2, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_SPI3_CLK] = imx_clk_scu("spi3_clk", IMX_SC_R_SPI_3, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_CAN0_CLK] = imx_clk_scu("can0_clk", IMX_SC_R_CAN_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_I2C0_CLK] = imx_clk_scu("i2c0_clk", IMX_SC_R_I2C_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_I2C1_CLK] = imx_clk_scu("i2c1_clk", IMX_SC_R_I2C_1, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_I2C2_CLK] = imx_clk_scu("i2c2_clk", IMX_SC_R_I2C_2, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_I2C3_CLK] = imx_clk_scu("i2c3_clk", IMX_SC_R_I2C_3, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_FTM0_CLK] = imx_clk_scu("ftm0_clk", IMX_SC_R_FTM_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_FTM1_CLK] = imx_clk_scu("ftm1_clk", IMX_SC_R_FTM_1, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_ADC0_CLK] = imx_clk_scu("adc0_clk", IMX_SC_R_ADC_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_PWM_CLK] = imx_clk_scu("pwm_clk", IMX_SC_R_LCD_0_PWM_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_ADMA_LCD_CLK] = imx_clk_scu("lcd_clk", IMX_SC_R_LCD_0, IMX_SC_PM_CLK_PER, clk_cells); + imx_clk_scu("uart0_clk", IMX_SC_R_UART_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("uart1_clk", IMX_SC_R_UART_1, IMX_SC_PM_CLK_PER); + imx_clk_scu("uart2_clk", IMX_SC_R_UART_2, IMX_SC_PM_CLK_PER); + imx_clk_scu("uart3_clk", IMX_SC_R_UART_3, IMX_SC_PM_CLK_PER); + imx_clk_scu("spi0_clk", IMX_SC_R_SPI_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("spi1_clk", IMX_SC_R_SPI_1, IMX_SC_PM_CLK_PER); + imx_clk_scu("spi2_clk", IMX_SC_R_SPI_2, IMX_SC_PM_CLK_PER); + imx_clk_scu("spi3_clk", IMX_SC_R_SPI_3, IMX_SC_PM_CLK_PER); + imx_clk_scu("can0_clk", IMX_SC_R_CAN_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("i2c0_clk", IMX_SC_R_I2C_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("i2c1_clk", IMX_SC_R_I2C_1, IMX_SC_PM_CLK_PER); + imx_clk_scu("i2c2_clk", IMX_SC_R_I2C_2, IMX_SC_PM_CLK_PER); + imx_clk_scu("i2c3_clk", IMX_SC_R_I2C_3, IMX_SC_PM_CLK_PER); + imx_clk_scu("ftm0_clk", IMX_SC_R_FTM_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("ftm1_clk", IMX_SC_R_FTM_1, IMX_SC_PM_CLK_PER); + imx_clk_scu("adc0_clk", IMX_SC_R_ADC_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("pwm_clk", IMX_SC_R_LCD_0_PWM_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("lcd_clk", IMX_SC_R_LCD_0, IMX_SC_PM_CLK_PER); /* Connectivity */ - clks[IMX_CONN_SDHC0_CLK] = imx_clk_scu("sdhc0_clk", IMX_SC_R_SDHC_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CONN_SDHC1_CLK] = imx_clk_scu("sdhc1_clk", IMX_SC_R_SDHC_1, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CONN_SDHC2_CLK] = imx_clk_scu("sdhc2_clk", IMX_SC_R_SDHC_2, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CONN_ENET0_ROOT_CLK] = imx_clk_scu("enet0_clk", IMX_SC_R_ENET_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CONN_ENET0_BYPASS_CLK] = imx_clk_scu("enet0_bypass_clk", IMX_SC_R_ENET_0, IMX_SC_PM_CLK_BYPASS, clk_cells); - clks[IMX_CONN_ENET0_RGMII_CLK] = imx_clk_scu("enet0_rgmii_clk", IMX_SC_R_ENET_0, IMX_SC_PM_CLK_MISC0, clk_cells); - clks[IMX_CONN_ENET1_ROOT_CLK] = imx_clk_scu("enet1_clk", IMX_SC_R_ENET_1, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CONN_ENET1_BYPASS_CLK] = imx_clk_scu("enet1_bypass_clk", IMX_SC_R_ENET_1, IMX_SC_PM_CLK_BYPASS, clk_cells); - clks[IMX_CONN_ENET1_RGMII_CLK] = imx_clk_scu("enet1_rgmii_clk", IMX_SC_R_ENET_1, IMX_SC_PM_CLK_MISC0, clk_cells); - clks[IMX_CONN_GPMI_BCH_IO_CLK] = imx_clk_scu("gpmi_io_clk", IMX_SC_R_NAND, IMX_SC_PM_CLK_MST_BUS, clk_cells); - clks[IMX_CONN_GPMI_BCH_CLK] = imx_clk_scu("gpmi_bch_clk", IMX_SC_R_NAND, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CONN_USB2_ACLK] = imx_clk_scu("usb3_aclk_div", IMX_SC_R_USB_2, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CONN_USB2_BUS_CLK] = imx_clk_scu("usb3_bus_div", IMX_SC_R_USB_2, IMX_SC_PM_CLK_MST_BUS, clk_cells); - clks[IMX_CONN_USB2_LPM_CLK] = imx_clk_scu("usb3_lpm_div", IMX_SC_R_USB_2, IMX_SC_PM_CLK_MISC, clk_cells); + imx_clk_scu("sdhc0_clk", IMX_SC_R_SDHC_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("sdhc1_clk", IMX_SC_R_SDHC_1, IMX_SC_PM_CLK_PER); + imx_clk_scu("sdhc2_clk", IMX_SC_R_SDHC_2, IMX_SC_PM_CLK_PER); + imx_clk_scu("enet0_clk", IMX_SC_R_ENET_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("enet0_bypass_clk", IMX_SC_R_ENET_0, IMX_SC_PM_CLK_BYPASS); + imx_clk_scu("enet0_rgmii_clk", IMX_SC_R_ENET_0, IMX_SC_PM_CLK_MISC0); + imx_clk_scu("enet1_clk", IMX_SC_R_ENET_1, IMX_SC_PM_CLK_PER); + imx_clk_scu("enet1_bypass_clk", IMX_SC_R_ENET_1, IMX_SC_PM_CLK_BYPASS); + imx_clk_scu("enet1_rgmii_clk", IMX_SC_R_ENET_1, IMX_SC_PM_CLK_MISC0); + imx_clk_scu("gpmi_io_clk", IMX_SC_R_NAND, IMX_SC_PM_CLK_MST_BUS); + imx_clk_scu("gpmi_bch_clk", IMX_SC_R_NAND, IMX_SC_PM_CLK_PER); + imx_clk_scu("usb3_aclk_div", IMX_SC_R_USB_2, IMX_SC_PM_CLK_PER); + imx_clk_scu("usb3_bus_div", IMX_SC_R_USB_2, IMX_SC_PM_CLK_MST_BUS); + imx_clk_scu("usb3_lpm_div", IMX_SC_R_USB_2, IMX_SC_PM_CLK_MISC); /* Display controller SS */ - clks[IMX_DC0_DISP0_CLK] = imx_clk_scu2("dc0_disp0_clk", dc0_sels, ARRAY_SIZE(dc0_sels), IMX_SC_R_DC_0, IMX_SC_PM_CLK_MISC0, clk_cells); - clks[IMX_DC0_DISP1_CLK] = imx_clk_scu2("dc0_disp1_clk", dc0_sels, ARRAY_SIZE(dc0_sels), IMX_SC_R_DC_0, IMX_SC_PM_CLK_MISC1, clk_cells); - clks[IMX_DC0_PLL0_CLK] = imx_clk_scu("dc0_pll0_clk", IMX_SC_R_DC_0_PLL_0, IMX_SC_PM_CLK_PLL, clk_cells); - clks[IMX_DC0_PLL1_CLK] = imx_clk_scu("dc0_pll1_clk", IMX_SC_R_DC_0_PLL_1, IMX_SC_PM_CLK_PLL, clk_cells); - clks[IMX_DC0_BYPASS0_CLK] = imx_clk_scu("dc0_bypass0_clk", IMX_SC_R_DC_0_VIDEO0, IMX_SC_PM_CLK_BYPASS, clk_cells); - clks[IMX_DC0_BYPASS1_CLK] = imx_clk_scu("dc0_bypass1_clk", IMX_SC_R_DC_0_VIDEO1, IMX_SC_PM_CLK_BYPASS, clk_cells); + imx_clk_scu2("dc0_disp0_clk", dc0_sels, ARRAY_SIZE(dc0_sels), IMX_SC_R_DC_0, IMX_SC_PM_CLK_MISC0); + imx_clk_scu2("dc0_disp1_clk", dc0_sels, ARRAY_SIZE(dc0_sels), IMX_SC_R_DC_0, IMX_SC_PM_CLK_MISC1); + imx_clk_scu("dc0_pll0_clk", IMX_SC_R_DC_0_PLL_0, IMX_SC_PM_CLK_PLL); + imx_clk_scu("dc0_pll1_clk", IMX_SC_R_DC_0_PLL_1, IMX_SC_PM_CLK_PLL); + imx_clk_scu("dc0_bypass0_clk", IMX_SC_R_DC_0_VIDEO0, IMX_SC_PM_CLK_BYPASS); + imx_clk_scu("dc0_bypass1_clk", IMX_SC_R_DC_0_VIDEO1, IMX_SC_PM_CLK_BYPASS); /* MIPI-LVDS SS */ - clks[IMX_MIPI0_LVDS_PIXEL_CLK] = imx_clk_scu("mipi0_lvds_pixel_clk", IMX_SC_R_LVDS_0, IMX_SC_PM_CLK_MISC2, clk_cells); - clks[IMX_MIPI0_LVDS_BYPASS_CLK] = imx_clk_scu("mipi0_lvds_bypass_clk", IMX_SC_R_LVDS_0, IMX_SC_PM_CLK_BYPASS, clk_cells); - clks[IMX_MIPI0_LVDS_PHY_CLK] = imx_clk_scu("mipi0_lvds_phy_clk", IMX_SC_R_LVDS_0, IMX_SC_PM_CLK_MISC3, clk_cells); - clks[IMX_MIPI0_I2C0_CLK] = imx_clk_scu("mipi0_i2c0_clk", IMX_SC_R_MIPI_0_I2C_0, IMX_SC_PM_CLK_MISC2, clk_cells); - clks[IMX_MIPI0_I2C1_CLK] = imx_clk_scu("mipi0_i2c1_clk", IMX_SC_R_MIPI_0_I2C_1, IMX_SC_PM_CLK_MISC2, clk_cells); - clks[IMX_MIPI0_PWM0_CLK] = imx_clk_scu("mipi0_pwm0_clk", IMX_SC_R_MIPI_0_PWM_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_MIPI1_LVDS_PIXEL_CLK] = imx_clk_scu("mipi1_lvds_pixel_clk", IMX_SC_R_LVDS_1, IMX_SC_PM_CLK_MISC2, clk_cells); - clks[IMX_MIPI1_LVDS_BYPASS_CLK] = imx_clk_scu("mipi1_lvds_bypass_clk", IMX_SC_R_LVDS_1, IMX_SC_PM_CLK_BYPASS, clk_cells); - clks[IMX_MIPI1_LVDS_PHY_CLK] = imx_clk_scu("mipi1_lvds_phy_clk", IMX_SC_R_LVDS_1, IMX_SC_PM_CLK_MISC3, clk_cells); - clks[IMX_MIPI1_I2C0_CLK] = imx_clk_scu("mipi1_i2c0_clk", IMX_SC_R_MIPI_1_I2C_0, IMX_SC_PM_CLK_MISC2, clk_cells); - clks[IMX_MIPI1_I2C1_CLK] = imx_clk_scu("mipi1_i2c1_clk", IMX_SC_R_MIPI_1_I2C_1, IMX_SC_PM_CLK_MISC2, clk_cells); - clks[IMX_MIPI1_PWM0_CLK] = imx_clk_scu("mipi1_pwm0_clk", IMX_SC_R_MIPI_1_PWM_0, IMX_SC_PM_CLK_PER, clk_cells); + imx_clk_scu("mipi0_lvds_pixel_clk", IMX_SC_R_LVDS_0, IMX_SC_PM_CLK_MISC2); + imx_clk_scu("mipi0_lvds_bypass_clk", IMX_SC_R_LVDS_0, IMX_SC_PM_CLK_BYPASS); + imx_clk_scu("mipi0_lvds_phy_clk", IMX_SC_R_LVDS_0, IMX_SC_PM_CLK_MISC3); + imx_clk_scu("mipi0_i2c0_clk", IMX_SC_R_MIPI_0_I2C_0, IMX_SC_PM_CLK_MISC2); + imx_clk_scu("mipi0_i2c1_clk", IMX_SC_R_MIPI_0_I2C_1, IMX_SC_PM_CLK_MISC2); + imx_clk_scu("mipi0_pwm0_clk", IMX_SC_R_MIPI_0_PWM_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("mipi1_lvds_pixel_clk", IMX_SC_R_LVDS_1, IMX_SC_PM_CLK_MISC2); + imx_clk_scu("mipi1_lvds_bypass_clk", IMX_SC_R_LVDS_1, IMX_SC_PM_CLK_BYPASS); + imx_clk_scu("mipi1_lvds_phy_clk", IMX_SC_R_LVDS_1, IMX_SC_PM_CLK_MISC3); + imx_clk_scu("mipi1_i2c0_clk", IMX_SC_R_MIPI_1_I2C_0, IMX_SC_PM_CLK_MISC2); + imx_clk_scu("mipi1_i2c1_clk", IMX_SC_R_MIPI_1_I2C_1, IMX_SC_PM_CLK_MISC2); + imx_clk_scu("mipi1_pwm0_clk", IMX_SC_R_MIPI_1_PWM_0, IMX_SC_PM_CLK_PER); /* MIPI CSI SS */ - clks[IMX_CSI0_CORE_CLK] = imx_clk_scu("mipi_csi0_core_clk", IMX_SC_R_CSI_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CSI0_ESC_CLK] = imx_clk_scu("mipi_csi0_esc_clk", IMX_SC_R_CSI_0, IMX_SC_PM_CLK_MISC, clk_cells); - clks[IMX_CSI0_I2C0_CLK] = imx_clk_scu("mipi_csi0_i2c0_clk", IMX_SC_R_CSI_0_I2C_0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_CSI0_PWM0_CLK] = imx_clk_scu("mipi_csi0_pwm0_clk", IMX_SC_R_CSI_0_PWM_0, IMX_SC_PM_CLK_PER, clk_cells); + imx_clk_scu("mipi_csi0_core_clk", IMX_SC_R_CSI_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("mipi_csi0_esc_clk", IMX_SC_R_CSI_0, IMX_SC_PM_CLK_MISC); + imx_clk_scu("mipi_csi0_i2c0_clk", IMX_SC_R_CSI_0_I2C_0, IMX_SC_PM_CLK_PER); + imx_clk_scu("mipi_csi0_pwm0_clk", IMX_SC_R_CSI_0_PWM_0, IMX_SC_PM_CLK_PER); /* GPU SS */ - clks[IMX_GPU0_CORE_CLK] = imx_clk_scu("gpu_core0_clk", IMX_SC_R_GPU_0_PID0, IMX_SC_PM_CLK_PER, clk_cells); - clks[IMX_GPU0_SHADER_CLK] = imx_clk_scu("gpu_shader0_clk", IMX_SC_R_GPU_0_PID0, IMX_SC_PM_CLK_MISC, clk_cells); - - for (i = 0; i < clk_data->num; i++) { - if (IS_ERR(clks[i])) - pr_warn("i.MX clk %u: register failed with %ld\n", - i, PTR_ERR(clks[i])); - } - - if (clk_cells == 2) { - ret = of_clk_add_hw_provider(ccm_node, imx_scu_of_clk_src_get, imx_scu_clks); - if (ret) - imx_clk_scu_unregister(); - } else { - /* - * legacy binding code path doesn't unregister here because - * it will be removed later. - */ - ret = of_clk_add_hw_provider(ccm_node, of_clk_hw_onecell_get, clk_data); - } + imx_clk_scu("gpu_core0_clk", IMX_SC_R_GPU_0_PID0, IMX_SC_PM_CLK_PER); + imx_clk_scu("gpu_shader0_clk", IMX_SC_R_GPU_0_PID0, IMX_SC_PM_CLK_MISC); + + ret = of_clk_add_hw_provider(ccm_node, imx_scu_of_clk_src_get, imx_scu_clks); + if (ret) + imx_clk_scu_unregister(); return ret; } diff --git a/drivers/clk/imx/clk-scu.h b/drivers/clk/imx/clk-scu.h index e8352164923e..a6c6d3103e94 100644 --- a/drivers/clk/imx/clk-scu.h +++ b/drivers/clk/imx/clk-scu.h @@ -32,22 +32,15 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name, void imx_clk_lpcg_scu_unregister(struct clk_hw *hw); static inline struct clk_hw *imx_clk_scu(const char *name, u32 rsrc_id, - u8 clk_type, u8 clk_cells) + u8 clk_type) { - if (clk_cells == 2) - return imx_clk_scu_alloc_dev(name, NULL, 0, rsrc_id, clk_type); - else - return __imx_clk_scu(NULL, name, NULL, 0, rsrc_id, clk_type); + return imx_clk_scu_alloc_dev(name, NULL, 0, rsrc_id, clk_type); } static inline struct clk_hw *imx_clk_scu2(const char *name, const char * const *parents, - int num_parents, u32 rsrc_id, u8 clk_type, - u8 clk_cells) + int num_parents, u32 rsrc_id, u8 clk_type) { - if (clk_cells == 2) - return imx_clk_scu_alloc_dev(name, parents, num_parents, rsrc_id, clk_type); - else - return __imx_clk_scu(NULL, name, parents, num_parents, rsrc_id, clk_type); + return imx_clk_scu_alloc_dev(name, parents, num_parents, rsrc_id, clk_type); } static inline struct clk_hw *imx_clk_lpcg_scu_dev(struct device *dev, const char *name, diff --git a/include/dt-bindings/clock/imx8-clock.h b/include/dt-bindings/clock/imx8-clock.h index 82b1fc8d1ee0..2e60ce4d2622 100644 --- a/include/dt-bindings/clock/imx8-clock.h +++ b/include/dt-bindings/clock/imx8-clock.h @@ -7,134 +7,6 @@ #ifndef __DT_BINDINGS_CLOCK_IMX_H #define __DT_BINDINGS_CLOCK_IMX_H -/* SCU Clocks */ - -#define IMX_CLK_DUMMY 0 - -/* CPU */ -#define IMX_A35_CLK 1 - -/* LSIO SS */ -#define IMX_LSIO_MEM_CLK 2 -#define IMX_LSIO_BUS_CLK 3 -#define IMX_LSIO_PWM0_CLK 10 -#define IMX_LSIO_PWM1_CLK 11 -#define IMX_LSIO_PWM2_CLK 12 -#define IMX_LSIO_PWM3_CLK 13 -#define IMX_LSIO_PWM4_CLK 14 -#define IMX_LSIO_PWM5_CLK 15 -#define IMX_LSIO_PWM6_CLK 16 -#define IMX_LSIO_PWM7_CLK 17 -#define IMX_LSIO_GPT0_CLK 18 -#define IMX_LSIO_GPT1_CLK 19 -#define IMX_LSIO_GPT2_CLK 20 -#define IMX_LSIO_GPT3_CLK 21 -#define IMX_LSIO_GPT4_CLK 22 -#define IMX_LSIO_FSPI0_CLK 23 -#define IMX_LSIO_FSPI1_CLK 24 - -/* Connectivity SS */ -#define IMX_CONN_AXI_CLK_ROOT 30 -#define IMX_CONN_AHB_CLK_ROOT 31 -#define IMX_CONN_IPG_CLK_ROOT 32 -#define IMX_CONN_SDHC0_CLK 40 -#define IMX_CONN_SDHC1_CLK 41 -#define IMX_CONN_SDHC2_CLK 42 -#define IMX_CONN_ENET0_ROOT_CLK 43 -#define IMX_CONN_ENET0_BYPASS_CLK 44 -#define IMX_CONN_ENET0_RGMII_CLK 45 -#define IMX_CONN_ENET1_ROOT_CLK 46 -#define IMX_CONN_ENET1_BYPASS_CLK 47 -#define IMX_CONN_ENET1_RGMII_CLK 48 -#define IMX_CONN_GPMI_BCH_IO_CLK 49 -#define IMX_CONN_GPMI_BCH_CLK 50 -#define IMX_CONN_USB2_ACLK 51 -#define IMX_CONN_USB2_BUS_CLK 52 -#define IMX_CONN_USB2_LPM_CLK 53 - -/* HSIO SS */ -#define IMX_HSIO_AXI_CLK 60 -#define IMX_HSIO_PER_CLK 61 - -/* Display controller SS */ -#define IMX_DC_AXI_EXT_CLK 70 -#define IMX_DC_AXI_INT_CLK 71 -#define IMX_DC_CFG_CLK 72 -#define IMX_DC0_PLL0_CLK 80 -#define IMX_DC0_PLL1_CLK 81 -#define IMX_DC0_DISP0_CLK 82 -#define IMX_DC0_DISP1_CLK 83 -#define IMX_DC0_BYPASS0_CLK 84 -#define IMX_DC0_BYPASS1_CLK 85 - -/* MIPI-LVDS SS */ -#define IMX_MIPI_IPG_CLK 90 -#define IMX_MIPI0_PIXEL_CLK 100 -#define IMX_MIPI0_BYPASS_CLK 101 -#define IMX_MIPI0_LVDS_PIXEL_CLK 102 -#define IMX_MIPI0_LVDS_BYPASS_CLK 103 -#define IMX_MIPI0_LVDS_PHY_CLK 104 -#define IMX_MIPI0_I2C0_CLK 105 -#define IMX_MIPI0_I2C1_CLK 106 -#define IMX_MIPI0_PWM0_CLK 107 -#define IMX_MIPI1_PIXEL_CLK 108 -#define IMX_MIPI1_BYPASS_CLK 109 -#define IMX_MIPI1_LVDS_PIXEL_CLK 110 -#define IMX_MIPI1_LVDS_BYPASS_CLK 111 -#define IMX_MIPI1_LVDS_PHY_CLK 112 -#define IMX_MIPI1_I2C0_CLK 113 -#define IMX_MIPI1_I2C1_CLK 114 -#define IMX_MIPI1_PWM0_CLK 115 - -/* IMG SS */ -#define IMX_IMG_AXI_CLK 120 -#define IMX_IMG_IPG_CLK 121 -#define IMX_IMG_PXL_CLK 122 - -/* MIPI-CSI SS */ -#define IMX_CSI0_CORE_CLK 130 -#define IMX_CSI0_ESC_CLK 131 -#define IMX_CSI0_PWM0_CLK 132 -#define IMX_CSI0_I2C0_CLK 133 - -/* PARALLER CSI SS */ -#define IMX_PARALLEL_CSI_DPLL_CLK 140 -#define IMX_PARALLEL_CSI_PIXEL_CLK 141 -#define IMX_PARALLEL_CSI_MCLK_CLK 142 - -/* VPU SS */ -#define IMX_VPU_ENC_CLK 150 -#define IMX_VPU_DEC_CLK 151 - -/* GPU SS */ -#define IMX_GPU0_CORE_CLK 160 -#define IMX_GPU0_SHADER_CLK 161 - -/* ADMA SS */ -#define IMX_ADMA_IPG_CLK_ROOT 165 -#define IMX_ADMA_UART0_CLK 170 -#define IMX_ADMA_UART1_CLK 171 -#define IMX_ADMA_UART2_CLK 172 -#define IMX_ADMA_UART3_CLK 173 -#define IMX_ADMA_SPI0_CLK 174 -#define IMX_ADMA_SPI1_CLK 175 -#define IMX_ADMA_SPI2_CLK 176 -#define IMX_ADMA_SPI3_CLK 177 -#define IMX_ADMA_CAN0_CLK 178 -#define IMX_ADMA_CAN1_CLK 179 -#define IMX_ADMA_CAN2_CLK 180 -#define IMX_ADMA_I2C0_CLK 181 -#define IMX_ADMA_I2C1_CLK 182 -#define IMX_ADMA_I2C2_CLK 183 -#define IMX_ADMA_I2C3_CLK 184 -#define IMX_ADMA_FTM0_CLK 185 -#define IMX_ADMA_FTM1_CLK 186 -#define IMX_ADMA_ADC0_CLK 187 -#define IMX_ADMA_PWM_CLK 188 -#define IMX_ADMA_LCD_CLK 189 - -#define IMX_SCU_CLK_END 190 - /* LPCG clocks */ /* LSIO SS LPCG */ From patchwork Fri Apr 23 03:33:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 12219495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA069C433B4 for ; Fri, 23 Apr 2021 03:34:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9262361452 for ; Fri, 23 Apr 2021 03:34:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237143AbhDWDfa (ORCPT ); Thu, 22 Apr 2021 23:35:30 -0400 Received: from mail-eopbgr140075.outbound.protection.outlook.com ([40.107.14.75]:46965 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231552AbhDWDfa (ORCPT ); Thu, 22 Apr 2021 23:35:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BvLOIHkWAwYN6l3s4FiF52NIqF28UiAed4i/akTzEQNt+2DQS6rlWgqao7BXtkB4icoY/3H3NVjy5eR0dISQkaeoLj9c9XFqyGh3kyb6TnwYWY0r1mSF+w1IEuw2W9g1zEAN5epM6hwtZnU5kj7hr3sANcTF7LYYSzE9jgNyLV94rd1TsSp0py+jNDv1elpPPjBg+sbYifdRV01nXr6Z63eiKQP6Xc3mutsd5G8zafcUzygjeyK2rDCZwqVLXiqqRwf69OZWAv3j2MeLzuWwOBfvSR4ewvlrF3x/89ury2msP1hYWJ1Z99shyLmUMeLorXkyzreotV18qXZUylInCw== 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-SenderADCheck; bh=O5EEABu03Y+JfIQRMhC6WcLAGpbqLoMVpvzZKT/xP2E=; b=ebRRF0hujWtVIpN9kqQdHUbYN4V+bkP/XOX1joOwO/npL91eqGZ8l3A014cnfGWFe/n4f4F5dgrQ9G1mams5bvdCiS6pyncjgGgFL1H4HXvXdj2FR9U3I1pVHW2zBlS/JNInEaeYrzAytG3CYXuDUIDtQ6BF2xy/ilS2ZabzyvHlk/Is+/906jYDBm4y/eGPoz19qfFHIgxbilh+zcIvmoLpEOSiptdHutJieGQ1mUi0s4rMLk07xfUEPoEmMqttf2HIeF8HPPcYSCmsEKckh+c4G4g4doZXb1Kffqmdg7fIr5DVeOeNrYkYXt0M7FjyOYcwuxS9/JHBKwPh4rqalQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=O5EEABu03Y+JfIQRMhC6WcLAGpbqLoMVpvzZKT/xP2E=; b=Qy/SVHRWNDmOxANzW7tZ2uqNMoHdKJD4PfSm3YlD0yk4lYyW2flcCz5dwhjpMxBDQ1ukbr4CvsZjYMnYJZBgrEijxPuAA8giBRKfG222droj7kfIJ8DBMnjnDjEnn5cPS39RCoaJ5QP5zetLEC7azlQYvp+2ONDIsOaWiEEDQGk= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) by AM6PR04MB5079.eurprd04.prod.outlook.com (2603:10a6:20b:4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 03:34:50 +0000 Received: from AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b]) by AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b%2]) with mapi id 15.20.4065.023; Fri, 23 Apr 2021 03:34:50 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, abel.vesa@nxp.com, sboyd@kernel.org, Dong Aisheng Subject: [PATCH 4/6] clk: imx: scu: add gpr clocks support Date: Fri, 23 Apr 2021 11:33:32 +0800 Message-Id: <20210423033334.3317992-4-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210423033334.3317992-1-aisheng.dong@nxp.com> References: <20210423033334.3317992-1-aisheng.dong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) To AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.10 via Frontend Transport; Fri, 23 Apr 2021 03:34:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 132cb94f-4485-498d-1e49-08d90608c006 X-MS-TrafficTypeDiagnostic: AM6PR04MB5079: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1122; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aoGCgpMNbk03ch9nkFqR+EbUJXdunmabxXVB4oX4n61PbAqYMzPlC3ff/USjgehebukfMrwY6q7GNwzAu/3JYYOo9Hp/C7TePNF35iz6KUEasPid+UweXWKpoob8urCckL6lu+o4S4jxNcafxoO87R79ykeSWTw1/eAc1W/JSgrRnkZoMEMfsRHbWdGHATr986ucMdKKCG2jt4/YZ7pibbjSh0cwJYQCdnAoIL7jeJ2QWrA7lAIqWymW/f9ITTYjc6lGvDNowfQZRXzPu4cfCm/ntyiolS3JR38+iCOG3wbzTh1t/q+LWBcL6mYDy3dkRKKepYChZ/E5oJl/ZVasJUbr9Hu8pG0mECa0tf0GHKNdJ0yXBhtVNIYC4kH1CMa0mkoGr8cvn+nSYGxmYZ8QRjpyUUd1l0MLB1+18Er+3fqxkDJvYtebsH0FFJpuUCGU/EgMVO3mieGU3khjDleo3U3XqBgMvkyKJdLocbR9qNI2fURsgdb+J8ug16UrhBA9b/8kG82ltFkCkorXwb2jFoWIAGvb/7VPQdBKorsP2k/KLRboPSaXaEgDpWxZx3TFB3Av2AShVxtwhY/QZpvfxTJ7DX4IikvrnCPMtUfSM8d78MPPKNplsqlme3J7sA8t87olILKAyjA255DMb1qA74NB4UJBxwlFx9WcHM06tRc71ALjGBbJVb21ZJGSc2AD X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4966.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(346002)(366004)(376002)(39860400002)(16526019)(2906002)(8936002)(6512007)(316002)(38350700002)(8676002)(52116002)(38100700002)(4326008)(66556008)(26005)(86362001)(66946007)(478600001)(36756003)(1076003)(2616005)(956004)(6666004)(5660300002)(6486002)(6506007)(186003)(66476007)(83380400001)(69590400013);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: yoJeUXQmH+MsHCPOoMO4VjqiICzUwRLrGxWwY0iB7iZ740LAsjZ6HjkYp012/Zx8OiVllO0P2BKhfiKn4WPt+9u+V4MQUUo9+S/sikkGhrrtiOXnViqt4zAiLhlHgek2UD9HyeiNhpUhDKyJlz70UWJW8bMLTLrDCng57TgCABw/w0avbAL22Uhln485cQNA8a7DECySz49yy1XsXBJiAx/9Bl/0sEeW1zR4GwOw7X0J/fU+9VG6SK5iLR0/XE/CDt7TsNdzRukRvE8IatY9dUUki2uqqQ2uLSzY+4AWqWWuVJAHhuQ5k6Xva4qvzYHrB9hXb6DrXjXmX22DTtSSXuEUo73hsKzUCTTwr8J1MuTAZT48Ajr0JfVs5YRPYlHGpDoxrRJaCBJZ6UjTRjUjWa8d663BowX0Z2WoxCWQgLWUg4giFa2r1rpt6xPa61tsjpWYd1VjcwrGZgqNnw3hci1l3/EKUbPyUKp7LXuifud44MIhFu/C41v2MKjyvKghnV7pJyzQX2u8eXdrh46mTK//kYDnUcv/4Yq2FT+Fr1IquR2gdNqPeCda7KlnOkEuj3s8jfuptmi2PkLxHFHQoLVr0Y6/PGlZjCSsOQHK4ABitntn1cDW/MGxV6H9tNjL9iHHrCIYSTGA2nHlPP17RG95XFlKKMc5G+9px9naKNJ/U0NVOTdUsg/cAwVuNw/8cUAauRHSwqu11XMMfXC+P37SxLggWk0eqv3HVVRfxNot11gaTapGZ9QiASqxhqbpjgpww6jvdiJ//+tQ+3Q1+giRvYGhh4GP8cfUJwBaHowuign50B4gy6S0XeAe1PP06UpImubKtOcfX0hygwL5y66s0SucZ78uBqdwp/0RA77rhJ2Cwj7j+7yPZF+juHv2LwtcxWTYurmp0WHNcEBXKvorxcv04rZrr/LUCOmR2ki9jwHudBBIaCidp9Oplp/+QZJMiqd/Byxlmp3whmWE09/7t9QRSpGTVX/0F7YaNujfH2SnKRHmIbxyeq2jazVbBt13xX3zt/oFjTJA280AXe3lx06c+iBNA2dFmntqtLQNJ+uLZyhN0VpLREloNlWj/8ZTDpstyWgIRYih/BwDv/mKjjBkxyFi9R2gbdE+W8OaBTYvpdJxdWwdeZI4fg+rrt2jmhbBLOtnFc4Wm6hzD8YwJ83p693dAk2uPD1huwb+dNnTsormMSbo7PT+s73uQU5bbzgWEMegasyxEEzbSQ1zFYZtZXTr8ApcCyS/1i/dQo/3zTxBwBLs4mIJJH9/hiDRGB5WD5Gm2ZmSv/OaOUsOB4QB7i/9dp1oKCsYSJ9j0eKV4aVDobMqlPXD+0lI X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 132cb94f-4485-498d-1e49-08d90608c006 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4966.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2021 03:34:50.5014 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1hcmsM0+tvU3fCu1AouQpMFUl2yksGsAijjycftnh4oQjdffKyBNWmgEBHlY0DUV7U5z8vBx04Hl7Lw4jeCFxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5079 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org SCU clock protocol supports a few clocks based on GPR controller registers including mux/divider/gate. And a general clock register API to support them all. Signed-off-by: Dong Aisheng Reviewed-by: Abel Vesa --- drivers/clk/imx/clk-scu.c | 186 ++++++++++++++++++++++++++++++++++++++ drivers/clk/imx/clk-scu.h | 29 ++++++ 2 files changed, 215 insertions(+) diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index 1f5518b7ab39..cff0e1bd7030 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -52,6 +52,22 @@ struct clk_scu { u32 rate; }; +/* + * struct clk_gpr_scu - Description of one SCU GPR clock + * @hw: the common clk_hw + * @rsrc_id: resource ID of this SCU clock + * @gpr_id: GPR ID index to control the divider + */ +struct clk_gpr_scu { + struct clk_hw hw; + u16 rsrc_id; + u8 gpr_id; + u8 flags; + bool gate_invert; +}; + +#define to_clk_gpr_scu(_hw) container_of(_hw, struct clk_gpr_scu, hw) + /* * struct imx_sc_msg_req_set_clock_rate - clock set rate protocol * @hdr: SCU protocol header @@ -604,3 +620,173 @@ void imx_clk_scu_unregister(void) } } } + +static unsigned long clk_gpr_div_scu_recalc_rate(struct clk_hw *hw, + unsigned long parent_rate) +{ + struct clk_gpr_scu *clk = to_clk_gpr_scu(hw); + unsigned long rate = 0; + u32 val; + int err; + + err = imx_sc_misc_get_control(ccm_ipc_handle, clk->rsrc_id, + clk->gpr_id, &val); + + rate = val ? parent_rate / 2 : parent_rate; + + return err ? 0 : rate; +} + +static long clk_gpr_div_scu_round_rate(struct clk_hw *hw, unsigned long rate, + unsigned long *prate) +{ + if (rate < *prate) + rate = *prate / 2; + else + rate = *prate; + + return rate; +} + +static int clk_gpr_div_scu_set_rate(struct clk_hw *hw, unsigned long rate, + unsigned long parent_rate) +{ + struct clk_gpr_scu *clk = to_clk_gpr_scu(hw); + uint32_t val; + int err; + + val = (rate < parent_rate) ? 1 : 0; + err = imx_sc_misc_set_control(ccm_ipc_handle, clk->rsrc_id, + clk->gpr_id, val); + + return err ? -EINVAL : 0; +} + +static const struct clk_ops clk_gpr_div_scu_ops = { + .recalc_rate = clk_gpr_div_scu_recalc_rate, + .round_rate = clk_gpr_div_scu_round_rate, + .set_rate = clk_gpr_div_scu_set_rate, +}; + +static u8 clk_gpr_mux_scu_get_parent(struct clk_hw *hw) +{ + struct clk_gpr_scu *clk = to_clk_gpr_scu(hw); + u32 val = 0; + + imx_sc_misc_get_control(ccm_ipc_handle, clk->rsrc_id, + clk->gpr_id, &val); + + return (u8)val; +} + +static int clk_gpr_mux_scu_set_parent(struct clk_hw *hw, u8 index) +{ + struct clk_gpr_scu *clk = to_clk_gpr_scu(hw); + + return imx_sc_misc_set_control(ccm_ipc_handle, clk->rsrc_id, + clk->gpr_id, index); +} + +static const struct clk_ops clk_gpr_mux_scu_ops = { + .get_parent = clk_gpr_mux_scu_get_parent, + .set_parent = clk_gpr_mux_scu_set_parent, +}; + +static int clk_gpr_gate_scu_prepare(struct clk_hw *hw) +{ + struct clk_gpr_scu *clk = to_clk_gpr_scu(hw); + + return imx_sc_misc_set_control(ccm_ipc_handle, clk->rsrc_id, + clk->gpr_id, !clk->gate_invert); +} + +static void clk_gpr_gate_scu_unprepare(struct clk_hw *hw) +{ + struct clk_gpr_scu *clk = to_clk_gpr_scu(hw); + int ret; + + ret = imx_sc_misc_set_control(ccm_ipc_handle, clk->rsrc_id, + clk->gpr_id, clk->gate_invert); + if (ret) + pr_err("%s: clk unprepare failed %d\n", clk_hw_get_name(hw), + ret); +} + +static int clk_gpr_gate_scu_is_prepared(struct clk_hw *hw) +{ + struct clk_gpr_scu *clk = to_clk_gpr_scu(hw); + int ret; + u32 val; + + ret = imx_sc_misc_get_control(ccm_ipc_handle, clk->rsrc_id, + clk->gpr_id, &val); + if (ret) + return ret; + + return clk->gate_invert ? !val : val; +} + +static const struct clk_ops clk_gpr_gate_scu_ops = { + .prepare = clk_gpr_gate_scu_prepare, + .unprepare = clk_gpr_gate_scu_unprepare, + .is_prepared = clk_gpr_gate_scu_is_prepared, +}; + +struct clk_hw *__imx_clk_gpr_scu(const char *name, const char * const *parent_name, + int num_parents, u32 rsrc_id, u8 gpr_id, u8 flags, + bool invert) +{ + struct imx_scu_clk_node *clk_node; + struct clk_gpr_scu *clk; + struct clk_hw *hw; + struct clk_init_data init; + int ret; + + if (rsrc_id >= IMX_SC_R_LAST || gpr_id >= IMX_SC_C_LAST) + return ERR_PTR(-EINVAL); + + clk_node = kzalloc(sizeof(*clk_node), GFP_KERNEL); + if (!clk_node) + return ERR_PTR(-ENOMEM); + + clk = kzalloc(sizeof(*clk), GFP_KERNEL); + if (!clk) { + kfree(clk_node); + return ERR_PTR(-ENOMEM); + } + + clk->rsrc_id = rsrc_id; + clk->gpr_id = gpr_id; + clk->flags = flags; + clk->gate_invert = invert; + + if (flags & IMX_SCU_GPR_CLK_GATE) + init.ops = &clk_gpr_gate_scu_ops; + + if (flags & IMX_SCU_GPR_CLK_DIV) + init.ops = &clk_gpr_div_scu_ops; + + if (flags & IMX_SCU_GPR_CLK_MUX) + init.ops = &clk_gpr_mux_scu_ops; + + init.flags = 0; + init.name = name; + init.parent_names = parent_name; + init.num_parents = num_parents; + + clk->hw.init = &init; + + hw = &clk->hw; + ret = clk_hw_register(NULL, hw); + if (ret) { + kfree(clk); + kfree(clk_node); + hw = ERR_PTR(ret); + } else { + clk_node->hw = hw; + clk_node->clk_type = gpr_id; + list_add_tail(&clk_node->node, &imx_scu_clks[rsrc_id]); + } + + return hw; +} diff --git a/drivers/clk/imx/clk-scu.h b/drivers/clk/imx/clk-scu.h index a6c6d3103e94..8ebee0cb0fe6 100644 --- a/drivers/clk/imx/clk-scu.h +++ b/drivers/clk/imx/clk-scu.h @@ -10,6 +10,10 @@ #include #include +#define IMX_SCU_GPR_CLK_GATE BIT(0) +#define IMX_SCU_GPR_CLK_DIV BIT(1) +#define IMX_SCU_GPR_CLK_MUX BIT(2) + extern struct list_head imx_scu_clks[]; extern const struct dev_pm_ops imx_clk_lpcg_scu_pm_ops; @@ -31,6 +35,10 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name, void __iomem *reg, u8 bit_idx, bool hw_gate); void imx_clk_lpcg_scu_unregister(struct clk_hw *hw); +struct clk_hw *__imx_clk_gpr_scu(const char *name, const char * const *parent_name, + int num_parents, u32 rsrc_id, u8 gpr_id, u8 flags, + bool invert); + static inline struct clk_hw *imx_clk_scu(const char *name, u32 rsrc_id, u8 clk_type) { @@ -58,4 +66,25 @@ static inline struct clk_hw *imx_clk_lpcg_scu(const char *name, const char *pare return __imx_clk_lpcg_scu(NULL, name, parent_name, flags, reg, bit_idx, hw_gate); } + +static inline struct clk_hw *imx_clk_gate_gpr_scu(const char *name, const char *parent_name, + u32 rsrc_id, u8 gpr_id, bool invert) +{ + return __imx_clk_gpr_scu(name, &parent_name, 1, rsrc_id, gpr_id, + IMX_SCU_GPR_CLK_GATE, invert); +} + +static inline struct clk_hw *imx_clk_divider_gpr_scu(const char *name, const char *parent_name, + u32 rsrc_id, u8 gpr_id) +{ + return __imx_clk_gpr_scu(name, &parent_name, 1, rsrc_id, gpr_id, + IMX_SCU_GPR_CLK_DIV, 0); +} + +static inline struct clk_hw *imx_clk_mux_gpr_scu(const char *name, const char * const *parent_names, + int num_parents, u32 rsrc_id, u8 gpr_id) +{ + return __imx_clk_gpr_scu(name, parent_names, num_parents, rsrc_id, + gpr_id, IMX_SCU_GPR_CLK_MUX, 0); +} #endif From patchwork Fri Apr 23 03:33:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 12219497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBC97C433ED for ; Fri, 23 Apr 2021 03:34:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABD6C61417 for ; Fri, 23 Apr 2021 03:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237229AbhDWDfc (ORCPT ); Thu, 22 Apr 2021 23:35:32 -0400 Received: from mail-eopbgr140084.outbound.protection.outlook.com ([40.107.14.84]:10126 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231552AbhDWDfc (ORCPT ); Thu, 22 Apr 2021 23:35:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aw4EcpS0Ex92zh77ixf1EJPSgdJY8C8LY4EQLTBNd/tb99ycrp+vzfF4lDvfxf9LMC7VIS8O4jFcoIRKX8Ez3nQKM7+c1iOx+asM+4mZjLzZnLMGWje/qoAO3ScbgCVg0Hjzw6W8FjAoOGAQLH81jycL8a+bL6vqLKUXfe20SnT3/dlVFhcfi7JLizD5S9x47KXR0OVjzXuQcWJo/0pK7y1tWbBlj5ePff1zN72VIsL0ljd0YHazVgruQweT26r8RwC64ZTrkNualmIynlKGrISxwQMpAQ2Gh+4dT2aHTIEE012o3/uFg/xBOcOYaO9wkGQJPYXJyJJEGh3NicjpUg== 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-SenderADCheck; bh=iI23FNDqiWDTN5MsgRlvJf5HcKhqk3YJNQWvXankiSc=; b=bnkMTXpllqhuNQnf4sCbAQED1rGxf/x+N2p2k6BZPoiWqiDv6jS9BjCpBLc7ZMQaOh6SbsSwGHHpjrRX6jMs1DzRRIm8jXqrRBk7ZNQsFBisULm0aPiW5UHqL9JcLsYOkJXFPw3WODK1iIcvE9Tfje8zjW7x02KjYo6G45trFe2hc4wnn9grTEMpH1v5FYmwQC8jPANFU4Vj9S0tb8xW/8SPBLikBkz5azlMs+aLAKCEJIGYM+m5/MOR0aoYZRBgADRf/hE6JmE84eyKe+3lZIJX6XFqscIjVfC5n75YYhE3QnhHcIRBxAyJQjhGKfizofIMZCIPf2LLKxUpEB20Tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iI23FNDqiWDTN5MsgRlvJf5HcKhqk3YJNQWvXankiSc=; b=LrKVaWojIJe81Wx8cu7Soyh2bzwQtUlCg4hAxtjorMRmlBIo/XTO/hvwwWGd6OFjmIwfIZHKHgbswDbXWZ0qCwXe4WjxD4h9/21UODvkZiwGE4Q7ZW5Ebiqkp5/9pnry1PZeq945j3jObyQ6CTJbkSicVsyXd5plRHVqu5aw9Yw= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) by AM6PR04MB5079.eurprd04.prod.outlook.com (2603:10a6:20b:4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 03:34:53 +0000 Received: from AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b]) by AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b%2]) with mapi id 15.20.4065.023; Fri, 23 Apr 2021 03:34:53 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, abel.vesa@nxp.com, sboyd@kernel.org, Dong Aisheng Subject: [PATCH 5/6] clk: imx8qxp: add clock valid checking mechnism Date: Fri, 23 Apr 2021 11:33:33 +0800 Message-Id: <20210423033334.3317992-5-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210423033334.3317992-1-aisheng.dong@nxp.com> References: <20210423033334.3317992-1-aisheng.dong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) To AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.10 via Frontend Transport; Fri, 23 Apr 2021 03:34:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9745d10d-c7d2-48fd-1445-08d90608c1fb X-MS-TrafficTypeDiagnostic: AM6PR04MB5079: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cxzqzL3WnmI4Qid1kjkGhwpG9cpVwrqjpgBhKoLj1UhC4T+RkHYF5VXS7oemRq+I3QihL01yrhq4xDKRYsXSl3MyG3SHeTYyafOTBL3K5oIaJYwVSmNAM2zlW8EqdHXxSCLqbG2vIO8zONyU+nHu1hFircHRPzKXQ0bLft/p/oHy4PaUqFRjDkuYCx+AebXWfDzxz4j/kVQOLCR/C9h8A6v+5mdlsHMUc5vBl9aVXy+MgzG7FpNWKt1Il/756muirj2aP1ePYLnRn3aCTkcKjEk7CGaty5tAWyZJYmAe5ggj/EkfzgtxXdqUckfrKhHWFHaRvE4P4TZ+ljDR7gSw1Kregp7F41yGE7CEhEsoQjOjQ8c1HL7SInLdF+AmNgPzlCYd1FO36rV1VhXBd7yH2mNGWTfoFlqAeU4TZPm+yd8IK2DWKHNOVMIPqoXCYDd4H4gZ7gE/9BU1Y7JKuJbENliTX4bAVC5djiO9MYRToQu5LKToi30iYaA9xGbrHhDmo3f7w1jVGOddPjCUnTvBfexkMYUDAgw3dEc+RszeLrw2N+b7OBlzmJHLFxW5pyit3PNLsd5M2kF7dOZvIdP5/mcLMfY6OCjgETmjohvpCDKILPUM91wcDte2diZZCfadZsql96CHs71L4xgG/iM4eh7i+3Wcly6sXk/1udQN3fZv5qRDAuuYNESoYI1LDbRKJCXZpXMRRYgrYWQdzAE3NA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4966.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(346002)(366004)(376002)(39860400002)(16526019)(2906002)(8936002)(6512007)(316002)(38350700002)(8676002)(52116002)(38100700002)(4326008)(66556008)(26005)(86362001)(66946007)(478600001)(36756003)(1076003)(2616005)(956004)(6666004)(5660300002)(6486002)(6506007)(186003)(66476007)(83380400001)(69590400013)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: cSJl1w+cntSWP88GM0AwfFb2F4l2UN7IqtJX0IIfVKEnieYn1huPXW0HFS+9x7+pDFjrcHRq3Xci0JC93Z6gQ+0gLVLNubIdoHjn3TD1eLqhVg+qu0UqGlcDGy+iqHcc+pHSp7yuDAtwmplqe2JbaxkzYGgQYMzHg0rqlI5Qx4MCO0yUGfU0UbJ2imvkUv10TuITBoU6hiRL2ogNveue38Gws7KS4IKhrC/bI17bgU5mNYzhu87VB83ixBf0TlETprD19JdKM7EfLGzhFf4j0gINxAzw21CCgZMU7UqvtlBw4XTBtTppn028cOiy1r+Khqc1ry/ApJ2JSSXiKyi9+EX13MTApf6WqBtrr0ExrBB/EVdGMo/hDEy0yk7H8Ylx3EIcVDKYBQqZ/xmRxfP3wZ9S1wqi7x2OVsCwOhVvS0u2pP0UG4cNQoDCmcyLIy5CPuFhUpamEhTyrevxaIgr701ZCe/mqgZaWqTG/BNvTXZn6rf4xAwIXYb3Sn8hVzD6JUhPxsK2Jz2fiWchQreppoWETfMWTccG1mm8LIS9Ozc/gzdfV5R73sWfoCDQHhRrXBjVEuue0jS2J1JbHzuQoy+/xMkwN5/F//FgERbGS4aEpRNU/qDBfxZueVTdOuyOLCXW62Fj3V/LTv4vDg3IFnSoyRtdRpyEOfOoEpCVXG3vk3JVm8/kVt2DMRLVdhpfbhIiG2to30vf4EGCnvHIAfKZZ7PJZqIBpbDKRgeRd3l9RVM2Kyn5pCS4n3JPME6TvodHIpkUX2d/8INKR1BsdaH0muWBjH8AM9gSVSZC6Eux9acvJsObfNMVHeLmuFk0JmBbm6wJukqPGetSZIh+bjVMApUtkbdabBX0HbmjGj8uY5FrxlV5lNFhNazfU1CvWPUhlybVZo7JF5LrHzEFMYh/xeWc5ZAuo000gatCONERXaw9en4jXXdguVaC5oCDhq06UZqBMLugocZZqKr+gxYOT16jLdKic61X+OnCxUQhiOv/vrUDw/2VLzIqeY3DD9Etj5c/u1BsS7qDEOtlLluQ1Bac4qUL0m8gKbS/sv9IELvocUwVVgY88JYOK81KnwO4wnbUcd4RMr7YzMLL0ufqQxMXWXVBxTRhvfG18mSYnKQ3sNMD0cm5w1VNhvmiACf1OR5gb882HXDc3RR2kQs9YgtyOZbJAthFR5AegE5w3Ddt6LDBY6wbJDIc+OAo6m5r+4CdUK3/hLyFQGVrEZXNlFbn67GQeSMQKa42jYMPfCIaCsYBjk4zJgYmceiCHlC7BID4pTzaY1Jd5evB/2fzvSmQxyMArPer3xB9ZgIpz4iXnYxQJM/CxGS2I6u7 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9745d10d-c7d2-48fd-1445-08d90608c1fb X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4966.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2021 03:34:53.6946 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kFtxYRhlSEVYbNVp3VPirLH9dp7jUg5P/EHRjE6pWOJTQEHTXcx85RGjB/MSA/XDSMs5uxbAyVDcGkAgPH0/Pg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5079 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org clk-imx8qxp is a common SCU clock driver used by both QM and QXP platforms. The clock numbers vary a bit between those two platforms. This patch introduces a mechanism to only register the valid clocks for one platform by checking the clk resource id table. Signed-off-by: Dong Aisheng Reviewed-by: Abel Vesa --- drivers/clk/imx/Makefile | 3 +- drivers/clk/imx/clk-imx8qxp-rsrc.c | 89 ++++++++++++++++++++++++++++++ drivers/clk/imx/clk-imx8qxp.c | 9 ++- drivers/clk/imx/clk-scu.c | 33 ++++++++++- drivers/clk/imx/clk-scu.h | 11 +++- 5 files changed, 137 insertions(+), 8 deletions(-) create mode 100644 drivers/clk/imx/clk-imx8qxp-rsrc.c diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index dd6a737d060b..2fdd2fff16c7 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -27,7 +27,8 @@ obj-$(CONFIG_CLK_IMX8MP) += clk-imx8mp.o obj-$(CONFIG_CLK_IMX8MQ) += clk-imx8mq.o obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o -clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o +clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o \ + clk-imx8qxp-rsrc.o clk-imx-lpcg-scu-$(CONFIG_CLK_IMX8QXP) += clk-lpcg-scu.o clk-imx8qxp-lpcg.o obj-$(CONFIG_CLK_IMX1) += clk-imx1.o diff --git a/drivers/clk/imx/clk-imx8qxp-rsrc.c b/drivers/clk/imx/clk-imx8qxp-rsrc.c new file mode 100644 index 000000000000..ab66811ba9c1 --- /dev/null +++ b/drivers/clk/imx/clk-imx8qxp-rsrc.c @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019-2021 NXP + * Dong Aisheng + */ + +#include + +#include "clk-scu.h" + +/* Keep sorted in the ascending order */ +static u32 imx8qxp_clk_scu_rsrc_table[] = { + IMX_SC_R_DC_0_VIDEO0, + IMX_SC_R_DC_0_VIDEO1, + IMX_SC_R_DC_0, + IMX_SC_R_DC_0_PLL_0, + IMX_SC_R_DC_0_PLL_1, + IMX_SC_R_SPI_0, + IMX_SC_R_SPI_1, + IMX_SC_R_SPI_2, + IMX_SC_R_SPI_3, + IMX_SC_R_UART_0, + IMX_SC_R_UART_1, + IMX_SC_R_UART_2, + IMX_SC_R_UART_3, + IMX_SC_R_I2C_0, + IMX_SC_R_I2C_1, + IMX_SC_R_I2C_2, + IMX_SC_R_I2C_3, + IMX_SC_R_ADC_0, + IMX_SC_R_FTM_0, + IMX_SC_R_FTM_1, + IMX_SC_R_CAN_0, + IMX_SC_R_GPU_0_PID0, + IMX_SC_R_LCD_0, + IMX_SC_R_LCD_0_PWM_0, + IMX_SC_R_PWM_0, + IMX_SC_R_PWM_1, + IMX_SC_R_PWM_2, + IMX_SC_R_PWM_3, + IMX_SC_R_PWM_4, + IMX_SC_R_PWM_5, + IMX_SC_R_PWM_6, + IMX_SC_R_PWM_7, + IMX_SC_R_GPT_0, + IMX_SC_R_GPT_1, + IMX_SC_R_GPT_2, + IMX_SC_R_GPT_3, + IMX_SC_R_GPT_4, + IMX_SC_R_FSPI_0, + IMX_SC_R_FSPI_1, + IMX_SC_R_SDHC_0, + IMX_SC_R_SDHC_1, + IMX_SC_R_SDHC_2, + IMX_SC_R_ENET_0, + IMX_SC_R_ENET_1, + IMX_SC_R_MLB_0, + IMX_SC_R_USB_2, + IMX_SC_R_NAND, + IMX_SC_R_LVDS_0, + IMX_SC_R_LVDS_1, + IMX_SC_R_M4_0_I2C, + IMX_SC_R_ELCDIF_PLL, + IMX_SC_R_AUDIO_PLL_0, + IMX_SC_R_PI_0, + IMX_SC_R_PI_0_PLL, + IMX_SC_R_MIPI_0, + IMX_SC_R_MIPI_0_PWM_0, + IMX_SC_R_MIPI_0_I2C_0, + IMX_SC_R_MIPI_0_I2C_1, + IMX_SC_R_MIPI_1, + IMX_SC_R_MIPI_1_PWM_0, + IMX_SC_R_MIPI_1_I2C_0, + IMX_SC_R_MIPI_1_I2C_1, + IMX_SC_R_CSI_0, + IMX_SC_R_CSI_0_PWM_0, + IMX_SC_R_CSI_0_I2C_0, + IMX_SC_R_AUDIO_PLL_1, + IMX_SC_R_AUDIO_CLK_0, + IMX_SC_R_AUDIO_CLK_1, + IMX_SC_R_A35, + IMX_SC_R_VPU_DEC_0, + IMX_SC_R_VPU_ENC_0, +}; + +const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qxp = { + .rsrc = imx8qxp_clk_scu_rsrc_table, + .num = ARRAY_SIZE(imx8qxp_clk_scu_rsrc_table), +}; diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c index d17b418ac577..9e35ae45b3a0 100644 --- a/drivers/clk/imx/clk-imx8qxp.c +++ b/drivers/clk/imx/clk-imx8qxp.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2018 NXP + * Copyright 2018-2021 NXP * Dong Aisheng */ @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -27,9 +28,11 @@ static const char *dc0_sels[] = { static int imx8qxp_clk_probe(struct platform_device *pdev) { struct device_node *ccm_node = pdev->dev.of_node; + const struct imx_clk_scu_rsrc_table *rsrc_table; int ret; - ret = imx_clk_scu_init(ccm_node); + rsrc_table = of_device_get_match_data(&pdev->dev); + ret = imx_clk_scu_init(ccm_node, rsrc_table); if (ret) return ret; @@ -130,7 +133,7 @@ static int imx8qxp_clk_probe(struct platform_device *pdev) static const struct of_device_id imx8qxp_match[] = { { .compatible = "fsl,scu-clk", }, - { .compatible = "fsl,imx8qxp-clk", }, + { .compatible = "fsl,imx8qxp-clk", &imx_clk_scu_rsrc_imx8qxp, }, { /* sentinel */ } }; diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c index cff0e1bd7030..02044d48d9bc 100644 --- a/drivers/clk/imx/clk-scu.c +++ b/drivers/clk/imx/clk-scu.c @@ -1,11 +1,12 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright 2018 NXP + * Copyright 2018-2021 NXP * Dong Aisheng */ #include #include +#include #include #include #include @@ -22,6 +23,7 @@ static struct imx_sc_ipc *ccm_ipc_handle; static struct device_node *pd_np; static struct platform_driver imx_clk_scu_driver; +static const struct imx_clk_scu_rsrc_table *rsrc_table; struct imx_scu_clk_node { const char *name; @@ -167,7 +169,26 @@ static inline struct clk_scu *to_clk_scu(struct clk_hw *hw) return container_of(hw, struct clk_scu, hw); } -int imx_clk_scu_init(struct device_node *np) +static inline int imx_scu_clk_search_cmp(const void *rsrc, const void *rsrc_p) +{ + return *(u32 *)rsrc - *(u32 *)rsrc_p; +} + +static bool imx_scu_clk_is_valid(u32 rsrc_id) +{ + void *p; + + if (!rsrc_table) + return true; + + p = bsearch(&rsrc_id, rsrc_table->rsrc, rsrc_table->num, + sizeof(rsrc_table->rsrc[0]), imx_scu_clk_search_cmp); + + return p != NULL; +} + +int imx_clk_scu_init(struct device_node *np, + const struct imx_clk_scu_rsrc_table *data) { u32 clk_cells; int ret, i; @@ -186,6 +207,8 @@ int imx_clk_scu_init(struct device_node *np) pd_np = of_find_compatible_node(NULL, NULL, "fsl,scu-pd"); if (!pd_np) return -EINVAL; + + rsrc_table = data; } return platform_driver_register(&imx_clk_scu_driver); @@ -582,6 +605,9 @@ struct clk_hw *imx_clk_scu_alloc_dev(const char *name, struct platform_device *pdev; int ret; + if (!imx_scu_clk_is_valid(rsrc_id)) + return ERR_PTR(-EINVAL); + pdev = platform_device_alloc(name, PLATFORM_DEVID_NONE); if (!pdev) { pr_err("%s: failed to allocate scu clk dev rsrc %d type %d\n", @@ -749,6 +775,9 @@ struct clk_hw *__imx_clk_gpr_scu(const char *name, const char * const *parent_na if (!clk_node) return ERR_PTR(-ENOMEM); + if (!imx_scu_clk_is_valid(rsrc_id)) + return ERR_PTR(-EINVAL); + clk = kzalloc(sizeof(*clk), GFP_KERNEL); if (!clk) { kfree(clk_node); diff --git a/drivers/clk/imx/clk-scu.h b/drivers/clk/imx/clk-scu.h index 8ebee0cb0fe6..bcacd8b1d1ab 100644 --- a/drivers/clk/imx/clk-scu.h +++ b/drivers/clk/imx/clk-scu.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright 2018 NXP + * Copyright 2018-2021 NXP * Dong Aisheng */ @@ -14,10 +14,17 @@ #define IMX_SCU_GPR_CLK_DIV BIT(1) #define IMX_SCU_GPR_CLK_MUX BIT(2) +struct imx_clk_scu_rsrc_table { + const u32 *rsrc; + u8 num; +}; + extern struct list_head imx_scu_clks[]; extern const struct dev_pm_ops imx_clk_lpcg_scu_pm_ops; +extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qxp; -int imx_clk_scu_init(struct device_node *np); +int imx_clk_scu_init(struct device_node *np, + const struct imx_clk_scu_rsrc_table *data); struct clk_hw *imx_scu_of_clk_src_get(struct of_phandle_args *clkspec, void *data); struct clk_hw *imx_clk_scu_alloc_dev(const char *name, From patchwork Fri Apr 23 03:33:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 12219499 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43ADBC433B4 for ; Fri, 23 Apr 2021 03:35:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F22161422 for ; Fri, 23 Apr 2021 03:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235302AbhDWDff (ORCPT ); Thu, 22 Apr 2021 23:35:35 -0400 Received: from mail-eopbgr30064.outbound.protection.outlook.com ([40.107.3.64]:42065 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231552AbhDWDfe (ORCPT ); Thu, 22 Apr 2021 23:35:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eq6IHL6eq9SMmFvAlYy8G/BcInDXwDl5vR+IeLmS0w8qv/DN1/I5HUT0AJj06tZOZaRVy6SI/NE1yZb6Xi3TAxQ5vd4MhGr8TpOJFNyRBmfwxTaffAvxh04rDshXUb1Tnw6mGdPEgjLYVGxe74NkJvUMznwPXWx+3p5fZ+z33J+LpDGIFxdhvSlRKGmsTYIyftzpZKIgEw6kiNmM4WjDLDximi/gA9n49PsS8SoFXVXruVK3Wf3YpdV0TseSq0MI+Urx2jDM+ZuhBTqRJ/pw37u+eg8wMoGgE4vUAiuOgcEChocsQPZNv7scyL9Cfsi1kMpRLW4O6SUBkTjhmYAoRg== 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-SenderADCheck; bh=t6xdeG7rddQFEimh1we2s9ToOlvf75Ufqg9yy/i/LCM=; b=JPabRxnWjT8GHVejq8cNQagNb/hIe2ka4VL3CehnU0lygizlGpcUCi8zRCpR/4/3nNfgz2sDwTBA8xMqDo+Jaudij4SIgKmKFpua3mqnCYi0irhP4TZAxZRsnwG12s/waOnKb4+DGlWE5qu/VJZ7Xx8wFUxwjT+QL+9XADtxoUoHf537blBX2LZrJ0aAt9rDmxLd2gLgRD2GEfzG6TGzEh6uPGWK5fsWPABGCCYSgacFmhN+qjgWyeAfHOGIk40xZuNPKj2ajao7/tCMG1aYLxE2DryAwHdL8ANkTh9PPwE2/ei5vUsvSagbeUoMQq/+2fza26jdn0oM1xaj2KRvcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t6xdeG7rddQFEimh1we2s9ToOlvf75Ufqg9yy/i/LCM=; b=NO9fItFBa8Joi785Ywx0+haXjstvtsUMg0W7B6yLuxh6YqUlzEwPZW5vBpUF0S6A0XCz08ywYb7ZMNUPwiGl98EQAjbmzPXCGkcL/RBdSPqSwoe9HeiGVJlWRuWqOe40NL35julP4rEOZYRLPJ10RF/VoFFQNMbrt+kFjdxnFHo= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) by AM6PR04MB5079.eurprd04.prod.outlook.com (2603:10a6:20b:4::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.21; Fri, 23 Apr 2021 03:34:56 +0000 Received: from AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b]) by AM6PR04MB4966.eurprd04.prod.outlook.com ([fe80::b10a:ad0:a6f5:db9b%2]) with mapi id 15.20.4065.023; Fri, 23 Apr 2021 03:34:56 +0000 From: Dong Aisheng To: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: dongas86@gmail.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-imx@nxp.com, abel.vesa@nxp.com, sboyd@kernel.org, Dong Aisheng Subject: [PATCH 6/6] clk: imx8qm: add clock valid resource checking Date: Fri, 23 Apr 2021 11:33:34 +0800 Message-Id: <20210423033334.3317992-6-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210423033334.3317992-1-aisheng.dong@nxp.com> References: <20210423033334.3317992-1-aisheng.dong@nxp.com> X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) To AM6PR04MB4966.eurprd04.prod.outlook.com (2603:10a6:20b:2::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by HK2P15301CA0017.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.10 via Frontend Transport; Fri, 23 Apr 2021 03:34:54 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bb9b7228-51d5-4103-4cdd-08d90608c3db X-MS-TrafficTypeDiagnostic: AM6PR04MB5079: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1107; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gplYpGMtW2z6upPv8l/BilkpNPJvc/Unirgd6UZkLDAxjEDgHbhjqhlVdfqxsy45rjdZg224GW9T4lO3iyX7xiH//87Yrp3c94Xid9P9e4cg3XJtV/nI0TkNEX4ozlUd3M2kudu8O+zzetqFVKTxoLC5gK7pFmYVIS4eKnKcipMqCdDdwnSlvn1NjvhTB9zUb3liR8EfHRJW5yK1wiTvnwd4hme5sCPx87HwZB3WAFVijfxjeEAKbuDs0afH0PxF6CHAGyKS0K/io4Nl4Ij/oZuhwfyn7us3Av1acIo+vdF08q41ucFmdBLqlKYzbj2nXZ8U1V+c/OAPs5RlyOLIz92XAFrn0caRi75weqwugs+BNaV/tOwTBACJ50k6/U16/q7xwLcx6kdYpk7b3w2V1g+OQW18+qjzBLpAO6Q7WS/4aKcvYhx17EBp/U4sRXzhhCnVUVv/zp56o/F9qLlY0q3bijHejPd4iFjiCPZZfoPZ4QtGvl34COhYDLNBASDN/k5zkwZM6mT4vxD7ZH92VgIH0iSRrgwOHVIra2MwNWTBpvrPDq6BU9oMQWFplRdFnUc6Th0mgQNDUWhdvyF3JLnOWQ6p8rkiheYOu/n2UTCLW+KD7jsMwY0TMxQ+a9ujw0LVe1KE9Dw44bqCHUoQyDZtXr+j55pNMnvozhU+z9Wp6KULIDUfBBhUPaERGgNAYhzQq83yFlixhOvPIs37Mg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4966.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(396003)(346002)(366004)(376002)(39860400002)(16526019)(2906002)(8936002)(6512007)(316002)(38350700002)(8676002)(52116002)(38100700002)(4326008)(66556008)(26005)(86362001)(66946007)(478600001)(36756003)(1076003)(2616005)(956004)(6666004)(5660300002)(6486002)(6506007)(186003)(66476007)(83380400001)(69590400013)(32563001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Kh+fhDBWpe4e5GaKe2FFq/wdTGDFwJtuwvWMVGQkhKybIIYdgjMzIx7OuPmMc/9so/iQVsHqKArVZrLbCR0oAXAQbvk+aTDSbhybjGIjwZjhVIwtuGwcQXqxu2UcheDob7Mkx1aDZQBf7OGZBi7P+Hmu8xd7mD5MVA27cSIOwsjV/C2dpecEnMPnDGeiOwa1mIt3wIHXIvw0URjDmn1j2zPDfd7tfccy5gWwGCVbln53e3tmGuaBo6YuduzfJcygTqhVkyJcrs1QyPrX+N3+q404FmgokGcnphBX+GDJraRPKYzpMLAjbpMvAlefW8cvqtHZBcWDCOeT8hy4dgFZ3sbkNs01H948JqID6ln/dyx6y4a/PSMBkWmwXdtwZBbqtnfT0f5kxsrAWI5KZxdQhw1ZQwiuyjBKxMshEjY0+6IklQMwrbrfdTVBQl6aBPJdE60TVvCz4l6wDBkJyGT4YcuqAlfw+nYWKsJCzCq1p1Hj2yYdd52N4AXSEmbdIFlttw/bytvXRmOs5d4dDLL7BaUqfcs/D8ASJfEFrdb3n8dH+hy5bDPa+ssYlk2JbW7uVPKeWevYniJE8VgOx9PTZfCGvGydnzKm2D6EqZp6/azVZX8yZ718gJeBt4Zi+uIqyAyT2v1Z22zOj3waCG7ivy0YWv89iV+sQpEkrabD3OPNci9Za9KJpADaa0EYGoOUljmvM1L76qEqU7zU7b6rkeoz4skCfBDE2if/kw8hMSGa1IF6HULS5UapBdG5kLLmgK1ZZwq38I7Ai+BW2ax7zhTH78lMvsN0KVqcpz/QVXt9i2oKBsVLVb0DUFES0PvgnZ9/Kh3N9k5sVR7wq2GzR85ldNE1/CpSgsmid8KkoYpGnadtowgVLVDP65ovbketyXUA39+dy16boLMK1d86bUiojWZAhMBTwkK7VmCmRgkj66F/zLJjETJhiebG+gRutqHYBvpTK7gTDj4BjUNzfqu4XegtoKfSTOhH+wvjHCOm7Cw63Dq5FojDZ6bFrMkZXYYfH6COvdAf5LIOkCTcUg67dsNM7ZzihIiFSA24/1W2dYf6sxtRZsODV/XiGi1MkDEBHhyTA+rPTlz8Qth1dZviwGTNLfkpH+GOsVGkYBsw8cL+p5Dmma5mnIeQQYO8NGache0TrKYwPsvnHPpMo/lopG0AznQWm/rW+VMb3WIKY9A993o0Vt/AFie+qMT29L3dSfE9rfMWxrhw34k9+Iif7ObrdHS8i3k60HS3imK6jrNKCBvPgbpJCT3cNfHJIEYmngs+hSrE3KboQdNZeXQfgGTIr0PYcXOesPefNbc+/YyHpqvGnWshQby1z9Qx X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb9b7228-51d5-4103-4cdd-08d90608c3db X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4966.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2021 03:34:56.6859 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nX6wY3QQROw36xG/7Pon/+zuClgOIFij2lBcQXBZT7MjKfHzZ8LAkyy/LKRrmiwUoeWf0+5Y3AwbawwOgjYNBg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5079 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org Add imx8qm clock valid resource checking mechanism Signed-off-by: Dong Aisheng Reviewed-by: Abel Vesa --- drivers/clk/imx/Makefile | 2 +- drivers/clk/imx/clk-imx8qm-rsrc.c | 116 ++++++++++++++++++++++++++++++ drivers/clk/imx/clk-imx8qxp.c | 1 + drivers/clk/imx/clk-scu.h | 1 + 4 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/imx/clk-imx8qm-rsrc.c diff --git a/drivers/clk/imx/Makefile b/drivers/clk/imx/Makefile index 2fdd2fff16c7..c24a2acbfa56 100644 --- a/drivers/clk/imx/Makefile +++ b/drivers/clk/imx/Makefile @@ -28,7 +28,7 @@ obj-$(CONFIG_CLK_IMX8MQ) += clk-imx8mq.o obj-$(CONFIG_MXC_CLK_SCU) += clk-imx-scu.o clk-imx-lpcg-scu.o clk-imx-scu-$(CONFIG_CLK_IMX8QXP) += clk-scu.o clk-imx8qxp.o \ - clk-imx8qxp-rsrc.o + clk-imx8qxp-rsrc.o clk-imx8qm-rsrc.o clk-imx-lpcg-scu-$(CONFIG_CLK_IMX8QXP) += clk-lpcg-scu.o clk-imx8qxp-lpcg.o obj-$(CONFIG_CLK_IMX1) += clk-imx1.o diff --git a/drivers/clk/imx/clk-imx8qm-rsrc.c b/drivers/clk/imx/clk-imx8qm-rsrc.c new file mode 100644 index 000000000000..183a071cbf20 --- /dev/null +++ b/drivers/clk/imx/clk-imx8qm-rsrc.c @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2019-2021 NXP + * Dong Aisheng + */ + +#include + +#include "clk-scu.h" + +/* Keep sorted in the ascending order */ +static u32 imx8qm_clk_scu_rsrc_table[] = { + IMX_SC_R_A53, + IMX_SC_R_A72, + IMX_SC_R_DC_0_VIDEO0, + IMX_SC_R_DC_0_VIDEO1, + IMX_SC_R_DC_0, + IMX_SC_R_DC_0_PLL_0, + IMX_SC_R_DC_0_PLL_1, + IMX_SC_R_DC_1_VIDEO0, + IMX_SC_R_DC_1_VIDEO1, + IMX_SC_R_DC_1, + IMX_SC_R_DC_1_PLL_0, + IMX_SC_R_DC_1_PLL_1, + IMX_SC_R_SPI_0, + IMX_SC_R_SPI_1, + IMX_SC_R_SPI_2, + IMX_SC_R_SPI_3, + IMX_SC_R_UART_0, + IMX_SC_R_UART_1, + IMX_SC_R_UART_2, + IMX_SC_R_UART_3, + IMX_SC_R_UART_4, + IMX_SC_R_EMVSIM_0, + IMX_SC_R_EMVSIM_1, + IMX_SC_R_I2C_0, + IMX_SC_R_I2C_1, + IMX_SC_R_I2C_2, + IMX_SC_R_I2C_3, + IMX_SC_R_I2C_4, + IMX_SC_R_ADC_0, + IMX_SC_R_ADC_1, + IMX_SC_R_FTM_0, + IMX_SC_R_FTM_1, + IMX_SC_R_CAN_0, + IMX_SC_R_GPU_0_PID0, + IMX_SC_R_GPU_1_PID0, + IMX_SC_R_PWM_0, + IMX_SC_R_PWM_1, + IMX_SC_R_PWM_2, + IMX_SC_R_PWM_3, + IMX_SC_R_PWM_4, + IMX_SC_R_PWM_5, + IMX_SC_R_PWM_6, + IMX_SC_R_PWM_7, + IMX_SC_R_GPT_0, + IMX_SC_R_GPT_1, + IMX_SC_R_GPT_2, + IMX_SC_R_GPT_3, + IMX_SC_R_GPT_4, + IMX_SC_R_FSPI_0, + IMX_SC_R_FSPI_1, + IMX_SC_R_SDHC_0, + IMX_SC_R_SDHC_1, + IMX_SC_R_SDHC_2, + IMX_SC_R_ENET_0, + IMX_SC_R_ENET_1, + IMX_SC_R_MLB_0, + IMX_SC_R_USB_2, + IMX_SC_R_NAND, + IMX_SC_R_LVDS_0, + IMX_SC_R_LVDS_0_PWM_0, + IMX_SC_R_LVDS_0_I2C_0, + IMX_SC_R_LVDS_0_I2C_1, + IMX_SC_R_LVDS_1, + IMX_SC_R_LVDS_1_PWM_0, + IMX_SC_R_LVDS_1_I2C_0, + IMX_SC_R_LVDS_1_I2C_1, + IMX_SC_R_M4_0_I2C, + IMX_SC_R_M4_1_I2C, + IMX_SC_R_AUDIO_PLL_0, + IMX_SC_R_VPU_UART, + IMX_SC_R_VPUCORE, + IMX_SC_R_MIPI_0, + IMX_SC_R_MIPI_0_PWM_0, + IMX_SC_R_MIPI_0_I2C_0, + IMX_SC_R_MIPI_0_I2C_1, + IMX_SC_R_MIPI_1, + IMX_SC_R_MIPI_1_PWM_0, + IMX_SC_R_MIPI_1_I2C_0, + IMX_SC_R_MIPI_1_I2C_1, + IMX_SC_R_CSI_0, + IMX_SC_R_CSI_0_PWM_0, + IMX_SC_R_CSI_0_I2C_0, + IMX_SC_R_CSI_1, + IMX_SC_R_CSI_1_PWM_0, + IMX_SC_R_CSI_1_I2C_0, + IMX_SC_R_HDMI, + IMX_SC_R_HDMI_I2S, + IMX_SC_R_HDMI_I2C_0, + IMX_SC_R_HDMI_PLL_0, + IMX_SC_R_HDMI_RX, + IMX_SC_R_HDMI_RX_BYPASS, + IMX_SC_R_HDMI_RX_I2C_0, + IMX_SC_R_AUDIO_PLL_1, + IMX_SC_R_AUDIO_CLK_0, + IMX_SC_R_AUDIO_CLK_1, + IMX_SC_R_HDMI_RX_PWM_0, + IMX_SC_R_HDMI_PLL_1, + IMX_SC_R_VPU, +}; + +const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qm = { + .rsrc = imx8qm_clk_scu_rsrc_table, + .num = ARRAY_SIZE(imx8qm_clk_scu_rsrc_table), +}; diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c index 9e35ae45b3a0..88cc737ee125 100644 --- a/drivers/clk/imx/clk-imx8qxp.c +++ b/drivers/clk/imx/clk-imx8qxp.c @@ -134,6 +134,7 @@ static int imx8qxp_clk_probe(struct platform_device *pdev) static const struct of_device_id imx8qxp_match[] = { { .compatible = "fsl,scu-clk", }, { .compatible = "fsl,imx8qxp-clk", &imx_clk_scu_rsrc_imx8qxp, }, + { .compatible = "fsl,imx8qm-clk", &imx_clk_scu_rsrc_imx8qm, }, { /* sentinel */ } }; diff --git a/drivers/clk/imx/clk-scu.h b/drivers/clk/imx/clk-scu.h index bcacd8b1d1ab..22156e93b85d 100644 --- a/drivers/clk/imx/clk-scu.h +++ b/drivers/clk/imx/clk-scu.h @@ -22,6 +22,7 @@ struct imx_clk_scu_rsrc_table { extern struct list_head imx_scu_clks[]; extern const struct dev_pm_ops imx_clk_lpcg_scu_pm_ops; extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qxp; +extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qm; int imx_clk_scu_init(struct device_node *np, const struct imx_clk_scu_rsrc_table *data);