mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 22:05:40 +00:00
Merge changes I1df23bfa,Ibc85e30c into integration
* changes: fix(st): support device tree DDR sizes higher than 16Gbits for aarch64 feat(fdt-wrappers): add function to read uint64 with default value
This commit is contained in:
commit
cc3d73cc67
3 changed files with 22 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2023, ARM Limited and Contributors. All rights reserved.
|
* Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -88,6 +88,19 @@ int fdt_read_uint64(const void *dtb, int node, const char *prop_name,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t fdt_read_uint64_default(const void *dtb, int node,
|
||||||
|
const char *prop_name, uint64_t dflt_value)
|
||||||
|
{
|
||||||
|
uint64_t ret = dflt_value;
|
||||||
|
int err = fdt_read_uint64(dtb, node, prop_name, &ret);
|
||||||
|
|
||||||
|
if (err < 0) {
|
||||||
|
return dflt_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read bytes from a given property of the given node. Any number of
|
* Read bytes from a given property of the given node. Any number of
|
||||||
* bytes of the property can be read. The fdt pointer is updated.
|
* bytes of the property can be read. The fdt pointer is updated.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2023, Arm Limited and Contributors. All rights reserved.
|
* Copyright (c) 2018-2024, Arm Limited and Contributors. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -21,6 +21,8 @@ uint32_t fdt_read_uint32_default(const void *dtb, int node,
|
||||||
const char *prop_name, uint32_t dflt_value);
|
const char *prop_name, uint32_t dflt_value);
|
||||||
int fdt_read_uint64(const void *dtb, int node, const char *prop_name,
|
int fdt_read_uint64(const void *dtb, int node, const char *prop_name,
|
||||||
uint64_t *value);
|
uint64_t *value);
|
||||||
|
uint64_t fdt_read_uint64_default(const void *dtb, int node,
|
||||||
|
const char *prop_name, uint64_t dflt_value);
|
||||||
int fdt_read_uint32_array(const void *dtb, int node, const char *prop_name,
|
int fdt_read_uint32_array(const void *dtb, int node, const char *prop_name,
|
||||||
unsigned int cells, uint32_t *value);
|
unsigned int cells, uint32_t *value);
|
||||||
int fdtw_read_string(const void *dtb, int node, const char *prop,
|
int fdtw_read_string(const void *dtb, int node, const char *prop,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2023, Arm Limited and Contributors. All rights reserved.
|
* Copyright (c) 2017-2024, Arm Limited and Contributors. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -243,7 +243,11 @@ size_t dt_get_ddr_size(void)
|
||||||
return 0U;
|
return 0U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __aarch64__
|
||||||
|
size = (size_t)fdt_read_uint64_default(fdt, node, "st,mem-size", 0ULL);
|
||||||
|
#else /* __aarch64__ */
|
||||||
size = (size_t)fdt_read_uint32_default(fdt, node, "st,mem-size", 0U);
|
size = (size_t)fdt_read_uint32_default(fdt, node, "st,mem-size", 0U);
|
||||||
|
#endif /* __aarch64__ */
|
||||||
|
|
||||||
flush_dcache_range((uintptr_t)&size, sizeof(size_t));
|
flush_dcache_range((uintptr_t)&size, sizeof(size_t));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue