From patchwork Thu Dec 7 08:57:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Wang X-Patchwork-Id: 17671 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4640989vqy; Thu, 7 Dec 2023 00:57:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuHR6ZAq9n+Cbr+G4cRFGVZI2RbVMAOsLdSqCsr2oB9SNbfQRUglXQuXUdfiRl0/7K6SJC X-Received: by 2002:a05:6870:1701:b0:1fb:75a:de51 with SMTP id h1-20020a056870170100b001fb075ade51mr2553730oae.63.1701939446637; Thu, 07 Dec 2023 00:57:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701939446; cv=none; d=google.com; s=arc-20160816; b=yDB0/qpGZZweMV9YP/YLA67POCAsZ94UcLOH8j6ZvJbdzMuud+1z8sQD82BOW3ZXC+ guWmAVO2vbBBVl3M9ONSiZsqa7DNBlMImUNyDNxZxtfDkrKFmLefn3TiwmdE1tzBrcHB oHZcNaCQtbKUTCyxdpx9gdGWEDPo27lpb3m3qY514CnfSzT+oNog/kznYoTiS2rItc1o oAcliXymrfhJk0+PBRKv3Y5YcSudy02RYmQsVNyY/gFgIqzwJHowBftnXF4Ea9jeo0YC 3kveqkHkrvjAHUsjL7HEhACxuRFfEMoaWk4n0b60FCnsPF3SdGarqFoe/rZH41tOFHjm fo8g== 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=P11i5JtOr3fzuVQuonrXRUS+CyP/6OsLPEuxS5gelmY=; fh=KH8xm6lWnQmjdwi1VtR18ptPhMUvoKU3JPF7cI3jXZo=; b=DB5S0e+Cjn8PZm9dNy0yijHeIkHot1RXqJ3zBQ2c1ZHd2rSPpWVI6Afhy8yE8k8awN XBALm+h8vurIYp3Lp/mnucgCgSiRPJvlnXSxhGe1Oj/FrZclhyUqyA+DFpMAodpSN964 /8vSB9nXf+qhNmfroMm7gqAtD2Rr3N9w3YpVAnRC9bT0RYyfqPkYvianrkJb/3L15W+i DBUh0NgE7CP3Ypq2mJ/g7YcGXMqshLsC6Dgdop+R9DUHKGF2yfHYZYqkWdTEXDLaujUK qkV5kyjQPxKKrvIcGLtB4ldXrn/6FMNrdpEo6yqmlllYCeTQRJ5udA/g9SAadLio/PQL 3H2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Z6uW96EL; 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 cd23-20020a056a02079700b005c1faa82bfesi831630pgb.857.2023.12.07.00.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 00:57:26 -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=Z6uW96EL; 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 73E4C8069F03; Thu, 7 Dec 2023 00:57:25 -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 S231439AbjLGI5P (ORCPT + 99 others); Thu, 7 Dec 2023 03:57:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231144AbjLGI5M (ORCPT ); Thu, 7 Dec 2023 03:57:12 -0500 Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59E1310C8; Thu, 7 Dec 2023 00:57:18 -0800 (PST) Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1fa26074783so485813fac.1; Thu, 07 Dec 2023 00:57:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701939437; x=1702544237; 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=P11i5JtOr3fzuVQuonrXRUS+CyP/6OsLPEuxS5gelmY=; b=Z6uW96ELdejKG/oxlqbq8xw6VHpb0BsLFo3RAEuiCTa4U1Vmc8sCAl5uP/Dk0iJkNO xH8GLs9ZQrcoHiITSrwJpCndQVkqg4hdBF2YEtJ8Eb/33Y/nusdfXZIix+o4/XqAfIIs pwHRogEqqVbhZAh7i2N7YITnEA/z5bpUvO1jhJbJ5Vd8sB+jAhHPe/MG8jrdplisd9ss 5hsIGUhgjTX8G+skY1c/5oJsyK2vSts84gpTxPS/6e+9pGIm9ChuzyyF1zpYSoRDYoZF M8O81IfGmCIJlXPPaMpHvr+rDpWEDiR33bwfBJFo96CXBKGCYvUE+0lnROEmWp+F2nBh UW+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701939437; x=1702544237; 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=P11i5JtOr3fzuVQuonrXRUS+CyP/6OsLPEuxS5gelmY=; b=vUbpKOopEpOLh7npE15dXKD6ZDWJgVqOgdE4lJ0U/WXYJxNwfkZ9xvK+fYTW480v8e k0lFtyM60Udsimj3IavahV0sAzGHTkbB6qsqV24G/xA7Vk9NUyI8bjor7f54WHBkW4Gy oIsmvUvsFUxqXYUf54TXMgLrYlntq8CC4n55dqnOfrlCUNyTgnLrH2SvYnQD91xuHxCC 6//bjwHSP9EIBOJRUbSFUdlw0Q+vhzwy+/iV4cDO0Rn5quXHdyoOTKjobzQllr5ASE7r XSx2hUzeX+GFKV7KjfvY4dhR5E2mQd+xkKzN7ejCbzXNX0kBPOn9CBmQ/wwRlemz8Ybw /83A== X-Gm-Message-State: AOJu0YzrISQH2/kJptSV8024EJjzkKp3fdlbx6qjBYHuSEKCcN9f/Woh t1L76wo9AcnRD8SDHUfn2nhRA1/Zha0= X-Received: by 2002:a05:6870:296:b0:1fa:fcd5:9ba6 with SMTP id q22-20020a056870029600b001fafcd59ba6mr2467290oaf.53.1701939437235; Thu, 07 Dec 2023 00:57:17 -0800 (PST) Received: from localhost.localdomain ([122.8.183.87]) by smtp.gmail.com with ESMTPSA id lw11-20020a0568708e0b00b001fb4aaf261csm193168oab.32.2023.12.07.00.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 00:57:16 -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 v5 0/4] riscv: sophgo: add clock support for sg2042 Date: Thu, 7 Dec 2023 16:57:08 +0800 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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: 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]); Thu, 07 Dec 2023 00:57:25 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784612857185619290 X-GMAIL-MSGID: 1784612857185619290 From: Chen Wang This series adds clock controller support for sophgo sg2042. Thanks, Chen --- Changes in v5: The patch series is based on v6.7-rc1. You can simply review or test the patches at the link [6]. - dt-bindings: improved yaml, such as: - add vendor prefix for system-ctrl property for clock generator. - Add explanation for system-ctrl property. - move sophgo,sg2042-clkgen.yaml to directly under clock folder. - fixed bugs for driver Makefile/Kconfig - continue cleaning-up debug print for driver code. Changes in v4: The patch series is based on v6.7-rc1. You can simply review or test the patches at the link [5]. - dt-bindings: fixed a dt_binding_check error. Changes in v3: The patch series is based on v6.7-rc1. You can simply review or test the patches at the link [3]. - DTS: don't use syscon but define sg2042 specific system control node. More background info can read [4]. - Updating minor issues in dt-bindings as per input from reviews. Changes in v2: The patch series is based on v6.7-rc1. You can simply review or test the patches at the link [2]. - Squashed the patch adding clock definitions with the patch adding the binding for the clock controller. - Updating dt-binding for syscon, remove oneOf for property compatible; define clock controller as child of syscon. - DTS changes: merge sg2042-clock.dtsi into sg2042.dtsi; move clock-frequency property of osc to board devicethree due to the oscillator is outside the SoC. - Fixed some bugs in driver code during testing, including removing warnings for rv32_defconfig. - Updated MAINTAINERS info. Changes in v1: The patch series is based on v6.7-rc1. You can simply review or test the patches at the link [1]. Link: https://github.com/unicornx/linux-riscv/commits/upstream-sg2042-clock-v1 [1] Link: https://github.com/unicornx/linux-riscv/commits/upstream-sg2042-clock-v2 [2] Link: https://github.com/unicornx/linux-riscv/commits/upstream-sg2042-clock-v3 [3] Link: https://lore.kernel.org/linux-riscv/MA0P287MB03329AE180378E1A2E034374FE82A@MA0P287MB0332.INDP287.PROD.OUTLOOK.COM/ [4] Link: https://github.com/unicornx/linux-riscv/commits/upstream-sg2042-clock-v4 [5] Link: https://github.com/unicornx/linux-riscv/commits/upstream-sg2042-clock-v5 [6] --- Chen Wang (4): dt-bindings: soc: sophgo: Add Sophgo system control module dt-bindings: clock: sophgo: support SG2042 clk: sophgo: Add SG2042 clock generator driver riscv: dts: add clock generator for Sophgo SG2042 SoC .../bindings/clock/sophgo,sg2042-clkgen.yaml | 53 + .../soc/sophgo/sophgo,sg2042-sysctrl.yaml | 34 + MAINTAINERS | 7 + .../boot/dts/sophgo/sg2042-milkv-pioneer.dts | 4 + arch/riscv/boot/dts/sophgo/sg2042.dtsi | 79 + 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 | 1355 +++++++++++++++++ drivers/clk/sophgo/clk-sophgo-sg2042.h | 226 +++ .../dt-bindings/clock/sophgo,sg2042-clkgen.h | 169 ++ 12 files changed, 1939 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/sophgo,sg2042-clkgen.yaml create mode 100644 Documentation/devicetree/bindings/soc/sophgo/sophgo,sg2042-sysctrl.yaml 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-clkgen.h base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86