]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/mcc200/auto_update.c
arm: mx5: clock: add support for changing CPU clock via cmdline
[karo-tx-uboot.git] / board / mcc200 / auto_update.c
index fcae35aaf8f227614d55b9d0958032a30dabc569..2f622b0846e103f5b3036322269e5577ca451427 100644 (file)
@@ -2,20 +2,7 @@
  * (C) Copyright 2006
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
- * 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>
@@ -25,7 +12,7 @@
 #include <usb.h>
 #include <part.h>
 
-#ifdef CFG_HUSH_PARSER
+#ifdef CONFIG_SYS_HUSH_PARSER
 #include <hush.h>
 #endif
 
@@ -40,8 +27,8 @@
 #error "must define CONFIG_USB_STORAGE"
 #endif
 
-#ifndef CFG_HUSH_PARSER
-#error "must define CFG_HUSH_PARSER"
+#ifndef CONFIG_SYS_HUSH_PARSER
+#error "must define CONFIG_SYS_HUSH_PARSER"
 #endif
 
 #if !defined(CONFIG_CMD_FAT)
@@ -144,7 +131,7 @@ int au_check_cksum_valid(int idx, long nbytes)
 
        hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-       if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
                puts ("Non legacy image format not supported\n");
                return -1;
        }
@@ -169,7 +156,7 @@ int au_check_header_valid(int idx, long nbytes)
 
        hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-       if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
                puts ("Non legacy image format not supported\n");
                return -1;
        }
@@ -247,7 +234,7 @@ int au_do_update(int idx, long sz)
 
        hdr = (image_header_t *)LOAD_ADDR;
 #if defined(CONFIG_FIT)
-       if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+       if (genimg_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
                puts ("Non legacy image format not supported\n");
                return -1;
        }
@@ -284,7 +271,7 @@ int au_do_update(int idx, long sz)
         */
        debug ("flash_sect_erase(%lx, %lx);\n", start, end);
        flash_sect_erase(start, end);
-       wait_ms(100);
+       mdelay(100);
 #ifdef CONFIG_PROGRESSBAR
        show_progress(end - start, totsize);
 #endif
@@ -341,7 +328,7 @@ int do_auto_update(void)
 {
        block_dev_desc_t *stor_dev;
        long sz;
-       int i, res = 0, bitmap_first, cnt, old_ctrlc, got_ctrlc;
+       int i, res = 0, cnt, old_ctrlc;
        char *env;
        long start, end;
 
@@ -352,7 +339,7 @@ int do_auto_update(void)
         * Read keypad status
         */
        i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status1, 2);
-       wait_ms(500);
+       mdelay(500);
        i2c_read(I2C_PSOC_KEYPAD_ADDR, 0, 0, keypad_status2, 2);
 
        /*
@@ -450,8 +437,6 @@ int do_auto_update(void)
        /* make sure that we see CTRL-C and save the old state */
        old_ctrlc = disable_ctrlc(0);
 
-       bitmap_first = 0;
-
        /* validate the images first */
        for (i = 0; i < AU_MAXFILES; i++) {
                ulong imsize;
@@ -491,7 +476,7 @@ int do_auto_update(void)
                        aufile[i], sz, image_get_header_size ());
 
                if (sz != ausize[i]) {
-                       printf ("%s: size %d read %d?\n", aufile[i], ausize[i], sz);
+                       printf ("%s: size %ld read %ld?\n", aufile[i], ausize[i], sz);
                        continue;
                }
 
@@ -506,14 +491,11 @@ int do_auto_update(void)
                /* this is really not a good idea, but it's what the */
                /* customer wants. */
                cnt = 0;
-               got_ctrlc = 0;
                do {
                        res = au_do_update(i, sz);
                        /* let the user break out of the loop */
                        if (ctrlc() || had_ctrlc()) {
                                clear_ctrlc();
-                               if (res < 0)
-                                       got_ctrlc = 1;
                                break;
                        }
                        cnt++;