Update for esd auto_update and hh405 board
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 @@
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) {