From patchwork Mon Dec 18 04:04:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inochi Amaoto X-Patchwork-Id: 13496171 X-Patchwork-Delegate: mail@conchuod.ie 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 666DBC35274 for ; Mon, 18 Dec 2023 04:04:37 +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=CIYo7O/HxlhMd9l5xWtWOjQUAoqxy6OSXNPaOStUPI0=; b=4iPFBuSUAHZQb4 r2xlHCM6fqxa4i84oruxZgGEmPJMRCSFlyPgSJ+hvV2/VAyVTYBWWyJHubxx2UTwhEqukXxvtSZ0N zNLih0csaHZvH2+YJC7c8W2pTm6eYxLVdeicFiMjkdxrTB5+/fpOmf9fr3ldT72t+nhFmvCTJoCf9 QZUEm4xKznh3KQskcxdaH1zsRP9WcW98EO0hHCeg2PI/GI/RJoQFBy0DpLXHGC3SO7vvfddZMYknJ C6YFu2oPPr8ScCuxhaxmS56j2wpFNCfJ+qkBVmH+CSNBY9CYxu3MdAAxtwC/eRcSpfySDaBXvMGE/ QIwR3Mpw0ki3C8YQAT3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rF4rl-0090nE-0V; Mon, 18 Dec 2023 04:04:29 +0000 Received: from mail-bn1nam02olkn20823.outbound.protection.outlook.com ([2a01:111:f400:7eb2::823] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rF4rh-0090mh-2b for linux-riscv@lists.infradead.org; Mon, 18 Dec 2023 04:04:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d5OiKCXeOg1EzemFQ3qfDoqlsUdMYzrSogkj7yw4kqwF67ZXMXyh1/JKzVljdZoaSe+gxEgDtOUqrwI2Ll7HtqmWMsSMwD7KwXgKe2LlHShDiKNXv6m17QhGz0aDw/v6d6Ixx089oiQqRueu6LR8DN7YG2+cA9wvTjZu0S9CVANHkZfexhCIP+OSvvnQ+/6tB3NZcMeby0Ircd/35YCe1fll45vq02+SDObnHvi+CRjN/N55YiTT9+tKaGx5LIp/koCP+4W+/Pn+qtk+31Pb+8wUSzuU317lMAoJa1uOEb+N7M4HiH9J6G9iVdtFwXxfm7XUK3VSf77riJDripuDMQ== 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=1HdgU7H2nhyRpso2nTAa2zf+sY/fnXNZmmlUiuP2SJI=; b=FYr7aEAIktqrLBuxGV6yeHLqf9UGRK8ZYI27HCzOQ//tnY6YuwXLzPqcsB3XT1jwmeBk4P6poIAOW/5gIK6VmXkiUZcrLghEilHP4Y7SvpOxf0Eq4QMcAgBiQT7qtLkq2Y/S410l19wYrdmLumJcGsj8PfgURiGxNFMkzDXwEQrVG82gkdGKbKfZNiZvXVBa+8QQ38iX7J/VVh7Gj7YiImaNpgFQCIOUzKdx/uRl5fNNkGFMtczbqUmx0NEaLU5/DBecoxKN/9wlkUJjD7fVyD63q1NKpEqivn2DeN/CeaNz/SGo0/FY/FFQ2ngtyZpC2uDupNLf1taCvAhcwfBoTQ== 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=1HdgU7H2nhyRpso2nTAa2zf+sY/fnXNZmmlUiuP2SJI=; b=Wps1Lz5Mlo3aJsf4MXiB2lmdumd/X4asYWGYgFZgxnKeIrPxElSo2ZrxLPQlwpXWEKgqHG8fjSE7CG5y4T7hoPFNhii4wnYZeHXa1u6NDzxdCY+wldHAXLf30je3tGTrua/akMlWDbPzLuAf5p4OxRTr2difDbjfER+HjyVG9gtCWGOTGPg7CVdcchsz8E3Mnv0yTdMXAOx6E24RD5pFxhpspnRoSv03g966+jt35g7kE9qkRP1j5cz23WHI7xWiDhGS/LS9zLcKeiI8Y2YjOsl4TKd/EOCI3ews3hjNZcZmatMpwfrG0uNHHjcyfQIVK5FBK/M4ruuwPl9ZXAYqog== Received: from IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) by BN0PR20MB3976.namprd20.prod.outlook.com (2603:10b6:408:127::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 04:04:15 +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.7091.034; Mon, 18 Dec 2023 04:04:15 +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 , Jingbao Qiu , dlan@gentoo.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Krzysztof Kozlowski Subject: [PATCH v4 1/4] dt-bindings: clock: sophgo: Add clock controller of CV1800 series SoC Date: Mon, 18 Dec 2023 12:04:03 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: X-TMN: [ZM1fdSAnHO2ZMEmzk45oG6hlrkUOPgyOY/swCxhqyi4=] X-ClientProxiedBy: TYCP286CA0218.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c5::17) To IA1PR20MB4953.namprd20.prod.outlook.com (2603:10b6:208:3af::19) X-Microsoft-Original-Message-ID: <20231218040407.574287-1-inochiama@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: IA1PR20MB4953:EE_|BN0PR20MB3976:EE_ X-MS-Office365-Filtering-Correlation-Id: deb4e84a-e4d9-4532-52fe-08dbff7e6689 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hnMn27/HDXyb438Y/eulTZN1BMGbbRlFHFEMeW3YZ54tG1crr07wKtFHR/OhQUAozIxIPG8DVnya5CYTjtVyaWYSrKWfoVNRRPmZ6mEoO2KErt1mpRhlz/glV4iCXo2Lh0nwnIQLPM0siBRScKl7juEHXMEOFVOcaYXz0yRur/bprU7FkFLwXlbThPlWO1gaGsw9jXVoIFqU+FJFrxcdM2L19vAK6TXxN+gL9ZaBxjN8mxKzJycYIrFx4mk7rjBzrh8sYNboMTYF4JvBhf5yWe0MLVHoYh0rrS2xhF9SdOcrRlKgAMVu1EZsp2jlpD0XUVe/eSt/By0xd2rqboRJ62aQkGY6SSWrqB0sbDXsLnt1JqbgMQ/Mo41plXfMCHLxQmOd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NxqYNcIITO1G9z8A6zwk0DfFN7bknJsVVtM/jZyQGLQe2ZtIqm2RuT9+8tu+CpBE0S5td8lX8YK/TfaclSIeGS81rG5iDUdIxcRWcETxRAcQ3lNVx1mspPf5VEj1AZt9ep5IqFASx6RVh9auyerh5KFKeeuPqktBfbFOuhDWGseI7ZaZDl7tzUDzZTz5ZqrTBwL41MF54WawMQozm7A+/isBXSn/7Ge5QXh9nzF5rg91QXhM/D6kQLb9e3urECK7v0feN9JJVxU934jsyKbM/vbL0FyZmGImqbULXT9QAm3HHFGPGj/kkKEzHjqCWFOoDJSHHZe17xA9/XmwyhpgHIvUSqJAgGW3cV1kGpwbB7/t4NV2rra5SaZD3OmAFRNsnQr2OCJdrc36757ilbZzgpV9xQDsYZ1ZHG7pAewaDhfZ3tcFEOiz7xZsoYHxyTlJn/vcLuQkM3D8BLFoqeblz6qbbHSgS4l0gIW2j+HwjNjYuFrxib2DppiUlhJ/gyjvSY2CcPZTycSG4GlfKLmn7kzda1TPVyCXXEP8G4= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: deb4e84a-e4d9-4532-52fe-08dbff7e6689 X-MS-Exchange-CrossTenant-AuthSource: IA1PR20MB4953.namprd20.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2023 04:04:15.7650 (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: BN0PR20MB3976 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231217_200425_848703_2E7D86C4 X-CRM114-Status: GOOD ( 11.98 ) 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 definition for the clock controller of the CV1800 series SoC. For CV181X, it has a clock that CV180X does not have. To avoid misuse, also add a compatible string to identify CV181X series SoC. Signed-off-by: Inochi Amaoto Link: https://github.com/milkv-duo/duo-files/blob/main/hardware/CV1800B/CV1800B-CV1801B-Preliminary-Datasheet-full-en.pdf Reviewed-by: Krzysztof Kozlowski --- .../bindings/clock/sophgo,cv1800-clk.yaml | 46 +++++ include/dt-bindings/clock/sophgo,cv1800.h | 176 ++++++++++++++++++ 2 files changed, 222 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/sophgo,cv1800-clk.yaml create mode 100644 include/dt-bindings/clock/sophgo,cv1800.h -- 2.43.0 diff --git a/Documentation/devicetree/bindings/clock/sophgo,cv1800-clk.yaml b/Documentation/devicetree/bindings/clock/sophgo,cv1800-clk.yaml new file mode 100644 index 000000000000..c1dc24673c0d --- /dev/null +++ b/Documentation/devicetree/bindings/clock/sophgo,cv1800-clk.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/sophgo,cv1800-clk.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sophgo CV1800 Series Clock Controller + +maintainers: + - Inochi Amaoto + +properties: + compatible: + enum: + - sophgo,cv1800-clk + - sophgo,cv1810-clk + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + "#clock-cells": + const: 1 + description: + See for valid indices. + +required: + - compatible + - reg + - clocks + - "#clock-cells" + +additionalProperties: false + +examples: + - | + clock-controller@3002000 { + compatible = "sophgo,cv1800-clk"; + reg = <0x03002000 0x1000>; + clocks = <&osc>; + #clock-cells = <1>; + }; + +... diff --git a/include/dt-bindings/clock/sophgo,cv1800.h b/include/dt-bindings/clock/sophgo,cv1800.h new file mode 100644 index 000000000000..cfbeca25a650 --- /dev/null +++ b/include/dt-bindings/clock/sophgo,cv1800.h @@ -0,0 +1,176 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +/* + * Copyright (C) 2023 Sophgo Ltd. + */ + +#ifndef __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ +#define __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ + +#define CLK_MPLL 0 +#define CLK_TPLL 1 +#define CLK_FPLL 2 +#define CLK_MIPIMPLL 3 +#define CLK_A0PLL 4 +#define CLK_DISPPLL 5 +#define CLK_CAM0PLL 6 +#define CLK_CAM1PLL 7 + +#define CLK_MIPIMPLL_D3 8 +#define CLK_CAM0PLL_D2 9 +#define CLK_CAM0PLL_D3 10 + +#define CLK_TPU 11 +#define CLK_TPU_FAB 12 +#define CLK_AHB_ROM 13 +#define CLK_DDR_AXI_REG 14 +#define CLK_RTC_25M 15 +#define CLK_SRC_RTC_SYS_0 16 +#define CLK_TEMPSEN 17 +#define CLK_SARADC 18 +#define CLK_EFUSE 19 +#define CLK_APB_EFUSE 20 +#define CLK_DEBUG 21 +#define CLK_AP_DEBUG 22 +#define CLK_XTAL_MISC 23 +#define CLK_AXI4_EMMC 24 +#define CLK_EMMC 25 +#define CLK_EMMC_100K 26 +#define CLK_AXI4_SD0 27 +#define CLK_SD0 28 +#define CLK_SD0_100K 29 +#define CLK_AXI4_SD1 30 +#define CLK_SD1 31 +#define CLK_SD1_100K 32 +#define CLK_SPI_NAND 33 +#define CLK_ETH0_500M 34 +#define CLK_AXI4_ETH0 35 +#define CLK_ETH1_500M 36 +#define CLK_AXI4_ETH1 37 +#define CLK_APB_GPIO 38 +#define CLK_APB_GPIO_INTR 39 +#define CLK_GPIO_DB 40 +#define CLK_AHB_SF 41 +#define CLK_AHB_SF1 42 +#define CLK_A24M 43 +#define CLK_AUDSRC 44 +#define CLK_APB_AUDSRC 45 +#define CLK_SDMA_AXI 46 +#define CLK_SDMA_AUD0 47 +#define CLK_SDMA_AUD1 48 +#define CLK_SDMA_AUD2 49 +#define CLK_SDMA_AUD3 50 +#define CLK_I2C 51 +#define CLK_APB_I2C 52 +#define CLK_APB_I2C0 53 +#define CLK_APB_I2C1 54 +#define CLK_APB_I2C2 55 +#define CLK_APB_I2C3 56 +#define CLK_APB_I2C4 57 +#define CLK_APB_WDT 58 +#define CLK_PWM_SRC 59 +#define CLK_PWM 60 +#define CLK_SPI 61 +#define CLK_APB_SPI0 62 +#define CLK_APB_SPI1 63 +#define CLK_APB_SPI2 64 +#define CLK_APB_SPI3 65 +#define CLK_1M 66 +#define CLK_CAM0_200 67 +#define CLK_PM 68 +#define CLK_TIMER0 69 +#define CLK_TIMER1 70 +#define CLK_TIMER2 71 +#define CLK_TIMER3 72 +#define CLK_TIMER4 73 +#define CLK_TIMER5 74 +#define CLK_TIMER6 75 +#define CLK_TIMER7 76 +#define CLK_UART0 77 +#define CLK_APB_UART0 78 +#define CLK_UART1 79 +#define CLK_APB_UART1 80 +#define CLK_UART2 81 +#define CLK_APB_UART2 82 +#define CLK_UART3 83 +#define CLK_APB_UART3 84 +#define CLK_UART4 85 +#define CLK_APB_UART4 86 +#define CLK_APB_I2S0 87 +#define CLK_APB_I2S1 88 +#define CLK_APB_I2S2 89 +#define CLK_APB_I2S3 90 +#define CLK_AXI4_USB 91 +#define CLK_APB_USB 92 +#define CLK_USB_125M 93 +#define CLK_USB_33K 94 +#define CLK_USB_12M 95 +#define CLK_AXI4 96 +#define CLK_AXI6 97 +#define CLK_DSI_ESC 98 +#define CLK_AXI_VIP 99 +#define CLK_SRC_VIP_SYS_0 100 +#define CLK_SRC_VIP_SYS_1 101 +#define CLK_SRC_VIP_SYS_2 102 +#define CLK_SRC_VIP_SYS_3 103 +#define CLK_SRC_VIP_SYS_4 104 +#define CLK_CSI_BE_VIP 105 +#define CLK_CSI_MAC0_VIP 106 +#define CLK_CSI_MAC1_VIP 107 +#define CLK_CSI_MAC2_VIP 108 +#define CLK_CSI0_RX_VIP 109 +#define CLK_CSI1_RX_VIP 110 +#define CLK_ISP_TOP_VIP 111 +#define CLK_IMG_D_VIP 112 +#define CLK_IMG_V_VIP 113 +#define CLK_SC_TOP_VIP 114 +#define CLK_SC_D_VIP 115 +#define CLK_SC_V1_VIP 116 +#define CLK_SC_V2_VIP 117 +#define CLK_SC_V3_VIP 118 +#define CLK_DWA_VIP 119 +#define CLK_BT_VIP 120 +#define CLK_DISP_VIP 121 +#define CLK_DSI_MAC_VIP 122 +#define CLK_LVDS0_VIP 123 +#define CLK_LVDS1_VIP 124 +#define CLK_PAD_VI_VIP 125 +#define CLK_PAD_VI1_VIP 126 +#define CLK_PAD_VI2_VIP 127 +#define CLK_CFG_REG_VIP 128 +#define CLK_VIP_IP0 129 +#define CLK_VIP_IP1 130 +#define CLK_VIP_IP2 131 +#define CLK_VIP_IP3 132 +#define CLK_IVE_VIP 133 +#define CLK_RAW_VIP 134 +#define CLK_OSDC_VIP 135 +#define CLK_CAM0_VIP 136 +#define CLK_AXI_VIDEO_CODEC 137 +#define CLK_VC_SRC0 138 +#define CLK_VC_SRC1 139 +#define CLK_VC_SRC2 140 +#define CLK_H264C 141 +#define CLK_APB_H264C 142 +#define CLK_H265C 143 +#define CLK_APB_H265C 144 +#define CLK_JPEG 145 +#define CLK_APB_JPEG 146 +#define CLK_CAM0 147 +#define CLK_CAM1 148 +#define CLK_WGN 149 +#define CLK_WGN0 150 +#define CLK_WGN1 151 +#define CLK_WGN2 152 +#define CLK_KEYSCAN 153 +#define CLK_CFG_REG_VC 154 +#define CLK_C906_0 155 +#define CLK_C906_1 156 +#define CLK_A53 157 +#define CLK_CPU_AXI0 158 +#define CLK_CPU_GIC 159 +#define CLK_XTAL_AP 160 + +// Only for CV181x +#define CLK_DISP_SRC_VIP 161 + +#endif /* __DT_BINDINGS_SOPHGO_CV1800_CLK_H__ */