From patchwork Tue Feb 13 08:21:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13554687 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 5E3BCC48260 for ; Tue, 13 Feb 2024 08:22:00 +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: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:In-Reply-To:References: List-Owner; bh=5nwtD593v9PeoiyTVcGXi3jJsbJMx7pomVrL6U2AIl4=; b=wkMjB1HJUa09Wb H13QGYmkkGKdZqmTyfGKaAtRCEvfuZoUcb8yxlLNJ+tUp/rRkwIhvpSysStWBCM0GHR/iU9fpXCJ7 LBR0ZSJuLq4d2eNmc7GVfH2dcyvbyeVHCPiysxuklYk7CSuLS64T5I/EydgYkISZXIiHVqvW+8wY7 OIVo2oVHGZHMpuNck2Z2EkuJ/erT6ShgvSXP75bCk5UJiBv15UMajdOZm6+C89CffxsijH/Xwztfi uLB3t471acp1LJrzdmANPL5CDzO+jJo5ONwJhCiKQJyAemkZyXOBqc2opEd7h8c4z/N0qtTGdtDLX zt601Q6zvA9yo1VZUlKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZo34-00000008OFE-2LEU; Tue, 13 Feb 2024 08:21:50 +0000 Received: from mail-bn1nam02olkn20801.outbound.protection.outlook.com ([2a01:111:f403:2c07::801] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZo31-00000008ODX-08IE for linux-riscv@lists.infradead.org; Tue, 13 Feb 2024 08:21:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F1VEYMqONYCwE5tkvAX7qCgegRd2PA/Gp1C4Tdp9qpkn59oYcnurk3lScOzRhGSGgczVI699eKDHruRwleGYWeblx0eai77ymaPJISNb4eDm+W88A7exYHGrJfoZRM+MvMVlII3TbYYF4gW6dr/Xu11VEqehDvBDN3fJpJZBL03RJKhGW5RbnJHXPZfp4oTS6Ueg4vQrTfgFl2EgbCESRF40J3+8f2JquiyGcC/dsSlFPocj4tVzh8o2zKw0XOkVqb7mg80SgV6LkMdteZdu9TE+ELyDV0HjSuv079Tjz5fOzGnCg3rICfC9N0IWYlIzw+CwXyfz0quP+K83T5GEQQ== 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=HEt50qoic42jLe4F/Hv1osOVrSwMApuYOG5cQBkRpcA=; b=eanjEHN33LYMCYwzBzo3QybizHsVTcHlUjXFE5BgFvx3/HY0ZWPdhu1HukV5QIaqa0f90p+sBVxZnJz7EV9Xlw/VC+y7zKg9PY4rYv/DND9od0CBYf5zSVrA3AVqtfD1vwnZixecJa1blbatNPOfpob8xZjH7GMQAAVNPqx4xJjWlnA3jdO1+vSuxVv+R8yWFzUAOA/tcxSR7GhsOfGv/Lw+qFoe6oB43PqdWxN4mqjJA/oyD37vb/Z6SNpqcGX9UmIGPBBTvbSyWfODDZNkpKLMqVZn0ifYsongtbMnksFs8d6EBqpkzoeL84BgcU/zurzS+WYl0+O3W15R6jG2lg== 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=HEt50qoic42jLe4F/Hv1osOVrSwMApuYOG5cQBkRpcA=; b=rfxBzUPSqOHHJPSYgI/VICBk55ke1sjtwEfMeIbmDEb+Z8EuWb9LvD4uGwf80SvL2T1CW7GKy9KjArZOzt+gi897kce6jwr/p3ZmiIyBhVEB7fso4Xp+G21mc9wQpEALbt8S+cTcjdHZEyt/DmcQL21uqGE85bB0tUjrF2nU99TqtOsY+VR3G3t5v5s5Zb6RflbsnEafATKawbDUmX1egoDgq6h635yx0dQtJ4P2ZvgARy1VKf6MmHnZQx/CHBRKBv7uj9i+/EJo1CUQShr4nyQCrTijdj0BxfBf0G5vWJishf3ly99uCWCFxk5MiFe/dUdUZpRfVenYQ+DbjpOq1g== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by DS7PR20MB3776.namprd20.prod.outlook.com (2603:10b6:5:3ab::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Tue, 13 Feb 2024 08:21:40 +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.7270.036; Tue, 13 Feb 2024 08:21:40 +0000 From: Inochi Amaoto To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chao Wei , 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 v8 0/8] riscv: sophgo: add clock support for Sophgo CV1800/SG2000 SoCs Date: Tue, 13 Feb 2024 16:21:42 +0800 Message-ID: X-Mailer: git-send-email 2.43.1 X-TMN: [8n6PzKHk2oiCnzp0EMVkK68fepHk6tva0ajc7E5F+7CR1eIb1ywgNgRxdkCWaV09] X-ClientProxiedBy: SG2PR01CA0109.apcprd01.prod.exchangelabs.com (2603:1096:4:40::13) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240213082143.591393-1-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|DS7PR20MB3776:EE_ X-MS-Office365-Filtering-Correlation-Id: 3abc961b-867e-4029-529e-08dc2c6ccddb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NWMHQ+DHQAw+NcPXCGc7lhY3W0xvKvWf6A6oCaOD7m7pcRHFZLT9EfOOceVC2kMiYVldi02TzJB6lsRS1NxyNQSvkzx6/fH5dM9j237cMOvGAQpgH+gkD7BD6CChEXE2nOhAfLqZNMgMM6ODOU87Cb5Xw8SGIYZkGv2eyZn96oleT148Hjb/kRAP6kW7Sx9ycjVXQLJcF5SUsn1h0bG6aYRWrnCXyYyroq5eM3nRah14IWWPxUdM7pNVUc5b1rZlJnqviolCPX4WH5tAnsQCsgxf/CiW6IW7fzCq0iEk2P71nLz8/FD75hnPaLduooJw1estNcjocfy4E9IwLz9zmxtrF7sohdVPMsNRc2GzI8UAb+gbdnuRNWxxw4JpN/ro92UJ9R0p2LxsSlHQsIpEGnNw4WXGfMw/U9wCJKOYPX1Eq6fMJgyV0VWJA1/9hpKy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63DcIRk7kHZpyjhvrkdh2MVCP8oy/B9Bp1E+cPgOteF+EtVBmc97e7Px4ltycpKg+/udv1PqeIrYlILkVi+0tOD95DJcsztX5Zwm+9tpWoq3HqSnDpu39SyQ4Sz/IPGlusKtmKByruXXJrqyfsl98MjZYkQwgsItZnzl88n7cfuiL4FmcoGPtF+Rl4pG40FSy8mD45I9Snd7KGsMnAZbKqB5NW0NTFERYHho6PiREJbdexBu2Cbyup0yw5E62hq8wMAKFnHGOD3Npb1V8qniFqXWIdb6Di2Vo+q4qRw8QYjaeTf6NVr3nyR2YxPxsiOr0b/YlPeJYb0F3zkKuqOd3r/mURmS9PTeDLRhPXUDZ8UXZ3eSdWNa9juw/JeYUC3birKdinnvUq0/0WCN3Wz9WpLA5UjyduiPpqThFMKmLJmZUkJ8xmiepNsTi90DFNvtND+qmvNorB7d54WjIVuf8iVuaTGwO5lHrWSRNugwA9HU= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3abc961b-867e-4029-529e-08dc2c6ccddb X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 08:21:40.3788 (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: DS7PR20MB3776 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240213_002147_138363_39EFD0B6 X-CRM114-Status: GOOD ( 12.43 ) 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 clock controller support for the Sophgo CV1800B, CV1812H and SG2000. Changed from v7: 1. fix unused variables warnings in patch 3 of v7 2. fix wrong pointer type in patch 3 of v7 3. move the clk_disp_vip_parents variable to the patch 5 to avoid warning Changed from v6: 1. fix dead lock when setting rate. 2. split the driver patch into several patch for easy reading. Changed from v5: 1. rebased to mainline master tree 2. add SG2000 clock support. 3. fix document link Changed from v4: 1. improve code for patch 2 2. remove the already applied bindings https://lore.kernel.org/all/IA1PR20MB49535E448097F6FFC1218C39BB90A@IA1PR20MB4953.namprd20.prod.outlook.com/ Changed from v3: 1. improve comment of patch 3 2. cleanup the include of patch 2 Changed from v2: 1. remove clock-names from bindings. 2. remove clock-frequency node of DT from previous patch. 3. change some unused clock to bypass mode to avoid unlockable PLL. Changed from v1: 1. fix license issues. Inochi Amaoto (8): dt-bindings: clock: sophgo: Add clock controller of SG2000 series SoC clk: sophgo: Add CV1800/SG2000 series clock controller driver skeleton clk: sophgo: implement clk_ops for CV1800 series clock controller driver clk: sophgo: Add clock support for CV1800 SoC clk: sophgo: Add clock support for CV1810 SoC clk: sophgo: Add clock support for SG2000 SoC riscv: dts: sophgo: add clock generator for Sophgo CV1800 series SoC riscv: dts: sophgo: add uart clock for Sophgo CV1800 series SoC .../bindings/clock/sophgo,cv1800-clk.yaml | 3 +- arch/riscv/boot/dts/sophgo/cv1800b.dtsi | 4 + arch/riscv/boot/dts/sophgo/cv1812h.dtsi | 4 + arch/riscv/boot/dts/sophgo/cv18xx.dtsi | 22 +- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/sophgo/Kconfig | 12 + drivers/clk/sophgo/Makefile | 7 + drivers/clk/sophgo/clk-cv1800.c | 1541 +++++++++++++++++ drivers/clk/sophgo/clk-cv1800.h | 123 ++ drivers/clk/sophgo/clk-cv18xx-common.c | 66 + drivers/clk/sophgo/clk-cv18xx-common.h | 81 + drivers/clk/sophgo/clk-cv18xx-ip.c | 887 ++++++++++ drivers/clk/sophgo/clk-cv18xx-ip.h | 261 +++ drivers/clk/sophgo/clk-cv18xx-pll.c | 420 +++++ drivers/clk/sophgo/clk-cv18xx-pll.h | 118 ++ 16 files changed, 3545 insertions(+), 6 deletions(-) create mode 100644 drivers/clk/sophgo/Kconfig create mode 100644 drivers/clk/sophgo/Makefile create mode 100644 drivers/clk/sophgo/clk-cv1800.c create mode 100644 drivers/clk/sophgo/clk-cv1800.h create mode 100644 drivers/clk/sophgo/clk-cv18xx-common.c create mode 100644 drivers/clk/sophgo/clk-cv18xx-common.h create mode 100644 drivers/clk/sophgo/clk-cv18xx-ip.c create mode 100644 drivers/clk/sophgo/clk-cv18xx-ip.h create mode 100644 drivers/clk/sophgo/clk-cv18xx-pll.c create mode 100644 drivers/clk/sophgo/clk-cv18xx-pll.h --- 2.43.1