]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/cm5200/fwupdate.c
karo: fdt: fix panel-dpi support
[karo-tx-uboot.git] / board / cm5200 / fwupdate.c
index 19aa94a5a03bd202f460a4f7e28d1563f3b8a00a..2b923624aea11f4adfe5fb57c0ce1b9f0a1fddfc 100644 (file)
@@ -7,27 +7,12 @@
  *   - code clean-up
  *   - bugfix for overwriting bootargs by user
  *
- * 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+
  */
 
 #include <common.h>
 #include <command.h>
+#include <fat.h>
 #include <malloc.h>
 #include <image.h>
 #include <usb.h>
 
 #include "fwupdate.h"
 
-extern int do_bootm(cmd_tbl_t *, int, int, char *[]);
-extern long do_fat_read(const char *, void *, unsigned long, int);
-extern int do_fat_fsload(cmd_tbl_t *, int, int, char *[]);
-
 static int load_rescue_image(ulong);
 
 void cm5200_fwupdate(void)
@@ -47,7 +28,7 @@ void cm5200_fwupdate(void)
        char *rsargs;
        char *tmp = NULL;
        char ka[16];
-       char *argv[3] = { "bootm", ka, NULL };
+       char * const argv[3] = { "bootm", ka, NULL };
 
        /* Check if rescue system is disabled... */
        if (getenv("norescue")) {
@@ -63,7 +44,7 @@ void cm5200_fwupdate(void)
        if (!bcmd)
                return;
 
-       sprintf(ka, "%lx", LOAD_ADDR);
+       sprintf(ka, "%lx", (ulong)LOAD_ADDR);
 
        /* prepare our bootargs */
        rsargs = getenv("rs-args");
@@ -99,7 +80,7 @@ static int load_rescue_image(ulong addr)
        char *tmp;
        char dev[7];
        char addr_str[16];
-       char *argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL };
+       char * const argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL };
        block_dev_desc_t *stor_dev = NULL;
        cmd_tbl_t *bcmd;
 
@@ -141,7 +122,7 @@ static int load_rescue_image(ulong addr)
                                /* Check if rescue image is present */
                                FW_DEBUG("Looking for firmware directory '%s'"
                                        " on partition %d\n", fwdir, i);
-                               if (do_fat_read(fwdir, NULL, 0, LS_NO) == -1) {
+                               if (!fat_exists(fwdir)) {
                                        FW_DEBUG("No NX rescue image on "
                                                "partition %d.\n", i);
                                        partno = -2;