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

stm32mp1: save boot interface in a static variable


In stm32_get_boot_interface(), there is no need to read the backup register
in which the boot interface and instance is saved. It can be saved in a
static variable. It will save time if it is used several times.

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


Reviewed-by: default avatarCITOOLS <smet-aci-reviews@lists.codex.cro.st.com>
Reviewed-by: default avatarCIBUILD <smet-aci-builds@lists.codex.cro.st.com>
Reviewed-by: default avatarLionel DEBIEVE <lionel.debieve@st.com>
parent a7a67d04
No related branches found
No related tags found
No related merge requests found
......@@ -466,14 +466,17 @@ int stm32_save_boot_interface(uint32_t interface, uint32_t instance)
int stm32_get_boot_interface(uint32_t *interface, uint32_t *instance)
{
uint32_t itf;
uint32_t bkpr = tamp_bkpr(TAMP_BOOT_ITF_BACKUP_REG_ID);
static uint32_t itf;
clk_enable(RTCAPB);
if (itf == 0U) {
uint32_t bkpr = tamp_bkpr(TAMP_BOOT_ITF_BACKUP_REG_ID);
itf = (mmio_read_32(bkpr) & TAMP_BOOT_ITF_MASK) >> TAMP_BOOT_ITF_SHIFT;
clk_enable(RTCAPB);
clk_disable(RTCAPB);
itf = (mmio_read_32(bkpr) & TAMP_BOOT_ITF_MASK) >> TAMP_BOOT_ITF_SHIFT;
clk_disable(RTCAPB);
}
*interface = itf >> 4;
*instance = itf & 0xFU;
......
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