[U-Boot-Users] [PATCH] fix flinfo formatting for CFI flash

Ladislav Michl ladis at linux-mips.org
Sat Feb 26 12:00:00 CET 2005


Hi,

flinfo is currently outputs this with CFG_FLASH_EMPTY_INFO defined:

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors
 Erase timeout 16384 ms, write timeout 0 ms, buffer write timeout 1 ms, buffer size 1
  Sector Start Addresses:
 00000000  RO  00002000  RO  00004000  RO  00006000  RO  00008000  RO
 0000A000  RO  0000C000  RO  0000E000  RO  00010000  RO  00020000 ERO
 00030000 ERO  00040000      00050000      00060000      00070000
 00080000      00090000      000A0000      000B0000      000C0000

and this with CFG_FLASH_EMPTY_INFO undefined:

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors
 Erase timeout 16384 ms, write timeout 0 ms, buffer write timeout 1 ms, buffer size 1
  Sector Start Addresses:
    00000000 (RO)   00002000 (RO)   00004000 (RO)   00006000 (RO)   00008000 (RO)
    0000A000 (RO)   0000C000 (RO)   0000E000 (RO)   00010000 (RO)   00020000 (RO)
    00030000 (RO)   00040000      00050000      00060000      00070000
    00080000      00090000      000A0000      000B0000      000C0000

Patch below fixes flinfo with CFG_FLASH_EMPTY_INFO undefined to print
informations as follows, making it similar with 1st case above

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 4 MB in 71 Sectors
 Erase timeout 16384 ms, write timeout 0 ms, buffer write timeout 1 ms, buffer size 1
  Sector Start Addresses:
    00000000 RO   00002000 RO   00004000 RO   00006000 RO   00008000 RO
    0000A000 RO   0000C000 RO   0000E000 RO   00010000 RO   00020000 RO
    00030000      00040000      00050000      00060000      00070000
    00080000      00090000      000A0000      000B0000      000C0000

Similar fix is contained in Michael Bendzick's patch, Message-ID: 
<31ADFA827355984B9E2A161514595B561C34C2 at lpdsrv04.logicpd.com> from
Fri, 14 Jan 2005 14:55:36 -0600, but I think this formatting is more
consistent with flash empty info version.

CHANGELOG:
* Patch by Ladislav Michl, 26 Feb 2005:
  - fix flinfo formatting for CFI flash

Index: drivers/cfi_flash.c
===================================================================
RCS file: /cvsroot/u-boot/u-boot/drivers/cfi_flash.c,v
retrieving revision 1.16
diff -u -r1.16 cfi_flash.c
--- drivers/cfi_flash.c	9 Jan 2005 17:12:33 -0000	1.16
+++ drivers/cfi_flash.c	26 Feb 2005 10:23:06 -0000
@@ -483,7 +482,7 @@
 		if ((i % 5) == 0)
 			printf ("\n   ");
 		printf (" %08lX%s",
-			info->start[i], info->protect[i] ? " (RO)  " : "     ");
+			info->start[i], info->protect[i] ? " RO  " : "     ");
 #endif
 	}
 	putc ('\n');




More information about the U-Boot mailing list