aboutsummaryrefslogtreecommitdiff
path: root/plat/st/stm32mp1/stm32mp1_context.c
diff options
context:
space:
mode:
authorYann Gautier <yann.gautier@st.com>2019-02-14 10:53:33 +0100
committerYann Gautier <yann.gautier@st.com>2019-02-14 11:20:23 +0100
commit0d21680c35f328f1b793f0765760e994d883ff12 (patch)
treec6e8b6e242aee14fbae6171261a63d31b5759b9d /plat/st/stm32mp1/stm32mp1_context.c
parent5202cb393da7f6f3a9cf48a49e2a12f3bdee2b16 (diff)
downloadtrusted-firmware-a-0d21680c35f328f1b793f0765760e994d883ff12.tar.gz
stm32mp1: update clock driver
Remove useless private structure in function prototypes. Add a reference counter on clocks. Prepare for future secured/shared/non-secured clocks. Change-Id: I3dbed81721da5ceff5e10b2c4155b1e340c036ee Signed-off-by: Yann Gautier <yann.gautier@st.com> Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Signed-off-by: Lionel Debieve <lionel.debieve@st.com> Signed-off-by: Nicolas LE BAYON <nicolas.le.bayon@st.com>
Diffstat (limited to 'plat/st/stm32mp1/stm32mp1_context.c')
-rw-r--r--plat/st/stm32mp1/stm32mp1_context.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/plat/st/stm32mp1/stm32mp1_context.c b/plat/st/stm32mp1/stm32mp1_context.c
index c402c2039b..cf8a91eb41 100644
--- a/plat/st/stm32mp1/stm32mp1_context.c
+++ b/plat/st/stm32mp1/stm32mp1_context.c
@@ -20,26 +20,16 @@
int stm32_save_boot_interface(uint32_t interface, uint32_t instance)
{
- uint32_t tamp_clk_off = 0;
uint32_t bkpr_itf_idx = tamp_bkpr(TAMP_BOOT_ITF_BACKUP_REG_ID);
- if (!stm32mp_clk_is_enabled(RTCAPB)) {
- tamp_clk_off = 1;
- if (stm32mp_clk_enable(RTCAPB) != 0) {
- return -EINVAL;
- }
- }
+ stm32mp_clk_enable(RTCAPB);
mmio_clrsetbits_32(bkpr_itf_idx,
TAMP_BOOT_ITF_MASK,
((interface << 4) | (instance & 0xFU)) <<
TAMP_BOOT_ITF_SHIFT);
- if (tamp_clk_off != 0U) {
- if (stm32mp_clk_disable(RTCAPB) != 0) {
- return -EINVAL;
- }
- }
+ stm32mp_clk_disable(RTCAPB);
return 0;
}