From 225d10b5914dbfc8f62808732c092205c146411e Mon Sep 17 00:00:00 2001 From: Sadik Ozer Date: Sat, 21 Dec 2024 15:02:53 +0300 Subject: [PATCH] Update MAX32657 cache controller access MAX32657 cache controller only accessibly by secure world. This commit add guard to invalid access Signed-off-by: Sadik Ozer --- Libraries/PeriphDrivers/Source/ICC/icc_me30.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Libraries/PeriphDrivers/Source/ICC/icc_me30.c b/Libraries/PeriphDrivers/Source/ICC/icc_me30.c index cace41e7ea..87e0f269fa 100644 --- a/Libraries/PeriphDrivers/Source/ICC/icc_me30.c +++ b/Libraries/PeriphDrivers/Source/ICC/icc_me30.c @@ -37,20 +37,31 @@ Maxim Internal Use int MXC_ICC_ID(mxc_icc_info_t cid) { +#if CONFIG_TRUSTED_EXECUTION_SECURE return MXC_ICC_RevA_ID((mxc_icc_reva_regs_t *)MXC_ICC, cid); +#else + return E_NOT_SUPPORTED; +#endif } void MXC_ICC_Enable(void) { + /* Cache controller only accessible in secure world. */ +#if CONFIG_TRUSTED_EXECUTION_SECURE MXC_ICC_RevA_Enable((mxc_icc_reva_regs_t *)MXC_ICC); +#endif } void MXC_ICC_Disable(void) { +#if CONFIG_TRUSTED_EXECUTION_SECURE MXC_ICC_RevA_Disable((mxc_icc_reva_regs_t *)MXC_ICC); +#endif } void MXC_ICC_Flush(void) { +#if CONFIG_TRUSTED_EXECUTION_SECURE MXC_ICC_Com_Flush(); +#endif }