uboot-mt623x/drivers/mtd
Ilya Yanok ec50a8e389 cfi_flash: handle 'chip size exceeds address window' situation
On some boards we have flash mapped high in the address space with
considerably small window (say 0xFE000000 and 32MB). When we install
bigger chip (say 64MB) on such a board strange things happen
(flash_write() doesn't work at all, for ex). That's because cfi_flash
driver doesn't care about window size at all.
Of course, cleanest solution would probably be to just extend address
window to be able to map the whole flash but for legacy/compatibility
reasons some people prefer just truncate the flash size and never use
the upper part.
This patch adds an option for cfi_flash driver to handle this situation
properly. To achieve this we add the new function cfi_flash_bank_size()
which can be provided by the board code and weak-aliased to default
implementation that returns value from the CONFIG_SYS_FLASH_BANKS_SIZES
array if it's defined or 0 otherwise (the last case is added for
compatibility).
If non-zero flash bank size is provided and detected chip size is bigger
than provided address window size the warning will be displayed and
flash chip will be truncated.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>

Changed cfi_flash_bank_size() return type to unsigned long
to match caller function.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-10-23 21:04:49 +02:00
..
nand davinci_nand, trivial : use symbolic ECC start command 2010-10-17 20:14:43 +02:00
onenand mtd: OneNAND: add support for OneNAND manufactured by Numonyx 2010-10-11 15:15:45 -05:00
spi sf: turn probe switch into a lookup table 2010-10-12 21:08:25 -04:00
ubi Fix "ubi part" cmd re-entrancy 2010-09-27 15:06:00 +02:00
Makefile mod change 755 => 644 for multiple files 2010-03-21 22:22:53 +01:00
at45.c
cfi_flash.c cfi_flash: handle 'chip size exceeds address window' situation 2010-10-23 21:04:49 +02:00
cfi_mtd.c cfi_flash: Remove uneccessary #ifdef CONFIG_SYS_MAX_FLASH_BANKS_DETECT 2010-09-20 15:09:00 +02:00
dataflash.c mtd/dataflash.c: fix a problem with the last partition 2008-12-02 21:53:24 +01:00
jedec_flash.c Support up to 7 banks for ids as specified in JEDEC JEP106Z 2009-08-26 08:58:27 +02:00
mtdconcat.c mtd: Add MTD concat support to concatenate multiple MTD NOR devices 2009-06-12 20:45:47 +02:00
mtdcore.c Followup fixes on the mtdparts spread patchset 2010-10-11 15:11:01 -05:00
mtdpart.c nand: remove dead code and suspend/resume 2010-10-11 15:10:35 -05:00
mw_eeprom.c Update i386 code (sc520_cdp) 2008-09-09 11:48:53 +02:00
spr_smi.c mod change 755 => 644 for multiple files 2010-03-21 22:22:53 +01:00