diff options
author | Wolfgang Denk <wd@pollux.denx.de> | 2007-02-19 23:09:51 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2007-02-19 23:09:51 +0100 |
commit | f5fcc3c20b65554e98a165542c36ee0c610a2d81 (patch) | |
tree | b24d069f1909e7fe44bda7d0d59a554c03f6f6d4 /board/mcc200/auto_update.c | |
parent | 489c696ae7211218961d159e43e722d74c36fcbc (diff) |
MCC200: Software Updater: allow both "ramdisk" and "filesystem" types
as root file system images.
Diffstat (limited to 'board/mcc200/auto_update.c')
-rw-r--r-- | board/mcc200/auto_update.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/board/mcc200/auto_update.c b/board/mcc200/auto_update.c index 12091fd782..43ef42bcc2 100644 --- a/board/mcc200/auto_update.c +++ b/board/mcc200/auto_update.c @@ -94,21 +94,21 @@ char *aufile[AU_MAXFILES] = { /* sizes of flash areas for each file */ long ausize[AU_MAXFILES] = { (AU_FL_FIRMWARE_ND + 1) - AU_FL_FIRMWARE_ST, - (AU_FL_KERNEL_ND + 1) - AU_FL_KERNEL_ST, - (AU_FL_ROOTFS_ND + 1) - AU_FL_ROOTFS_ST + (AU_FL_KERNEL_ND + 1) - AU_FL_KERNEL_ST, + (AU_FL_ROOTFS_ND + 1) - AU_FL_ROOTFS_ST, }; /* array of flash areas start and end addresses */ struct flash_layout aufl_layout[AU_MAXFILES] = { - {AU_FL_FIRMWARE_ST, AU_FL_FIRMWARE_ND,}, - {AU_FL_KERNEL_ST, AU_FL_KERNEL_ND,}, - {AU_FL_ROOTFS_ST, AU_FL_ROOTFS_ND,} + { AU_FL_FIRMWARE_ST, AU_FL_FIRMWARE_ND, }, + { AU_FL_KERNEL_ST, AU_FL_KERNEL_ND, }, + { AU_FL_ROOTFS_ST, AU_FL_ROOTFS_ND, }, }; /* where to load files into memory */ #define LOAD_ADDR ((unsigned char *)0x00200000) -/* the app is the largest image */ +/* the root file system is the largest image */ #define MAX_LOADSZ ausize[IDX_ROOTFS] /*i2c address of the keypad status*/ @@ -193,7 +193,9 @@ int au_check_header_valid(int idx, long nbytes) printf ("Image %s wrong type\n", aufile[idx]); return -1; } - if ((idx == IDX_ROOTFS) && (hdr->ih_type != IH_TYPE_RAMDISK)) { + if ((idx == IDX_ROOTFS) && + ( (hdr->ih_type != IH_TYPE_RAMDISK) || (hdr->ih_type != IH_TYPE_FILESYSTEM) ) + ) { printf ("Image %s wrong type\n", aufile[idx]); return -1; } @@ -277,9 +279,9 @@ int au_do_update(int idx, long sz) return -1; } - /* check the dcrc of the copy */ + /* check the data CRC of the copy */ if (crc32 (0, (uchar *)(start + off), ntohl(hdr->ih_size)) != ntohl(hdr->ih_dcrc)) { - printf ("Image %s Bad Data Checksum After COPY\n", aufile[idx]); + printf ("Image %s Bad Data Checksum after COPY\n", aufile[idx]); return -1; } |