From 747fd1867bebc97ea3a65a6fd53fa2baa7b39a62 Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Wed, 5 Feb 2025 16:06:26 +0100 Subject: [PATCH] drivers: firewall: stm32_etzpc: remove header file Remove stm32_etzpc.h header file that is not required since the declared and defined resources are used internally in stm32_etzpc.c By the way, also remove inclusion of stm32mp15-etzpc.h DT bindings header file from stm32_rng.c where it is not needed. Signed-off-by: Etienne Carriere --- core/arch/arm/plat-stm32mp1/main.c | 1 - core/drivers/firewall/stm32_etzpc.c | 14 ++++++++--- core/drivers/stm32_rng.c | 4 ---- core/include/drivers/stm32_etzpc.h | 36 ----------------------------- 4 files changed, 11 insertions(+), 44 deletions(-) delete mode 100644 core/include/drivers/stm32_etzpc.h diff --git a/core/arch/arm/plat-stm32mp1/main.c b/core/arch/arm/plat-stm32mp1/main.c index b9075920aaa..3779fcb631e 100644 --- a/core/arch/arm/plat-stm32mp1/main.c +++ b/core/arch/arm/plat-stm32mp1/main.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/core/drivers/firewall/stm32_etzpc.c b/core/drivers/firewall/stm32_etzpc.c index 0c6c5875928..8e0ad40f8ad 100644 --- a/core/drivers/firewall/stm32_etzpc.c +++ b/core/drivers/firewall/stm32_etzpc.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #ifdef CFG_STM32MP15 #include @@ -67,6 +66,15 @@ #define TZMA_PM_LOCK_BIT BIT(15) #define TZMA_PM_VALUE_MASK GENMASK_32(9, 0) +/* ETZPC DECPROT bit field values */ +enum etzpc_decprot_attributes { + ETZPC_DECPROT_S_RW = 0, + ETZPC_DECPROT_NS_R_S_W = 1, + ETZPC_DECPROT_MCU_ISOLATION = 2, + ETZPC_DECPROT_NS_RW = 3, + ETZPC_DECPROT_MAX = 4, +}; + /* * struct stm32_etzpc_platdata - Driver data set at initialization * @@ -218,7 +226,7 @@ static void etzpc_configure_decprot(uint32_t decprot_id, etzpc_unlock(exceptions); } -enum etzpc_decprot_attributes etzpc_get_decprot(uint32_t decprot_id) +static enum etzpc_decprot_attributes etzpc_get_decprot(uint32_t decprot_id) { size_t offset = U(4) * (decprot_id / IDS_PER_DECPROT_REGS); uint32_t shift = (decprot_id % IDS_PER_DECPROT_REGS) << DECPROT_SHIFT; @@ -260,7 +268,7 @@ static bool decprot_is_locked(uint32_t decprot_id) return io_read32(base + offset + ETZPC_DECPROT_LOCK0) & mask; } -void etzpc_configure_tzma(uint32_t tzma_id, uint16_t tzma_value) +static void etzpc_configure_tzma(uint32_t tzma_id, uint16_t tzma_value) { size_t offset = sizeof(uint32_t) * tzma_id; vaddr_t base = etzpc_device->pdata.base.va; diff --git a/core/drivers/stm32_rng.c b/core/drivers/stm32_rng.c index e1875e7ca54..470ab1cf76b 100644 --- a/core/drivers/stm32_rng.c +++ b/core/drivers/stm32_rng.c @@ -7,10 +7,6 @@ #include #include #include -#if defined(CFG_STM32MP15) -#include -#include -#endif /* defined(CFG_STM32MP15) */ #include #include #include diff --git a/core/include/drivers/stm32_etzpc.h b/core/include/drivers/stm32_etzpc.h deleted file mode 100644 index e49d30de6e4..00000000000 --- a/core/include/drivers/stm32_etzpc.h +++ /dev/null @@ -1,36 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause */ -/* - * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved. - * Copyright (c) 2018-2019, STMicroelectronics - */ - -#ifndef __DRIVERS_STM32_ETZPC_H -#define __DRIVERS_STM32_ETZPC_H - -#include -#include - -enum etzpc_decprot_attributes { - ETZPC_DECPROT_S_RW = 0, - ETZPC_DECPROT_NS_R_S_W = 1, - ETZPC_DECPROT_MCU_ISOLATION = 2, - ETZPC_DECPROT_NS_RW = 3, - ETZPC_DECPROT_MAX = 4, -}; - -/* - * Get the DECPROT attribute - * @decprot_id: ID that is the index of the DECPROT in the ETZPC interface - * Return attribute of this DECPROT - */ -enum etzpc_decprot_attributes etzpc_get_decprot(uint32_t decprot_id); - -/* - * Configure the target TZMA secure memory range - * @tzma_id: ID that is the index of the TZMA in the ETZPC interface - * @tzma_value: Secure memory secure size in 4kByte page size. Note that this - * is an offset from the memory base address - */ -void etzpc_configure_tzma(uint32_t tzma_id, uint16_t tzma_value); - -#endif /*__DRIVERS_STM32_ETZPC_H*/