From: wdenk Date: Wed, 15 May 2002 22:30:21 +0000 (+0000) Subject: * Patch by Wolfgang Grandegger, 15 May 2002: X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ab79f880b9e5b27a9ac0e7132e0751bbd4026b98;p=users%2Frw%2Fppcboot.git * Patch by Wolfgang Grandegger, 15 May 2002: Add "filesize" support for "loadb" and "loads" commands --- diff --git a/CHANGELOG b/CHANGELOG index 9d1f1c9..54aaaa6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,11 @@ Modifications for 1.1.6: ====================================================================== +* Patch by Wolfgang Grandegger, 15 May 2002: + Add "filesize" support for "loadb" and "loads" commands + +* Some cleanup + * Patch by Stefan Roese, 15 May 2002: - Support for esd CPCI-405 Version 2 added. diff --git a/common/cmd_boot.c b/common/cmd_boot.c index 77adb7e..75ac09b 100644 --- a/common/cmd_boot.c +++ b/common/cmd_boot.c @@ -225,6 +225,8 @@ load_serial (ulong offset) int binlen; /* no. of data bytes in S-Rec. */ int type; /* return code for record type */ ulong addr; /* load address from S-Record */ + ulong size; /* number of bytes transferred */ + char buf[32]; ulong store_addr; ulong start_addr = ~0; ulong end_addr = 0; @@ -271,15 +273,16 @@ load_serial (ulong offset) case SREC_END3: case SREC_END4: udelay (10000); + size = end_addr - start_addr + 1; printf ("\n" - "## First Load Addr = 0x%08lx\n" - "## Last Load Addr = 0x%08lx\n" - "## Total Size = 0x%08lx = %ld Bytes\n", - start_addr, end_addr, - end_addr - start_addr + 1, - end_addr - start_addr + 1 + "## First Load Addr = 0x%08lX\n" + "## Last Load Addr = 0x%08lX\n" + "## Total Size = 0x%08lX = %ld Bytes\n", + start_addr, end_addr, size, size ); - flush_cache (addr, end_addr - start_addr + 1); + flush_cache (addr, size); + sprintf(buf, "%lX", size); + setenv("filesize", buf); return (addr); case SREC_START: break; @@ -452,10 +455,16 @@ int do_load_serial_bin (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *ar static ulong load_serial_bin (ulong offset) { int size; + char buf[32]; set_kerm_bin_mode ((ulong *) offset); size = k_recv (); flush_cache (offset, size); + + printf("## Total Size = 0x%08x = %d Bytes\n", size, size); + sprintf(buf, "%X", size); + setenv("filesize", buf); + return offset; }