From patchwork Thu Feb 8 08:48:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13549475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BB48C48260 for ; Thu, 8 Feb 2024 08:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eYjsQPNSj7Y9LNdOFWXsrLYlqkuheMC/cyz1f4gkcQU=; b=3MMwQ2fpWvoNrb uQb1NNN0wIhh8PcEXx8rRbnQ0ZzR63XKnKI8qSeVhiRIAFYqnF4gXWOGpaFfGTi0BfbTpqgfhi3Rq izwFAeCjOjVXH+JpGfjhBDlhUCz1/5uARXb9gnbz5AYYUjcvmr7M1YBVWfLRDZ4T/2MElU8RUt/Ty l/5qB/VkmQexLgZIsgs+/a9IaB90qjCMuAOlM4QOGaXsfaTPWnExHMPE1ts8r+WMRbP5JjsNdBLB4 hdegk2DfqiMARBKc8wv0Y/nJLDY0nwWYSjzKfzFuNl/sk4xUEj8Zk3EtdWqAy7LN1Af4+hu1Af5z0 lmTd5l0cV2xh4Xc+wDIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY06D-0000000D4kr-1irR; Thu, 08 Feb 2024 08:49:37 +0000 Received: from mail-sn1nam02acsn20803.outbound.protection.outlook.com ([2a01:111:f400:7ea9::803] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY069-0000000D4ew-03er for linux-riscv@lists.infradead.org; Thu, 08 Feb 2024 08:49:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RbKo2hsTWr5hTCmfKHjLdWmqFYpVfXJnfNo70CgSslagR4zZqoPzqOZfH0VAHO+R5zFTKbZHj3IfOqqmvPstAK/miB3NfIdO6QxF1/qa/1tv7bvox5DUXMD2T06LyCqVtayaCxGzruQJDywe0V+eRLhQ/5cDAeO1J8qfrUFzt+49PEi4PUMgWSZATeFiezDfzcNzmI6NO3Cyjt0Nq2UZ7aSyPODF2Kk9unWsWZDfPEG6G4qB0kylnzf7el3CriUKi8OuHCHje81ZtrS3GPILR+UQPBXzXRVMzyLxlK/t7hCjSdmognzSbLi0/pxS8+EkCjq6CIKbU8mI+CaOrz3HTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+FacdSvpDTgJbywybMZZ1StTXTxM7PAvHaUuPFXyjpw=; b=awhVybUzjgLgcpId/Q8ElJUOSOlAnF4Bybd3VjGQb94auPRa0j0rZyQNM1/nZnoAGcVB6Ecqcnzqm8X7BtFF2t0/RzWZGkfWbNdEuWMO6ydhY4cbv8vLzUCwNXad7Bxf+vlck5hZXHVCkuJfBY1Jvz01PGCYFggYJwaz6Ia7IzrZmgWCIm20xMsb3TEL5A5RDMy1GD7ECyvzpTBLR2oW4ZjWE1wgYhqlZlqw3y5n6gxOu45fywFbrPREGXIde2itTzStQY+2OUsdfHeY9Jbr1OGCmcnZATccZay3hYLkxuZXs1pAWekeSH7pt4RJaIz1vZelqJnA5HiT5/YdBY/Z6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+FacdSvpDTgJbywybMZZ1StTXTxM7PAvHaUuPFXyjpw=; b=seNqDlL2sWLwUhfSEcI5DgK7r42hT8LvtZCpcstSa8g0OUtTAbhU5Yxj2ivYFudwCwNbCy8EsGubQk7j9hiN79J/G7QJIthPBX4Z5VqhPUKe1VL3OmHDxjJvVPAn9xW2snjRVKyMBmIEVxANcMaon/GRB55zYV1nC0iXrYLhCaOzGtxv0hvEfKrc0KedpZlXgr21IHY+N8LGQZfopi0Qzj9F7p6YtidzKFvplAUeT6lPdti3381ZFJ0Ulz6nGtj/SjW/uJ2smateYiFAZJYqDFPExRYdkqlLP06LIsHmSCuT1gfI3QjUWVRq+0JiL0KXVAOaAUBW4q8BaU1aAWxyaQ== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by CY8PR20MB5985.namprd20.prod.outlook.com (2603:10b6:930:73::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Thu, 8 Feb 2024 08:49:26 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::406a:664b:b8bc:1e6b]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::406a:664b:b8bc:1e6b%2]) with mapi id 15.20.7249.035; Thu, 8 Feb 2024 08:49:25 +0000 From: Inochi Amaoto To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Paul Walmsley , Palmer Dabbelt , Albert Ou , Inochi Amaoto Cc: Jisheng Zhang , Liu Gui , Jingbao Qiu , dlan@gentoo.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v7 6/8] clk: sophgo: Add clock support for SG2000 SoC Date: Thu, 8 Feb 2024 16:48:54 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: X-TMN: [zDvzIWwbhO57qGzbAx9ov7J+Vl8HaXGXwWbMaWKwjvoHRk2YxAGdoLw98SaInEFT] X-ClientProxiedBy: SI1PR02CA0030.apcprd02.prod.outlook.com (2603:1096:4:1f4::8) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240208084858.1113628-6-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|CY8PR20MB5985:EE_ X-MS-Office365-Filtering-Correlation-Id: e7dbdbc8-3cfb-45c3-96ed-08dc2882da7c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qDB/aRnD3XEagwIvSainUX0WMYZqLmeQgKqIZ2GuRZZgDxQ7SDk7y01TGefs+XglhiXwQBaE7CBSA9IJyyJgmDZNlQWb4P6MWEURWmJnpJx9pryCZAewoQggFOWAHuYRFaFrP/zaFJ7cJfuOldYx8wm0yumCPyrtqknmqWBhYWE5Nf305gEkU2cUpAfTrl0DX8m8b/ZTTYKUfFd8eD/+jTq6tLD+Jf+uiNZJw6sgelJLupuA7oFiv30IT8s0mqe9mdqbYwjhdN8OgxkKQuvUb8C3HMHcJ+TDdnPhB+DDcM0ucP8kHDkLPiDfiVUvm0qpDv7LksZSMG93BJ90vvfS/GmXcTGcVhoW82oiRzVz9FbNNaVXPYwckTCLSlB11FSyYUBALgHLZRVFt//jCCJZX7Znpq1r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XV1JgQ6FhDxeodfjajCIeHdHOqjsJpp5puWH1qlZkpcsPpKghvs3sEiAja+eqir6iRz5hiy3YuIYUtXT7LhXhVhIV6NpfjlKJVtMC9noPhr7870BKA11be877G6hS5qmUaSpnz7kxiDz2FWC6OhulSZp2L1Megn4U8V3FrkT+F9yS5glt8MNUcPQzQQqtfiv9bFbwL988s44umQUP/gIAyp12rL3i83Yan+fB94OzL1W4Tq4QH4iDGKGb8uhUroC44Az9+t26bFsXWgptnydHX5J8972FxqRGSHtjrZJQzBr18S22H03FfX+tDPclfTN5IsQnZ+p3q4FkZd4Kdc8puo4pWhCbtd33c1tzUO5olOfTdFB8vQmZW/1otCYCzYg6jT/y7kQo7sy0KcYAoy03lN8OSSil/9k+ELBrhpV3yFTnvz/19ji7h7KW+eqV1DZ3EYxuui0j0znzcqt3xUIV25c+4WwvFN03HQqratBSk9ajA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7dbdbc8-3cfb-45c3-96ed-08dc2882da7c X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2024 08:49:25.7872 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR20MB5985 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_004933_170683_A9624839 X-CRM114-Status: GOOD ( 10.76 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add and init code for SG2000 SoC. Signed-off-by: Inochi Amaoto Link: https://github.com/sophgo/sophgo-doc/releases/tag/sg2000-datasheet-v1.0-alpha --- drivers/clk/sophgo/clk-cv1800.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.43.0 diff --git a/drivers/clk/sophgo/clk-cv1800.c b/drivers/clk/sophgo/clk-cv1800.c index 6ee8ef56570c..1aedf2df242c 100644 --- a/drivers/clk/sophgo/clk-cv1800.c +++ b/drivers/clk/sophgo/clk-cv1800.c @@ -1437,6 +1437,20 @@ static const struct cv1800_clk_desc cv1810_desc = { .pre_init = cv1810_pre_init, }; +static int sg2000_pre_init(struct device *dev, void __iomem *base, + struct cv1800_clk_ctrl *ctrl, + const struct cv1800_clk_desc *desc) +{ + cv18xx_clk_disable_auto_pd(base); + + return 0; +} + +static const struct cv1800_clk_desc sg2000_desc = { + .clks_data = &cv1810_hw_clks, + .pre_init = sg2000_pre_init, +}; + static int cv1800_clk_init_ctrl(struct device *dev, void __iomem *reg, struct cv1800_clk_ctrl *ctrl, const struct cv1800_clk_desc *desc) @@ -1510,6 +1524,7 @@ static int cv1800_clk_probe(struct platform_device *pdev) static const struct of_device_id cv1800_clk_ids[] = { { .compatible = "sophgo,cv1800-clk", .data = &cv1800_desc }, { .compatible = "sophgo,cv1810-clk", .data = &cv1810_desc }, + { .compatible = "sophgo,sg2000-clk", .data = &sg2000_desc }, { } }; MODULE_DEVICE_TABLE(of, cv1800_clk_ids);