aboutsummaryrefslogtreecommitdiff
path: root/lib/fconf
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fconf')
-rw-r--r--lib/fconf/fconf_dyn_cfg_getter.c12
-rw-r--r--lib/fconf/fconf_tbbr_getter.c12
2 files changed, 16 insertions, 8 deletions
diff --git a/lib/fconf/fconf_dyn_cfg_getter.c b/lib/fconf/fconf_dyn_cfg_getter.c
index 56e0c4ae7..7b5bd6ec9 100644
--- a/lib/fconf/fconf_dyn_cfg_getter.c
+++ b/lib/fconf/fconf_dyn_cfg_getter.c
@@ -57,26 +57,32 @@ int fconf_populate_dtb_registry(uintptr_t config)
}
fdt_for_each_subnode(child, dtb, node) {
+ uint32_t val32;
+ uint64_t val64;
+
dtb_info = pool_alloc(&dtb_info_pool);
/* Read configuration dtb information */
- rc = fdtw_read_cells(dtb, child, "load-address", 2, &dtb_info->config_addr);
+ rc = fdt_read_uint64(dtb, child, "load-address", &val64);
if (rc < 0) {
ERROR("FCONF: Incomplete configuration property in dtb-registry.\n");
return rc;
}
+ dtb_info->config_addr = (uintptr_t)val64;
- rc = fdtw_read_cells(dtb, child, "max-size", 1, &dtb_info->config_max_size);
+ rc = fdt_read_uint32(dtb, child, "max-size", &val32);
if (rc < 0) {
ERROR("FCONF: Incomplete configuration property in dtb-registry.\n");
return rc;
}
+ dtb_info->config_max_size = val32;
- rc = fdtw_read_cells(dtb, child, "id", 1, &dtb_info->config_id);
+ rc = fdt_read_uint32(dtb, child, "id", &val32);
if (rc < 0) {
ERROR("FCONF: Incomplete configuration property in dtb-registry.\n");
return rc;
}
+ dtb_info->config_id = val32;
VERBOSE("FCONF: dyn_cfg.dtb_registry cell found with:\n");
VERBOSE("\tload-address = %lx\n", dtb_info->config_addr);
diff --git a/lib/fconf/fconf_tbbr_getter.c b/lib/fconf/fconf_tbbr_getter.c
index a4d61d8cd..21278019e 100644
--- a/lib/fconf/fconf_tbbr_getter.c
+++ b/lib/fconf/fconf_tbbr_getter.c
@@ -17,6 +17,8 @@ int fconf_populate_tbbr_dyn_config(uintptr_t config)
{
int err;
int node;
+ uint64_t val64;
+ uint32_t val32;
/* As libfdt use void *, we can't avoid this cast */
const void *dtb = (void *)config;
@@ -30,7 +32,7 @@ int fconf_populate_tbbr_dyn_config(uintptr_t config)
}
/* Locate the disable_auth cell and read the value */
- err = fdtw_read_cells(dtb, node, "disable_auth", 1, &tbbr_dyn_config.disable_auth);
+ err = fdt_read_uint32(dtb, node, "disable_auth", &tbbr_dyn_config.disable_auth);
if (err < 0) {
WARN("FCONF: Read cell failed for `disable_auth`\n");
return err;
@@ -48,19 +50,19 @@ int fconf_populate_tbbr_dyn_config(uintptr_t config)
#endif
/* Retrieve the Mbed TLS heap details from the DTB */
- err = fdtw_read_cells(dtb, node,
- "mbedtls_heap_addr", 2, &tbbr_dyn_config.mbedtls_heap_addr);
+ err = fdt_read_uint64(dtb, node, "mbedtls_heap_addr", &val64);
if (err < 0) {
ERROR("FCONF: Read cell failed for mbedtls_heap\n");
return err;
}
+ tbbr_dyn_config.mbedtls_heap_addr = (void *)(uintptr_t)val64;
- err = fdtw_read_cells(dtb, node,
- "mbedtls_heap_size", 1, &tbbr_dyn_config.mbedtls_heap_size);
+ err = fdt_read_uint32(dtb, node, "mbedtls_heap_size", &val32);
if (err < 0) {
ERROR("FCONF: Read cell failed for mbedtls_heap\n");
return err;
}
+ tbbr_dyn_config.mbedtls_heap_size = val32;
VERBOSE("FCONF:tbbr.disable_auth cell found with value = %d\n",
tbbr_dyn_config.disable_auth);