Skip to content
Snippets Groups Projects
Commit 9d948eeb authored by Yann Gautier's avatar Yann Gautier Committed by Sebastien Pasdeloup
Browse files

stm32mp1: add a function to check boot is from serial device


This function will return true if the platform has booted from UART or USB,
false if it booted from a storage device.

Change-Id: I427f87cb3005c337b878430d2d484fb43236d5ea
Signed-off-by: default avatarYann Gautier <yann.gautier@st.com>
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/tf-a/+/188655


Reviewed-by: default avatarCITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: default avatarSebastien PASDELOUP <sebastien.pasdeloup-ext@st.com>
Tested-by: default avatarSebastien PASDELOUP <sebastien.pasdeloup-ext@st.com>
parent 57ac430e
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ bool stm32mp1_is_wakeup_from_standby(void);
int stm32_save_boot_interface(uint32_t interface, uint32_t instance);
int stm32_get_boot_interface(uint32_t *interface, uint32_t *instance);
bool stm32_boot_is_serial(void);
enum etzpc_decprot_attributes stm32mp_etzpc_binding2decprot(uint32_t mode);
......
......@@ -843,6 +843,21 @@ int stm32_get_boot_interface(uint32_t *interface, uint32_t *instance)
return 0;
}
bool stm32_boot_is_serial(void)
{
uint32_t boot_itf;
uint32_t boot_instance;
stm32_get_boot_interface(&boot_itf, &boot_instance);
if ((boot_itf == BOOT_API_CTX_BOOT_INTERFACE_SEL_SERIAL_UART) ||
(boot_itf == BOOT_API_CTX_BOOT_INTERFACE_SEL_SERIAL_USB)) {
return true;
}
return false;
}
#if defined(IMAGE_BL32) && DEBUG
static const char *const dump_table[] = {
"sp_usr ",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment