From patchwork Tue Jan 16 07:21:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Wang X-Patchwork-Id: 188436 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp97326dye; Mon, 15 Jan 2024 23:22:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHW9fJm6v8KFFKOshcw/gVw3cT5Dk8y7NkzyjjiOLDKz1TaiMiKbZ4lG2m2nTxLOSCKq9XV X-Received: by 2002:a05:6a21:6704:b0:19b:21cb:cee4 with SMTP id wh4-20020a056a21670400b0019b21cbcee4mr990434pzb.116.1705389726796; Mon, 15 Jan 2024 23:22:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705389726; cv=none; d=google.com; s=arc-20160816; b=o/8RY72/2wczNFaWbft3DUmjjGdX8jb9UCA4X4VFW8i+a7TAoVxfYSyNh4n1iTyaSB 6nhwnnu0pUucVRAPnMQbqhTbV7gt3V4Y0gs8QA4lVB80MDaHhHPWLkPlrjGHhyDf6uPZ 8Ealw/daAkf/hifJEYfYy/qhyk3XBL5PRD5pNI0LuQ6F1KcCge3bmG1G553y+KipiHNR K/ljQLU68Taf0zqujLgdvJU7QXqVCWEN7Bc+MGf3A0aXH61BRzqH9TNW5dnzK9OGNYsj rZSUqoAjUNSCA9SnFNXtHXBF03o4/xTMCQ9B7/MCQthdanpo+6iICjiAPKIw99cGF/np Lh8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=sqr4Lsc+9ICnRlEvhlkS3+10M/kIcF4XlsWKAjrshfQ=; fh=KH8xm6lWnQmjdwi1VtR18ptPhMUvoKU3JPF7cI3jXZo=; b=V3vJtz6JSC2kQhYhCU03Kv/eL5VspjNoiiIJqAfHCY6a9KBd8evUE118X12C4uQn6f TBnMyI0RzRX4+253nyb/zq8MBprI/JAUx9OHyZBLbQW/xegaiD4sASgDkKWmeuOYfYTn C+MGD9FrczTfdFHz0CaE6CH7evnFZhsNVtTMKBPGj+He8u0iLpdAws85Vg4JT/dPhrfF /2qpKLR5iid44r32dLF7R0t8VvHGi7xNOxqwsW2wgOoucNPK+lETLHGg/Cpk/gNJG2hV wJ27ZuT0DCheFNq5T4CHRbKFlmphxMSCgsjbR73yASFZEPW4+dT3m1CuxQazXi44hacM uDtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LGpQITe9; spf=pass (google.com: domain of linux-kernel+bounces-27064-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27064-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t16-20020a17090aae1000b0028af3016cc4si10553615pjq.37.2024.01.15.23.22.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 23:22:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27064-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LGpQITe9; spf=pass (google.com: domain of linux-kernel+bounces-27064-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27064-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 503B92846C5 for ; Tue, 16 Jan 2024 07:22:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9A5E1119E; Tue, 16 Jan 2024 07:21:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LGpQITe9" Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53CE810A24; Tue, 16 Jan 2024 07:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-210645bcf4cso245239fac.3; Mon, 15 Jan 2024 23:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705389708; x=1705994508; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sqr4Lsc+9ICnRlEvhlkS3+10M/kIcF4XlsWKAjrshfQ=; b=LGpQITe9R9UYmdmTzK/zb/OjPkQ68c8zdM0tDZ9AuYHBlzxELSyWLh1WNtGYujsrOL vKpLORXOiafSDx6SmW20o691QHG25CI0PNu4Gspvwxmwx8cE/OSte2kxND0jWvnmBih7 2f3T15cuHyYQQ8mDZ6QSi7V4sPMVOAXBxByBLTQD8HEqdyhrSL5DQz5sOKmKv1qRGwYS vo+QKsnn2shihgEUPf9RmUSAYRzBFRhk+9iY2Ylulxe4iFPuia3otqB4ntddFxIYZHSw Izv3SmA8WQ5HSkE4G7Gi/EJeGH+CYKrY3R+ez7Yrid7HO1hhuAw4C9DTqWKpU5ZdrisH 5l+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705389708; x=1705994508; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sqr4Lsc+9ICnRlEvhlkS3+10M/kIcF4XlsWKAjrshfQ=; b=c33rWxuqJfH70ljzyP+FdbbD5z+DilAu+9WfRW1vpDDrOFC8CUPoyluIiE6sCYNryG QWw1T973AGaS9pa1TvWUTi3dA9L2eofYdA7c1v58xZ2u3aMI8qlSD7dkYU3okOWYb/s1 2V63kPQDGPme82w0qrYuxRsBjrJdErKRqIkAkpe/3vND+xo2diGZc05D3f0aPfUDm7Wu B0x3VPsc2JeCZ1YHGV+JtWJ4KoB3KaT1bWH4FC+UQ1XKnjIEoYyYDNqJU00pRwLN5L/r wDCgmidVXIJJ+5yHHRGsuS2YYpoxSH2Zz7S55N9kvZRsqKaJVgio8Ok7IMyW9+pynHEp gD1A== X-Gm-Message-State: AOJu0YytQVn+u5tqrpdGUTwafRVspLGyVZjldXn6XI/Kh3BH/bjd1BLO q7u6JGfOnLIEuhxvZ1fFthY= X-Received: by 2002:a05:6870:9344:b0:206:c593:3111 with SMTP id j4-20020a056870934400b00206c5933111mr8359396oak.104.1705389707776; Mon, 15 Jan 2024 23:21:47 -0800 (PST) Received: from localhost.localdomain ([122.8.183.87]) by smtp.gmail.com with ESMTPSA id pf5-20020a0568717b0500b0020683d51a4csm2896892oac.46.2024.01.15.23.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 23:21:47 -0800 (PST) From: Chen Wang To: aou@eecs.berkeley.edu, chao.wei@sophgo.com, conor@kernel.org, krzysztof.kozlowski+dt@linaro.org, mturquette@baylibre.com, palmer@dabbelt.com, paul.walmsley@sifive.com, richardcochran@gmail.com, robh+dt@kernel.org, sboyd@kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, haijiao.liu@sophgo.com, xiaoguang.xing@sophgo.com, guoren@kernel.org, jszhang@kernel.org, inochiama@outlook.com, samuel.holland@sifive.com Cc: Chen Wang Subject: [PATCH v8 3/5] dt-bindings: clock: sophgo: add clkgen for SG2042 Date: Tue, 16 Jan 2024 15:21:40 +0800 Message-Id: <089f2fbe3626ed9c17b02d09d57a1b77fd1dee6a.1705388518.git.unicorn_wang@outlook.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788230738533491911 X-GMAIL-MSGID: 1788230738533491911 From: Chen Wang Add bindings for the clocks of which configuration registers are in the range of CLOCK in the memory-map. Signed-off-by: Chen Wang --- .../bindings/clock/sophgo,sg2042-clkgen.yaml | 40 +++++++ .../dt-bindings/clock/sophgo,sg2042-clkgen.h | 111 ++++++++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/sophgo,sg2042-clkgen.yaml create mode 100644 include/dt-bindings/clock/sophgo,sg2042-clkgen.h diff --git a/Documentation/devicetree/bindings/clock/sophgo,sg2042-clkgen.yaml b/Documentation/devicetree/bindings/clock/sophgo,sg2042-clkgen.yaml new file mode 100644 index 000000000000..4291889cd550 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/sophgo,sg2042-clkgen.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/clock/sophgo,sg2042-clkgen.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sophgo SG2042 Clock Generator + +description: + These clocks have configuration registers in the CLOCK range of memory-map. + +maintainers: + - Chen Wang + +properties: + compatible: + const: sophgo,sg2042-clkgen + + reg: + maxItems: 1 + + '#clock-cells': + const: 1 + description: + See for valid indices. + +required: + - compatible + - reg + - '#clock-cells' + +additionalProperties: false + +examples: + - | + clock-controller@30012000 { + compatible = "sophgo,sg2042-clkgen"; + reg = <0x30012000 0x1000>; + #clock-cells = <1>; + }; diff --git a/include/dt-bindings/clock/sophgo,sg2042-clkgen.h b/include/dt-bindings/clock/sophgo,sg2042-clkgen.h new file mode 100644 index 000000000000..84f7857317a2 --- /dev/null +++ b/include/dt-bindings/clock/sophgo,sg2042-clkgen.h @@ -0,0 +1,111 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */ +/* + * Copyright (C) 2023 Sophgo Technology Inc. All rights reserved. + */ + +#ifndef __DT_BINDINGS_SOPHGO_SG2042_CLKGEN_H__ +#define __DT_BINDINGS_SOPHGO_SG2042_CLKGEN_H__ + +#define DIV_CLK_MPLL_RP_CPU_NORMAL_0 0 +#define DIV_CLK_MPLL_AXI_DDR_0 1 +#define DIV_CLK_FPLL_DDR01_1 2 +#define DIV_CLK_FPLL_DDR23_1 3 +#define DIV_CLK_FPLL_RP_CPU_NORMAL_1 4 +#define DIV_CLK_FPLL_50M_A53 5 +#define DIV_CLK_FPLL_TOP_RP_CMN_DIV2 6 +#define DIV_CLK_FPLL_UART_500M 7 +#define DIV_CLK_FPLL_AHB_LPC 8 +#define DIV_CLK_FPLL_EFUSE 9 +#define DIV_CLK_FPLL_TX_ETH0 10 +#define DIV_CLK_FPLL_PTP_REF_I_ETH0 11 +#define DIV_CLK_FPLL_REF_ETH0 12 +#define DIV_CLK_FPLL_EMMC 13 +#define DIV_CLK_FPLL_SD 14 +#define DIV_CLK_FPLL_TOP_AXI0 15 +#define DIV_CLK_FPLL_TOP_AXI_HSPERI 16 +#define DIV_CLK_FPLL_AXI_DDR_1 17 +#define DIV_CLK_FPLL_DIV_TIMER1 18 +#define DIV_CLK_FPLL_DIV_TIMER2 19 +#define DIV_CLK_FPLL_DIV_TIMER3 20 +#define DIV_CLK_FPLL_DIV_TIMER4 21 +#define DIV_CLK_FPLL_DIV_TIMER5 22 +#define DIV_CLK_FPLL_DIV_TIMER6 23 +#define DIV_CLK_FPLL_DIV_TIMER7 24 +#define DIV_CLK_FPLL_DIV_TIMER8 25 +#define DIV_CLK_FPLL_100K_EMMC 26 +#define DIV_CLK_FPLL_100K_SD 27 +#define DIV_CLK_FPLL_GPIO_DB 28 +#define DIV_CLK_DPLL0_DDR01_0 29 +#define DIV_CLK_DPLL1_DDR23_0 30 + +#define GATE_CLK_RP_CPU_NORMAL_DIV0 31 +#define GATE_CLK_AXI_DDR_DIV0 32 + +#define GATE_CLK_RP_CPU_NORMAL_DIV1 33 +#define GATE_CLK_A53_50M 34 +#define GATE_CLK_TOP_RP_CMN_DIV2 35 +#define GATE_CLK_HSDMA 36 +#define GATE_CLK_EMMC_100M 37 +#define GATE_CLK_SD_100M 38 +#define GATE_CLK_TX_ETH0 39 +#define GATE_CLK_PTP_REF_I_ETH0 40 +#define GATE_CLK_REF_ETH0 41 +#define GATE_CLK_UART_500M 42 +#define GATE_CLK_EFUSE 43 + +#define GATE_CLK_AHB_LPC 44 +#define GATE_CLK_AHB_ROM 45 +#define GATE_CLK_AHB_SF 46 + +#define GATE_CLK_APB_UART 47 +#define GATE_CLK_APB_TIMER 48 +#define GATE_CLK_APB_EFUSE 49 +#define GATE_CLK_APB_GPIO 50 +#define GATE_CLK_APB_GPIO_INTR 51 +#define GATE_CLK_APB_SPI 52 +#define GATE_CLK_APB_I2C 53 +#define GATE_CLK_APB_WDT 54 +#define GATE_CLK_APB_PWM 55 +#define GATE_CLK_APB_RTC 56 + +#define GATE_CLK_AXI_PCIE0 57 +#define GATE_CLK_AXI_PCIE1 58 +#define GATE_CLK_SYSDMA_AXI 59 +#define GATE_CLK_AXI_DBG_I2C 60 +#define GATE_CLK_AXI_SRAM 61 +#define GATE_CLK_AXI_ETH0 62 +#define GATE_CLK_AXI_EMMC 63 +#define GATE_CLK_AXI_SD 64 +#define GATE_CLK_TOP_AXI0 65 +#define GATE_CLK_TOP_AXI_HSPERI 66 + +#define GATE_CLK_TIMER1 67 +#define GATE_CLK_TIMER2 68 +#define GATE_CLK_TIMER3 69 +#define GATE_CLK_TIMER4 70 +#define GATE_CLK_TIMER5 71 +#define GATE_CLK_TIMER6 72 +#define GATE_CLK_TIMER7 73 +#define GATE_CLK_TIMER8 74 +#define GATE_CLK_100K_EMMC 75 +#define GATE_CLK_100K_SD 76 +#define GATE_CLK_GPIO_DB 77 + +#define GATE_CLK_AXI_DDR_DIV1 78 +#define GATE_CLK_DDR01_DIV1 79 +#define GATE_CLK_DDR23_DIV1 80 + +#define GATE_CLK_DDR01_DIV0 81 +#define GATE_CLK_DDR23_DIV0 82 + +#define GATE_CLK_DDR01 83 +#define GATE_CLK_DDR23 84 +#define GATE_CLK_RP_CPU_NORMAL 85 +#define GATE_CLK_AXI_DDR 86 + +#define MUX_CLK_DDR01 87 +#define MUX_CLK_DDR23 88 +#define MUX_CLK_RP_CPU_NORMAL 89 +#define MUX_CLK_AXI_DDR 90 + +#endif /* __DT_BINDINGS_SOPHGO_SG2042_CLKGEN_H__ */