summaryrefslogtreecommitdiff
path: root/drivers/clk
AgeCommit message (Collapse)Author
3 daysclk: stm32: Pass udevice pointer to clk_register_composite()Marek Vasut
The clk_register_composite() does clk_resolve_parent_clk() look up, which requires valid udevice pointer. Do not pass NULL, pass a valid device pointer to prevent hang on registering ck_usbo_48m clock on STM32MP13xx. Signed-off-by: Marek Vasut <marek.vasut@mailbox.org> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
14 daysMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-samsungTom Rini
- Fix issues reported by smatch - exynos4210-origen cleanups - e850-96 improvements
2025-09-01clk: exynos: Fix always true testAndrew Goodbody
In exynos7420_peric1_get_rate the variable ret is declared as an 'unsigned int' but is then used to receive the return value of clk_get_by_index which returns an int. The value of ret is then tested for being less than 0 which will always fail for an unsigned variable. Fix this by declaring ret as an 'int' so that the test for the error condition is valid. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2025-08-30rockchip: clk: clk_rk3528: Add dummy CLK_REF_PCIE_INNER_PHY supportJonas Karlman
Add dummy support for the CLK_REF_PCIE_INNER_PHY clock to allow probe of the phy-rockchip-naneng-combphy driver on RK3528. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-30rockchip: clk: clk_rk3576: Add dummy CLK_REF_PCIEx_PHY supportJonas Karlman
Add dummy support for the CLK_REF_PCIEx_PHY clocks to allow probe of the phy-rockchip-naneng-combphy driver on RK3576. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-08-26Merge tag 'u-boot-at91-fixes-2025.10-a' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-at91 First set of u-boot-at91 fixes for the 2025.10 cycle: This set includes smatch fixes for clocks and mmc and one QSPI fix.
2025-08-13clk: at91: Fix use of unsigned loop indexAndrew Goodbody
The use of the unsigned variable 'i' as a loop index leads to the test for i being non-negative always being true. Instead declare 'i' as an int so that the for loop will terminate as expected. If the original for loop completes 'i' will be 1 past the end of the array so decrement it in the subsequent error path to prevent an out of bounds access occurring. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-13clk: at91: Fix testing of unsigned variable to be negativeAndrew Goodbody
The variable 'index' is declared as unsigned but used to receive the return value of a function returning 'int'. This value is then tested for being less than zero to detect an error condition but as index is unsigned this can never be true. Change the variable 'index' to be an int so that the error condition can be detected. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-08Merge tag 'u-boot-socfpga-next-20250808' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-socfpga This pull request introduces initial U-Boot support for Agilex7 M-series, along with several enhancements and cleanups across existing Agilex platforms. Key changes include new board support, DDR driver additions, updated device trees, and broader SoCFPGA SPL improvements. Highlights: - Agilex7 M-series bring-up: - Basic DT support and board initialization for Agilex7 M-series SoC and SoCDK. - New sdram_agilex7m DDR driver with UIBSSM mailbox support and HBM support. - Clock driver support for Agilex7 M-series. - New defconfig: socfpga_agilex7m_defconfig. - Agilex and Agilex5 enhancements: - Improved SPL support: ASYNC interrupt enabling, system manager init refactor, and cold scratch register usage. - Updated firewall probing and watchdog support in SPL. - Cleaned up DDR code, added secure region support for ATF, and improved warm reset handling. - Device Tree and config updates: - Migration to upstream Linux DT layout for Agilex platforms. - Consolidated socfpga_agilex_defconfig and removed deprecated configs. - Platform-specific environment variables for Distro Boot added. - Driver fixes and cleanups: - dwc_eth_xgmac and clk-agilex cleanup and improvements. - Several coverity and style fixes. Contributions in this PR are from Alif Zakuan Yuslaimi, Tingting Meng, and Andrew Goodbody. This patch set has been tested on Agilex 5 devkit, Agilex devkit and Agilex7m devkit. Passing all pipeline tests at SoCFPGA U-boot custodian https://source.denx.de/u-boot/custodians/u-boot-socfpga/-/pipelines/27318
2025-08-08clk: altera: Add clock support for Agilex7 M-seriesTingting Meng
Agilex7 M-series reuse the clock driver from Agilex. Signed-off-by: Tingting Meng <tingting.meng@altera.com> Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com> Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-08-08drivers: clk: agilex: Replace status polling with wait_for_bit_le32()Alif Zakuan Yuslaimi
Replace cm_wait_for_fsm() function with wait_for_bit_le32() function which supports accurate timeout. Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com> Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-08-08drivers: clk: agilex: Use real clock source frequencyAlif Zakuan Yuslaimi
Update the ARMv8 generic timer frequency register (cntfrq_el0) with the actual hardware timer frequency (COUNTER_FREQUENCY_REAL). The generic timer frequency was set to 0x200000000 during boot clk which needs to be set to 0x400000000 when transition from boot clk to PLL clk. This will ensure that subsequent timer operations are based on the correct frequency, ensuring accurate timekeeping. Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com> Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-08-07clk: imx: Free pll on error pathAndrew Goodbody
For an unknown pll type the error path neglects to free the memory just allocated. Add the free. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-08-06clk: renesas: Do not test unsigned variable to be less than 0Andrew Goodbody
In rcar_clk_set_rate64_div_table the unsigned variable 'value' is used to receive the return value from rcar_clk_get_table_val which returns an int and then attempts to test for being less than 0, which can never be true. Instead declare value as an int so the code can behave as expected. Also remove initial values from 'value' and 'div' as they are not needed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-07-31Merge tag 'u-boot-stm32-20250731' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-stm CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/27236 - Add support for STM32 TIMERS and STM32 PWM on STM32MP25 - Add STM32MP13xx SPL and OpTee-OS start support - Fix header misuse in stm32 reset drivers - Fix STMicroelectronics spelling - Fix clk-stm32h7 wrong macros used in register read - Fix PRE_CON_BUF_ADDR on STM32MP13 - Fix clock identifier passed to struct scmi_clk_parent_set_in - Fix stm32 reset for STM32F4/F7 and H7 - Enable OF_UPSTREAM_BUILD_VENDOR for stm32mp13_defconfig - Add STM32MP23 SoC and stm32mp235f-dk board support
2025-07-30clk: n5x: Fix misplaced parenAndrew Goodbody
Smatch reported an issue about the precedence of shift being higher than mask in clk_get_emac_clk_hz. This turned out to be a misplaced paren in one of the calculations. Fix this by placing the paren in the same place as in the other similar calculations in the same function. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2025-07-29clk: stm32: Wrong macros used in register readAndrew Goodbody
Smatch reported a warning about a shift macro being used as a mask. Make the obvious changes to make this register read calculation work the same as the previous ones. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-07-29clk: scmi: Fix clock identifier passed to struct scmi_clk_parent_set_inAlice Guo
Commit aa7bdc1af505 ("clk: scmi: manage properly the clk identifier with CFF") enables CONFIG_CLK_AUTO_ID, so need to use clk_get_id() to get the real SCMI CLK ID, otherwise wrong ID is used when set clk parent. Fixes: aa7bdc1af505 ("clk: scmi: manage properly the clk identifier with CCF") Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-07-29Merge tag 'u-boot-at91-2025.10-b' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-at91 Second set of u-boot-at91 features for the 2025.10 cycle: This feature set includes the addition of new sama7d65 SoC and a new board named sama7d65-curiosity.
2025-07-27clk: sunxi: Add support for the A523 -R CCUAndre Przywara
Add a clock driver for the PRCM clock controller on the Allwinner A523 family of SoCs, often also used with an "r" prefix or suffix. This just describes the clock gates and reset lines for the few devices that we would need, most prominently the R_I2C device for the PMIC. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2025-07-27clk: sunxi: Add support for the A523 CCUAndre Przywara
Add a clock driver for the main clock controller on the Allwinner A523 family of SoCs. As usual, this just describes the clock gates and reset lines for the few device that U-Boot cares about: USB, Ethernet, MMC, I2C, SPI. Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2025-07-25clk: at91: sama7d65: add clock supportRyan Wanner
Add clock support for SAMA7D65 Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com> [romain.sioen@microchip.com: add Fractional PLL core output range] Signed-off-by: Romain Sioen <romain.sioen@microchip.com> [varshini.rajendran@microchip.com: adapt driver to upstream] Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
2025-07-25clk: at91: Update MAX PLL and master clk IDRyan Wanner
Update the MAX PLL and master CLK ID to support sama7d65 SoC family. Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
2025-07-17clk: thead: th1520-ap: Correctly handle flags for dividersYao Zi
Unlike the gate clocks which make no use of flags, most dividers in TH1520 SoC are one-based, thus are applied with CLK_DIVIDER_ONE_BASED flag. We couldn't simply ignore the flag, which causes wrong results when calculating the clock rates. Add a member to ccu_div_internal for defining the flags, and pass it to divider_recalc_rate(). With this fix, frequency of all the clocks match the Linux kernel's calculation. Fixes: e6bfa6fc94f ("clk: thead: Port clock controller driver of TH1520 SoC") Signed-off-by: Yao Zi <ziyao@disroot.org> Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-07-14clk: qcom: sm8650: add usb3 noc clkRui Miguel Silva
Commit [0] introduced, correctly, the bubble of qcom clock errors to make it easy to spot missing clocks in the platforms, and this is a case of that, add the GCC_CFG_NOC_USB3_PRIM_AXI_CLK clock to sm8650 clock pool. 0: 7c5460afec3f ("clk/qcom: bubble up qcom_gate_clk_en() errors") Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://lore.kernel.org/r/20250618093253.225929-1-rui.silva@linaro.org Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-07-08clk: zynqmp: Add support for dpll clock sourcePadmarao Begari
The clock driver fails to correctly calculate the PLL clock rate for peripherals when using the DPLL as the clock source. The DPLL operates within the full power domain, while peripheral clocks reside in the low power domain. To ensure accurate PLL clock rate computation when the peripheral clock source is set to DPLL, the DPLL-to-LPD cross divisor is used. Signed-off-by: Padmarao Begari <padmarao.begari@amd.com> Link: https://lore.kernel.org/r/20250618094329.296731-1-padmarao.begari@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2025-07-08clk: versal: Fix clock driver dependencyMichal Simek
Driver fully depends on firmware driver to be present that's why change imply to depends on to cover it. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/bd18a4ce3e65411bb956636d4a2ef4b5fbe8b9e1.1749104235.git.michal.simek@amd.com
2025-06-24clk/qcom: sm8250: Fix variable name of msm_clk_dataLuca Weiss
Update the variable name to sm8250_gcc_data as it's in the sm8250 driver. Fixes: dcd688229cb ("clk/qcom: add driver for sm8250 GCC") Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250611-qcom-clk-variable-names-v1-2-37615b74daad@fairphone.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-06-24clk/qcom: sc7280: Fix variable name of msm_clk_dataLuca Weiss
Update the variable name to sc7280_gcc_data as it's in the sc7280 driver. Fixes: f50e7be6bb1 ("clk/qcom: add initial clock driver for sc7280") Signed-off-by: Luca Weiss <luca.weiss@fairphone.com> Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250611-qcom-clk-variable-names-v1-1-37615b74daad@fairphone.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-06-24clk/qcom: qcs615: Add GCC clock driver for QCS615Aswin Murugan
Port Linux's gcc-qcs615.c driver to U-Boot for basic bring-up. Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250521035324.1182833-4-aswin.murugan@oss.qualcomm.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-06-24clk/qcom: qcs8300: Add GCC clock driver for QCS8300Balaji Selvanathan
* Port Linux's gcc-qcs8300.c driver to U-Boot for basic bring-up. * Enable QCS8300 clocks in qcom_defconfig. Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250529154931.1879976-4-quic_bselvana@quicinc.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-06-23clk/qcom: add initial clock driver for ipq5424Varadarajan Narayanan
Add initial set of clocks and resets for enabling U-Boot on ipq5424 based RDP platforms. Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com> Reviewed-by: Casey Connolly <casey.connolly@linaro.org> Link: https://lore.kernel.org/r/20250304110105.2762124-5-quic_varada@quicinc.com Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
2025-06-20Merge tag 'u-boot-at91-2025.10-a' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-at91 into next First set of u-boot-at91 features for the 2025.10 cycle: This feature set includes the addition of new sam9x7 SoC and a new board named sam9x7-curiosity. There is also new support for sam9x60 compatible at91 watchdog.
2025-06-19clk: at91: sam9x7: add pmc driver for sam9x7 SoC familyVarshini Rajendran
Add PMC driver support for sam9x7 SoC family Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com> [balamanikandan.gunasundar@microchip.com: Add peripheral clock id for pmecc] Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
2025-06-19clk: at91: clk-main: drop parent_name check when registering main_rc oscillatorManikandan Muralidharan
The clk_register function logs an error if parent_name is missing from the Device Tree.On the SAM9X7, the main_rc node is omitted to stay aligned with the Linux Device Tree.Remove the parent_name check in at91_clk_main_rc() to allow it to pass NULL when the parent is not specified. Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
2025-06-19clk: at91: sam9x60-pll: add support for HW PLL freq dividersVarshini Rajendran
Add support for hardware dividers for PLL IDs.In sam9x7 SoC, PLL_ID_PLLA and PLL_ID_PLLA_DIV2 has /2 hardware dividers each. fcorepllack -----> HW Div = 2 -+--> fpllack | +--> HW Div = 2 ---> fplladiv2ck Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
2025-06-19clk: at91: sam9x60-pll: add support for core clock frequency inputsVarshini Rajendran
Add support for different core clock frequency input ranges for different PLL IDs in the PLL driver and align sam9x60, sama7g5 SOC platforms. Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
2025-06-18clk: renesas: Handle CLK_TYPE_GEN4_MDSEL in gen3_clk_get_rate64()Shmuel Leib Melamud
Add support of CLK_TYPE_GEN4_MDSEL clock type to gen3_clk_get_rate64() function. In particular, this type of clock is used by Renesas R-Car Gen4 watchdog. It operates similarly to CLK_TYPE_GEN3_MDSEL clock. Signed-off-by: Shmuel Leib Melamud <smelamud@redhat.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Stefan Roese <sr@denx.de>
2025-06-14Merge patch series "linux/bitfield.h: sync <linux/bitfield.h> from Linux ↵Tom Rini
6.15 + winbond" Christian Marangi <ansuelsmth@gmail.com> says: This small series sync linux/bitfield.h from Linux 6.15 and fix all the compilation error due to a change in the header include. The sync is needed to make it easier to support the winbond changes. The changes are CI test with [1] [1] https://github.com/u-boot/u-boot/pull/777 Link: https://lore.kernel.org/r/20250607211133.2005-1-ansuelsmth@gmail.com
2025-06-14clk: imx: add missing linux/bug.h header for WARNChristian Marangi
The WARN macro requires inclusion of linux/bug.h header. It does currently work as bitfield.h includes it indirectly but this will change when bitfield.h will be synced with new Linux version. Explicitly include the header to fix future compilation error. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-06-14Merge patch series "Hex value prefix case cleanup"Tom Rini
E Shattow <e@freeshell.de> says: Make consistent use of lowercase hexadecimal prefix '0x' throughout U-Boot. There are a few remaining uses of uppercase 'X' to denote hexadecimal prefix or placeholder in documentation and error messages. External devicetree-rebasing dts/upstream and the generated code of xilinx/zynq are ignored for the series. Link: https://lore.kernel.org/r/20250606224558.1117422-1-e@freeshell.de
2025-06-14drivers: use lowercase hex prefix styleE Shattow
Use consistent lowercase hex prefix style in drivers/* Does not change hex prefix case in allcaps uppercase style error messages Signed-off-by: E Shattow <e@freeshell.de>
2025-06-11board: stm32: add stm32h747-discovery board supportDario Binacchi
The board includes an STM32H747XI SoC with the following resources: - 2 Mbytes Flash - 1 Mbyte SRAM - LCD-TFT controller - MIPI-DSI interface - FD-CAN - USB 2.0 high-speed/full-speed - Ethernet MAC - camera interface Detailed information can be found at: https://www.st.com/en/evaluation-tools/stm32h747i-disco.html Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-11clk: stm32mp13: Add SPL support and clock tree init to STM32MP13 RCC driverMarek Vasut
Add SPL support and clock tree init to STM32MP13 RCC driver. This consists of two parts, make SCMI into an optional dependency and add clock tree initialization. The SCMI dependency is made optional first by registering the few core clock provided by SCMI clock as fixed clock, and second by letting the clock core parse out the clock configuration from SoC registers. The clock initialization code is derived from STM32MP15xx clock tree initialization code, which is almost identical, except for the use of new PLL2000 for PLL1 on STM32MP13xx . Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
2025-06-11clk: stm32mp13: Fix typo in STM32MP13 RCC driverMarek Vasut
Fix basic typo, missing t in security . No functional change . Signed-off-by: Marek Vasut <marek.vasut@mailbox.org> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-11clk: stm32: fix clock counterGabriel Fernandez
In RCC the ops of the CCF registered CLK device can be called directly, this patch avoid recursive call of clk_ function done by CCF clock framework which update the clock information, for example clk_enable is called 2 times, clkp->enable_count is increased 2 times. Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-11clk: scmi: manage properly the clk identifier with CCFPatrick Delaunay
Each clock identifier needs to be unique when CCF is activated, and it is not respected today by SCMI clock driver. This patch supports a unique clk id by using the uclass API clk_get_id() / dev_clk_dm() and by activating by default CONFIG_CLK_AUTO_ID with CCF which adds an offset to the SCMI clock identifiers. After this patch, the SCMI clock driver can coexist with other clock provider without conflict, they can share internal identifier [0..N] defined in their binding and the clock ID = 0 (reserved for dummy clock) is no more used. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-11clk: fixed_rate: configure clock ID with CONFIG_CLK_AUTO_IDPatrick Delaunay
Update CLK ID to avoid 0 id, used for dummy clock with CCF and to allow selection by clk_get_by_id, used to get private data associated to the UCLASS_CLK device Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-11clk: sandbox: update driver for CONFIG_CLK_AUTO_ID supportPatrick Delaunay
Update the sandbox driver to allow support of the CONFIG_CLK_AUTO_ID by using the new API clk_get_id() to get the internal SANDBOX identifier. With CONFIG_CLK_AUTO_ID, clk->id have the also seq identifier. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-11clk: add CONFIG_CLK_AUTO_IDPatrick Delaunay
Add a new config CONFIG_CLK_AUTO_ID to support a unique clk id for all the clock providers, managed by clk uclass, when the clock reference arg[0] is the same. When the CONFIG is activated, the clock id is limited to the lower CLK_ID_SZ = 24 bits in default clock xlate function and the sequence number + 1 of the clk provider device is added for the 8 higher bits. We use sequence number + 1 to avoid the "dummy" clock id = 0, used for invalid clock when CCF is activated. When this config is activated, the new function clk_get_id() should be used to get back the internal reference to clock for the each clock provider. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>