[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240110-clk-th1520-v1-0-8b0682567984@tenstorrent.com>
Date: Wed, 10 Jan 2024 08:35:14 -0800
From: Drew Fustini <dfustini@...storrent.com>
To: Jisheng Zhang <jszhang@...nel.org>, Guo Ren <guoren@...nel.org>,
Fu Wei <wefu@...hat.com>, Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>, Yangtao Li <frank.li@...o.com>
Cc: linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-clk@...r.kernel.org, devicetree@...r.kernel.org,
Emil Renner Berthing <emil.renner.berthing@...onical.com>,
Han Gao <gaohan@...as.ac.cn>, Xi Ruoyao <xry111@...111.site>,
Robert Nelson <robertcnelson@...gleboard.org>,
Jason Kridner <jkridner@...gleboard.org>,
Drew Fustini <dfustini@...storrent.com>,
Drew Fustini <dfustini@...storrent.org>,
Drew Fustini <drew@...storrent.org>
Subject: [PATCH RFC 0/3] clk: thead: add support for T-HEAD TH1520 AP clock
controller
This series adds support for the AP sub system clock controller in the
T-HEAD TH1520. This include CPU, DPU, GMAC and TEE PLLs.
Yangtao Li originally submitted this series back in May [1]. Jisheng
made additional improvements and then passed on the work in progress to
me. The driver code is cleaner than the version in the T-Head SDK [2].
I fixed checkpatch and dt_binding_check warnings along with:
- deduplicated CLK_NPU and CLK_NPU_AXI number in header
- corrected the npu_clk enable bit
- fixed c910_i0_clk reg typo
I am marking this as an RFC because I have not been able to get the eMMC
controller to work with the clock driver yet. The T-Head SDK does have
full clock driver support but it still uses a fixed clock for the mmc
controller. I've not yet determined why that is.
According to the documentation [4], the "emmc sdio ref clk" is listed as
792 MHz in table "4.3.4 Clock Frequency of Key Module". PERI_CLK_CFG
contains the clock gate. 792 MHz divided by 4 is 198 MHz which is the
fixed clock frequency used for the mmc controller. However, I can't seem
to figured how the divider is controlled for the "emmc sdio ref clk".
Anyways, Emil is working on the pinctrl driver and Conor asked about the
state of the clock driver [5]. I thought it best to send this RFC now so
that discussion can take place on the list.
Thank you,
Drew
[1] https://lore.kernel.org/linux-riscv/20230515054402.27633-1-frank.li@vivo.com/
[2] https://openbeagle.org/beaglev-ahead/beaglev-ahead-linux/-/blob/beaglev-v5.10.113-1.1.2/drivers/clk/thead/clk-light-fm.c
[3] https://openbeagle.org/beaglev-ahead/beaglev-ahead-linux/-/blob/beaglev-v5.10.113-1.1.2/arch/riscv/boot/dts/thead/light.dtsi
[4] https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf
[5] https://lore.kernel.org/linux-riscv/20240109-boggle-frugality-03a77cab8308@spud/
Signed-off-by: Drew Fustini <dfustini@...storrent.com>
---
Jisheng Zhang (1):
clk: thead: add support for T-HEAD TH1520 AP clocks
Yangtao Li (2):
dt-bindings: clock: Add T-Head TH1520 AP clock definitions
dt-bindings: clock: Document T-Head TH1520 AP clock controller
.../bindings/clock/thead,th1520-clk-ap.yaml | 65 ++
MAINTAINERS | 3 +
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 | 1018 ++++++++++++++++++++
include/dt-bindings/clock/thead,th1520-clk.h | 96 ++
8 files changed, 1198 insertions(+)
---
base-commit: 8cb47d7cd090a690c1785385b2f3d407d4a53ad0
change-id: 20240109-clk-th1520-399429299d51
Best regards,
--
Drew Fustini <dfustini@...storrent.com>
Powered by blists - more mailing lists