]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/cmd_source.c
arm: mx6: fix NFC clock get/set routines for i.MX6QP,i.MX6UL
[karo-tx-uboot.git] / common / cmd_source.c
index a4406143244beabca205c490ba370793980331f6..db7ab7e5f4092a0b996f96702e4ed53b9cd897bb 100644 (file)
@@ -2,23 +2,7 @@
  * (C) Copyright 2001
  * Kyle Harris, kharris@nexus-tech.net
  *
- * 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+
  */
 
 /*
@@ -35,6 +19,7 @@
 #include <command.h>
 #include <image.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <asm/byteorder.h>
 #include <asm/io.h>
 #if defined(CONFIG_8xx)
@@ -45,8 +30,10 @@ int
 source (ulong addr, const char *fit_uname)
 {
        ulong           len;
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
        const image_header_t *hdr;
-       ulong           *data;
+#endif
+       u32             *data;
        int             verify;
        void *buf;
 #if defined(CONFIG_FIT)
@@ -60,6 +47,7 @@ source (ulong addr, const char *fit_uname)
 
        buf = map_sysmem(addr, 0);
        switch (genimg_get_format(buf)) {
+#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
        case IMAGE_FORMAT_LEGACY:
                hdr = buf;
 
@@ -86,7 +74,7 @@ source (ulong addr, const char *fit_uname)
                }
 
                /* get length of script */
-               data = (ulong *)image_get_data (hdr);
+               data = (u32 *)image_get_data (hdr);
 
                if ((len = uimage_to_cpu (*data)) == 0) {
                        puts ("Empty Script\n");
@@ -100,6 +88,7 @@ source (ulong addr, const char *fit_uname)
                 */
                while (*data++);
                break;
+#endif
 #if defined(CONFIG_FIT)
        case IMAGE_FORMAT_FIT:
                if (fit_uname == NULL) {
@@ -139,7 +128,7 @@ source (ulong addr, const char *fit_uname)
                        return 1;
                }
 
-               data = (ulong *)fit_data;
+               data = (u32 *)fit_data;
                len = (ulong)fit_len;
                break;
 #endif
@@ -154,8 +143,7 @@ source (ulong addr, const char *fit_uname)
 
 /**************************************************/
 #if defined(CONFIG_CMD_SOURCE)
-int
-do_source (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_source(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
        ulong addr;
        int rcode;