mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-28 08:08:45 +00:00
fix(st): update dt_get_ddr_size() type
Move to size_t to ensure a generic algorithm whatever the platform architecture. Signed-off-by: Nicolas Le Bayon <nicolas.le.bayon@st.com> Change-Id: I7879367849ed86750dcff2b6a15f4b998bf6da18 Signed-off-by: Sebastien PASDELOUP <sebastien.pasdeloup-ext@st.com>
This commit is contained in:
parent
f4d765a128
commit
2a4abe0b37
2 changed files with 9 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020-2022, STMicroelectronics - All Rights Reserved
|
* Copyright (c) 2020-2023, STMicroelectronics - All Rights Reserved
|
||||||
* 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
|
* 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_node(struct dt_node_info *info, int offset, const char *compat);
|
||||||
int dt_get_stdout_uart_info(struct dt_node_info *info);
|
int dt_get_stdout_uart_info(struct dt_node_info *info);
|
||||||
int dt_match_instance_by_compatible(const char *compatible, uintptr_t address);
|
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);
|
uint32_t dt_get_pwr_vdd_voltage(void);
|
||||||
struct rdev *dt_get_vdd_regulator(void);
|
struct rdev *dt_get_vdd_regulator(void);
|
||||||
struct rdev *dt_get_cpu_regulator(void);
|
struct rdev *dt_get_cpu_regulator(void);
|
||||||
|
|
|
@ -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
|
* 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.
|
* This function gets DDR size information from the DT.
|
||||||
* Returns value in bytes on success, and 0 on failure.
|
* 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;
|
int node;
|
||||||
|
|
||||||
if (size != 0U) {
|
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);
|
node = fdt_node_offset_by_compatible(fdt, -1, DT_DDR_COMPAT);
|
||||||
if (node < 0) {
|
if (node < 0) {
|
||||||
INFO("%s: Cannot read DDR node in DT\n", __func__);
|
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;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue