]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
TRAB auto-update: Base decision if we have to strip the image
authorwdenk <wdenk>
Thu, 16 Oct 2003 12:53:35 +0000 (12:53 +0000)
committerwdenk <wdenk>
Thu, 16 Oct 2003 12:53:35 +0000 (12:53 +0000)
header on image type as encoded in the header

CHANGELOG
README
board/trab/auto_update.c

index 0c871e9b69372bd75e0ffe0c3bb726ee828b184c..b8e52fdb6c431093584b4caf2f8eeafd6bd25efc 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
 Changes for U-Boot 1.0.0:
 ======================================================================
 
+* TRAB auto-update: Base decision if we have to strip the image
+  header on image type as encoded in the header
+
 * Patches by Xianghua Xiao, 15 Oct 2003:
 
   - Added Motorola CPU 8540/8560 support (cpu/85xx)
diff --git a/README b/README
index e3f4f9ddd41d89632c57795245b7fe7fe89ce43a..82a8ec64a1428b498a96601489af65c608f8f6ae 100644 (file)
--- a/README
+++ b/README
@@ -2325,8 +2325,8 @@ defines the following image properties:
   LynxOS, pSOS, QNX, RTEMS, ARTOS;
   Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS).
 * Target CPU Architecture (Provisions for Alpha, ARM, Intel x86,
-  IA64, MIPS, MIPS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
-  Currently supported: PowerPC).
+  IA64, MIPS, NIOS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
+  Currently supported: ARM, Intel x86, MIPS, NIOS, PowerPC).
 * Compression Type (uncompressed, gzip, bzip2)
 * Load Address
 * Entry Point
index 40a92fd91ebb568b792a356e29cf1e8430df88a9..dd62d0948372d36983bfbbc35d9239727dd963af 100644 (file)
@@ -352,8 +352,12 @@ au_do_update(int idx, long sz)
        debug ("flash_sect_erase(%lx, %lx);\n", start, end);
        flash_sect_erase(start, end);
        wait_ms(100);
-       /* strip the header - except for the kernel and app */
-       if (idx == IDX_FIRMWARE || idx == IDX_DISK) {
+       /* strip the header - except for the kernel and ramdisk */
+       if (hdr->ih_type == IH_TYPE_KERNEL || hdr->ih_type == IH_TYPE_RAMDISK) {
+               addr = (char *)hdr;
+               off = sizeof(*hdr);
+               nbytes = sizeof(*hdr) + ntohl(hdr->ih_size);
+       } else {
                addr = (char *)((char *)hdr + sizeof(*hdr));
 #ifdef AU_UPDATE_TEST
                /* copy it to where Linux goes */
@@ -362,10 +366,6 @@ au_do_update(int idx, long sz)
 #endif
                off = 0;
                nbytes = ntohl(hdr->ih_size);
-       } else {
-               addr = (char *)hdr;
-               off = sizeof(*hdr);
-               nbytes = sizeof(*hdr) + ntohl(hdr->ih_size);
        }
 
        /* copy the data from RAM to FLASH */