Commit Graph

902 Commits

Author SHA1 Message Date
Krzysztof Chruściński
2cb2cf226c drivers: clock_control: nrf: Add workaround for XO start anomaly
Add workaround to HFCLK start and stop in nrf54l. In future workaround
will be in nrfx driver.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-02-19 14:50:50 +00:00
Krzysztof Chruściński
a4625c2112 drivers: clock_control: hsfll: Add option to set lowest oppoint in init
Add option to set the lowest DVFS operation point during initialization.
Option is by default enabled for nrf54h cores with DVFS.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-02-14 17:05:16 +01:00
Krzysztof Chruściński
ff82048124 modules: hal_nordic: nrfs: dvfs: Deprecate Kconfig option
Deprecate NRFS_LOCAL_DOMAIN_DVFS_SCALE_DOWN_AFTER_INIT option for
scaling down CPU frequency during dvfs handler initialization.
Clock control API is managing access to DVFS and DVFS should not
be controlled bypassing this API. Deprecated feature will be added in
the clock control.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-02-14 17:05:16 +01:00
Etienne Carriere
c7c001405c drivers: clock: stm32: factorize clock selection macros
Factorize STM32_CLOCK_*_GET() and STM32_MCO_CFGR_*_GET() macros
into a single series of STM32_DT_CLKSEL_*_GET() macros based on
recently introduced new common macros STM32_DT_CLKSEL_*_SHIFT and
STM32_DT_CLKSEL_*_MASK.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-02-14 13:40:52 +01:00
Tien Nguyen
b9a4e30d3b drivers: clock control: Initial support for RZ/G3S
Add Clock Control driver support for Renesas RZ/G3S

Signed-off-by: Tien Nguyen <tien.nguyen.zg@renesas.com>
Signed-off-by: Nhut Nguyen <nhut.nguyen.kc@renesas.com>
2025-02-13 09:11:19 +01:00
Hou Zhiqiang
372c9128bf drivers: clock: ccm_rev2: add imx91 support
Add clock driver support for MIMX9131.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2025-02-11 22:08:59 +01:00
Jérôme Pouiller
ffb1c0de61 drivers: clock: Add dumb clock driver for SiWx91x
This driver is mostly the initial seed for further implementation of a
real clock driver.

It doesn't allow the user to choose the clock source for the various
peripherals. The driver hardcodes some sane values.

Note that for now, the driver snps,designware-i2c does not support
"clocks" attribute. So this patch hardcode the clock configuration in
the init of the clock driver.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-02-11 22:07:11 +01:00
Lucien Zhao
0f29766b08 drivers: clock: mcux_lpc_syscon_clock.c: add ctimer5/6/7 support
add ctimer5/6/7 clock get support

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-02-11 18:55:53 +01:00
Sylvio Alves
a0bdafb021 espressif: add console and RTC kconfig entries
Add hidden console and RTC configurations used in hal
to common SoC folder.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-02-10 19:05:40 +01:00
Khaoula Bidani
541c0959c3 drivers : clock_control: clean "STM32_SRC_SYSCLK"
clean up usage of usage "#ifdef STM32_SRC_SYSCLK"
and code under the "#else" from clock_stm32_ll_common.c.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-02-07 10:25:52 +01:00
Francois Ramu
3086c69fb8 drivers: clock control of stm32f4 serie w/o clk 48M on PLL I2S
Some stm32f4, like the sm32f411 mcu have clk 48M on the main PLL output q
Some stm32f4, like the sm32f412 mcu have clk 48M on the PLL I2S output q
This PR is for selecting the right one

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2025-02-06 10:42:36 +01:00
McAtee Maxwell
24eb735b24 adc: modifications to support adc on cyw920829m2evk_02 platform
- Modifications to adc driver
	- Modifications to clock_control driver
	- Add adc to board's yaml
	- Add adc to relevant dts file

Signed-off-by: McAtee Maxwell <maxwell.mcatee@infineon.com>
2025-02-03 19:50:11 +01:00
Tran Van Quy
fc831ead04 drivers: clock_control: Add condition to verify the CPU clock config
- Add a condition to check the clock supplying the CPU to match with
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
- Correct CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC for EK-RA4W1

