Commit 7c3dc776b91a683b2f7dd40ed91361124a3a91c0

Authored by Pantelis Antoniou
Committed by Simon Glass
1 parent ad026adbcf

fit: Do not throw away extra configuration on fit_image_load()

fit_image_load() threw away the extra configuration parts when
loading. We need them around for applying extra overlays for
building the boot fdt.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Acked-by: Simon Glass <sjg@chromium.org>

Showing 1 changed file with 7 additions and 4 deletions Side-by-side Diff

... ... @@ -1653,6 +1653,7 @@
1653 1653 int cfg_noffset, noffset;
1654 1654 const char *fit_uname;
1655 1655 const char *fit_uname_config;
  1656 + const char *fit_base_uname_config;
1656 1657 const void *fit;
1657 1658 const void *buf;
1658 1659 size_t size;
... ... @@ -1668,6 +1669,7 @@
1668 1669 fit = map_sysmem(addr, 0);
1669 1670 fit_uname = fit_unamep ? *fit_unamep : NULL;
1670 1671 fit_uname_config = fit_uname_configp ? *fit_uname_configp : NULL;
  1672 + fit_base_uname_config = NULL;
1671 1673 prop_name = fit_get_image_type_property(image_type);
1672 1674 printf("## Loading %s from FIT Image at %08lx ...\n", prop_name, addr);
1673 1675  
1674 1676  
... ... @@ -1701,11 +1703,11 @@
1701 1703 BOOTSTAGE_SUB_NO_UNIT_NAME);
1702 1704 return -ENOENT;
1703 1705 }
1704   - fit_uname_config = fdt_get_name(fit, cfg_noffset, NULL);
1705   - printf(" Using '%s' configuration\n", fit_uname_config);
  1706 + fit_base_uname_config = fdt_get_name(fit, cfg_noffset, NULL);
  1707 + printf(" Using '%s' configuration\n", fit_base_uname_config);
1706 1708 if (image_type == IH_TYPE_KERNEL) {
1707 1709 /* Remember (and possibly verify) this config */
1708   - images->fit_uname_cfg = fit_uname_config;
  1710 + images->fit_uname_cfg = fit_base_uname_config;
1709 1711 if (IMAGE_ENABLE_VERIFY && images->verify) {
1710 1712 puts(" Verifying Hash Integrity ... ");
1711 1713 if (fit_config_verify(fit, cfg_noffset)) {
... ... @@ -1861,7 +1863,8 @@
1861 1863 if (fit_unamep)
1862 1864 *fit_unamep = (char *)fit_uname;
1863 1865 if (fit_uname_configp)
1864   - *fit_uname_configp = (char *)fit_uname_config;
  1866 + *fit_uname_configp = (char *)(fit_uname_config ? :
  1867 + fit_base_uname_config);
1865 1868  
1866 1869 return noffset;
1867 1870 }