[U-Boot-Users] TQM823L flash recognition problem

Hi Everybody,
trying to use the u-boot V1.3.3 on a TQ Module: TQM823L-AF Rev.311
which had u-boot v1.1.4 running without a problem, I now get this on two modules: -------------------- U-Boot 1.3.3 (Jun 27 2008 - 14:45:35)
CPU: PPC823EZTnnB2 at 50 MHz: 16 kB I-Cache 8 kB D-Cache Board: TQM823LDB0A3-E50I.311 DRAM: 16 MB FLASH: ## Unknown FLASH on Bank 2 - Size = 0x00000000 = 0 MB 4 MB In: serial Out: serial Err: serial Net: SCC ETHERNET PCMCIA: No Card found -------------------
The module has four AMD L160DB90VI onboard. Compiled u-boot after "make TQM823L_config" without modifications.
- Anything I'm missing here? - Was this answered before?
Thanks much for your help to point me in the right direction.
Tom

Hi Thomas,
Thomas Maenner schrieb:
Hi Everybody,
trying to use the u-boot V1.3.3 on a TQ Module: TQM823L-AF Rev.311
which had u-boot v1.1.4 running without a problem, I now get this on two modules:
U-Boot 1.3.3 (Jun 27 2008 - 14:45:35)
CPU: PPC823EZTnnB2 at 50 MHz: 16 kB I-Cache 8 kB D-Cache Board: TQM823LDB0A3-E50I.311 DRAM: 16 MB FLASH: ## Unknown FLASH on Bank 2 - Size = 0x00000000 = 0 MB 4 MB In: serial Out: serial Err: serial Net: SCC ETHERNET PCMCIA: No Card found
The module has four AMD L160DB90VI onboard. Compiled u-boot after "make TQM823L_config" without modifications.
- Anything I'm missing here?
- Was this answered before?
Thanks much for your help to point me in the right direction.
Tom
Could you please change TQM823L.h:
-#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE } +#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE, CFG_FLASH_BASE + 0x400000 }
and try again?
There was a switch-over to use the CFI driver (see git history of file TQM823L.h). AFAIK the CFI driver needs a list with fix start addresses of each bank to start the CFI query on.
Best Regards, Jens

Thanks much Jens!!!
That did the trick - works fine so far!
Cheers Tom
On Monday 30 June 2008 04:03:30 Jens Gehrlein wrote:
Hi Thomas,
Thomas Maenner schrieb:
Hi Everybody,
trying to use the u-boot V1.3.3 on a TQ Module: TQM823L-AF Rev.311
which had u-boot v1.1.4 running without a problem, I now get this on two modules:
U-Boot 1.3.3 (Jun 27 2008 - 14:45:35)
CPU: PPC823EZTnnB2 at 50 MHz: 16 kB I-Cache 8 kB D-Cache Board: TQM823LDB0A3-E50I.311 DRAM: 16 MB FLASH: ## Unknown FLASH on Bank 2 - Size = 0x00000000 = 0 MB 4 MB In: serial Out: serial Err: serial Net: SCC ETHERNET PCMCIA: No Card found
The module has four AMD L160DB90VI onboard. Compiled u-boot after "make TQM823L_config" without modifications.
- Anything I'm missing here?
- Was this answered before?
Thanks much for your help to point me in the right direction.
Tom
Could you please change TQM823L.h:
-#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE } +#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE, CFG_FLASH_BASE + 0x400000 }
and try again?
There was a switch-over to use the CFI driver (see git history of file TQM823L.h). AFAIK the CFI driver needs a list with fix start addresses of each bank to start the CFI query on.
Best Regards, Jens