Signed-off-by: Tran Van Quy <quy.tran.pz@renesas.com>
2025-02-03 14:01:59 +01:00
Francois Ramu
73ab22e8ba drivers: clock control of some stm32f4x has no 48MHz from PLL i2s
Remove the LL_RCC_PLLI2S_ConfigDomain_48M for the stm32f4
w/o Q divider on the PLLI2S to configure the PLL48CK

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2025-01-31 16:12:03 +01:00
Francois Ramu
bba13ae22a drivers: clock control: some stm32f4 have no div-q on there plli2s
Check that the plli2s has a DIV-Q output or not. That depends
on the PLLi2S of some stm32F4xx devices

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2025-01-31 16:12:03 +01:00
Jamie McCrae
560db8509a drivers: kconfig: Fix bleeding options
Fixes a multitude of Kconfigs that wrongly appear on devices
where support is literally impossible

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-01-31 11:50:12 +01:00
Marcio Ribeiro
c3b53d0fa3 soc: esp32xx: makes esp_console_init() calling conditional
Makes the esp_console_init() calling during hardware initialization
conditioned to CONFIG_ESP_CONSOLE

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2025-01-30 16:21:13 +01:00
Neil Chen
35a489e3be drivers: syscon: update syscon driver to add lpspi clock
Add lpspi clock support

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2025-01-28 23:41:08 +01:00
Guillaume Gautier
daeb2a8377 drivers: clock: add stm32n6 clock
Add STM32N6 clock driver.
Supported clocks are LSE, LSI, HSE, HSI, PLL1-4, IC1-20,
peripheral clock and CPU clock.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2025-01-28 18:14:45 +01:00
Michał Stasiak
9a47667468 drivers: clock_control: nrf: start HFXO when using LFSYNTH
When using synthesized low frequency clock, HFXO should be running
to ensure correct frequency.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2025-01-28 09:47:06 +01:00
Nikodem Kastelik
2692f16757 drivers: clock_control: nrf: ignore XOTUNE-related events for now
New events from nrfx_clock driver are not utilized for now
by the clock_control, so should be ignored to avoid assertion.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-01-27 13:25:02 +01:00
Jiafei Pan
75301887e3 drivers: clock_control: mcux_ccm: add ii2c clock support
Add I2C clock support for imx8m platforms.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-01-24 19:15:57 +01:00
Matthias Hauser
543864321c drivers: nrfx: Avoid unhandled event calling assert function
Avoid unhandled event calling assert function

Signed-off-by: Matthias Hauser <matthias.hauser@we-online.de>
2025-01-24 15:42:07 +01:00
Pieter De Gendt
f1c4760304 drivers: Update APIs to use DEVICE_API macro
Some drivers APIs were not wrapped using the DEVICE_API macro.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-24 01:15:19 +01:00
Qiang Zhang
436f3dc65e clock: driver/clock_control: Add sai clock support for syscon.
Add sai clock support for syscon.

Signed-off-by: Qiang Zhang <qiang.zhang_6@nxp.com>
2025-01-17 02:13:01 +01:00
Lucien Zhao
47cc069cb9 drivers: clock_control: update mcux_lpc_syscon_clock.c drivers
add more flexcomm instances clock support to adapt
rt700 instances number

add xspi clock support

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-01-14 17:56:53 +01:00
Lucien Zhao
1f0bea6c08 driver: clock_control_mcux_ccm_rev2.c: update new lpspi support
On RT1180, two lpspis share the same clock root,
support lpspi in clock driver for RT118x

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-01-13 10:08:36 +01:00
Pisit Sawangvonganan
ce2d907e4d drivers: clock_control: stm32: enable PLL1FRACN setting
Enables the fractional-N (FRACN) setting for PLL1 in the STM32H5XX
clock driver.
This feature allows achieving a system clock frequency of 250 MHz from
an 8 MHz `clk_hse`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-01-10 21:08:10 +01:00
Lin Yu-Cheng
6ea7560ce2 driver: clock_control: Add clock controller initial version of RTS5912.
Add clock controller driver for Realtek RTS5912.

Signed-off-by: Lin Yu-Cheng <lin_yu_cheng@realtek.com>
2025-01-10 11:58:02 +01:00
Neil Chen
55f68b7ac3 drivers: syscon: update syscon driver to support mcxa flexcan clock
Add mcxa flexcan clock support

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2025-01-07 15:56:57 +01:00
Grzegorz Runc
9fcb17400b soc: stm32: add support for stm32h757
Add support for STM32H757 SoC, which shares its design
with STM32H747 with added cryptography peripherals.

Signed-off-by: Grzegorz Runc <g.runc@grinn-global.com>
2025-01-06 17:12:55 +00:00
Andrew Featherstone
8d39008f2f drivers: clock_control: rpi_pico: Start tick generators for timers
Unlike the RP2040, the RP2350 has multiple tick generators that need to
be started. Start TIMER0 and TIMER1 tick generators during
clock_control_init.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2024-12-23 23:57:57 +01:00
Andrew Featherstone
122784df15 drivers: clock_control: rpi_pico: Add support for the RP2350.
Add support for SoC-specific clock ids and update the initialization
function to support the existing RP2040 and add support for the RP2350.

clock_control_rpi_pico.c uses numerical values for clock ids taken from
rpi_pico_clock.h which are the "clock generator". For the RP2350 these
values are different for some of the same logical clock sources, as well
as the RP2040 and RP2350 having different clock sources available.

Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
2024-12-23 23:57:57 +01:00
Andrzej Głąbek
c8fff0c77d drivers: clock_control_nrf2: Add missing cancelation of request
This is a follow-up to commit fe0e2dbc60.

