From bd738228e5936f90c9ffac7e45cbda54abf02357 Mon Sep 17 00:00:00 2001 From: Clement Faure Date: Fri, 25 Aug 2023 15:52:09 +0200 Subject: [PATCH] drivers: caam: check OPTEE DDR location if the CAAM DMA is 32 bits width On i.MX platforms, the CAAM DMA width is limited to 32 bits. That limitation requires OPTEE to be located in the 32 bits DDR address space. Signed-off-by: Clement Faure Acked-by: Jerome Forissier --- core/drivers/crypto/caam/caam_ctrl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/drivers/crypto/caam/caam_ctrl.c b/core/drivers/crypto/caam/caam_ctrl.c index b72508fca59..02aebdf01d7 100644 --- a/core/drivers/crypto/caam/caam_ctrl.c +++ b/core/drivers/crypto/caam/caam_ctrl.c @@ -4,6 +4,7 @@ * * Brief CAAM Global Controller. */ +#include #include #include #include @@ -21,6 +22,14 @@ #include #include +/* + * If the CAAM DMA only supports 32 bits physical addresses, OPTEE must + * be located within the 32 bits address space. + */ +#ifndef CFG_CAAM_64BIT +static_assert((CFG_TZDRAM_START + CFG_TZDRAM_SIZE) < UINT32_MAX); +#endif + /* Crypto driver initialization */ static TEE_Result crypto_driver_init(void) {