aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLionel Debieve <lionel.debieve@foss.st.com>2021-11-03 17:14:12 +0100
committerJérôme Forissier <jerome@forissier.org>2021-11-08 11:28:53 +0100
commitaabd492e7184065398dd1e8f6049b9f653a8f543 (patch)
treec500ce5f2bfde12c8a77dba5ff30fd0bb2b90ff6 /core
parent3ae6a7d7326cf157d75c39df3b822095cc08bb2f (diff)
drivers: stm32_rng: use reg_size to map virtual addresses
Use the register map size from the dt_node_info structure to call the phys_to_virt() function. Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Diffstat (limited to 'core')
-rw-r--r--core/drivers/stm32_rng.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/drivers/stm32_rng.c b/core/drivers/stm32_rng.c
index bbeb0f3c..fd961f91 100644
--- a/core/drivers/stm32_rng.c
+++ b/core/drivers/stm32_rng.c
@@ -217,7 +217,8 @@ static TEE_Result stm32_rng_init(void)
panic();
assert(dt_info.clock != DT_INFO_INVALID_CLOCK &&
- dt_info.reg != DT_INFO_INVALID_REG);
+ dt_info.reg != DT_INFO_INVALID_REG &&
+ dt_info.reg_size != DT_INFO_INVALID_REG_SIZE);
if (dt_info.status & DT_STATUS_OK_NSEC) {
stm32mp_register_non_secure_periph_iomem(dt_info.reg);
@@ -229,7 +230,7 @@ static TEE_Result stm32_rng_init(void)
stm32_rng->base.pa = dt_info.reg;
stm32_rng->base.va = (vaddr_t)phys_to_virt(dt_info.reg, mtype,
- 1);
+ dt_info.reg_size);
stm32_rng->clock = (unsigned long)dt_info.clock;