summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-10-16 12:53:35 +0000
committerwdenk <wdenk>2003-10-16 12:53:35 +0000
commit3d1e8a9d4e40ce17a4fec75ee4055e7ddf6ca1a9 (patch)
tree43236455d0052d62368a13832a32db815685666d /board
parent42d1f0394bef0624fc9664714d54bb137931d6a6 (diff)
TRAB auto-update: Base decision if we have to strip the image
header on image type as encoded in the header
Diffstat (limited to 'board')
-rw-r--r--board/trab/auto_update.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/board/trab/auto_update.c b/board/trab/auto_update.c
index 40a92fd91e..dd62d09483 100644
--- a/board/trab/auto_update.c
+++ b/board/trab/auto_update.c
@@ -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 */