Commit graph

14 commits

Author SHA1 Message Date
Yann Gautier
1a25db196d feat(st-clock): use early traces
Replace trace macros with their corresponding EARLY_* macros.

Change-Id: I39b163964fa3129be38e58352b5dee9b4081675b
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2024-06-11 14:02:10 +02:00
Yann Gautier
1be399b813 refactor(st-clock): move stm32mp1_clk_rcc_regs_*lock
Those functions are only used on MP1, they should not be in STM32 clock
core. Move them to MP13 driver (they are already in MP15 driver).
Redefine new clk_stm32_rcc_regs_*lock() functions in clock core. This
change avoid sparse warning:
drivers/st/clk/clk-stm32-core.c:46:6: warning: symbol
 'stm32mp1_clk_rcc_regs_lock' was not declared. Should it be static?
drivers/st/clk/clk-stm32-core.c:51:6: warning: symbol
 'stm32mp1_clk_rcc_regs_unlock' was not declared. Should it be static?

Change-Id: I9f255acaa843e41fc14267c1a8091f93bd029796
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
d9a7ddeb25 refactor(st-clock): driver size optimization
Re-ordering structures to avoid gaps and minimize data.
Reduce type of gate_refcounts[], uint8_t is enough.
Re-ordering structures to avoid gaps and minimize data.
Use an unsigned char to define a clock ops type.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Change-Id: I6b793dc34abdd6ef013609fc0f122da5d1824a34
2024-06-11 14:02:10 +02:00
Yann Gautier
698bba5e74 refactor(st-clock): remove BL32 support on STM32MP13
TF-A BL32 (SP_MIN) is not supported on STM32MP13. Only OP-TEE is used
as BL32. Remove the code under IMAGE_BL32 flag in STM32MP13 driver.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I6cc9f230782c44129b205e66a44cdb4bcb5f95c3
2024-06-11 14:02:10 +02:00
Yann Gautier
f655922788 feat(stm32mp1): always boot at 650MHz
Switching to higher CPU frequencies requires a dedicated chip version
(STM32MP1xxD or STM32MP1xxF), and increase CPU voltage. To avoid
re-configuring I2C and PMIC before and after applying clock tree,
always boot at 650MHz, which is the frequency for nominal voltage.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Id05a3ee17e7dd57e2d64dc06f8f1e7f9cb21e110
2024-06-11 14:02:10 +02:00
Gabriel Fernandez
6583da67d6 refactor(st-clock): remove LSEDRV_MEDIUM_HIGH for STM32MP13
Remove useless LSEDRV_MEDIUM_HIGH definition in clk-stm32mp13.c.
It's already defined in include/dt-bindings/clock/stm32mp13-clksrc.h.

Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Change-Id: Ie3fa4711930f922fa0733ba7c76d72ec9639e9a5
2024-06-11 14:01:34 +02:00
Patrick Delaunay
039b7d4673 fix(st-clock): display proper PLL number for STM32MP13
The PLL clk_id does not start at 0, but it is in the enum listing all
clocks. To have a better display of the PLL number, start at PLL1,
by changing pll->clk_id in messages with pll->clk_id - _CK_PLL1 + 1.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Change-Id: Ic09195ae6fe5f8d3a87e69962425f7c826f3670b
2024-06-11 11:45:38 +02:00
Yann Gautier
f4a2bb986b fix(st-clock): do not reconfigure LSE
If LSE oscillator is already ON, which is the case when returning from
low-power state or if we are on VBAT, it mustn't be reconfigured.

Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Change-Id: Ie75f2b0b42aeb3d95e2266e1fca811a2f2b3e29f
2024-06-11 11:45:38 +02:00
Gabriel Fernandez
1bbcb58a69 fix(st-clock): disabling CKPER clock is not functional on stm32mp13
The mask used to configure the CKPER MUX was wrong and unnecessary.

Change-Id: I40098f2a27b9e5ba8706ab5377d23f578c09838b
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
2023-05-30 15:39:50 +02:00
Yann Gautier
4198fa1db7 fix(st-clock): avoid arithmetics on pointers
This corrects MISRA C2012-18.4:
The +, -, += and -= operators should not be applied to an expression
of pointer type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I9128f567a7c83d8e3381428b07e6bd785be2703b
2022-12-07 14:18:31 +01:00
Yann Gautier
ee21709e98 fix(st-clock): give the size for parent_mp13 and dividers_mp13 tables
This corrects MISRA C2012-9.5:
Where designated initializers are used to initialize an array object
the size of the array shall be specified explicitly.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I4c331b0225af975fd022ffe9e5fd1d536ed59879
2022-12-07 14:18:31 +01:00
Yann Gautier
c3ae7da02d fix(st-clock): use Boolean type for tests
This corrects MISRA C2012-14.4
The controlling expression of an if statement and the controlling
expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Id217d3da223caf75cd0439d7ce11c9efab87b4d2
2022-12-07 14:18:31 +01:00
Gabriel Fernandez
3ff1ff4047 refactor(st-clock): code size optimization
Clock name is not used and can be removed for code size optimization.

Change-Id: I75f6a1828e4374004e31a7ce13fa6885c52bbac3
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
2022-08-10 09:56:32 +02:00
Gabriel Fernandez
9be88e75c1 feat(st-clock): add clock driver for STM32MP13
Add new clock driver for STM32MP13. Split the include file to manage
either STM32MP13 or STM32MP15.

Change-Id: Ia568cd12b1d5538809204f0fd2224d51e5d1e985
Signed-off-by: Gabriel Fernandez <gabriel.fernandez@st.com>
2022-03-22 09:09:23 +01:00