If `nrf_clock_control_request_sync()` ends up with a timeout, before
returning it must cancel the request that was not fulfilled on time.
Otherwise, the request may actually finish successfully a bit later,
but the caller will not be aware that the clock needs to be released
(since the call resulted in an error). And actually even more serious
problem is that because the `req` structure is placed on stack, after
the function returns, the contents of this structure will be probably
overwritten with some other data, so if the request finishes at that
point, an attempt to execute the callback function pointed by this
structure will most likely cause a crash.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2024-12-21 15:04:58 +01:00
Benjamin Curtis Byers
fa1b93d148 drivers: clock_control: stm32 ll common: fix RCC pll disable
The clock_stm32_ll_common.c function set_up_plls calls
LL_RCC_PLL_Disable();and it was not waiting for the
disable to complete before trying to configure
the pll sysclock which creates a race condition for
pll configuration.The wait for re-enabling the RCC pll
is already there, it was just missing the wait for
the disable before configuration. Also added the wait for PLL2.

Signed-off-by: Benjamin Curtis Byers <ben.byers@ubcobikes.com>
2024-12-19 15:19:13 +01:00
Jun Lin
17ccc5fdfb driver: clock_control: npcx: use CONFIG_CLOCK_CONTROL_LOG_LEVEL
This commit replaces the hard-coded log level with
CONFIG_CLOCK_CONTROL_LOG_LEVEL.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2024-12-19 04:18:34 +01:00
Gerard Marull-Paretas
bcb2b3620e drivers: clock_control: nrf54h-fll16m: use values from BICR
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
f267c339f7 drivers: clock_control: nrf54h-lfclk: use values from BICR
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
d5041aecec drivers: clock_control: nrf54h-common: add utility to obtain LFOSC acc
Add a utility function to obtain LFOSC accuracy in PPM from BICR.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
5415c42dd4 drivers: clock_control: nrf54h-hfxo: use values from BICR
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Lucien Zhao
a831f7df6d drivers: clock_control: add i3c clock for clock_control_mcux_ccm_rev2.c
add i3c case to get i3c instance clock

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2024-12-18 01:01:37 +01:00
Piotr Pryga
233095c3f4 drivers: clock_control: nrf: hfxo: Remove redundad code
There were redundant code in full_irq_lock(), full_irq_unlock()
functions that supposed to be used when ZLI IRQs are disabled.
These functions are compiled in only when CONFIG_ZERO_LATENCY_IRQS
is set, hence the non-ZLI execution path was never included
in final binaries.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-12-18 01:00:56 +01:00
Bjarki Arge Andreasen
ef8bf34e61 drivers: clock_control: nrf2: add support for global hfsll clock
Add device driver support for global hsfll clock.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-17 15:22:37 +01:00
Bjarki Arge Andreasen
777adf4231 dts: bindings: update nrf-hsfll to nrf-hsfll-local
The nrf-hsfll was previously the only supported HSFLL clock, hence it
was not namespaced fully. Since we added nrf-hsfll-global, we should
add the namespace to nrf-hsfll as well.

Updates drivers and devicetree uses of HSFLL as well.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2024-12-17 15:22:37 +01:00
Girisha Dengi
36e71c839f drivers: clock_control: Agilex5 clock control driver updates
The clock controller/manager registers are updated with
the correct divider values by bootloader via hand-off
data, so now we can use the clock controller to get the
clock value of each peripheral during the run time.

Signed-off-by: Girisha Dengi <girisha.dengi@intel.com>
2024-12-16 17:12:34 -05:00
Neil Chen
89c9dc7f59 drivers: syscon: update syscon driver to add lpi2c clock
Add lpi2c clock support

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2024-12-16 20:50:37 +01:00
Francois Ramu
f1a4928bdd drivers: clock control: stm32 function to get 48MHz freq
Add a function to compute the clock48 from the clock tree
of a stm32f412/f413 mcu. The value depends on its clock source
Requires to identify the PLL source HSE or HSI.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-13 20:05:11 +01:00
Francois Ramu
15bdefecc0 drivers: clock control: stm32F412 has PLL48MHz
Add the configuration of the PLL Q divider of main PLL
and I2S_Q of the PLLI2S toset the PLL48MHz clock which feeds
 the USB, SDMMC, RNG through the RCC_DCKCFGR2 register.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-12-13 20:05:11 +01:00
Bjarki Arge Andreasen
73a45a7012 drivers: clock_control: nrf: hfxo: impl zero-latency isr API
Implement the zero latency interrupt safe APIs to the HFXO clock
commonly used by the bluetooth stach from zero latency interrupt
context.

Co-authored-by: Piotr Pryga <piotr.pryga@nordicsemi.no>

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2024-12-13 17:44:26 +01:00
Krzysztof Chruściński
fe0e2dbc60 drivers: clock_control: nrf: Add API for synchronous request
Add API for synchronous request for clock attributes.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-12-13 11:46:41 +01:00