[U-Boot-Users] cfi_flash.c patch

Ladislav Michl ladis at linux-mips.org
Mon Apr 11 15:00:43 CEST 2005


On Sat, Apr 09, 2005 at 04:41:31PM +0300, richard at uclinux.net wrote:
> Afternoon...
> 
> Adding 2 spaces in cfi_flash.c makes the output of "flinfo" much
> more readable if there are protected and unprotected sectors:

Rick,

would you mind to consider this patch instead of yours. It was sent to
mailing list some time ago and I think it makes output a bit more
consistent. (So far three patches for this simple issue exists :))

Thanks,
	ladis

----- Forwarded message from Ladislav Michl <ladis at linux-mips.org> -----

To: u-boot-users at lists.sourceforge.net
From: Ladislav Michl <ladis at linux-mips.org>
Subject: [U-Boot-Users] [PATCH] fix flinfo formatting for CFI flash

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');


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

----- End forwarded message -----
> ----------------------------------------------------------------------------
> 
> CHANGELOG:
> * Patch by Richard Klingler, 09 Apr 2005:
>   correct column layout of flinfo output.
> 
> 
> 
> 
> --- u-boot.orig/drivers/cfi_flash.c 2005-01-09 19:12:33.000000000 +0200
> +++ u-boot/drivers/cfi_flash.c  2005-04-09 16:35:04.000000000 +0300
> @@ -483,7 +483,7 @@ void flash_print_info (flash_info_t * in
>         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');
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users




More information about the U-Boot mailing list