TRAB auto-update: Base decision if we have to strip the image

header on image type as encoded in the header
This commit is contained in:
wdenk 2003-10-16 12:53:35 +00:00
parent 42d1f0394b
commit 3d1e8a9d4e
3 changed files with 11 additions and 8 deletions

View File

@ -2,6 +2,9 @@
Changes for U-Boot 1.0.0: 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: * Patches by Xianghua Xiao, 15 Oct 2003:
- Added Motorola CPU 8540/8560 support (cpu/85xx) - Added Motorola CPU 8540/8560 support (cpu/85xx)

4
README
View File

@ -2325,8 +2325,8 @@ defines the following image properties:
LynxOS, pSOS, QNX, RTEMS, ARTOS; LynxOS, pSOS, QNX, RTEMS, ARTOS;
Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS). Currently supported: Linux, NetBSD, VxWorks, QNX, RTEMS, ARTOS, LynxOS).
* Target CPU Architecture (Provisions for Alpha, ARM, Intel x86, * Target CPU Architecture (Provisions for Alpha, ARM, Intel x86,
IA64, MIPS, MIPS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit; IA64, MIPS, NIOS, PowerPC, IBM S390, SuperH, Sparc, Sparc 64 Bit;
Currently supported: PowerPC). Currently supported: ARM, Intel x86, MIPS, NIOS, PowerPC).
* Compression Type (uncompressed, gzip, bzip2) * Compression Type (uncompressed, gzip, bzip2)
* Load Address * Load Address
* Entry Point * Entry Point

View File

@ -352,8 +352,12 @@ au_do_update(int idx, long sz)
debug ("flash_sect_erase(%lx, %lx);\n", start, end); debug ("flash_sect_erase(%lx, %lx);\n", start, end);
flash_sect_erase(start, end); flash_sect_erase(start, end);
wait_ms(100); wait_ms(100);
/* strip the header - except for the kernel and app */ /* strip the header - except for the kernel and ramdisk */
if (idx == IDX_FIRMWARE || idx == IDX_DISK) { 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)); addr = (char *)((char *)hdr + sizeof(*hdr));
#ifdef AU_UPDATE_TEST #ifdef AU_UPDATE_TEST
/* copy it to where Linux goes */ /* copy it to where Linux goes */
@ -362,10 +366,6 @@ au_do_update(int idx, long sz)
#endif #endif
off = 0; off = 0;
nbytes = ntohl(hdr->ih_size); 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 */ /* copy the data from RAM to FLASH */