summaryrefslogtreecommitdiff
path: root/drivers/clk
AgeCommit message (Collapse)Author
2026-03-09Merge tag 'v2026.04-rc4' into nextTom Rini
Prepare v2026.04-rc4
2026-03-04treewide: Remove Timesys from ADI ADSP maintenancePhilip Molloy
After years of developing the ADI ADSP platform, Timesys was purchased by another company and is no longer contracted to maintain the platform. Signed-off-by: Philip Molloy <[email protected]> Reviewed-by: Greg Malysa <[email protected]>
2026-02-28clk: imx6q: add ipu and ldb clocks and dependenciesBrian Ruley
This is required for the IPUv3 driver to migrate to CCF, changes are largely based on the Linux kernel equivalent. Add new gate2_flags function (also present in the Linux code) to set required flags. Add usboh clock to get rid of error. Signed-off-by: Brian Ruley <[email protected]>
2026-02-28clk: imx6q: apply clang-formatBrian Ruley
Reduces the number of checkpatch warnings in the following commits. Signed-off-by: Brian Ruley <[email protected]>
2026-02-24clk: stm32mp21: Add clock driver supportPatrice Chotard
Add clock driver support for STM32MP21 SoCs. Signed-off-by: Nicolas Le Bayon <[email protected]> Signed-off-by: Patrice Chotard <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2026-02-23Merge tag 'v2026.04-rc3' into nextTom Rini
Prepare v2026.04-rc3
2026-02-18Merge patch series "Add MT8195 support"Tom Rini
Julien Stephan <[email protected]> says: This series adds basic support for Mediatek soc MT8195: - clock driver - watchdog - add a new macro helper to define gate clock. Other driver can be cleaned later to use the new macro Other driver will be added later. It will also serve as basis for board support such as MT8395_EVK based on MT8195. Link: https://lore.kernel.org/r/[email protected]
2026-02-18clk: mediatek: add MT8195 clock driverChris-QJ Chen
The following clocks have been added for MT8195 SoC: apmixedsys, topckgen, infracfg These clocks driver are based on the ones present in the kernel: drivers/clk/mediatek/clk-mt8195-* Signed-off-by: Chris-QJ Chen <[email protected]> Signed-off-by: Julien Stephan <[email protected]>
2026-02-18clk: mediatek: implement GATE_FLAGS macroJulien Stephan
Add helper macro for mtk_gate, the same way, there are macros for FIXED_CLK, MUX and FACTOR. Signed-off-by: Julien Stephan <[email protected]>
2026-02-18Merge patch series "clk: mediatek: mt8188: fix clocks"Tom Rini
Julien Stephan <[email protected]> says: I recently submitted the clock driver for MT8188. I naively submitted a driver that was ported from the kernel driver, and mostly work to boot a kernel. Recently David Lechner, added support for the clk dump command for Mediatek clock drivers, so I used it to check the MT8188 and found several issues fixed on this series: - removed topckgen_cg, gates are now part of topckgen - fixed several parents clocks - added missing fixed clocks While at it, I also refactored a bit the driver to improve readability, and future additions to it. Link: https://lore.kernel.org/r/[email protected]
2026-02-18clk: mediatek: mt8188: refactor driver to improve readabilityJulien Stephan
Refactor some part of the driver to improve readability and future additions: - use CLK_TOP_NR_CLK for added clocks - rename the id map to make it more clear that the map applies to top clocks only - refactor the id map to improve readability - xtal2_rate is only used for PLL clocks, so only the apmixedsys clock tree needs it. Remove it elsewhere. Signed-off-by: Julien Stephan <[email protected]>
2026-02-18clk: mediatek: mt8188: fix some clock parentsJulien Stephan
Fix a number of clock parent definitions for MT8188 clocks. Signed-off-by: Julien Stephan <[email protected]>
2026-02-18clk: mediatek: mt8188: add missing fixed clockJulien Stephan
CLK_TOP_CLK13M was missing, add it. Signed-off-by: Julien Stephan <[email protected]>
2026-02-18clk: mediatek: mt8188: fix circular clock dependencyJulien Stephan
FACTOR1(CLK_TOP_APLL1_D4, CLK_TOP_APLL1, 1, 3) --> CLK_TOP_APLL1_D4 declares CLK_TOP_APLL1 as it's parents MUX_GATE(CLK_TOP_APLL1, apll1_parents, 0x0F8, 0, 4, 7) --> CLK_TOP_APLL1 declares apll1_parents as it's parents static const int apll1_parents[] = { CLK_TOP_CLK26M, CLK_TOP_APLL1_D4 }; --> CLK_TOP_APLL1_D4 is a parent of CLK_TOP_APLL1 Fix this, by correctly setting CLK_TOP_APLL1_DX parent to CLK_APMIXED_APLLX Signed-off-by: Julien Stephan <[email protected]>
2026-02-18clk: mediatek: mt8188: remove separate topckgen-cg driverJulien Stephan
Remove the separate topckgen-cg driver for handling clock gates in the topckgen address space. Commit 8aeeeff50d46 ("clk: mediatek: allow gates in topckgen drivers") added support for gates in topckgen driver. This commit fixes MT8188 driver, the same way commit ba207d7f54f9 ("clk: mediatek: mt8365: remove separate topckgen-cg driver") does for MT8365. Signed-off-by: Julien Stephan <[email protected]>
2026-02-17Merge patch series "treewide: Clean up usage of DECLARE_GLOBAL_DATA_PTR"Tom Rini
Peng Fan (OSS) <[email protected]> says: This patch set primarily removes unused DECLARE_GLOBAL_DATA_PTR instances. Many files declare DECLARE_GLOBAL_DATA_PTR and include asm/global_data.h even though gd is never used. In these cases, asm/global_data.h is effectively treated as a proxy header, which is not a good practice. Following the Include What You Use principle, files should include only the headers they actually depend on, rather than relying on global_data.h indirectly. This approach is also adopted in Linux kernel [1]. The first few patches are prepartion to avoid building break after remove the including of global_data.h. A script is for filtering the files: list=`find . -name "*.[ch]"` for source in ${list} do result=`sed -n '/DECLARE_GLOBAL_DATA_PTR/p' ${source}` if [ "${result}" == "DECLARE_GLOBAL_DATA_PTR;" ]; then echo "Found in ${source}" result=`sed -n '/\<gd\>/p' ${source}` result2=`sed -n '/\<gd_/p' ${source}` result3=`sed -n '/\<gd->/p' ${source}` if [ "${result}" == "" ] && [ "${result2}" == "" ] && [ "${result3}" == "" ];then echo "Cleanup ${source}" sed -i '/DECLARE_GLOBAL_DATA_PTR/{N;/\n[[:space:]]*$/d;s/.*\n//;}' ${source} sed -i '/DECLARE_GLOBAL_DATA_PTR/d' ${source} sed -i '/global_data.h/d' ${source} git add ${source} fi fi done [1] https://lpc.events/event/17/contributions/1620/attachments/1228/2520/Linux%20Kernel%20Header%20Optimization.pdf CI: https://github.com/u-boot/u-boot/pull/865 Link: https://lore.kernel.org/r/[email protected]
2026-02-17treewide: Clean up DECLARE_GLOBAL_DATA_PTR usagePeng Fan
Remove DECLARE_GLOBAL_DATA_PTR from files where gd is not used, and drop the unnecessary inclusion of asm/global_data.h. Headers should be included directly by the files that need them, rather than indirectly via global_data.h. Reviewed-by: Patrice Chotard <[email protected]> #STMicroelectronics boards and STM32MP1 ram test driver Tested-by: Anshul Dalal <[email protected]> #TI boards Acked-by: Yao Zi <[email protected]> #TH1520 Signed-off-by: Peng Fan <[email protected]>
2026-02-14Replace TARGET namespace and cleanup properlyTien Fong Chee
TARGET namespace is for machines / boards / what-have-you that building U-Boot for. Simply replace from TARGET to ARCH make things more clear and proper for ALL SoCFPGA. Signed-off-by: Brian Sune <[email protected]> Reviewed-by: Tien Fong Chee <[email protected]> # Conflicts: # drivers/ddr/altera/Makefile
2026-02-14clk: altera: agilex: Exclude AGILEX_L4_SYS_FREE_CLK from enable/disable ↵Alif Zakuan Yuslaimi
operations AGILEX_L4_SYS_FREE_CLK is a free-running clock with no gate control in hardware, therefore attempting to enable or disable it is not applicable. Update the clock driver to explicitly exclude this clock ID from enable/disable operations by returning -EOPNOTSUPP in bitmask_from_clk_id() and treating this as a no-op in the socfpga_clk_enable() and socfpga_clk_disable() functions. This prevents unnecessary register access for clocks that cannot be gated and ensures clean handling when the clock is present in the device tree. Signed-off-by: Alif Zakuan Yuslaimi <[email protected]> Reviewed-by: Tien Fong Chee <[email protected]>
2026-02-14socfpga: agilex: fix NAND clock handlingDinesh Maniyam
In v2025.10, the Agilex clock driver was updated to support clk_enable() and clk_disable() using clock-ID based bitmasks. However, only AGILEX_NAND_CLK was implemented, while the NAND DT node still referenced both nand and nand_x clocks. Since AGILEX_NAND_X_CLK is not defined in the clock driver or the clock-ID specification, clk_enable() failed during NAND probe. As a result, the Denali NAND controller never completed initialization. Fix this by mapping the NAND X clock to the existing l4_mp clock bitmask, aligning the DT expectations with the clock driver and restoring proper NAND controller initialization. Signed-off-by: Dinesh Maniyam <[email protected]> Reviewed-by: Tien Fong Chee <[email protected]>
2026-02-10drivers/clk/clk_zynqmp.c: get rid of compiler warning for !CONFIG_CMD_CLK buildsPeter Korsgaard
When built without CONFIG_CMD_CLK, we get a warning about the unused clk_names variable: ../drivers/clk/clk_zynqmp.c:153:27: warning: ‘clk_names’ defined but not used [-Wunused-const-variable=] 153 | static const char * const clk_names[clk_max] = { So also guard it with CONFIG_CMD_CLK to get rid of that. Signed-off-by: Peter Korsgaard <[email protected]> Reviewed-by: Quentin Schulz <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2026-02-10drivers/clk/Kconfig: fix "related" typo in help textPeter Korsgaard
It looks like the original zynqmp typo was copied to versal as well. Fix both. Signed-off-by: Peter Korsgaard <[email protected]> Reviewed-by: Quentin Schulz <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2026-02-03clk: sunxi: Add MBUS Master Clock Gating RegisterRichard Genoud
Add MBUS Master Clock Gating Register for H6 and H616 For H6/H616, the NAND controller needs the MBUS NAND clock along with CLK_NAND0/1 and CLK_BUS_NAND. The bit locations are from H6/H616 User Manuals. Signed-off-by: Richard Genoud <[email protected]> Signed-off-by: Michael Trimarchi <[email protected]>
2026-01-29clk: stm32: Update clock management for STM32MP13/25Patrice Chotard
During clock's registration, clock's name are used to establish parent - child relation. On STM32MP13 and STM32MP25, most of SCMI clocks are parent clocks. Since commit fdb1bffe2827 ("clk: scmi: Postpone clock name resolution"), all scmi clocks are named by default "scmi-%zu" until they are enabled, it breaks clocks registration and boot process for STM32MP13/25 platforms. Rework the STM32 core clock driver and STM32MP13/25 clock description to use clock index instead of their real name. Introduce struct clk_parent_data which allows to identify parent clock either by index or by name. Name is only used for particular clocks provided by IP which are clock provider as i2s/i2s_ckin, usb0/ck_usbo_48m, and ltdc/ck_ker_ltdc. STM32_GATE() and STM32_COMPOSITE_NOMUX macros are updated in order to use parent clock index. As STM32MP13 supports both SPL and SCMI boot, keep using an array with clock's name for SPL. Fixes: fdb1bffe2827 ("clk: scmi: Postpone clock name resolution") Reviewed-by: Patrick Delaunay <[email protected]> Signed-off-by: Patrice Chotard <[email protected]>
2026-01-29clk: stm32mp13: Reorder include filesPatrice Chotard
Reorder include following rules available here : https://docs.u-boot.org/en/latest/develop/codingstyle.html#include-files Reviewed-by: Patrick Delaunay <[email protected]> Signed-off-by: Patrice Chotard <[email protected]>
2026-01-21clk: mtk: use IS_ERR_VALUE() to check rate return valuesDavid Lechner
Replace casting with long to IS_ERR_VALUE() macro to check for error return values from rate calculation functions. This is the recommended way to check the return value from clock rate functions. Signed-off-by: David Lechner <[email protected]>
2026-01-21clk: mediatek: fix mux clocks with mapped parent IDsDavid Lechner
Pass the unmapped parent ID when setting parent for mux clocks. For technical reasons, some Mediatek clock driver have a mapping between the clock IDs used in the devicetree and ID used in the generic clock framework. The mtk_clk_mux_set_parent() function is comparing the passed mapped parent ID against the unmapped IDs in the chip-specific data structures. Before this change, we were passing the mapped parent ID. When there is a mapping, this resulted in buggy behavior (usually just incorrectly failing to find a match and returning an error). We need to pass the unmapped ID of the parent clock instead for the matching to work correctly. Since the reverse lookup is a bit verbose, a helper function is added to keep the code clean. Fixes: b1358915728b ("clk: mediatek: add of_xlate ops") Signed-off-by: David Lechner <[email protected]>
2026-01-21Merge patch series "clk: clk-uclass: debug message improvements"Tom Rini
David Lechner <[email protected]> says: I needed to debug some clock issues and found some places where pointer addresses were being printed when names were available. The addresses are not very helpful, but the names are. So here a couple of patches to improve that. Link: https://lore.kernel.org/r/[email protected]
2026-01-21clk: clk-uclass: used dev name in debug messageDavid Lechner
Consistently use the device name in debug messages. The clk-uclass file previously had a mix of printing the dev pointer and the device name. Changing all to use the device name makes the debug messages more useful. Signed-off-by: David Lechner <[email protected]>
2026-01-21clk: clk-uclass: fix format specifier for ofnode nameDavid Lechner
Change the format specifier from %p to %s when printing the ofnode name so that the actual name is printed instead of the pointer address. Signed-off-by: David Lechner <[email protected]>
2026-01-14clk: qcom: sa8775p: Fix USB clock configuration and add resetsBalaji Selvanathan
Correct USB30 primary clock RCG configuration and add missing USB3_PRIM_PHY_AUX_CMD_RCGR RCG configuration. Above taken from Linux commit 08c51ceb12f7 ("clk: qcom: add the GCC driver for sa8775p") Add missing USB3_PRIM_PHY_PIPE_CLK gate clock definition. Extend reset map with USB-related BCR entries and video BCR for comprehensive reset control support. Signed-off-by: Balaji Selvanathan <[email protected]> Link: https://patch.msgid.link/[email protected] [casey: indentation fix] Signed-off-by: Casey Connolly <[email protected]>
2026-01-14clk: qcom: sa8775p: Add QUP serial engine clock supportSwathi Tamilselvan
Add clock gate definitions and entries for QUP (Qualcomm Universal Peripheral) serial engine clocks across all four wrappers on SA8775P. This enables proper clock management for I2C, SPI, and UART peripherals connected to the QUP blocks. This resolves the "unknown clock ID 133" error for UART10 and provides complete QUP clock infrastructure for the platform. Signed-off-by: Swathi Tamilselvan <[email protected]> Signed-off-by: Balaji Selvanathan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2026-01-14clk/qcom: sc7280: add more QUP clocksCasey Connolly
Add more clocks for UART2, i2c9 and a few others. This is enough to get the rubikpi 3 working. Link: https://patch.msgid.link/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2026-01-14clk/qcom: qcm2290: Add SDCC1 apps clock frequency tableLoic Poulain
Add support for configuring the SDCC1 apps clock on QCM2290 by introducing a frequency table and enabling dynamic rate setting. Previously, the clock was assumed to be fixed at 384 MHz by firmware, which limited flexibility and correctness when selecting optimal rates for SD/MMC operations. Suggested-by: Sumit Garg <[email protected]> Signed-off-by: Loic Poulain <[email protected]> Reviewed-by: Sumit Garg <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Casey Connolly <[email protected]>
2026-01-12clk: mediatek: mt8365: fix missing topckgen IDsDavid Lechner
Use a ID map to add clocks for the missing CLK_TOP_CLK32K and CLK_TOP_CLK26M that were not included in the devicetree definitions. This fixes getting the rate of any clock that had one of these as a parent. CLK_TOP_UNIVPLL does not appear to be a real clock, so it is omitted now since we can do that with the ID map as well. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: mt8365: remove separate topckgen-cg driverDavid Lechner
Remove the separate topckgen-cg driver for handling clock gates in the topckgen address space. The devicetree bindings for this were not acceptable upstream because it was creating a separate clock controller using the same address space as the main topckgen clock controller. The gates are moved to the topckgen tree instead. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: allow gates in topckgen driversDavid Lechner
Add handling for gates in the topckgen clk drivers. This avoids the need to have separate topckgen-cg drivers and devicetree nodes for the same address space and clock ID range. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: mt8365: split struct mtk_clk_treeDavid Lechner
Split the struct mtk_clk_tree for MT8365 into separate structures for the apmixedsys, topckgen and infracfg clock controllers. This is needed to support moving the topckgen gates into the struct mtk_clk_tree. Since apmixedsys can also have gates, we need separate structures. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: mt8365: fix some clock parentsDavid Lechner
Fix a number of clock parent definitions for MT8365 clocks. Most of these are just informational or don't make a function change. The clocks with the new PLL_FACTOR2 macro and the change in apu_parents are fixing actual bugs. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: fix fixed clock parentsDavid Lechner
Add a flags field to struct mtk_fixed_clk to allow properly resolving the parent clock. All chip-specific clocks are updated to populate this field correctly. The parent is currently only used for printing debug information, so there are no functional bugs being fixed. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: add separate gates_offs for cg gatesDavid Lechner
Add a gates_offs field to struct mtk_cg_priv and use that instead of struct mtk_clk_tree.gates_offs. Prior to this change, struct mtk_clk_tree.gates_offs could be the offset of struct mtk_clk_tree.gates or struct mtk_cg_priv.gates depending on the context. This was confusing and error-prone. For example, in mt8365 there is one set of gates that needs an offset and one that does not that share the same struct mtk_clk_tree. This is fixed in this patch by giving the correct offset for each gate separately. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: mt8365: fix missing and out of order clocksDavid Lechner
Fix a few missing clocks and even more clocks in the incorrect order. Since the clocks are looked up by index, having them out of order or skipping an ID will lead to incorrect clocks being used. Signed-off-by: David Lechner <[email protected]>
2026-01-12Merge patch series "clk: mediatek: implement of_xlate and dump"Tom Rini
David Lechner <[email protected]> says: I started looking into fixing some bugs in the mt8365 clock driver and realized that there was no way to inspect or debug the clock trees. I set out to implement the dump function to help with this. The driver architecture didn't make this easy since there was no way to know the number of elements in each of the clock arrays. The first few patches in this series are adding fields to the data structures to hold this information. Once that was fixed, I was still getting crashes due to other bugs. To work around this, I implemented the of_xlate function to validate clk IDs as early as possible and return errors instead of crashing when requested IDs are invalid. This also makes use of the new size fields to prevent out of bounds array accesses. There are a couple of drivers that remap IDs, so there are a few extra patches to handle that as well. Then finally, I was able to implement the dump function to print out the clock tree information without crashing. In the v1 cover letter, there is an example of the output (it is quite long and doesn't need to be repeated here). Link: https://lore.kernel.org/r/[email protected]
2026-01-12clk: mediatek: implement dump callbacksDavid Lechner
Implement dump callbacks for Mediatek clocks. On these platforms, there are 100s of clocks, so it can be easy to miss mistakes. The dump callbacks will be useful for debugging and verifying clock configs. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: mt7623: set unmapped IDs to -1David Lechner
Add range initializers to the id_offs_map arrays in the mt7623 clk driver to set unmapped IDs to -1. This prevents accidental usage of unmapped IDs that would otherwise map to 0. mtk_common_clk_of_xlate() checks these values for < 0 and returns -ENOENT in that case. A range initializer covering the entire array is used since it is less error-prone than manually looking up the value of each macro in the existing initializers and checking for gaps. It is placed first so that the specific initializers override it. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: clarify mapped vs. unmapped IDDavid Lechner
Update documentation comments to clarify the difference between which .id fields are mapped (only struct clk.id) vs. unmapped (all struct mtk_*.id and .parent fields). The unmapped IDs are the ones defined in the devicetree bindings, while the mapped IDs are the ones used as the index into the various clk arrays. Also fix spelling of "parent" while we are touching this. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: add of_xlate opsDavid Lechner
Add driver-specific of_xlate ops for MediaTek clocks. This provides better checking of the args passed from the devicetree. Compared to the default of_xlate implementation, this will return -EINVAL if there are zero args (id is always required) and -ENOENT if the id is out of range for the clock type. This will protect against out of bounds array accesses later on when the clk->id is used to index into the clock data arrays. If there is a id_offs_map, then we have to do that translation first before checking the id to see if it is in range. There is no sense in doing the mapping multiple times, so we save the mapped ID in clk->id and remove mtk_clk_get_id(). mtk_clk_find_parent_rate() also had to be updated since it creates a temporary struct clk to represent the parent clock. It now has do the translation in case the parent clock also uses an id_offs_map. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: organize infrasys functionsDavid Lechner
Move all infrasys ops and related functions next to each other in the file for better organization. Generally all ops functions are grouped together like this for the other ops types (apmixedsys, topckgen, etc). However the infrasys functions were mixed in with the other sections making them harder to find. This will also give a logical place to add any future infrasys-specific functions. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: add array size field for id_offs_mapDavid Lechner
Add id_offs_map_size field to struct mtk_clk_tree and populate it for all existing drivers. Currently, there is no bounds checking when accessing the id_offs_map array. Adding this field will allow for bounds checking in the future. Signed-off-by: David Lechner <[email protected]>
2026-01-12clk: mediatek: add array size fields to cg gatesDavid Lechner
Add num_gates field to struct mtk_cg_priv and populate it for all existing drivers. Currently, there is no bounds checking when accessing the gates array. Adding this field will allow for bounds checking in the future. Signed-off-by: David Lechner <[email protected]>