Commit graph

12 commits

Author SHA1 Message Date
Yann Gautier
47ea303389 feat(stm32mp2): use early traces
Replace ERROR message with EARLY_ERROR for OTP driver probe, as this
will be called before default console is enabled.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I756a04727c494d5f681a45d47d01189dff07dbe7
2024-04-24 15:44:28 +02:00
Yann Gautier
94cad75a35 refactor(st): replace STM32MP_EARLY_CONSOLE with EARLY_CONSOLE
Now that EARLY_CONSOLE is generic, use it instead of the ST flag.
Remove stm32mp_setup_early_console() calls as it is done in common TF-A
code.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Icac29b62a6267303cb5c679d15847c013ead1d23
2024-04-24 15:44:28 +02:00
Yann Gautier
2e905c0682 feat(stm32mp2): add STM32MP_USB_PROGRAMMER compilation
Add minimal compilation step when enabling STM32MP_USB_PROGRAMMER flag
on STM32MP2. Add DWL_BUFFER_BASE in platform.mk and the compilation
of the new file plat/st/stm32mp2/stm32mp2_usb_dfu.c (just stubs for
the moment).

Signed-off-by: Pankaj Dev <pankaj.dev@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I8891ff23ddc3d40d7477ada3e49e439dd8af8316
2024-02-05 09:25:02 +01:00
Yann Gautier
197ac780d7 feat(stm32mp2): add BSEC and OTP support
Add compilation and initialization of BSEC peripheral, to access OTP
fuses. Add the definition of OTP fuses.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: If6403838b1e2c04c59effc8545b381aced5f7cda
2024-01-23 14:49:43 +01:00
Yann Gautier
cb0d6b5b5f fix(stm32mp2): add missing include
Without #include <plat/common/platform.h>, we have the following warning
with sparse:
plat/st/stm32mp2/bl2_plat_setup.c:15:6: warning: symbol
 'bl2_el3_early_platform_setup' was not declared. Should it be static?
plat/st/stm32mp2/bl2_plat_setup.c:23:6: warning: symbol
 'bl2_platform_setup' was not declared. Should it be static?
plat/st/stm32mp2/bl2_plat_setup.c:27:6: warning: symbol
 'bl2_el3_plat_arch_setup' was not declared. Should it be static?

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I18f9265c1eef1f8e8e0eac3d6c37a959e5c9e8b6
2024-01-18 11:32:10 +01:00
Yann Gautier
3007c72844 feat(st): do not directly call BSEC functions in common code
When STM32MP2 boots on Cortex-M33, the Cortex-A35 do no more have access
to BSEC peripheral. New static inline stm32_otp_* wrappers are added,
which just redirect to BSEC functions.

While at it remove a useless bsec.h include.

Change-Id: Ie0f917c02e48acf456634f455dae41805bf6adbf
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
2024-01-18 11:30:42 +01:00
Antonio Borneo
2331a34f78 feat(stm32mp2): put back core 1 in wfi after debugger's halt
The core 1 is put in wfi for pen holding. If a debugger halts the
core, it causes the core to exit from wfi.

Let the core to jump back in wfi when the debugger resumes the
core's execution.

Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Change-Id: I9b5607b05cdcde905dc4047af8d6f1292d53d701
2024-01-12 17:04:38 +01:00
Yann Gautier
d1c85da8ef feat(stm32mp2): add plat_my_core_pos
This function is required, at least for bakery locks.

Change-Id: I28906c50e0a0ebff5d387a424247513ec1a599fc
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2024-01-12 17:04:30 +01:00
Yann Gautier
4da462dcdc fix(stm32mp2): correct early/crash console init
The former code, using x2 register, was removing the LPEN bit from UART
config register. So the UART clock is stopped as soon as the CA35 is in
CSleep. It was then displaying crap in Linux console.
The ands check instruction is replaced with a clearer tst instruction
directly with the bit to be tested.

Change-Id: I8a2b3ab195981dee2962e0c2f5d501d5933c17f4
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2024-01-12 17:04:07 +01:00
Yann Gautier
e5839ed79e feat(stm32mp2): generate stm32 file
To be able to boot, STM32MPU platforms require the BL2 binary (together
with its DT) to be preceded with an STM32 header. Add the required
files and macro to properly generate this header.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I675de2c5cb733fe9d9e9baf76a941741a06dfac8
2023-09-08 10:56:49 +02:00
Yann Gautier
87a940e027 feat(stm32mp2): add console configuration
Use UART driver and fill helpers for crash console.
Add early console setup in bl2_el3_early_platform_setup().

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: Ifb39554214dec05dafe4e306f8754e1454cdab61
2023-09-08 10:56:49 +02:00
Yann Gautier
35527fb418 feat(st): introduce new platform STM32MP2
This new STMicroelectronics SoC is based on a dual Cortex-A35.
For the moment, only BL2 is compiled with the common parts for ST
platforms.

Change-Id: I1bc4e6835dba4230359ea9b26d736791e27258aa
Signed-off-by: Yann Gautier <yann.gautier@st.com>
2023-09-08 10:56:49 +02:00