mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00

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>
35 lines
778 B
C
35 lines
778 B
C
/*
|
|
* Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <errno.h>
|
|
|
|
#include <platform_def.h>
|
|
|
|
#include <drivers/st/stm32mp1_clk.h>
|
|
#include <dt-bindings/clock/stm32mp1-clks.h>
|
|
#include <lib/mmio.h>
|
|
|
|
#include <stm32mp1_context.h>
|
|
|
|
#define TAMP_BOOT_ITF_BACKUP_REG_ID U(20)
|
|
#define TAMP_BOOT_ITF_MASK U(0x0000FF00)
|
|
#define TAMP_BOOT_ITF_SHIFT 8
|
|
|
|
int stm32_save_boot_interface(uint32_t interface, uint32_t instance)
|
|
{
|
|
uint32_t bkpr_itf_idx = tamp_bkpr(TAMP_BOOT_ITF_BACKUP_REG_ID);
|
|
|
|
stm32mp_clk_enable(RTCAPB);
|
|
|
|
mmio_clrsetbits_32(bkpr_itf_idx,
|
|
TAMP_BOOT_ITF_MASK,
|
|
((interface << 4) | (instance & 0xFU)) <<
|
|
TAMP_BOOT_ITF_SHIFT);
|
|
|
|
stm32mp_clk_disable(RTCAPB);
|
|
|
|
return 0;
|
|
}
|