From f75a8a68f3f5336556e4235b771c3f47c574e378 Mon Sep 17 00:00:00 2001 From: Karsten Schwinne Date: Mon, 18 May 2009 15:18:46 +0200 Subject: [cfi] add autoprobing, use cfi size for flash chips size If a flash chip has been added with the size of "0" the cfi's size is used for the flash chip. Signed-off-by: Karsten Schwinne Signed-off-by: Marc Kleine-Budde --- drivers/nor/cfi_flash_new.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/nor/cfi_flash_new.c b/drivers/nor/cfi_flash_new.c index 693edaedbd..936e7fece8 100644 --- a/drivers/nor/cfi_flash_new.c +++ b/drivers/nor/cfi_flash_new.c @@ -502,6 +502,12 @@ static int cfi_probe (struct device_d *dev) /* Init: no FLASHes known */ info->flash_id = FLASH_UNKNOWN; size += info->size = flash_get_size(info, dev->map_base); + + if (dev->size == 0) { + printf("cfi_probe: size : 0x%08x\n", info->size); + dev->size = info->size; + } + if (info->flash_id == FLASH_UNKNOWN) { #ifndef CFG_FLASH_QUIET_TEST printf ("## Unknown FLASH on Bank at 0x%08x - Size = 0x%08lx = %ld MB\n", -- cgit v1.2.3