summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/fdt_support.c3
-rw-r--r--common/image-fdt.c2
-rw-r--r--common/image-fit.c21
-rw-r--r--common/image-sig.c8
-rw-r--r--common/image.c19
5 files changed, 25 insertions, 28 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 202058621ae..0609470dfb8 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -523,7 +523,7 @@ void fdt_fixup_ethernet(void *fdt)
}
/* Resize the fdt to its actual size + a bit of padding */
-int fdt_shrink_to_minimum(void *blob)
+int fdt_shrink_to_minimum(void *blob, uint extrasize)
{
int i;
uint64_t addr, size;
@@ -551,6 +551,7 @@ int fdt_shrink_to_minimum(void *blob)
actualsize = fdt_off_dt_strings(blob) +
fdt_size_dt_strings(blob) + 5 * sizeof(struct fdt_reserve_entry);
+ actualsize += extrasize;
/* Make it so the fdt ends on a page boundary */
actualsize = ALIGN(actualsize + ((uintptr_t)blob & 0xfff), 0x1000);
actualsize = actualsize - ((uintptr_t)blob & 0xfff);
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 3d23608c043..5454227fc99 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -503,7 +503,7 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob,
lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,
(phys_size_t)fdt_totalsize(blob));
- ret = fdt_shrink_to_minimum(blob);
+ ret = fdt_shrink_to_minimum(blob, 0);
if (ret < 0)
goto err;
of_size = ret;
diff --git a/common/image-fit.c b/common/image-fit.c
index 1b0234a90cb..77dc011dc3b 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1026,7 +1026,7 @@ int fit_image_verify(const void *fit, int image_noffset)
}
/* Process all hash subnodes of the component image node */
- fdt_for_each_subnode(fit, noffset, image_noffset) {
+ fdt_for_each_subnode(noffset, fit, image_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
/*
@@ -1457,7 +1457,7 @@ int fit_conf_get_prop_node(const void *fit, int noffset,
void fit_conf_print(const void *fit, int noffset, const char *p)
{
char *desc;
- char *uname;
+ const char *uname;
int ret;
int loadables_index;
@@ -1469,7 +1469,7 @@ void fit_conf_print(const void *fit, int noffset, const char *p)
else
printf("%s\n", desc);
- uname = (char *)fdt_getprop(fit, noffset, FIT_KERNEL_PROP, NULL);
+ uname = fdt_getprop(fit, noffset, FIT_KERNEL_PROP, NULL);
printf("%s Kernel: ", p);
if (uname == NULL)
printf("unavailable\n");
@@ -1477,26 +1477,23 @@ void fit_conf_print(const void *fit, int noffset, const char *p)
printf("%s\n", uname);
/* Optional properties */
- uname = (char *)fdt_getprop(fit, noffset, FIT_RAMDISK_PROP, NULL);
+ uname = fdt_getprop(fit, noffset, FIT_RAMDISK_PROP, NULL);
if (uname)
printf("%s Init Ramdisk: %s\n", p, uname);
- uname = (char *)fdt_getprop(fit, noffset, FIT_FDT_PROP, NULL);
+ uname = fdt_getprop(fit, noffset, FIT_FDT_PROP, NULL);
if (uname)
printf("%s FDT: %s\n", p, uname);
- uname = (char *)fdt_getprop(fit, noffset, FIT_FPGA_PROP, NULL);
+ uname = fdt_getprop(fit, noffset, FIT_FPGA_PROP, NULL);
if (uname)
printf("%s FPGA: %s\n", p, uname);
/* Print out all of the specified loadables */
for (loadables_index = 0;
- fdt_get_string_index(fit, noffset,
- FIT_LOADABLE_PROP,
- loadables_index,
- (const char **)&uname) == 0;
- loadables_index++)
- {
+ uname = fdt_stringlist_get(fit, noffset, FIT_LOADABLE_PROP,
+ loadables_index, NULL), uname;
+ loadables_index++) {
if (loadables_index == 0) {
printf("%s Loadables: ", p);
} else {
diff --git a/common/image-sig.c b/common/image-sig.c
index eda5e1353ab..28f7a20cadf 100644
--- a/common/image-sig.c
+++ b/common/image-sig.c
@@ -212,7 +212,7 @@ static int fit_image_verify_sig(const void *fit, int image_noffset,
int ret;
/* Process all hash subnodes of the component image node */
- fdt_for_each_subnode(fit, noffset, image_noffset) {
+ fdt_for_each_subnode(noffset, fit, image_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
if (!strncmp(name, FIT_SIG_NODENAME,
@@ -260,7 +260,7 @@ int fit_image_verify_required_sigs(const void *fit, int image_noffset,
return 0;
}
- fdt_for_each_subnode(sig_blob, noffset, sig_node) {
+ fdt_for_each_subnode(noffset, sig_blob, sig_node) {
const char *required;
int ret;
@@ -393,7 +393,7 @@ static int fit_config_verify_sig(const void *fit, int conf_noffset,
int ret;
/* Process all hash subnodes of the component conf node */
- fdt_for_each_subnode(fit, noffset, conf_noffset) {
+ fdt_for_each_subnode(noffset, fit, conf_noffset) {
const char *name = fit_get_name(fit, noffset, NULL);
if (!strncmp(name, FIT_SIG_NODENAME,
@@ -438,7 +438,7 @@ int fit_config_verify_required_sigs(const void *fit, int conf_noffset,
return 0;
}
- fdt_for_each_subnode(sig_blob, noffset, sig_node) {
+ fdt_for_each_subnode(noffset, sig_blob, sig_node) {
const char *required;
int ret;
diff --git a/common/image.c b/common/image.c
index c0ad36a60f8..0e86c13a88a 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1305,7 +1305,7 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
void *buf;
int conf_noffset;
int fit_img_result;
- char *uname, *name;
+ const char *uname, *name;
int err;
int devnum = 0; /* TODO support multi fpga platforms */
const fpga_desc * const desc = fpga_get_desc(devnum);
@@ -1332,9 +1332,9 @@ int boot_get_fpga(int argc, char * const argv[], bootm_headers_t *images,
case IMAGE_FORMAT_FIT:
conf_noffset = fit_conf_get_node(buf, images->fit_uname_cfg);
- err = fdt_get_string_index(buf, conf_noffset, FIT_FPGA_PROP, 0,
- (const char **)&uname);
- if (err < 0) {
+ uname = fdt_stringlist_get(buf, conf_noffset, FIT_FPGA_PROP, 0,
+ NULL);
+ if (!uname) {
debug("## FPGA image is not specified\n");
return 0;
}
@@ -1404,7 +1404,7 @@ int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images,
int loadables_index;
int conf_noffset;
int fit_img_result;
- char *uname;
+ const char *uname;
/* Check to see if the images struct has a FIT configuration */
if (!genimg_has_config(images)) {
@@ -1428,15 +1428,14 @@ int boot_get_loadable(int argc, char * const argv[], bootm_headers_t *images,
conf_noffset = fit_conf_get_node(buf, images->fit_uname_cfg);
for (loadables_index = 0;
- fdt_get_string_index(buf, conf_noffset,
- FIT_LOADABLE_PROP,
- loadables_index,
- (const char **)&uname) == 0;
+ uname = fdt_stringlist_get(buf, conf_noffset,
+ FIT_LOADABLE_PROP, loadables_index,
+ NULL), uname;
loadables_index++)
{
fit_img_result = fit_image_load(images,
tmp_img_addr,
- (const char **)&uname,
+ &uname,
&(images->fit_uname_cfg), arch,
IH_TYPE_LOADABLE,
BOOTSTAGE_ID_FIT_LOADABLE_START,