From bccae9039e59ac09a776429119389a6a4e679fd7 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 6 Oct 2005 01:50:50 +0200 Subject: Fix booting from serial dataflash on AT91RM9200 Patch by Peter Menzebach, 29 Aug 2005 --- common/cmd_bootm.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index c200fd8b86..ab6ccbb07c 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -204,19 +204,21 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } SHOW_BOOT_PROGRESS (3); +#ifdef CONFIG_HAS_DATAFLASH + if (addr_dataflash(addr)){ + len = ntohl(hdr->ih_size) + sizeof(image_header_t); + read_dataflash(addr, len, (char *)CFG_LOAD_ADDR); + addr = CFG_LOAD_ADDR; + } +#endif + + /* for multi-file images we need the data part, too */ print_image_hdr ((image_header_t *)addr); data = addr + sizeof(image_header_t); len = ntohl(hdr->ih_size); -#ifdef CONFIG_HAS_DATAFLASH - if (addr_dataflash(addr)){ - read_dataflash(data, len, (char *)CFG_LOAD_ADDR); - data = CFG_LOAD_ADDR; - } -#endif - if (verify) { puts (" Verifying Checksum ... "); if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) { -- cgit