]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/image-fit.c
board: .gitignore: ignore board-specific generated files
[karo-tx-uboot.git] / common / image-fit.c
index b75e119d930e5d70d6ac703f70bbef50687ee21d..b94a3fe86dc3469bf651f09980b3d366b573cb04 100644 (file)
@@ -6,23 +6,7 @@
  * (C) Copyright 2000-2006
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #ifdef USE_HOSTCC
@@ -74,7 +58,7 @@ static int fit_parse_spec(const char *spec, char sepc, ulong addr_curr,
  * @conf_name double pointer to a char, will hold pointer to a configuration
  * unit name
  *
- * fit_parse_conf() expects configuration spec in the for of [<addr>]#<conf>,
+ * fit_parse_conf() expects configuration spec in the form of [<addr>]#<conf>,
  * where <addr> is a FIT image address that contains configuration
  * with a <conf> unit name.
  *
@@ -100,7 +84,7 @@ int fit_parse_conf(const char *spec, ulong addr_curr,
  * subimage
  * @image_name: double pointer to a char, will hold pointer to a subimage name
  *
- * fit_parse_subimage() expects subimage spec in the for of
+ * fit_parse_subimage() expects subimage spec in the form of
  * [<addr>]:<subimage>, where <addr> is a FIT image address that contains
  * subimage with a <subimg> unit name.
  *
@@ -359,6 +343,17 @@ void fit_image_print(const void *fit, int image_noffset, const char *p)
        else
                printf("%s\n", desc);
 
+       if (IMAGE_ENABLE_TIMESTAMP) {
+               time_t timestamp;
+
+               ret = fit_get_timestamp(fit, 0, &timestamp);
+               printf("%s  Created:      ", p);
+               if (ret)
+                       printf("unavailable\n");
+               else
+                       genimg_print_time(timestamp);
+       }
+
        fit_image_get_type(fit, image_noffset, &type);
        printf("%s  Type:         %s\n", p, genimg_get_type_name(type));
 
@@ -1336,7 +1331,7 @@ int fit_conf_find_compat(const void *fit, const void *fdt)
  *
  * When NULL is provided in second argument fit_conf_get_node() will search
  * for a default configuration node instead. Default configuration node unit
- * name is retrived from FIT_DEFAULT_PROP property of the '/configurations'
+ * name is retrieved from FIT_DEFAULT_PROP property of the '/configurations'
  * node.
  *
  * returns:
@@ -1478,12 +1473,13 @@ int fit_get_node_from_config(bootm_headers_t *images, const char *prop_name,
 }
 
 int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
-                  const char **fit_unamep, const char *fit_uname_config,
+                  const char **fit_unamep, const char **fit_uname_configp,
                   int arch, int image_type, int bootstage_id,
                   enum fit_load_op load_op, ulong *datap, ulong *lenp)
 {
        int cfg_noffset, noffset;
        const char *fit_uname;
+       const char *fit_uname_config;
        const void *fit;
        const void *buf;
        size_t size;
@@ -1493,6 +1489,7 @@ int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
 
        fit = map_sysmem(addr, 0);
        fit_uname = fit_unamep ? *fit_unamep : NULL;
+       fit_uname_config = fit_uname_configp ? *fit_uname_configp : NULL;
        printf("## Loading %s from FIT Image at %08lx ...\n", prop_name, addr);
 
        bootstage_mark(bootstage_id + BOOTSTAGE_SUB_FORMAT);
@@ -1503,7 +1500,7 @@ int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
        }
        bootstage_mark(bootstage_id + BOOTSTAGE_SUB_FORMAT_OK);
        if (fit_uname) {
-               /* get ramdisk component image node offset */
+               /* get FIT component image node offset */
                bootstage_mark(bootstage_id + BOOTSTAGE_SUB_UNIT_NAME);
                noffset = fit_image_get_node(fit, fit_uname);
        } else {
@@ -1599,7 +1596,7 @@ int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
        len = (ulong)size;
 
        /* verify that image data is a proper FDT blob */
-       if (image_type == IH_TYPE_FLATDT && fdt_check_header((char *)buf)) {
+       if (image_type == IH_TYPE_FLATDT && fdt_check_header(buf)) {
                puts("Subimage data is not a FDT");
                return -ENOEXEC;
        }
@@ -1658,6 +1655,8 @@ int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
        *lenp = len;
        if (fit_unamep)
                *fit_unamep = (char *)fit_uname;
+       if (fit_uname_configp)
+               *fit_uname_configp = (char *)fit_uname_config;
 
        return noffset;
 }