diff options
author | stroese <stroese> | 2005-03-16 20:58:31 +0000 |
---|---|---|
committer | stroese <stroese> | 2005-03-16 20:58:31 +0000 |
commit | acdcd10c9a39999f608d3af07da367825647dd11 (patch) | |
tree | d882e9a3dee9ddf534ca1df206a49bbb5f87ca07 /board/esd/common | |
parent | 89c02e2c5747bcc20c19a54d8c88426997b384b5 (diff) | |
download | u-boot-midas-acdcd10c9a39999f608d3af07da367825647dd11.tar.gz u-boot-midas-acdcd10c9a39999f608d3af07da367825647dd11.tar.bz2 u-boot-midas-acdcd10c9a39999f608d3af07da367825647dd11.zip |
Update for esd auto_update and hh405 board
Diffstat (limited to 'board/esd/common')
-rw-r--r-- | board/esd/common/auto_update.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c index d4009b7c4e..0604a4e6fe 100644 --- a/board/esd/common/auto_update.c +++ b/board/esd/common/auto_update.c @@ -224,6 +224,25 @@ int au_do_update(int i, long sz) start = au_image[i].start; end = au_image[i].start + au_image[i].size - 1; + /* + * do not update firmware when image is already in flash. + */ + if (au_image[i].type == AU_FIRMWARE) { + char *orig = (char*)start; + char *new = (char *)((char *)hdr + sizeof(*hdr)); + nbytes = ntohl(hdr->ih_size); + + while(--nbytes) { + if (*orig++ != *new++) { + break; + } + } + if (!nbytes) { + printf("Skipping firmware update - images are identical\n"); + break; + } + } + /* unprotect the address range */ /* this assumes that ONLY the firmware is protected! */ if (au_image[i].type == AU_FIRMWARE) { |