
In message 444F81AF.32040.10275B0@fuchs.ftz-leipzig.de you wrote:
there is a bug in cfi_flash.c in function flash_get_size(). The problem appears if the board specific CFG_MAX_FLASH_SECT macro is smaller than the real number of sectors.
That's not a bug in the driver, but in your configuration then.
In this case i use a 32 MiB Spansion flash (S29GL256), but we only want respectivly can use 16 MiB of the flash because of the broken A24 line on the AT91RM9200. Therefore i defined CFG_MAX_FLASH_SECT to 128, but the real value is 256. The structure allocation of
This is not correct. You should not lie to the driver. Don't complain if he refuses to work for you.
flash_info_t in flash.h defines the size of the protect array to CFG_MAX_FLASH_SECT (in my case 128). The for-loop in flash_get_size() initialises this array, but it does it for all sectors (erase_region_count) which is 256 in my case. This will cause the info->portwidth variable (and of course all following too) to be overwritten.
This should be fixed. It should complain about the misconfiguration and die.
Please submit a patch.
--Alt-Boundary-8434.16938416 Content-type: text/html; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body
And never post HTML here!
Best regards,
Wolfgang Denk