Skip to contentSkip to conversation

complains on bad CFG_MAX_FLASH_SECT description

PATCH New Mirco Fuchs 1 participant 1 message Apr 28, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 complains on bad CFG_MAX_FLASH_SECT description

Hello,

this Patch complains if the macro CFG_MAX_FLASH_SECT is smaller than the truly available flash sectors.

best regards
Mirco

---

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