* [U-Boot-Users] [PATCH] complains on bad CFG_MAX_FLASH_SECT description
@ 2006-04-28 6:42 Mirco Fuchs
0 siblings, 0 replies; only message in thread
From: Mirco Fuchs @ 2006-04-28 6:42 UTC (permalink / raw)
To: u-boot
Hello,
this Patch complains if the macro CFG_MAX_FLASH_SECT is smaller than
the truly available flash sectors.
best regards
Mirco
Signed-off-by: Mirco Fuchs <mircofuchs@web.de>
---
--- u-boot_1.1.4/u-boot-1.1.4/drivers/cfi_flash.c 2006-03-12 02:13:21.000000000 +0100
+++ u-boot-1.1.4/drivers/cfi_flash.c 2006-04-27 17:41:54.495071792
+0200
@@ -1131,6 +1131,10 @@ ulong flash_get_size (ulong base, int ba
erase_region_count = (tmp & 0xffff) + 1;
debug ("erase_region_count = %d erase_region_size = %d\n",
erase_region_count, erase_region_size);
+ if (erase_region_count > CFG_MAX_FLASH_SECT) {
+ printf ("*** Warning - nbr. of erase regions > CFG_MAX_FLASH_SECT\n");
+ return 0;
+ }
for (j = 0; j < erase_region_count; j++) {
info->start[sect_cnt] = sector;
sector += (erase_region_size * size_ratio);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-28 6:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28 6:42 [U-Boot-Users] [PATCH] complains on bad CFG_MAX_FLASH_SECT description Mirco Fuchs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox