]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* Patch by Wolfgang Grandegger, 15 May 2002:
authorwdenk <wdenk>
Wed, 15 May 2002 22:30:21 +0000 (22:30 +0000)
committerwdenk <wdenk>
Wed, 15 May 2002 22:30:21 +0000 (22:30 +0000)
  Add "filesize" support for "loadb" and "loads" commands

CHANGELOG
common/cmd_boot.c

index 9d1f1c9d5b4a0d7ff203953dba06282ad1c29a36..54aaaa6d4896caf74c4f11a8b2fff5113623671a 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
 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.
index 77adb7e11226e3e8300df2ee57eb650f8d7f752b..75ac09b47f35d4c733ee39e844353e7a3287d22f 100644 (file)
@@ -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;
 }