In message 4868BD82.20407@tqs.de Jens Gehrlein wrote:
Could you please change TQM823L.h:
-#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE } +#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE, CFG_FLASH_BASE + 0x400000 }
Note that a proper patch (and without line wrapping) would have been much more useful.
There was a switch-over to use the CFI driver (see git history of file TQM823L.h). AFAIK the CFI driver needs a list with fix start addresses of each bank to start the CFI query on.
Thanks for pointing this out.
The big disadvantage of above code is that it requires a static mapping of the second flash bank, i. e. it works only correctly for fixed flash sizes. This may be not a big problem for the boards in question here, but we use autoconfiguration everywhere else so this doesn't fit in style.
The following patch tries to fix this in a more general way, but it requires slight modification of the CFI driver to support this.
From 53abac832029696e47fdd2bcc36a079419076b4a Mon Sep 17 00:00:00 2001 From: Wolfgang Denk wd@denx.de
Date: Sun, 6 Jul 2008 23:54:34 +0200 Subject: [PATCH] TQM8xxL: fix support for second flash bank
When switching the TQM8xxL modules to use the CFI flash driver, support for the second flash bank was broken. This gets fixed now.
One problem was that the CFI driver allows only for static initia- lizers in the CFG_FLASH_BANKS_LIST definition, i. e. it did not allow to map several flash banks contiguously if the bank sizes were not known in advance, which kind of violates U-Boot's design philosophy.
Now we can refer to dynamically determined flash sizes and addresses.
Signed-off-by: Wolfgang Denk wd@denx.de ---
Note that the whole CFG_MAX_FLASH_BANKS_DETECT stuff is a big mess and should be cleaned up, too, but that's another story. Any volunteers?
drivers/mtd/cfi_flash.c | 14 ++++++++------ include/configs/TQM823L.h | 2 +- include/configs/TQM850L.h | 2 +- include/configs/TQM855L.h | 2 +- include/configs/TQM860L.h | 2 +- include/configs/TQM862L.h | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index c0ea97b..1ed92b1 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -158,13 +158,13 @@ static uint flash_offset_cfi[2] = { FLASH_OFFSET_CFI, FLASH_OFFSET_CFI_ALT };
/* use CFG_MAX_FLASH_BANKS_DETECT if defined */ #ifdef CFG_MAX_FLASH_BANKS_DETECT -static ulong bank_base[CFG_MAX_FLASH_BANKS_DETECT] = CFG_FLASH_BANKS_LIST; -flash_info_t flash_info[CFG_MAX_FLASH_BANKS_DETECT]; /* FLASH chips info */ +# define CFI_MAX_FLASH_BANKS CFG_MAX_FLASH_BANKS_DETECT #else -static ulong bank_base[CFG_MAX_FLASH_BANKS] = CFG_FLASH_BANKS_LIST; -flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* FLASH chips info */ +# define CFI_MAX_FLASH_BANKS CFG_MAX_FLASH_BANKS #endif
+flash_info_t flash_info[CFI_MAX_FLASH_BANKS]; /* FLASH chips info */ + /* * Check if chip width is defined. If not, start detecting with 8bit. */ @@ -1909,12 +1909,14 @@ unsigned long flash_init (void) char *s = getenv("unlock"); #endif
+#define BANK_BASE(i) (((unsigned long [CFI_MAX_FLASH_BANKS])CFG_FLASH_BANKS_LIST)[i]) + /* Init: no FLASHes known */ for (i = 0; i < CFG_MAX_FLASH_BANKS; ++i) { flash_info[i].flash_id = FLASH_UNKNOWN;
- if (!flash_detect_legacy (bank_base[i], i)) - flash_get_size (bank_base[i], i); + if (!flash_detect_legacy (BANK_BASE(i), i)) + flash_get_size (BANK_BASE(i), i); size += flash_info[i].size; if (flash_info[i].flash_id == FLASH_UNKNOWN) { #ifndef CFG_FLASH_QUIET_TEST diff --git a/include/configs/TQM823L.h b/include/configs/TQM823L.h index 100be7c..3871722 100644 --- a/include/configs/TQM823L.h +++ b/include/configs/TQM823L.h @@ -196,7 +196,7 @@ /* use CFI flash driver */ #define CFG_FLASH_CFI 1 /* Flash is CFI conformant */ #define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */ -#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE } +#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size } #define CFG_FLASH_EMPTY_INFO #define CFG_FLASH_USE_BUFFER_WRITE 1 #define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */ diff --git a/include/configs/TQM850L.h b/include/configs/TQM850L.h index 3097bc3..17afa89 100644 --- a/include/configs/TQM850L.h +++ b/include/configs/TQM850L.h @@ -183,7 +183,7 @@ /* use CFI flash driver */ #define CFG_FLASH_CFI 1 /* Flash is CFI conformant */ #define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */ -#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE } +#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size } #define CFG_FLASH_EMPTY_INFO #define CFG_FLASH_USE_BUFFER_WRITE 1 #define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */ diff --git a/include/configs/TQM855L.h b/include/configs/TQM855L.h index 8ca8906..73d6583 100644 --- a/include/configs/TQM855L.h +++ b/include/configs/TQM855L.h @@ -187,7 +187,7 @@ /* use CFI flash driver */ #define CFG_FLASH_CFI 1 /* Flash is CFI conformant */ #define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */ -#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE } +#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size } #define CFG_FLASH_EMPTY_INFO #define CFG_FLASH_USE_BUFFER_WRITE 1 #define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */ diff --git a/include/configs/TQM860L.h b/include/configs/TQM860L.h index f66aace..576e3e2 100644 --- a/include/configs/TQM860L.h +++ b/include/configs/TQM860L.h @@ -190,7 +190,7 @@ /* use CFI flash driver */ #define CFG_FLASH_CFI 1 /* Flash is CFI conformant */ #define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */ -#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE } +#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size } #define CFG_FLASH_EMPTY_INFO #define CFG_FLASH_USE_BUFFER_WRITE 1 #define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */ diff --git a/include/configs/TQM862L.h b/include/configs/TQM862L.h index 7813a20..6d2f91b 100644 --- a/include/configs/TQM862L.h +++ b/include/configs/TQM862L.h @@ -190,7 +190,7 @@ /* use CFI flash driver */ #define CFG_FLASH_CFI 1 /* Flash is CFI conformant */ #define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */ -#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE } +#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE, CFG_FLASH_BASE+flash_info[0].size } #define CFG_FLASH_EMPTY_INFO #define CFG_FLASH_USE_BUFFER_WRITE 1 #define CFG_MAX_FLASH_BANKS 2 /* max number of memory banks */
participants (3)
-
Jens Gehrlein
-
Thomas Maenner
-
Wolfgang Denk