summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Schwinne <kartsten.schwinne@de.bucurus.com>2009-05-18 15:18:46 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2009-05-18 16:20:04 +0200
commitf75a8a68f3f5336556e4235b771c3f47c574e378 (patch)
treecec61f877b4caa327f42f09e63bd87f421080c80
parentc2c1f2f8df96dffc19ed8a925ce2d9b7bc1eae16 (diff)
downloadbarebox-f75a8a68f3f5336556e4235b771c3f47c574e378.tar.gz
barebox-f75a8a68f3f5336556e4235b771c3f47c574e378.tar.xz
[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 <kartsten.schwinne@de.bucurus.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rw-r--r--drivers/nor/cfi_flash_new.c6
1 files changed, 6 insertions, 0 deletions
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",