From patchwork Sun Jan 14 04:15:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 762836 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02olkn2060.outbound.protection.outlook.com [40.92.15.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1ADE51841; Sun, 14 Jan 2024 04:16:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=outlook.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=outlook.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outlook.com header.i=@outlook.com header.b="eA6j+gDf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FDo+cutGyHj9MND7h5DdhZOl9Sp9oNlbwvXCSqTQfASS204Uk6YGZ39bmumk/C3M/6Gionwz2LKWYg3lT6rvtXwwj9c3OZWe+m4FDFIidI5kbMcEEDOGwlBgor4KSUfLxltaWJXZ9VkojxEz47wr/Jtajf+VSHij2J7nz6lil1Q96kgM7g122Q1On5MnoUbqAvv/iHT0bUEC4a8TVxVDIVfAQw0ITouZipITyEED5jA71PMezc/8TjLIzyE1pDKL7KHuP3ocOcCYngT0BEEEJ+EC0MVAl5zUbM38xEy1fXIHPH2C6VilXpoB/vJWTrqtoT8R+SfVxRqFXcU867ZfKQ== 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=Z9LV8xY6m+yrPmHzl9yaQtyXezmiCEUE5ZGuPv3mjYQ=; b=WR/JBnjOIwHZaWUlK9dpd6KNA7YsStsBpPICwd8gzLpnKxP74iZuBxbXo6bVUKgSJz/H2pOada0eltIaoebwp5kIJexG4ITPkCvr/YMG/Co9NsnW4LD4tjm1FCJwTlQZQbTuQ7A86CLY06IjmT6ZTcKvWO/SS140oNg0BUmwD+VrAA4YnypEBgNVeaYrgwixrqkuRyhEao6hDgUjscZ4QqJS9OeczrJN8MQGBufx/hUXU1ZnPeJyulncLI1gi5SVdu3BIIazWOFDclQcsQpuyLxEfWYsaxM7U4+rpURK1936+6/W36Yq7D5Jz2/jFgMl+uSH/CbIBsxLmOynP6p1Cw== 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=Z9LV8xY6m+yrPmHzl9yaQtyXezmiCEUE5ZGuPv3mjYQ=; b=eA6j+gDfS4DGl1lbsneMYq/FiISPca3lIbcy4I1Dg7E0GjCOeiQuaAAvwpyGCW0zn833wBVfkuXKEZ3Jikd4e60npDTQhxr0bbX49WP25b39M1thNao0JvHSpWdFE7FpA6fxSez6CScFIf5yOHYt7u1/ElqOuS1ZwHiasfAr4EiqZ75yxtoIgiojVyYKPRN4lXPcRnbsBR/gAmx9ocPVW+wVgJHdPq+pSj1/roT0gQJ0a3hssNw3JCrkF4ozg76ztrlzz3QnypahoFnjhX9R4LTpwYbsucb6ddQdT09TCfdjdFeie62PMUsfHTA0lZTf0pS91NwybKr1So0jfce/Vg== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by MN2PR20MB3477.namprd20.prod.outlook.com (2603:10b6:208:265::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Sun, 14 Jan 2024 04:16:05 +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.7181.020; Sun, 14 Jan 2024 04:16:05 +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 v6 0/4] riscv: sophgo: add clock support for Sophgo CV1800/SG2000 SoCs Date: Sun, 14 Jan 2024 12:15:49 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 X-TMN: [rGpn4lst4WMLBvfu9MwdM8OLQHemRgeZ6ElFrwcUYa4IzLpWJaQ++5vOMKlsgXD4] X-ClientProxiedBy: SI1PR02CA0007.apcprd02.prod.outlook.com (2603:1096:4:1f7::6) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20240114041550.641859-1-inochiama@outlook.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|MN2PR20MB3477:EE_ X-MS-Office365-Filtering-Correlation-Id: a1d13a5f-495f-465d-dc93-08dc14b78680 X-MS-Exchange-SLBlob-MailProps: Om8TgR6f4EDHDmDz1kJnX51tgKpLn0gov2fc+D3OJcERD+AaFy+An/pZu+ZA11trO/TRQX0oYPRTUOApPdnd7UYbY7E+zBxU1B4Xjr7AHHzDAoi+gKPEe1O2OvB4M62TOy6HnBd2cIWa3pI05hFsl7S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wwpXimwTP1eDnE2z/FQXkVqpvfuRqEWmORTgynvtZQ8iOVoP2jmi+6N2pwkBgnv9L7k12uyk5luByJ3UgyicPnBjQjBhnNsKexN6XSygtcoOZFwL6m2qNXZhAlq0R3v/3zeVpSpyYvUutPcmQzZLxl142WZ0xgGP5SGF1ORWsmfqtB391Toq1sCxrxJR1bCgnwdCxU2jd2D90UH4rTQ6eKOBFFlcdLqAzbGVcTw9+22zfvCeCvK5UKker0EpCPV4UvfL6VM7bNexZdrmSL2a6LpmvO5ijOErqAuqcQC8gX22zwmi2JHMHR6qcQPXHB97atLIXY/5TG95XgaADwVoO9F/2ONdxXVvIZxiCiwzHRHJQMLvyFi+L2vlfB/+w8326x1RZ3o5yE8r4MpqFUGzOon1D1J/u5DYXJbWJrK1GuH8/yFdDbZ/xEoHjL6s0waQZE9p+KpyWicCFrJl5BDlUyChoux1GY6kF2QxYNHoduMIce/LPRPyj+58XPIPA8lgowaYe5q4VBSitzIP3qPiS5UHz4ER56lYES62+w5MqN5p6AdE31mu4dPcFqxozpSqcVirGGaZlp4zCZGgRBeNdwZQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1d13a5f-495f-465d-dc93-08dc14b78680 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2024 04:16:05.1323 (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: MN2PR20MB3477 Add clock controller support for the Sophgo CV1800B, CV1812H and SG2000. 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 (4): dt-bindings: clock: sophgo: Add clock controller of SG2000 series SoC clk: sophgo: Add CV1800/SG2000 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 | 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 | 1545 +++++++++++++++++ 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 | 905 ++++++++++ drivers/clk/sophgo/clk-cv18xx-ip.h | 265 +++ drivers/clk/sophgo/clk-cv18xx-pll.c | 425 +++++ drivers/clk/sophgo/clk-cv18xx-pll.h | 119 ++ 16 files changed, 3577 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.0