summaryrefslogtreecommitdiff
path: root/board/esd/common
diff options
context:
space:
mode:
authorstroese <stroese>2005-03-16 20:58:31 +0000
committerstroese <stroese>2005-03-16 20:58:31 +0000
commitacdcd10c9a39999f608d3af07da367825647dd11 (patch)
treed882e9a3dee9ddf534ca1df206a49bbb5f87ca07 /board/esd/common
parent89c02e2c5747bcc20c19a54d8c88426997b384b5 (diff)
downloadu-boot-imx-acdcd10c9a39999f608d3af07da367825647dd11.zip
u-boot-imx-acdcd10c9a39999f608d3af07da367825647dd11.tar.gz
u-boot-imx-acdcd10c9a39999f608d3af07da367825647dd11.tar.bz2
Update for esd auto_update and hh405 board
Diffstat (limited to 'board/esd/common')
-rw-r--r--board/esd/common/auto_update.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
index d4009b7..0604a4e 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) {