From patchwork Thu Dec 7 08:36:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13482936 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 22153C10DCE for ; Thu, 7 Dec 2023 08:36:41 +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=Lyz1l+uYur0KxR4iwKen0OZVVdA8Mub1lGDHRmlxYW0=; b=IABwZWsvjcTn1U WZM2auXFJMgjb68qmJ+6+LZOOYNkZeWYLd0xlxJ4RgYPJA7qH9tU4KIo60DMchnATbtHsL6sFkjs7 RQ/k0+zPP2Dc9B3jjStB/rOAokbPULG8TWVJx/GFcWtuemrwsFyXuU7/qv9D/Pc5HGKi/fPZnhxsc 0wRhYlRXaud72eCnO3BLpfasPnIMxtTmK+kSn22Zp3W7eGdD4hY1Zjkprt/pn45RtuabYWmCsmIq8 NIKF1rxKithezVctZavRBDbRfeRtLeFn9kLKEkVgfPTyL+aCddNDcfEHQMb/QohiE6T5QwRgmqPzA GcJ4f8rQa+EwwgRstMsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rB9rz-00CEoN-2L; Thu, 07 Dec 2023 08:36:31 +0000 Received: from mail-bn8nam11olkn20800.outbound.protection.outlook.com ([2a01:111:f400:7eae::800] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rB9rx-00CEmq-0M for linux-riscv@lists.infradead.org; Thu, 07 Dec 2023 08:36:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q7MrzwtLVn4on7FcI6iGSkEjBl2JZQMd5+4sCaW9+ZSXIxRW2xMLkR/CK5T65/z4PVOG7/QO8IFgtIYLXs41ZBt3DwcSdz7GtUt2TlfWTJW7MdsKem1cl1UfLTUE0Gl9eV5uWEHVDcwlBa35jkt9LPEHX8fGLis8y8Ge8Xy63ucvOYM7T97GxeKKrrg2cn2WBaMfQjNENXEkm/gXst/hoE5Vhf61j0pkAp73CdT8hENaom0QD93Jtv0m7220yTYKtg8cGmp9BbmDSQSBnaAVYMFafg8viQ88f6UkxsYqtSMUcBn5nOon/thy81TnFdjdVxNdIkPPVCkqt5uIsST3Sg== 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=4x0ZDtxEuyn90rNaHPhcEJIBSFAs/YdcfGt2+0IbFFs=; b=jfiqMYasSsyaE4YwnarR7aE7CYR8ymSVtNkMKOlg2ppNE79BGBOV/nrIhIqkZh7JsIMIs5zyVVVPfk1Lgs2vxrSg2rtse/XvPKcQO4Tob3iz7wL2Ddu7W+5pvd54AtYV2mTEGTV9pSK7SfGvpB5+Dm8+UJEKK6q3zH067IjQgews0AP/U6Disuip+OlGZ0krFdgMaEQ25w9KK+USeLHbFz6qtDN4hZBXNeQT1AO3DWxIjnEjdl6qfuTodqrJTmSJbvvWkzmw0VRyAAeJe2C6nkgTfej2F8PdDsf64PzBUkP+blredR23izaZOnv4U8N2Yxh0XBpbr41dpF4JdVwTqQ== 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=4x0ZDtxEuyn90rNaHPhcEJIBSFAs/YdcfGt2+0IbFFs=; b=oyqGfObQ0C5jrHpPYLl9BihBvS9jvzO662CqHyHWrAGDx4AylSXOhGWkSZc4q0v03stN4qeMoRSXxrtLjH0fPDaKI6jD3D1vcz65WjzpxpzdJimoS7ac/QCJtHIqJHsFbbPQCfKuqMSTdCCtMYzTvuH53ui4QHBQeqKJ3uc2pB8DKR0OiyM2UO15j2x7rq1jeV/JVlWvBRtSEqxmGcs6nk61YaKoWcgmzh/yiz+UWogs9S3NCKXwVEwWXOmu5ltVTK7hz5yIqYC1VYHNruM9nIhbjJC6L2KC3KDZVABEjGalk70d98b1MrHDX06JJiJGQSGlGtUoXd616xzry4WpAQ== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by LV2PR20MB4582.namprd20.prod.outlook.com (2603:10b6:408:17e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.27; Thu, 7 Dec 2023 08:36:18 +0000 Received: from IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::55b:c350:980:ad8]) by IA1PR20MB4953.namprd20.prod.outlook.com ([fe80::55b:c350:980:ad8%6]) with mapi id 15.20.7046.024; Thu, 7 Dec 2023 08:36:18 +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 , Emil Renner Berthing , qiujingbao.dlmu@gmail.com, dlan@gentoo.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v3 0/4] riscv: sophgo: add clock support for Sophgo CV1800 SoCs Date: Thu, 7 Dec 2023 16:36:17 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 X-TMN: [G/eCHKOyduTaY5FL1jADlOLE/LlZEEuEsS93U/nOd58=] X-ClientProxiedBy: TYCP286CA0341.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38e::9) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20231207083618.872121-1-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|LV2PR20MB4582:EE_ X-MS-Office365-Filtering-Correlation-Id: 21e5ed8d-2ec1-4eef-d726-08dbf6ff9529 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XvZfTEMmR8D94aJQvC7qjK1NDLzw9ldqj4rDQitxTKbk525HzCfp6+ymNZCkE/wqe9+JuhiV7RzLUuYpRDdXujDpZnEOYlbGJMqofGolB121kgvKEhDx24tF/s05phy5rcQ2FGyIun3yDgVEyK8r8UlQ5nSNDkjUC+oqldzmsCDvdLZIq5+W2ZU7yhKBfA2oSBkcIRSDjTOYtSd2+Pp8PwpoKxv66yceepJnBGrih544isZsZu7F8ZqgXNfL1sK5+sgiJSL6uV+HIjM0ZaQEMRgPt7PG0+BNJOcWOJmCF+PTfAqGcBukzbOmzFeIunt1yf3Jmk3TRJCLXPgo8/MLsHLU6Rp6dN0ycF/5YyWO5kQ2epq3k9JSU5XRepelQ7XRhV28Aw6HaPhjgy9nsrJ7unDAX6oIsaGsnwKqZUG3EJU1mllLZ0A2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tnMWtcjmb600x/3tnPwyFitOFmZtvLD2R1BQ1O3OSyyFb48CPujc/37dt3P8+GvfU+wjqZ+O6IYwvW7FpeNBJ8p1bokEgMtvIThbVhrfW/sC+0Z+59sg8AjkJrXB5Dd7wVLIY1dY/66sft/WFpQlIMeTOt2bNc5+If1BHQ8OBO+GdmWMvHusFPmfcz9pjZ0RVapkz2hA3xvqpFW94gKWjApW/JRMVhU2/9YE+rm/KCdnS8XVSTmU0BLd7XIkGDd6VO4LIK4vTMa8K2xxTnDk8+bX9LNfqUKFwHjLZobNVYZEe+gKS9gAvVH80WH3pGDJPEpYNxNJ6CrOD1DKUXC8S0TqH1XBthdWUg44VhHFwHQXrnR4l0eHaBseETvWpFN32RxHvEGN7UUuNgI+9PelDhFuHrtikNkB7nfCUHcHOwDpcouLSNbuRk6kw4= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21e5ed8d-2ec1-4eef-d726-08dbf6ff9529 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2023 08:36:18.6594 (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: LV2PR20MB4582 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231207_003629_169887_E008C5CE X-CRM114-Status: UNSURE ( 9.33 ) X-CRM114-Notice: Please train this message. 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 and CV1812H. This patch follow this patch series: https://lore.kernel.org/all/IA1PR20MB495399CAF2EEECC206ADA7ABBBD5A@IA1PR20MB4953.namprd20.prod.outlook.com/ 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 (4): dt-bindings: clock: sophgo: Add clock controller of CV1800 series SoC clk: sophgo: Add CV1800 series clock controller driver 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 | 46 + 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 | 1574 +++++++++++++++++ drivers/clk/sophgo/clk-cv1800.h | 123 ++ drivers/clk/sophgo/clk-cv18xx-common.c | 76 + drivers/clk/sophgo/clk-cv18xx-common.h | 85 + drivers/clk/sophgo/clk-cv18xx-ip.c | 894 ++++++++++ drivers/clk/sophgo/clk-cv18xx-ip.h | 266 +++ drivers/clk/sophgo/clk-cv18xx-pll.c | 465 +++++ drivers/clk/sophgo/clk-cv18xx-pll.h | 79 + include/dt-bindings/clock/sophgo,cv1800.h | 176 ++ 17 files changed, 3830 insertions(+), 5 deletions(-) create mode 100644 Documentation/devicetree/bindings/clock/sophgo,cv1800-clk.yaml 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 create mode 100644 include/dt-bindings/clock/sophgo,cv1800.h --- 2.43.0