diff --git a/plat/st/common/include/stm32mp_dt.h b/plat/st/common/include/stm32mp_dt.h index b7bf1d012..2d1165365 100644 --- a/plat/st/common/include/stm32mp_dt.h +++ b/plat/st/common/include/stm32mp_dt.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2020-2022, STMicroelectronics - All Rights Reserved - * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2020-2023, STMicroelectronics - All Rights Reserved + * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -35,7 +35,7 @@ void dt_fill_device_info(struct dt_node_info *info, int node); int dt_get_node(struct dt_node_info *info, int offset, const char *compat); int dt_get_stdout_uart_info(struct dt_node_info *info); int dt_match_instance_by_compatible(const char *compatible, uintptr_t address); -uint32_t dt_get_ddr_size(void); +size_t dt_get_ddr_size(void); uint32_t dt_get_pwr_vdd_voltage(void); struct rdev *dt_get_vdd_regulator(void); struct rdev *dt_get_cpu_regulator(void); diff --git a/plat/st/common/stm32mp_dt.c b/plat/st/common/stm32mp_dt.c index 34d52e1d7..1cbf51bac 100644 --- a/plat/st/common/stm32mp_dt.c +++ b/plat/st/common/stm32mp_dt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -228,9 +228,9 @@ int dt_match_instance_by_compatible(const char *compatible, uintptr_t address) * This function gets DDR size information from the DT. * Returns value in bytes on success, and 0 on failure. ******************************************************************************/ -uint32_t dt_get_ddr_size(void) +size_t dt_get_ddr_size(void) { - static uint32_t size; + static size_t size; int node; if (size != 0U) { @@ -240,12 +240,12 @@ uint32_t dt_get_ddr_size(void) node = fdt_node_offset_by_compatible(fdt, -1, DT_DDR_COMPAT); if (node < 0) { INFO("%s: Cannot read DDR node in DT\n", __func__); - return 0; + return 0U; } - size = fdt_read_uint32_default(fdt, node, "st,mem-size", 0U); + size = (size_t)fdt_read_uint32_default(fdt, node, "st,mem-size", 0U); - flush_dcache_range((uintptr_t)&size, sizeof(uint32_t)); + flush_dcache_range((uintptr_t)&size, sizeof(size_t)); return size; }