summaryrefslogtreecommitdiff
path: root/drivers/clk/renesas
AgeCommit message (Collapse)Author
2025-12-29clk: renesas: Do not disable realtime modules on R8A77995 D3Niklas Söderlund
Later versions of the datasheet makes it clear D3 do not have any realtime module stop control registers (RMSTPCRx). Remove the manipulation of them from the module clock table to match this. Suggested-by: Marek Vasut <[email protected]> Signed-off-by: Niklas Söderlund <[email protected]>
2025-12-29clk: renesas: Do not enable MSTP4 extra modules on R8A77995 D3Niklas Söderlund
Since commit a2bd99549c61 ("clk: renesas: Tear clock controller down last before booting OS") enabling the module gated by bit 8 in MSTP4 prevents Linux from booting. The bits 8 and 7 of MSTP4 where only documented in early versions of the datasheet and have since been removed. To allow Linux to boot update the MSTP4 enable value to reflect the hardware default, 0x80. Suggested-by: Marek Vasut <[email protected]> Signed-off-by: Niklas Söderlund <[email protected]>
2025-12-03clk: renesas: Introduce temporary compound clock for SCP compatibilityMarek Vasut
The current state of SCP on Renesas R-Car Gen5 is not yet final and is still missing full clock control, the clock control is exposed as separate enable/disable and rate controls. Temporarily introduce custom local compound clock, which are used as an adaptation layer between U-Boot clock tree and current state of SCP, and which bind two SCP clock into a single compound clock, which provides both enable/disable and rate controls. This is mainly meant to be used by SD/eMMC controller, to allow the driver to both turn its clock on and off, and also obtain the current clock rate. This is going to be removed once the SCP clock protocol solidifies. Signed-off-by: Marek Vasut <[email protected]>
2025-11-07clk: renesas: Isolate R-Car Gen3 driver to Gen3, Gen4 and RZ/G2LMarek Vasut
Isolate Renesas R-Car Gen3 clock driver to R-Car Gen3 and Gen4 and RZ/G2L. The Renesas R-Car Gen5 uses SCMI clock protocol driver instead. This is a preparatory change for R-Car Gen5. No functional change. Signed-off-by: Marek Vasut <[email protected]>
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 <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
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 <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
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 <[email protected]>
2025-03-11clk: rzg2l: Ignore disable for core clocksPaul Barker
Following on from commit 9a699a0a0d62 ("clk: rzg2l: Ignore enable for core clocks"), we also need to ignore attempts to disable core clocks to avoid the need for conditionals around clk_disable_bulk() calls in drivers which support both RZ/G2L and other Renesas SoCs. Signed-off-by: Paul Barker <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2024-12-20clk: renesas: r8a779h0: Drop CLK_PLL2_DIV2 to clarify ZCn clocksGeert Uytterhoeven
Early revisions of the R-Car V4M Series Hardware User’s Manual contained an incorrect formula for the CPU core clocks: ZCnφ = (PLL2VCO x 1/2) x mult/32 Dang-san fixed this by using CLK_PLL2_DIV2 instead of CLK_PLL2 as the parent clock. In Rev.0.70 of the documentation, the formula was corrected to: ZCnφ = (PLL2VCO x 1/4) x mult/32 As the CPG Block Diagram now shows a separate 1/4 post-divider for PLL2, the use of CLK_PLL2_DIV2 is a recurring source of confusion. Hence get rid of CLK_PLL2_DIV2, and include the proper 1/4 post-divider in the invocation of the DEF_GEN4_Z() macro, like is done on other R-Car Gen4 (and Gen3) SoCs. Ported from Linux commit 92850bed9d4d ("clk: renesas: r8a779h0: Drop CLK_PLL2_DIV2 to clarify ZCn clocks") Reported-by: Vinh Nguyen <[email protected]> Signed-off-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/0d2789cac2bf306145fe0bbf269c2da5942bb68f.1728377724.git.geert+renesas@glider.be Signed-off-by: Marek Vasut <[email protected]>
2024-12-11clk: renesas: Fix R-Car spellingMarek Vasut
The correct spelling is R-Car, including the dash, update the usage. Kconfig strings and comment changes only, no functional change. Signed-off-by: Marek Vasut <[email protected]>
2024-12-08clk: rzg2l: Ignore enable for core clocksPaul Barker
In the RZ/G2L family, core clocks are always on and can't be disabled. However, drivers which are shared with other SoCs may call clk_enable() or clk_enable_bulk() for a clock referenced in the device tree which happens to be a core clock on the RZ/G2L. To avoid the need for conditionals in these drivers, simply ignore attempts to enable a core clock. Signed-off-by: Paul Barker <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2024-11-03clk: renesas: Fix missing unbind on driver look up failureMarek Vasut
In case lists_driver_lookup_name("rst_gen3") fails, the clk_gen3 driver has to be unbound before erroring out. Reorder the function such that both clk_gen3 and rst_gen3 drivers are looked up first, if either look up fails then the function errors out right away. Second, the clk_gen3 is bound, if binding fails, the function still errors out right away because there is nothing to undo after either lists_driver_lookup_name() call. Finally, rst_gen3 is bound and if this binding fails, then that is the only place where clk_gen3 has to be unbound before erroring out. Signed-off-by: Marek Vasut <[email protected]>
2024-10-13clk: renesas: Synchronize R-Car R8A779H0 V4M clock tables with Linux 6.10.9Marek Vasut
Synchronize R-Car R8A779H0 V4M clock tables with Linux 6.10.9, commit 1611860f184a2c9e74ed593948d43657734a7098 . Signed-off-by: Marek Vasut <[email protected]>
2024-10-13clk: renesas: Synchronize R-Car R8A779G0 V4H clock tables with Linux 6.10.9Marek Vasut
Synchronize R-Car R8A779G0 V4H clock tables with Linux 6.10.9, commit 1611860f184a2c9e74ed593948d43657734a7098 . Signed-off-by: Marek Vasut <[email protected]>
2024-10-13clk: renesas: Synchronize R-Car R8A779F0 S4 clock tables with Linux 6.10.9Marek Vasut
Synchronize R-Car R8A779F0 S4 clock tables with Linux 6.10.9, commit 1611860f184a2c9e74ed593948d43657734a7098 . Signed-off-by: Marek Vasut <[email protected]>
2024-10-13clk: renesas: Synchronize R-Car R8A779A0 V3U clock tables with Linux 6.10.9Marek Vasut
Synchronize R-Car R8A779A0 V3U clock tables with Linux 6.10.9, commit 1611860f184a2c9e74ed593948d43657734a7098 . Signed-off-by: Marek Vasut <[email protected]>
2024-10-05clk: renesas: rcar-gen3: Fix SSCG caching replacement with MDSEL/PE cachingMarek Vasut
The SSCG is active with MDSEL[12] is not set. Previous commit 99c7e031196d ("clk: renesas: rcar-gen3: Replace SSCG caching with MDSEL/PE caching") inverted the conditional assignment of priv->sscg = !(cpg_mode & BIT(12)) during conversion from (priv->sscg ? 16 : 0) to priv->cpg_mode & BIT(core->offset) ? 16 : 0; Invert the assignment back to the correct state. This fixes R8A77980, R8A77990, R8A77995 and R8A774C0. Fixes: 99c7e031196d ("clk: renesas: rcar-gen3: Replace SSCG caching with MDSEL/PE caching") Signed-off-by: Marek Vasut <[email protected]>
2024-07-06clk: renesas: Synchronize R-Car R8A779H0 V4M clock tables with Linux 6.9.3Marek Vasut
Synchronize R-Car R8A779H0 V4M clock tables with Linux 6.9.3, commit 1b4861e32e461b6fae14dc49ed0f1c7f20af5146 . Signed-off-by: Marek Vasut <[email protected]>
2024-07-06clk: renesas: Synchronize R-Car R8A779G0 V4H clock tables with Linux 6.9.3Marek Vasut
Synchronize R-Car R8A779G0 V4H clock tables with Linux 6.9.3, commit 1b4861e32e461b6fae14dc49ed0f1c7f20af5146 . Signed-off-by: Marek Vasut <[email protected]>
2024-07-06clk: renesas: Synchronize R-Car R8A779F0 S4 clock tables with Linux 6.9.3Marek Vasut
Synchronize R-Car R8A779F0 S4 clock tables with Linux 6.9.3, commit 1b4861e32e461b6fae14dc49ed0f1c7f20af5146 . Signed-off-by: Marek Vasut <[email protected]>
2024-07-06clk: renesas: Synchronize R-Car R8A779A0 V3U clock tables with Linux 6.9.3Marek Vasut
Synchronize R-Car R8A779A0 V3U clock tables with Linux 6.9.3, commit 1b4861e32e461b6fae14dc49ed0f1c7f20af5146 . Signed-off-by: Marek Vasut <[email protected]>
2024-07-06clk: renesas: Synchronize R-Car R8A77951 H3 clock tables with Linux 6.9.3Marek Vasut
Synchronize R-Car R8A77951 H3 clock tables with Linux 6.9.3, commit 1b4861e32e461b6fae14dc49ed0f1c7f20af5146 . Signed-off-by: Marek Vasut <[email protected]>
2024-04-22common: Convert *.c/h from UTF-8 to ASCII enconfingMichal Simek
Convert UTF-8 chars to ASCII in cases where make sense. No Copyright or names are converted. Signed-off-by: Michal Simek <[email protected]> Reviewed-by: Tom Rini <[email protected]> Acked-by: Marek Behún <[email protected]>
2024-03-02Merge patch series "ARM: renesas: Rename R-Mobile to Renesas"Tom Rini
Marek Vasut <[email protected]> says: Rename R-Mobile to Renesas all over the place because the chips are made by Renesas, while only a subset of them is from the R-Mobile line.
2024-03-02ARM: renesas: Rename ARCH_RMOBILE to ARCH_RENESASMarek Vasut
Rename ARCH_RMOBILE to ARCH_RENESAS because all the chips are made by Renesas, while only a subset of them is from the R-Mobile line. Use the following command to perform the rename: " $ git grep -l 'ARCH_RMOBILE' | xargs -I {} sed -i 's@ARCH_RMOBILE@ARCH_RENESAS@g' {} " Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Paul Barker <[email protected]>
2024-02-28clk: renesas: Confirm all clock & reset changes on RZ/G2LPaul Barker
When enabling/disabling a clock or reset signal, confirm that the change has completed before returning from the function. A somewhat arbitrary 100ms timeout is defined to ensure that the system doesn't lock up in the case of an error. Since we need to dynamically determine if we're waiting for a 0 bit or a 1 bit, it's easier to use wait_for_bit_32() than readl_poll_timeout(). This change is needed for reliable initialization of the I2C driver which is added in a following patch. Signed-off-by: Paul Barker <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2024-02-17clk: renesas: Fix broken clocks on all Gen2 boardsNiklas Söderlund
To prepare support for multiple register layouts pointers to register tables where added to struct cpg_mssr_info. These pointers are suppose to be filled in at probe time and no intended change in behavior was intended. However the new pointers where only filled in by some paths of the driver implemented in clk-rcar-gen3.c. The path implemented in clk-rcar-gen2.c was not updated leaving the pointers uninitialized leading to a crash when trying to probe the clocks. Fix this by filling in the pointers in the Gen2 code path with the values used before they where moved to struct cpg_mssr_info. Fixes: d413214fb748 ("clk: renesas: Add register pointers into struct cpg_mssr_info") Signed-off-by: Niklas Söderlund <[email protected]> Acked-by: Marek Vasut <[email protected]> Tested-by: Marek Vasut <[email protected]> # R8A7791 Porter Reviewed-by: Geert Uytterhoeven <[email protected]>
2024-02-10clk: renesas: Implement R8A779H0 V4M PLL7 supportMarek Vasut
Add PLL7 support to Gen3/Gen4 common clock driver. Add initial PLL7 multiplier and divider values into table in R8A779H0 V4M clock driver. The PLL7 is new PLL added in R8A779H0 V4M SoC. Only integer multiplication mode is supported by PLL7. The PLL reference clock are either 16.66 MHz or 20 MHz on R8A779H0 V4M SoC, and the output frequency must be 2000 MHz. The multiplier values fitting this requirement are calculated to 120 or 100. Signed-off-by: Marek Vasut <[email protected]>
2024-02-10clk: renesas: Add R8A779H0 V4M clock tablesHai Pham
Add clock tables for R8A779H0 V4M SoC. The current version is imported from: https://lore.kernel.org/linux-renesas-soc/c678ef7164e3777fa91572f72e47ef385cea64b8.1706194617.git.geert+renesas@glider.be/ The current version still contains PLL7 extras from the previous version to provide ethernet support in U-Boot. Signed-off-by: Hai Pham <[email protected]>
2024-01-27clk: renesas: Drop include common.hMarek Vasut
The header file is not necessary in either of those files, remove it as common.h is going away. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Paul Barker <[email protected]>
2024-01-14clk: renesas: Synchronize RZ R8A774E1 RZ/G2H clock tables with Linux 6.6.3Marek Vasut
Synchronize RZ R8A774E1 RZ/G2H clock tables with Linux 6.6.3, commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 . Signed-off-by: Marek Vasut <[email protected]>
2024-01-14clk: renesas: Synchronize RZ R8A774C0 RZ/G2E clock tables with Linux 6.6.3Marek Vasut
Synchronize RZ R8A774C0 RZ/G2E clock tables with Linux 6.6.3, commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 . Signed-off-by: Marek Vasut <[email protected]>
2024-01-14clk: renesas: Synchronize RZ R8A774B1 RZ/G2N clock tables with Linux 6.6.3Marek Vasut
Synchronize RZ R8A774B1 RZ/G2N clock tables with Linux 6.6.3, commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 . Signed-off-by: Marek Vasut <[email protected]>
2024-01-14clk: renesas: Synchronize RZ R8A774A1 RZ/G2M clock tables with Linux 6.6.3Marek Vasut
Synchronize RZ R8A774A1 RZ/G2M clock tables with Linux 6.6.3, commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 . Signed-off-by: Marek Vasut <[email protected]>
2024-01-14clk: renesas: Synchronize R-Car R8A77995 D3 clock tables with Linux 6.6.3Marek Vasut
Synchronize R-Car R8A77995 D3 clock tables with Linux 6.6.3, commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 . Signed-off-by: Marek Vasut <[email protected]>
2024-01-14clk: renesas: Synchronize R-Car R8A77990 E3 clock tables with Linux 6.6.3Marek Vasut
Synchronize R-Car R8A77990 E3 clock tables with Linux 6.6.3, commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 . Signed-off-by: Marek Vasut <[email protected]>
2024-01-14clk: renesas: Synchronize R-Car R8A77965 M3-N clock tables with Linux 6.6.3Marek Vasut
Synchronize R-Car R8A77965 M3-N clock tables with Linux 6.6.3, commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 . Signed-off-by: Marek Vasut <[email protected]>
2024-01-14clk: renesas: Synchronize R-Car R8A77960 M3-W and R8A77961 M3-W+ clock ↵Marek Vasut
tables with Linux 6.6.3 Synchronize R-Car R8A77960 M3-W and R8A77961 M3-W+ clock tables with Linux 6.6.3, commit bd3a9e5771a8b332f466d06f7c130a69cab0d526 . Add ZG clock macro into rcar-gen3-cpg.h to cover the new clock type . Signed-off-by: Marek Vasut <[email protected]>
2023-11-02clk: rzg2l: Drop <common.h>Paul Barker
In line with changes elsewhere, drop inclusion of the common header. Signed-off-by: Paul Barker <[email protected]>
2023-10-16clk: renesas: Add RZ/G2L & RZ/G2LC CPG driverPaul Barker
This driver provides clock and reset control for the Renesas R9A07G044L (RZ/G2L) and R9A07G044C (RZ/G2LC) SoC. It consists of two parts: * driver code which is applicable to all SoCs in the RZ/G2L family. * static data describing the clocks and resets which are specific to the R9A07G044{L,C} SoCs. The identifier r9a07g044 (without a final letter) is used to indicate that both SoCs are supported. clk_set_rate() and clk_get_rate() are implemented only for the clocks that are actually used in u-boot. The CPG driver is marked with DM_FLAG_PRE_RELOC to ensure that its bind function is called before the SCIF (serial port) driver is probed. This is required so that we can de-assert the relevant reset signal during the serial driver probe function. This patch is based on the corresponding Linux v6.5 driver (commit 52e12027d50affbf60c6c9c64db8017391b0c22e). Signed-off-by: Paul Barker <[email protected]> Reviewed-by: Biju Das <[email protected]> Reviewed-by: Lad Prabhakar <[email protected]> Reviewed-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A774E1 RZ/G2H clock tables with Linux 6.5.3Marek Vasut
Synchronize R8A774E1 RZ/G2H clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A774C0 RZ/G2E clock tables with Linux 6.5.3Marek Vasut
Synchronize R8A774C0 RZ/G2E clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A774B1 RZ/G2N clock tables with Linux 6.5.3Marek Vasut
Synchronize R8A774B1 RZ/G2N clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A774A1 RZ/G2M clock tables with Linux 6.5.3Marek Vasut
Synchronize R8A774A1 RZ/G2M clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A779G0 V4H clock tables with Linux 6.5.3Marek Vasut
Synchronize R-Car R8A779G0 V4H clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . The PLL2_VAR is not implemented yet and PLL2 is still configured as regular PLL2 only. Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A779F0 S4 clock tables with Linux 6.5.3Marek Vasut
Synchronize R-Car R8A779F0 S4 clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A779A0 V3U clock tables with Linux 6.5.3Marek Vasut
Synchronize R-Car R8A779A0 V3U clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A77995 D3 clock tables with Linux 6.5.3Marek Vasut
Synchronize R-Car R8A77995 D3 clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A77990 E3 clock tables with Linux 6.5.3Marek Vasut
Synchronize R-Car R8A77990 E3 clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>
2023-10-01clk: renesas: Synchronize R8A77980 V3H clock tables with Linux 6.5.3Marek Vasut
Synchronize R-Car R8A77980 V3H clock tables with Linux 6.5.3, commit 238589d0f7b421aae18c5704dc931595019fa6c7 . Signed-off-by: Marek Vasut <[email protected]>