Message ID | cover.1699879741.git.unicorn_wang@outlook.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1194111vqg; Mon, 13 Nov 2023 05:18:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmsO0Nx57mtoCAzSKIcHJW3QW62UJ8FnKTN9mTjySpc/zvi8c8tnX7EeQU4+3aiZXzk+ch X-Received: by 2002:a05:6a20:6a0d:b0:186:7509:7f6e with SMTP id p13-20020a056a206a0d00b0018675097f6emr2278693pzk.27.1699881483233; Mon, 13 Nov 2023 05:18:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699881483; cv=none; d=google.com; s=arc-20160816; b=YloJyLdRX5FjKFwX9tOBdtBy+3GRJE5A6yxkGpIklVTze0frhKSNxgt4qHLba4Dhxo 2xZU9iBSL5dyaia7XBxVEL3rB+NQOGWDrsfb3lt17HOs/1nZ+u1pofRB40aVg5SG9U+3 DG1Qk0JjOSLNNEOByUPlmS/kYZqcaJsn+LAAJp65TyRSuaCV6vUCtnexO0O8wIgdZI1e 6YHI0DLDj7tx8l0Uo3miS2va9bJ4YMoH9EVHa2/5B/YfrypiYQMCJy+o8GrjcQC/gvuu Vf0JYqPXmhEUjrTcnjMdi3lyH5AMDYiaglCWrFxNmNHVjOFY0cxFPiF2lsNu2F+8kH9X DQNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sMYVHHaJeCjmpAavU23RMpRyLk0TWskkcBNgC6viZA4=; fh=sooM70BILLu/JyIlt/wZqYx4U5S6TlD2RvlTS5d39Ek=; b=JJr54rL2JSOCJ25Nmck+hlkJp4MkONKnAT5XWXIdZoBO7aWm4oGbbW6daihfITd363 L8pncgZRBCQCqM8de5kwla6hrPG2tKIQd7+rQbfymcgTWIqgWJGzJaq/ETLjYEYVSIGW jcGR5Z8gcpqMZ2IXovxPkSxFwTurmUPxL6pN7TYQkQC+VCn5ApR95xWXU5+MrI3ap2lH 39cRIUa51FAg897AXEfI7aiZB2Lhl5qvixpoGA/f9AS/5MXBnLGibSVMCd2Qdlx4eBnl Q5pQoUqKZE5jRKSEShXbFxKZTCuKvwNMlnirJZ74SOJMffuWTAvZoxuVz3UWevzx3VFd 08dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g6tm2kPd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id g16-20020a62e310000000b006c111d6f49esi5575004pfh.383.2023.11.13.05.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 05:18:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g6tm2kPd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 59E77802FD1C; Mon, 13 Nov 2023 05:18:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbjKMNR7 (ORCPT <rfc822;heyuhang3455@gmail.com> + 29 others); Mon, 13 Nov 2023 08:17:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230396AbjKMNR5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Nov 2023 08:17:57 -0500 Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BD4FD6D; Mon, 13 Nov 2023 05:17:52 -0800 (PST) Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3b2ea7cca04so2722162b6e.2; Mon, 13 Nov 2023 05:17:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699881472; x=1700486272; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sMYVHHaJeCjmpAavU23RMpRyLk0TWskkcBNgC6viZA4=; b=g6tm2kPdHEfk79n/oIuAzWgzZcAfeG2dUseu0MiZKS0OB0G6AGYqX4bL+Nf+SGhEqn GoNFNjqeLfewtQIA5gc2nv/85wqRhW29DG+mfY/5KSYSX7Bdil4gjabIpISwbcDc9gvH rpbT5b3OAQSKvKL/s3sQ2d31wCqs3gditoTu6KtELLWTjzpoSfHSWe5Zc7ANF3nOMUFz gE0opy5GD24g1j//raiCy8qtuoS/rD7R0wOhrh+T4YdYdNQzmqaqotfs8p5V7qMs3uVR sIa8AefuIb22YnMydb/KJLGUupc9zMXzgqXh4LXaURZL4nS48e9WfF4JWvcGVLod+1/Z r7jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699881472; x=1700486272; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sMYVHHaJeCjmpAavU23RMpRyLk0TWskkcBNgC6viZA4=; b=rf9EnKDbjPVZUgMze3FKsQXqZrMCo15FOq8jzQ6IQrdVVoN6VFAGBq8sZwDLt54U7u r4NZ6iAPsp7P2GClUtw1U+Dx8D5zwc46+0++2t7IyN+ctsmc9Nb5LnsQY03asVGM6G6m iatgOTNvz4PmJ069fscytk9jmrLuXXkjFP1z0IYDwYN6hwS9AMvvJBL79wYAloBqHW/C 4wuhXmWJ2kdHhIJ7ROYF4fecGm5NZOiWcCUYZgV9V8QiA35Ne3baPYSdpErKW7LpWhPB E08zZZHBu0jdxDPr0P0m3nEcKwtju6ySrUWsYm/icLZuOLZcQNcSiqO01vAsBT0nprPf HM+A== X-Gm-Message-State: AOJu0YweEhmZdsuaoSAz0gS/cjTNm4kE6gQOlsc/G6/E9YuVHx2g8uxm kVr43jAB3BYaWqAvdaeIYEY= X-Received: by 2002:a05:6808:b13:b0:3a8:6b4d:6b78 with SMTP id s19-20020a0568080b1300b003a86b4d6b78mr7628082oij.35.1699881471814; Mon, 13 Nov 2023 05:17:51 -0800 (PST) Received: from localhost.localdomain ([122.8.183.87]) by smtp.gmail.com with ESMTPSA id g34-20020a0568080de200b003b2df32d9a9sm773426oic.19.2023.11.13.05.17.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 05:17:51 -0800 (PST) From: Chen Wang <unicornxw@gmail.com> 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 Cc: Chen Wang <unicorn_wang@outlook.com> Subject: [PATCH 0/5] riscv: sophgo: add clock support for sg2042 Date: Mon, 13 Nov 2023 21:16:36 +0800 Message-Id: <cover.1699879741.git.unicorn_wang@outlook.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 13 Nov 2023 05:18:02 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782454925863390821 X-GMAIL-MSGID: 1782454925863390821 |
Series | riscv: sophgo: add clock support for sg2042 | |
Message
Chen Wang
Nov. 13, 2023, 1:16 p.m. UTC
From: Chen Wang <unicorn_wang@outlook.com>
This series adds clock controller support for sophgo sg2042.
Chen Wang (5):
dt-bindings: clock: sophgo: Add SG2042 clock definitions
dt-bindings: soc: sophgo: Add Sophgo syscon module
dt-bindings: clock: sophgo: Add SG2042 bindings
clk: sophgo: Add SG2042 clock generator driver
riscv: dts: add clock generator for Sophgo SG2042 SoC
.../clock/sophgo/sophgo,sg2042-clkgen.yaml | 48 +
.../soc/sophgo/sophgo,sg2042-syscon.yaml | 38 +
MAINTAINERS | 8 +
arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi | 76 +
arch/riscv/boot/dts/sophgo/sg2042.dtsi | 10 +
drivers/clk/Kconfig | 1 +
drivers/clk/Makefile | 1 +
drivers/clk/sophgo/Kconfig | 8 +
drivers/clk/sophgo/Makefile | 2 +
drivers/clk/sophgo/clk-sophgo-sg2042.c | 1259 +++++++++++++++++
drivers/clk/sophgo/clk-sophgo-sg2042.h | 226 +++
include/dt-bindings/clock/sophgo-sg2042-clk.h | 169 +++
12 files changed, 1846 insertions(+)
create mode 100644 Documentation/devicetree/bindings/clock/sophgo/sophgo,sg2042-clkgen.yaml
create mode 100644 Documentation/devicetree/bindings/soc/sophgo/sophgo,sg2042-syscon.yaml
create mode 100644 arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi
create mode 100644 drivers/clk/sophgo/Kconfig
create mode 100644 drivers/clk/sophgo/Makefile
create mode 100644 drivers/clk/sophgo/clk-sophgo-sg2042.c
create mode 100644 drivers/clk/sophgo/clk-sophgo-sg2042.h
create mode 100644 include/dt-bindings/clock/sophgo-sg2042-clk.h
base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86
Comments
On Mon, Nov 13, 2023 at 09:20:11PM +0800, Chen Wang wrote: > From: Chen Wang <unicorn_wang@outlook.com> > > Add clock generator node to device tree for SG2042, and enable clock for > uart0. > > Signed-off-by: Chen Wang <unicorn_wang@outlook.com> > --- > arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi | 76 ++++++++++++++++++++ There's no need to create an entirely new file for this. > arch/riscv/boot/dts/sophgo/sg2042.dtsi | 10 +++ > 2 files changed, 86 insertions(+) > create mode 100644 arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi > > diff --git a/arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi b/arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi > new file mode 100644 > index 000000000000..66d2723fab35 > --- /dev/null > +++ b/arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi > @@ -0,0 +1,76 @@ > +// SPDX-License-Identifier: (GPL-2.0 OR MIT) > +/* > + * Copyright (C) 2023 Sophgo Technology Inc. All rights reserved. > + */ > + > +/ { > + cgi: oscillator { > + compatible = "fixed-clock"; > + clock-frequency = <25000000>; > + clock-output-names = "cgi"; > + #clock-cells = <0>; > + }; What actually is this oscillator? Is it provided by another clock controller on the SoC, or is it provided by an oscillator on the board? > + > + clkgen: clock-controller { > + compatible = "sophgo,sg2042-clkgen"; > + #clock-cells = <1>; > + system-ctrl = <&sys_ctrl>; Why is this node not a child of the system controller? Cheers, Conor.
On 2023-11-14 7:34 PM, Chen Wang wrote: > On 2023/11/15 1:31, Conor Dooley wrote: >> On Mon, Nov 13, 2023 at 09:20:11PM +0800, Chen Wang wrote: >>> From: Chen Wang <unicorn_wang@outlook.com> >>> >>> Add clock generator node to device tree for SG2042, and enable clock for >>> uart0. >>> >>> Signed-off-by: Chen Wang <unicorn_wang@outlook.com> >>> --- >>> arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi | 76 ++++++++++++++++++++ >> There's no need to create an entirely new file for this. > Agree, I will merge this into sg2042.dtsi in next revision. >> >>> arch/riscv/boot/dts/sophgo/sg2042.dtsi | 10 +++ >>> 2 files changed, 86 insertions(+) >>> create mode 100644 arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi >>> >>> diff --git a/arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi >>> b/arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi >>> new file mode 100644 >>> index 000000000000..66d2723fab35 >>> --- /dev/null >>> +++ b/arch/riscv/boot/dts/sophgo/sg2042-clock.dtsi >>> @@ -0,0 +1,76 @@ >>> +// SPDX-License-Identifier: (GPL-2.0 OR MIT) >>> +/* >>> + * Copyright (C) 2023 Sophgo Technology Inc. All rights reserved. >>> + */ >>> + >>> +/ { >>> + cgi: oscillator { >>> + compatible = "fixed-clock"; >>> + clock-frequency = <25000000>; >>> + clock-output-names = "cgi"; >>> + #clock-cells = <0>; >>> + }; >> What actually is this oscillator? >> Is it provided by another clock controller on the SoC, or is it provided >> by an oscillator on the board? > > This oscillator is an individual ic chip outside the SoC on the board, that's > why I list it outside soc node. > > Actually the "cgi" is abbrevation for "Clock Generation IC chip". Since the oscillator is outside the SoC, this node (or at least its clock-frequency property) belongs in the board devicetree, not the SoC .dtsi. See [1]. Regards, Samuel [1]: https://lore.kernel.org/linux-riscv/b5401052-e803-9788-64d6-82b2737533ce@linaro.org/