Message ID | 20240623-th1520-clk-v2-0-ad8d6432d9fb@tenstorrent.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org> 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 8E61EC2D0D1 for <linux-riscv@archiver.kernel.org>; Mon, 24 Jun 2024 02:16:05 +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:Cc:To:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=fODkoZft1WLDVQ1+jxLAOTXhMzRbc0MB0WzZnclq5NU=; b=XN1mCzM5+nlHHt nBFUeMbd9JAjI8kigGK8ViluEi1QGMKogyndXp9P+v27edJoOzKT3g60KNzFOzsOGuJ+0zzYMGU3N 30DMkVoPf8hrIP61Iu4Z6RAgrJ+dtdC/AyKDnEWGZuC4MtYAlWUH0t1/zRuLINNmdOiMNp5HNq9f0 XB3p7aHamsLGPg/RF8eHSHcrt+CgHooI0O9WHgmN5GyM19Z+jwiy0OC2a/n1kx2wXxpcKuWtOn+QL EEnk/JfV1mtAVYhy9WEP8lMhM/jXWNCUBJCAEZ0LXtovGuSLZDus6WlsJdpY4Oglxp22HP7WgRmNz 6eeWv+ResdjObApmJr0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLZFJ-0000000FGIz-1vuF; Mon, 24 Jun 2024 02:15:53 +0000 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLZFC-0000000FGFw-39fb for linux-riscv@lists.infradead.org; Mon, 24 Jun 2024 02:15:48 +0000 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6f971cb3c9cso2097052a34.1 for <linux-riscv@lists.infradead.org>; Sun, 23 Jun 2024 19:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenstorrent.com; s=google; t=1719195344; x=1719800144; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=cG0rkekfA0/04oEi1+NIQK8l/D8qu4Ajnp33da6VKb8=; b=Zy2AOTcd2cif7Nwz5G0bMjhEjB03pCsKYBjHpBSxo7sq/IH1NdYBmvrr53vaI0J+GE BPv1veulhTidxmtEyLrsWsV8BWEXk1z3vA1f74qkQuW71+PZ2RZdLDquX++Dl07tUWrr SvaYPpG1ur47i8IBjkJKzQ0rm/2QdxI7SFG73TrzvJWxNhbigS6dvJJCEtfy6ObKIX04 iqJcqyHo91Ca5myuAeZ6x1eF0Za6Q9SlzmJhEqFZO6gZrsGGYST8A/7sENH/ay3NjnpG OWlVkV0mDJ7DfD79Z1zPyY1haiJn2LM6oRjODBNQniPnyKPFzdOLq8+B5o4tahlSb/us c75w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719195344; x=1719800144; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cG0rkekfA0/04oEi1+NIQK8l/D8qu4Ajnp33da6VKb8=; b=WKXTqfCrM44aBlE26oXovxmy51H5RRXPUxHwmBLv69CO/r9U3nXUdyc85K+/8AdNqV MzHDuCZ39ErqwBBtoeuQ7HQTO9mQNG/K8mrcEVDJ880wB4DpaR1+9H6VjzXdFCr3wA54 DAppxSa6EK3Mi64xAWd+i26uOjaxJHL3/vaQXvmvImcAZGB5kj7D/dbl+hTnxCxCN+bA Hdv6FWa80dPdESMw0FXb07hlEn9fudkYg5N0Kg24i1d6J+lgyWx9CtLxgJiaDq2W+Upz fIweWNvz9hNj5O5kJjv4y64jz+0h/ZKCQqrKeaAgwA+3n/goielX3SPO+XWKTyY0SShQ JrlQ== X-Gm-Message-State: AOJu0Yy1aSct+G33/6nFdOJCspk3diL1RVg1x+CoUlhUMk2hjWQo+NiT wFvUyVFpE0Y666yTLJnISSjQ78Vqat/GAVrd36NkGXVoQoMlyABbQ+ZrXN5z/kI= X-Google-Smtp-Source: AGHT+IG4tN22FOX8kFP/2mE6a1+JdImZuY7NBg6dlaS2QQXJKWOjfrDeHKXCWj/E2BBFso0FuA0m2g== X-Received: by 2002:a05:6870:2183:b0:258:37e7:a1d0 with SMTP id 586e51a60fabf-25d06c7d88cmr3516225fac.30.1719195344471; Sun, 23 Jun 2024 19:15:44 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1802:170:1584:936e:5eb0:fab]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-706511b137csm5071770b3a.86.2024.06.23.19.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jun 2024 19:15:44 -0700 (PDT) From: Drew Fustini <dfustini@tenstorrent.com> Subject: [PATCH v2 0/7] clk: thead: Add support for TH1520 AP_SUBSYS clock controller Date: Sun, 23 Jun 2024 19:12:30 -0700 Message-Id: <20240623-th1520-clk-v2-0-ad8d6432d9fb@tenstorrent.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAA7WeGYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyjHQUlJIzE vPSU3UzU4B8JSMDIxMDMyMj3ZIMQ1MjA93knGzdVAtD40RL8yTLVEMzJaCGgqLUtMwKsGHRsbW 1ADdeJAVcAAAA To: Jisheng Zhang <jszhang@kernel.org>, Guo Ren <guoren@kernel.org>, Fu Wei <wefu@redhat.com>, Yangtao Li <frank.li@vivo.com>, Thomas Bonnefille <thomas.bonnefille@bootlin.com>, Emil Renner Berthing <emil.renner.berthing@canonical.com>, Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>, Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley <conor+dt@kernel.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu> Cc: linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Drew Fustini <dfustini@tenstorrent.com>, Conor Dooley <conor.dooley@microchip.com> X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1719195343; l=5635; i=dfustini@tenstorrent.com; s=20230430; h=from:subject:message-id; bh=JijfjFPlraHiUgnawO2/kxVwba0m23O7FMLW3giYAVE=; b=F7q7iNFfGLlmb776JDHJ7tm1chn5J68zQ7WbJCM4oKJk4x9bLeDQswpYtOZs8I+SqZwcLw+e1 iBLTwDyn374BQLTAn520AvakNQv6cVPk72xCQx7iJKbq9+sTeALDIk5 X-Developer-Key: i=dfustini@tenstorrent.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240623_191547_014861_16C0A414 X-CRM114-Status: GOOD ( 21.00 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-riscv/> List-Post: <mailto:linux-riscv@lists.infradead.org> List-Help: <mailto:linux-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" <linux-riscv-bounces@lists.infradead.org> Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org |
Series |
clk: thead: Add support for TH1520 AP_SUBSYS clock controller
|
expand
|
This series adds support for the AP sub-system clock controller in the T-Head TH1520 [1]. Yangtao Li originally submitted this series in May 2023 [2]. Jisheng made additional improvements and then passed on the work in progress to me. Changes in v2: - Add clock property to the gpio nodes after Conor asked why they were missing. These clock gates correspond to enable bits in PERI_CLK_CFG. - Drop 2 cell address and size properties from the binding example per Conor and add Reviewed-by from from Conor. Changes in v1: - Split th1520_clks into groups for gate, mux, div, pll - Convert gate clocks to devm_clk_hw_register_gate_parent_data() - Convert mux clocks to devm_clk_hw_register_mux_parent_data_table() - Split the PLL recalculation into th1520_pll_vco_recalc_rate() and th1520_pll_postdiv_recalc_rate(). Based on Emil's comments in v1, add logic to handle the fractional portion of feedback divide value when the delta-sigma modulator (DSM) is active. - Drop clock-names from the binding per Stephan to avoid relying on anything other than the cell index when describing clk_parent_data (note: I dropped Rob's Rb because I changed the binding patch) - Rename reg/reg2 to cfg0/cfg1 to match the SoC documentation - Rename struct for pll clocks from ccu_mdiv to ccu_pll - Rebase on v6.10-rc3, remove the dts node reordering patch from v3 now that it is in mainline Changes in RFC v3 [3]: - Drop redundant new line and unused clk label from the dts example in the DT binding which I failed to fix in v2. - Add patch [4] from Thomas Bonnefille that fixes dts node ordering in th1520.dtsi. Conor has already merged it into riscv-dt-for-next so the dts patches in this series are based on top of that. - Remove fixed uart clock and converted uart DT nodes to use clocks from the clock controller. - Remove fixed apb clock and converted the dma controller and timer DT nodes to use a clock from the clock controller. - Made ccu_disable_helper() and ccu_enable_helper() to static functions - Follow the advice from Stephen Boyd in Yangtao's original series to not use strings for clk tree topology. Created clk_parent_data arrays to be used with CLK_HW_INIT_PARENTS_DATA instead of parent strings. - Rebase on top of v6.9-rc7 Changes in RFC v2 [5]: - squash the header file patch into the DT schema patch - describe the changes I made to original series in the cover letter instead of the individual patches - fix my typo in my email address Changes in RFC v1 [6] from the original series: - corrected the npu_clk enable bit - deduplicated CLK_NPU and CLK_NPU_AXI number in header - fixed c910_i0_clk reg typo - fixed checkpatch and dt_binding_check warnings - rebased on v6.9-rc5 - revised commit descriptions Thank you, Drew [1] https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf [2] https://lore.kernel.org/all/20230515054402.27633-1-frank.li@vivo.com/ [3] https://lore.kernel.org/all/20240506-th1520-clk-v3-0-085a18a23a7f@tenstorrent.com/ [4] https://lore.kernel.org/all/20240425082138.374445-1-thomas.bonnefille@bootlin.com/ [5] https://lore.kernel.org/all/20240426-th1520-clk-v2-v2-0-96b829e6fcee@tenstorrent.com/ [6] https://lore.kernel.org/all/20240110-clk-th1520-v1-0-8b0682567984@tenstorrent.com/ To: Jisheng Zhang <jszhang@kernel.org> To: Guo Ren <guoren@kernel.org> To: Fu Wei <wefu@redhat.com> To: Yangtao Li <frank.li@vivo.com> To: Thomas Bonnefille <thomas.bonnefille@bootlin.com> To: Emil Renner Berthing <emil.renner.berthing@canonical.com> To: Michael Turquette <mturquette@baylibre.com> To: Stephen Boyd <sboyd@kernel.org> To: Rob Herring <robh@kernel.org> To: Krzysztof Kozlowski <krzk+dt@kernel.org> To: Conor Dooley <conor+dt@kernel.org> To: Paul Walmsley <paul.walmsley@sifive.com> To: Palmer Dabbelt <palmer@dabbelt.com> To: Albert Ou <aou@eecs.berkeley.edu> Cc: linux-riscv@lists.infradead.org Cc: linux-clk@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Drew Fustini <dfustini@tenstorrent.com> --- Drew Fustini (7): dt-bindings: clock: Document T-Head TH1520 AP_SUBSYS controller clk: thead: Add support for T-Head TH1520 AP_SUBSYS clocks riscv: dts: thead: Add TH1520 AP_SUBSYS clock controller riscv: dts: thead: change TH1520 uart nodes to use clock controller riscv: dts: thead: change TH1520 mmc nodes to use clock controller riscv: dts: thead: update TH1520 dma and timer nodes to use clock controller riscv: dts: thead: add clock to TH1520 gpio nodes .../bindings/clock/thead,th1520-clk-ap.yaml | 53 + MAINTAINERS | 3 + arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 12 - .../boot/dts/thead/th1520-lichee-module-4a.dtsi | 12 - arch/riscv/boot/dts/thead/th1520.dtsi | 73 +- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/thead/Kconfig | 12 + drivers/clk/thead/Makefile | 2 + drivers/clk/thead/clk-th1520-ap.c | 1086 ++++++++++++++++++++ include/dt-bindings/clock/thead,th1520-clk-ap.h | 96 ++ 11 files changed, 1290 insertions(+), 61 deletions(-) --- base-commit: 83a7eefedc9b56fe7bfeff13b6c7356688ffa670 change-id: 20240622-th1520-clk-e813a97b9e16 Best regards,