Merge with /home/sr/git/u-boot/denx

This commit is contained in:
Stefan Roese 2007-03-01 21:12:06 +01:00
commit 3bf6c39b7b
2 changed files with 8 additions and 6 deletions

View file

@ -162,7 +162,7 @@ int au_check_cksum_valid(int idx, long nbytes)
int au_check_header_valid(int idx, long nbytes) int au_check_header_valid(int idx, long nbytes)
{ {
image_header_t *hdr; image_header_t *hdr;
unsigned long checksum; unsigned long checksum, fsize;
hdr = (image_header_t *)LOAD_ADDR; hdr = (image_header_t *)LOAD_ADDR;
/* check the easy ones first */ /* check the easy ones first */
@ -205,7 +205,7 @@ int au_check_header_valid(int idx, long nbytes)
return -1; return -1;
} }
if ((idx == IDX_ROOTFS) && if ((idx == IDX_ROOTFS) &&
( (hdr->ih_type != IH_TYPE_RAMDISK) || (hdr->ih_type != IH_TYPE_FILESYSTEM) ) ( (hdr->ih_type != IH_TYPE_RAMDISK) && (hdr->ih_type != IH_TYPE_FILESYSTEM) )
) { ) {
printf ("Image %s wrong type\n", aufile[idx]); printf ("Image %s wrong type\n", aufile[idx]);
ausize[idx] = 0; ausize[idx] = 0;
@ -213,8 +213,10 @@ int au_check_header_valid(int idx, long nbytes)
} }
/* recycle checksum */ /* recycle checksum */
checksum = ntohl(hdr->ih_size); checksum = ntohl(hdr->ih_size);
/* for kernel and app the image header must also fit into flash */
if (idx != IDX_FIRMWARE) fsize = checksum + sizeof(*hdr);
/* for kernel and ramdisk the image header must also fit into flash */
if (idx == IDX_KERNEL || hdr->ih_type == IH_TYPE_RAMDISK)
checksum += sizeof(*hdr); checksum += sizeof(*hdr);
/* check the size does not exceed space in flash. HUSH scripts */ /* check the size does not exceed space in flash. HUSH scripts */
@ -224,7 +226,7 @@ int au_check_header_valid(int idx, long nbytes)
return -1; return -1;
} }
/* Update with the real filesize */ /* Update with the real filesize */
ausize[idx] = (idx == IDX_FIRMWARE ? checksum + sizeof(*hdr) : checksum); ausize[idx] = fsize;
return checksum; /* return size to be written to flash */ return checksum; /* return size to be written to flash */
} }

View file

@ -115,7 +115,7 @@
":${hostname}:${netdev}:off panic=1\0" \ ":${hostname}:${netdev}:off panic=1\0" \
"flash_nfs=run nfsargs addip;" \ "flash_nfs=run nfsargs addip;" \
"bootm ${kernel_addr}\0" \ "bootm ${kernel_addr}\0" \
"flash_nand=nand_args addip addcon;bootm ${kernel_addr}\0" \ "flash_nand=run nand_args addip addcon;bootm ${kernel_addr}\0" \
"net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0" \ "net_nfs=tftp 200000 ${bootfile};run nfsargs addip;bootm\0" \
"rootpath=/opt/eldk/ppc_4xx\0" \ "rootpath=/opt/eldk/ppc_4xx\0" \
"bootfile=/tftpboot/sc3/uImage\0" \ "bootfile=/tftpboot/sc3/uImage\0" \