summaryrefslogtreecommitdiff
path: root/drivers/clk/imx
AgeCommit message (Collapse)Author
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-05-31clk: imx: add i.MX6UL clk driverMichael Trimarchi
Add i.MX6UL clk driver for i.MX6UL CLK driver model usage Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Christoph Niedermaier <cniedermaier@dh-electronics.com> Tested-by: Christoph Niedermaier <cniedermaier@dh-electronics.com> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-05-12spi: fspi: Add imxrt1170 device dataJonathan Currier
Add the device specific driver data, and the clock configuration. Signed-off-by: Jonathan Currier <dullfire@yahoo.com>
2025-04-28clk: imx: Pass CCM udevice into clk_register_composite()Marek Vasut
Pass the clock controller udevice into clk_register_composite(), so it can be passed further to any registered composite clocks and used for look up of parent clock referenced in DT "clocks" and "clock-names" properties by phandle and name pair. Use the clock controller udevice in imx8m_clk_mux_set_parent() to perform accurate look up of parent clock referenced in the CCM driver by name. If the clock name that is being looked up matches one of the names listed in the clock controller DT node "clock-names" array property, then the offset of the name is looked up in the "clocks" DT property and the phandle at that offset is resolved to the parent clock udevice. The test to determine whether a particular driver instance registered with clock uclass matches the parent clock is done by comparing the OF nodes of the clock registered with clock uclass and parent clock resolved from the phandle. Example: drivers/clk/imx/clk-imx8mm.c: static const char * const imx8mm_a53_sels[] = {"osc_24m", "arm_pll_out", ... _____________| arch/arm/dts/imx8mm.dtsi: | clk: clock-controller@30380000 { v clock-names = "osc_32k", "osc_24m", ... | v clocks = <&osc_32k>, <&osc_24m>, ... }; _______________________| ... | / { v osc_24m: clock-osc-24m { compatible = "fixed-clock"; ... }; Signed-off-by: Marek Vasut <marex@denx.de> Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com> Tested-by: Fabio Estevam <festevam@gmail.com> Tested-by: Adam Ford <aford173@gmail.com> # imx8mp-beacon
2025-04-25clk: imx: Finish converting clock-osc-24 back to osc_24Adam Ford
The UART clocks were added around the same time some other clock updates were happening, so converting clock-osc-24 back to osc_24 was missed on the UART clocks for imx8mm and imx8mn, so update them here. Fixes: b4734c9c333b ("clk: imx: Convert clock-osc-* back to osc_*") Signed-off-by: Adam Ford <aford173@gmail.com> Reported-by: Christoph Niedermaier <cniedermaier@dh-electronics.com> Reviewed-by: Fabio Estevam <festevam@gmail.com>
2025-04-10clk: imx8mp: Add media related clocksMiquel Raynal
These are all the clocks needed to get an LCD panel working, going through one of the LCDIF and the LDB. The media AXI and APB clocks are also described. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2025-03-24clk: imx: Pass struct udevice into imx_clk_fixed_factor*()Marek Vasut
Pass struct udevice * into imx_clk_fixed_factor*() functions, so the clock core would have access to parent struct udevice *. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: Pass struct udevice into imx_clk_divider*()Marek Vasut
Pass struct udevice * into imx_clk_divider*() functions, so the clock core would have access to parent struct udevice *. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: pllv3: Resolve parent clock by nameMarek Vasut
Use clock-names property which is accessible via parent clock OF node to look up the parent clock by name instead of depending on unreliable global clock name to perform look up. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: Pass struct udevice into imx_clk_pllv3*()Marek Vasut
Pass struct udevice * into imx_clk_pllv3*() functions, so the clock core would have access to parent struct udevice *. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: Convert clock-osc-* back to osc_*Marek Vasut
Convert clock-osc-24m back to osc_24m and clock-osc-32k back to osc_32k. These are the clock which match clock tables in Linux. This is now possible because the clock drivers now resolve clock names based on clock-names DT property in the CCM DT node. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: Pass struct udevice into imx_clk_composite*()Marek Vasut
Pass struct udevice * into imx_clk_composite*() functions, so the clock core would have access to parent struct udevice *. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: Pass struct udevice to clk_register_gate*()Marek Vasut
Pass U-Boot specific struct udevice pointer to clock parent device to clk_register_gate*(), so clk_register_gate*() can access the parent udevice. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: Pass struct udevice into imx_clk_gate*()Marek Vasut
Pass struct udevice * into imx_clk_gate*() functions, so the clock core would have access to parent struct udevice *. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: gate2: Resolve parent clock by nameMarek Vasut
Use clock-names property which is accessible via parent clock OF node to look up the parent clock by name instead of depending on unreliable global clock name to perform look up. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: gate2: Use struct udevice instead of struct deviceMarek Vasut
Use U-Boot specific struct udevice instead of Linux compatibility struct device in gate2 clock registration. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: Pass struct udevice to clk_register_mux()Marek Vasut
Pass U-Boot specific struct udevice pointer to clock parent device to clk_register_mux(), so clk_register_mux() can access the parent udevice. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: imx: Pass struct udevice into imx_clk_mux*()Marek Vasut
Pass struct udevice * into imx_clk_mux*() functions, so the clock core would have access to parent struct udevice *. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-19clk: imx: select SPL_CLK_COMPOSITE_CCF when SPL_CLK_IMX8MPAdam Ford
If SPL_CLK_IMX8MP is selected alone, it causes a build error. The clock composite is required when using the clock framework, so select it when SPL_CLK_IMX8MP is enabled. This is already being done outside of SPL. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19clk: imx8mn: register UART clocksAdam Ford
In order to let the serial driver enable the clocks, the UART clocks must be registered first. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19clk: imx8mm: register UART clocksAdam Ford
In order to let the serial driver enable the clocks, the UART clocks must be registered first. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19clk: imx6q: Register UART clocksAdam Ford
In order to use the driver model and clock system to enable UART clocks from the serial driver, it's necessary to register the UART clocks. With the helper function to check for imx6qp vs other variants, the UART can register for both scenarios. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2025-03-19clk: imx6q: Properly handle imx6qp ECSPI clk_selsAdam Ford
The ECSPI clock has the ability to select between pll3_60m and osc on the imx6qp, where it's fixed on other variants. Fix this by adding using a helper function to determine SoC variant and register the clock accordingly. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2024-12-07clk: imx: clk-fracn-gppll: Add new PLL rateYe Li
Add new rates to integer and frac PLL to support iMX91 Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-12-07clk: imx93: support i.MX91Peng Fan
i.MX91 is a derived from i.MX93, and most clocks could be reused from i.MX93. Also Update imx93-clock.h to sync with linux next. Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-25imx: imxrt1050-evk: Fix missing clocks for mmcJesse Taube
Two of the clocks required by the usdhc1 controller are missing from the clock controller node. A recent change enables all the clocks in the esdhc node, which fails as they are not defined in the clock controller. Fixes: 76332fae769 ("mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk bulk API") Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com> Cc: Peng Fan <peng.fan@nxp.com>
2024-10-18clk: imx8: Add dummy clkPeng Fan
There is a dummy clk entry for i.MX8QM/QXP, so add the dummy clk enable and get rate. Otherwise "__imx8_clk_enable(Invalid clk ID #0)". Fixes: 76332fae769 ("mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk bulk API") Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Peng Fan <peng.fan@nxp.com> Tested-by: Heiko Schocher <hs@denx.de>
2024-10-13clk: imx8mp: Add i.MX8MP Dummy clkPeng Fan
i.MX8MP SDHC use CLK_IMX8MP_DUMMY clk entry. Without the clk, the bulk api will return failure. The correct entry should be replaced with IMX8MP_IPG_ROOT clk in device tree. This will be done in Kernel device tree and sync to U-Boot in future: https://lore.kernel.org/all/20241012025221.1728438-1-peng.fan@oss.nxp.com/ Fixes: 76332fae769 ("mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk bulk API") Reported-by: Gilles Talis <gilles.talis@nxp.com> Tested-by: Gilles TALIS <gilles.talis@gmail.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-11global: Rename SPL_TPL_ to PHASE_Simon Glass
Use PHASE_ as the symbol to select a particular XPL build. This means that SPL_TPL_ is no-longer set. Update the comment in bootstage to refer to this symbol, instead of SPL_ Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILDSimon Glass
Use the new symbol to refer to any 'SPL' build, including TPL and VPL Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-02clk: imx8m: register ARM A53 core clockHou Zhiqiang
Register ARM A53 core clock for i.MX 8M Mini, Nano and Plus, preparing for enabling the 'cpu' command, which depends on this to print CPU core frequency. Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
2024-07-22Merge tag 'u-boot-imx-master-20240722' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/21728 - Conversions to DM_I2C and DM_SERIAL. - Support for I2C3 and PWM1 for the imx6q clock driver. - Improvements for udoo-neo - Describe the i.MX93 CPU clocks in the devicetree to fix CPU clock printing - Fix for SPI and NANC clk-imx8mn clock driver
2024-07-22clk: imx6q: Add definition for IMX6QDL_CLK_PWM1Emil Kronborg
Enabling CONFIG_CMD_PWM, and consequently CONFIG_DM_PWM, causes the pwm command to fail due to a missing clock. => pwm enable 0 0 Enable clock-controller@20c4000 failed Failed to enable per_clk pwm: '0' not found Command 'pwm' failed: Error -2 Note that it is trivial to also add the clocks for PWM2, PWM3, and PWM4. However, I only tested PWM1 and thus only added the clock for that signal. Signed-off-by: Emil Kronborg <emil.kronborg@protonmail.com>
2024-07-22clk: imx6q: Add definition for IMX6QDL_CLK_I2C3Emil Kronborg
Commit 727fa4539ca2 ("clk: Add support for I2C clocks on NXP's imx6q SoC which use CCF") added I2C clocks for I2C1 and I2C2, but not I2C3. Consequently, devices using I2C3 fail after enabling CONFIG_CLK_IMX6Q and thus CONFIG_CLK. Therefore, this commit adds the last I2C clock. Signed-off-by: Emil Kronborg <emil.kronborg@protonmail.com>
2024-07-22clk: imx8mp: Make parent names arrays const pointersMichael Trimarchi
The arrays containing the mux selectors need to be of const pointer to const char. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-07-22clk: imx8mm: Make parent names arrays const pointersMichael Trimarchi
The arrays containing the mux selectors need to be of const pointer to const char. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-07-22clk: imx8mn: Make parent names arrays const pointersMichael Trimarchi
The arrays containing the mux selectors need to be of const pointer to const char. Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-07-22clk: imx: clk-imx8mn Fix nand and spi clock parentMichael Trimarchi
The osc_24m is the clock-output-name and not the one that is used as internal name reference from the strcmp. The clock that use osc_24m, will not be able to reparent it as they should. We need anyway register the osc_24m clock fixed factor in the clock tree. Fixes: 710c4ffb890 ("clk: imx: clk-imx8mn add gpmi nand clocks") Fixes: 85b1c11989c ("clk: imx: Add ECSPI to iMX8MN") Cc: Marek Vasut <marex@denx.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-07-22drivers: clk: Remove duplicate newlinesMarek Vasut
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-07-06clk: imx: add mux ops for i.MX8M composite clkMichael Trimarchi
Upstream Linux commit f90b68d6c8b0. The CORE/BUS root slice has following design, simplied graph: The difference is core not have pre_div block. A composite core/bus clk has 8 inputs for mux to select, saying clk[0-7]. It support target(smart) interface and normal interface. Target interface is exported for programmer easy to configure ccm root. Normal interface is also exported, but we not use it in our driver, because it will introduce more complexity compared with target interface. The normal interface simplified as below: SEL_A GA +--+ +-+ | +->+ +------+ CLK[0-7]--->+ | +-+ | | | | +----v---+ +----+ | +--+ |pre_diva+----> | +---------+ | +--------+ |mux +--+post_div | | +--+ |pre_divb+--->+ | +---------+ | | | +----^---+ +----+ +--->+ | +-+ | | +->+ +------+ +--+ +-+ SEL_B GB The mux in the upper pic is not the target interface MUX, target interface MUX is hiding SEL_A and SEL_B. When you choose clk[0-7], you are actually writing SEL_A or SEL_B depends on the internal counter which will also control the internal "mux". The target interface simplified as below which is used by Linux Kernel: CLK[0-7]--->MUX-->Gate-->pre_div-->post_div A requirement of the Target Interface's software is that the target clock source is active, it means when setting SEL_A, the current input clk to SEL_A must be active, same to SEL_B. We touch target interface, but hardware logic actually also need configure normal interface. There will be system hang, when doing the following steps: The initial state: SEL_A/SEL_B are both sourcing from clk0, the internal counter choose SEL_A. 1. switch mux from clk0 to clk1 The hardware logic will choose SEL_B and configure SEL_B to clk1. SEL_A no changed. 2. gate off clk0 Disable clk0, then the input to SEL_A is off. 3. switch from clk1 to clk2 The hardware logic will choose SEL_A and configure SEL_A to clk2, however the current SEL_A input clk0 is off, the system hang. The solution to fix the issue is in step 1, write twice to target interface MUX, it will make SEL_A/SEL_B both sources from clk1, then no need to care about the state of clk0. And finally system performs well. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-07-06clk: imx: Fix wrong flags assignment clk-composite-93Michael Trimarchi
The mux flags (u8), div flags (u8), and gate flags (u8) are not the clk flags (unsigned long). They have different meanings Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-07-06clk: imx: Fix wrong flags assignment clk-composite-8mMichael Trimarchi
The mux flags (u8), div flags (u8), and gate flags (u8) are not the clk flags (unsigned long). They have different meanings Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-07clk: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-20clk: imx8mm: Add support for PCIe clocksTim Harvey
Add support for PCIe clocks required to enable PCIe support on iMX8MM SoC. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Reviewed-by: Marek Vasut <marex@denx.de>
2024-04-15clk: imx93: fix anatop basePeng Fan
The PLL clk needs use anatop base, otherwise wrong PLL address will be used. Fixes: 9c153e46661b ("clk: imx: add i.MX93 CCF driver") Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-03-25Merge tag 'v2024.04-rc5' into nextTom Rini
Prepare v2024.04-rc5
2024-03-24clk: imx8mp: Add support for PCIe clocksSumit Garg
Add support for PCIe clocks required to enable PCIe support on iMX8MP SoC. Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8mp-venice* Tested-by: Adam Ford <aford173@gmail.com> #imx8mp-beacon-kit Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>