Skip to contentSkip to conversation

about ## Unknown FLASH on Bank 0

U-Boot Peter Pan 2 participants 8 messages Oct 26, 2009 – Nov 26, 2009 1 message not in the archive

lore
Share & tools
lore

Peter Pan

author
#0 lore raw

My U-boot 1.2.0 works fine before. but I want to add some memory test actions before u-boot start Linux.
I use the "mtest" command to test the memory. But the "mtest" command will test the memory infinitely.
So, I change the /common/cmd_mem.c, and do the following change:

#if defined(CFG_ALT_MEMTEST)
    printf(.....);
    PRINTF(...);
    for(;iterations == 1;)

/* for(;;) { */
....

Which I think will make the memory test only once.

But after I cross-compile the u-boot, the "Unknown FLASH" happens:

FLASH: ## Unknown FLASH on Bank 0
## Unknown FLASH on Bank 0 - Siz= 0x00000000 = 0 MB *** failed ***
### ERROR ### Please RESET the board ###

But after I add these in my board flash.c file, the u-boot works well again:

for(i = 0; i < 100; i++)

    printf("");

the above lines is added in flash_get_size function, after I get the 4 codes of the flash,
and before I start to compare the codes with S29GL_ID0.

Anybody get any idea?

#1 lore raw

Dear Peter Pan,

Quoted 6 lines · In message <[email protected]> you…

My U-boot 1.2.0 works fine before. but I want to add some memory test actions before u-boot start Linux.
I use the "mtest" command to test the memory. But the "mtest" command will test the memory infinitely.
So, I change the /common/cmd_mem.c, and do the following change:

Instead of hacking ancient code in incompatible ways I recommend you to update and use curent code. Ther the "mtest" command takes an optional 4th argument which defines the number of iterations.

Also please note that "mtest" is not really optimal for a memory test unless you #define CONFIG_SYS_ALT_MEMTEST.

And finally it might be worth to look into the memory test facilities that are part of the POST implementation instead.

Quoted 6 lines

But after I cross-compile the u-boot, the "Unknown FLASH" happens:

FLASH: ## Unknown FLASH on Bank 0
## Unknown FLASH on Bank 0 - Siz= 0x00000000 = 0 MB *** failed ***
### ERROR ### Please RESET the board ###

Well, this is obviouly completely unrelated to the changes you describe, so you must have changed other things, too, if the code was working before,

Quoted 1 line

Anybody get any idea?

Ancient, completely unsupported code. Please update.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"You'll pay to know what you really think."        - J.R. "Bob" Dobbs

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Dear Peter Pan,

please keel the mailinmg list on Cc:

Quoted 7 lines · In message <[email protected]> you…

I also think the 1.2.0 is an ancient version, so I migrate my u-boot from 1.2.0 to u-boot-2009-08 yestoday, the same "Unknown Flash Bank" problem happened.
I changed a little in the common files, all of which I think should not lead to this "Unknown Flash Bank" problem.
I use MPC8247, and all my changes are:

Which exact board are you using?

Quoted 2 lines

1. in /common/env_common.c, I add my environment variables to array default_environment.

Bad, very bad. You should never meddle with this file. You should add your custom settings to your board config file only.

Quoted 4 lines

2. in /cpu/mpc8260/cpu_init.c, in function cpu_init_f, I common this line "immr->im_clkrst.car_rsr = RSR_ALLBITS;", because I will need RSR register value later
3. in /cpu/mpc8260/serial_smc.c, we use BRG1 for SMC1 instead of BRG7

You are not supposed to meddle with these files. No changes to such common files are necessary to port U-Boot to custom hardware.

Quoted 4 lines

4. in /include/mpc8260.h, we add a hardware dog kick function, and modified functiion "reset_8260_watchdog" a little to kick the hardware dog.
5. in /common/main.c, we add support to the two jumper on our board, which is just two "if... else...".

Such changes should be done in board specific code, not in common files.

Quoted 9 lines

6. in our board specific files, they all works fine before and I did not change a thing.
Make all the changes above, the u-boot works fine. then I modified the /common/cmd_mem.c, we make the mtest command to test memory only once(in CFG_ALT_MEMTEST mode).
I change the "for(;;)" to for(;iterations == 1;)", then the "Unknown Flash Bank" happens.
I printed out the 4 Flash IDs, the Manufacture Id changes from 0x01(normal) to 0x808(wrong!!), other IDs are all normal.

This makes zero sense to me.

I understand you have a custom board with local modifications. That means we don't know neither your hardware nor your code, which makes it impossible to help. From the symptoms you describe, there must be something fundamentally broken with your port, but without seeing your code we cannot even guess what this might be.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The high cost of living hasn't affected its popularity.
author
#4 lore raw

Dear Wolfgang Denk:

Our hardware should be fine. We run VxWorks on it before and it works fine. The hardware running VxWorks is already
a mature product of our company. We recently want to run linux on it because of the high price of VxWorks.

I do a little experiments on the U-Boot-2009-08, any I successfully make the "Unknown Flash on Bank 0" appear without any
code modification on common files. I only add my board specification files and my config file, change the Makefile to
support my board files to compile, then the "unknown flash on bank 0" appears.

I use ELDK for cross compile, and the ELDK gcc version is :
ppc_6xx-gcc(GCC) 4.2.2

Which part of the code may cause this kind of problem? Maybe I can send your that part of my codes.

2009/10/27 Wolfgang Denk <[email protected]>

Quoted 72 lines

Dear Peter Pan,

please keel the mailinmg list on Cc:

In message <[email protected]>

Quoted 5 lines · you

I also think the 1.2.0 is an ancient version, so I migrate my u-boot from 1.2.0 to u-boot-2009-08 yestoday, the same "Unknown Flash Bank" problem happened.
I changed a little in the common files, all of which I think should not

lead

Quoted 2 lines

to this "Unknown Flash Bank" problem.
I use MPC8247, and all my changes are:

Which exact board are you using?

Quoted 2 lines

1. in /common/env_common.c, I add my environment variables to array default_environment.

Bad, very bad. You should never meddle with this file. You should add your custom settings to your board config file only.

Quoted 2 lines

2. in /cpu/mpc8260/cpu_init.c, in function cpu_init_f, I common this line "immr->im_clkrst.car_rsr = RSR_ALLBITS;", because I will need RSR

register

Quoted 2 lines

value later
3. in /cpu/mpc8260/serial_smc.c, we use BRG1 for SMC1 instead of BRG7

You are not supposed to meddle with these files. No changes to such common files are necessary to port U-Boot to custom hardware.

Quoted 1 line

4. in /include/mpc8260.h, we add a hardware dog kick function, and

modified

Quoted 2 lines

functiion "reset_8260_watchdog" a little to kick the hardware dog.
5. in /common/main.c, we add support to the two jumper on our board,

which

Quoted 1 line

is just two "if... else...".

Such changes should be done in board specific code, not in common files.

Quoted 6 lines

6. in our board specific files, they all works fine before and I did not change a thing.
Make all the changes above, the u-boot works fine. then I modified the /common/cmd_mem.c, we make the mtest command to test memory only once(in CFG_ALT_MEMTEST mode).
I change the "for(;;)" to for(;iterations == 1;)", then the "Unknown

Flash

Quoted 2 lines

Bank" happens.
I printed out the 4 Flash IDs, the Manufacture Id changes from

0x01(normal)

Quoted 1 line

to 0x808(wrong!!), other IDs are all normal.

This makes zero sense to me.

I understand you have a custom board with local modifications. That means we don't know neither your hardware nor your code, which makes it impossible to help. From the symptoms you describe, there must be something fundamentally broken with your port, but without seeing your code we cannot even guess what this might be.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The high cost of living hasn't affected its popularity.

author
#5 lore raw

I have checked this problem again, and find out the reason why sometimes we get a false value of the ID0 we read from norflash.

When we read IDs from norflash, we first write the read id command:

AMD_SEND_CMD(baseaddr, ACMD_READMODE);

AMD_SEND_CMD((baseaddr | LATCH_OFFSET1), ACMD_UNLOCK1);
AMD_SEND_CMD((baseaddr | LATCH_OFFSET2), ACMD_UNLOCK2);
AMD_SEND_CMD((baseaddr | LATCH_OFFSET1), ACMD_ID);

then we read the IDs from norflash:
pAddr = (unsigned short *)(baseaddr & 0xFFFFFF00); //Manufacture Id
code0 = *(pAddr); //cycle 4: Addr: X00 data = 0x01
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE1_OFFSET_2X16);
code1 = *pAddr; //cycle 4: Addr: X01, X - don't care. data = 0x227E
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE2_OFFSET_2X16);
code2 = *pAddr; //cycle 5: Addr: X0E data = 0x2223
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE3_OFFSET_2X16);
code3 = *(pAddr); //cycle 6: Addr: X0F data = 0x2201
AMD_SEND_CMD(baseaddr, ACMD_READMODE);

We need to add a __asm__ __volatile__ ("sync"); between the write and read operation to always get a correct result.

2009/10/28 Peter Pan <[email protected]>

Quoted 99 lines

Dear Wolfgang Denk:

Our hardware should be fine. We run VxWorks on it before and it works fine. The hardware running VxWorks is already
a mature product of our company. We recently want to run linux on it because of the high price of VxWorks.

I do a little experiments on the U-Boot-2009-08, any I successfully make the "Unknown Flash on Bank 0" appear without any
code modification on common files. I only add my board specification files and my config file, change the Makefile to
support my board files to compile, then the "unknown flash on bank 0" appears.

I use ELDK for cross compile, and the ELDK gcc version is :
ppc_6xx-gcc(GCC) 4.2.2

Which part of the code may cause this kind of problem? Maybe I can send your that part of my codes.

2009/10/27 Wolfgang Denk <[email protected]>

Quoted 75 lines

Dear Peter Pan,

please keel the mailinmg list on Cc:

In message <[email protected]>

Quoted 2 lines · you

I also think the 1.2.0 is an ancient version, so I migrate my u-boot

from

Quoted 3 lines

1.2.0 to u-boot-2009-08 yestoday, the same "Unknown Flash Bank" problem happened.
I changed a little in the common files, all of which I think should not

lead

Quoted 2 lines

to this "Unknown Flash Bank" problem.
I use MPC8247, and all my changes are:

Which exact board are you using?

Quoted 2 lines

1. in /common/env_common.c, I add my environment variables to array default_environment.

Bad, very bad. You should never meddle with this file. You should add your custom settings to your board config file only.

Quoted 1 line

2. in /cpu/mpc8260/cpu_init.c, in function cpu_init_f, I common this

line

Quoted 1 line

"immr->im_clkrst.car_rsr = RSR_ALLBITS;", because I will need RSR

register

Quoted 2 lines

value later
3. in /cpu/mpc8260/serial_smc.c, we use BRG1 for SMC1 instead of BRG7

You are not supposed to meddle with these files. No changes to such common files are necessary to port U-Boot to custom hardware.

Quoted 1 line

4. in /include/mpc8260.h, we add a hardware dog kick function, and

modified

Quoted 2 lines

functiion "reset_8260_watchdog" a little to kick the hardware dog.
5. in /common/main.c, we add support to the two jumper on our board,

which

Quoted 1 line

is just two "if... else...".

Such changes should be done in board specific code, not in common files.

Quoted 6 lines

6. in our board specific files, they all works fine before and I did not change a thing.
Make all the changes above, the u-boot works fine. then I modified the /common/cmd_mem.c, we make the mtest command to test memory only once(in CFG_ALT_MEMTEST mode).
I change the "for(;;)" to for(;iterations == 1;)", then the "Unknown

Flash

Quoted 2 lines

Bank" happens.
I printed out the 4 Flash IDs, the Manufacture Id changes from

0x01(normal)

Quoted 1 line

to 0x808(wrong!!), other IDs are all normal.

This makes zero sense to me.

I understand you have a custom board with local modifications. That means we don't know neither your hardware nor your code, which makes it impossible to help. From the symptoms you describe, there must be something fundamentally broken with your port, but without seeing your code we cannot even guess what this might be.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The high cost of living hasn't affected its popularity.

#6 lore raw

Dear Peter Pan,

Quoted 11 lines · In message <[email protected]> you…

I have checked this problem again, and find out the reason why sometimes we get a false value of the ID0 we read from norflash.

When we read IDs from norflash, we first write the read id command:

AMD_SEND_CMD(baseaddr, ACMD_READMODE);

AMD_SEND_CMD((baseaddr | LATCH_OFFSET1), ACMD_UNLOCK1);
AMD_SEND_CMD((baseaddr | LATCH_OFFSET2), ACMD_UNLOCK2);
AMD_SEND_CMD((baseaddr | LATCH_OFFSET1), ACMD_ID);
Quoted 10 lines

then we read the IDs from norflash:
pAddr = (unsigned short *)(baseaddr & 0xFFFFFF00); //Manufacture Id
code0 = *(pAddr); //cycle 4: Addr: X00 data = 0x01
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE1_OFFSET_2X16);
code1 = *pAddr; //cycle 4: Addr: X01, X - don't care. data = 0x227E
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE2_OFFSET_2X16);
code2 = *pAddr; //cycle 5: Addr: X0E data = 0x2223
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE3_OFFSET_2X16);
code3 = *(pAddr); //cycle 6: Addr: X0F data = 0x2201
AMD_SEND_CMD(baseaddr, ACMD_READMODE);

Umm.. could you please point out which specific part of code (i. e . file name and line numbers, or snippet of the real code from the source file) you are talking about here?

I have problems following you, as for example I can find no such thing as AMD_SEND_CMD or ACMD_READMODE or LATCH_OFFSET anywhere in the whole source tree ?

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You could end up being oddly sad and full of a strange, diffuse  com-
passion  which would lead you to believe that it might be a good idea
to wipe out the whole human race and start again with amoebas.
                                 - Terry Pratchett, _Guards! Guards!_
author
#7 lore raw

The part of code I given out is in my get_flash_size() function in my flash.c.
This part of code is used to read out the Manufacture ID and Device ID of my nor flash.
This maybe have no contribution to the source tree, but maybe others that having the same problem can get a clue for such problems.

2009/11/26 Wolfgang Denk <[email protected]>

Quoted 47 lines

Dear Peter Pan,

In message <[email protected]>

Quoted 11 lines · you

I have checked this problem again, and find out the reason why sometimes we get a false value of the ID0 we read from norflash.

When we read IDs from norflash, we first write the read id command:

AMD_SEND_CMD(baseaddr, ACMD_READMODE);

AMD_SEND_CMD((baseaddr | LATCH_OFFSET1), ACMD_UNLOCK1);
AMD_SEND_CMD((baseaddr | LATCH_OFFSET2), ACMD_UNLOCK2);
AMD_SEND_CMD((baseaddr | LATCH_OFFSET1), ACMD_ID);
Quoted 10 lines

then we read the IDs from norflash:
pAddr = (unsigned short *)(baseaddr & 0xFFFFFF00); //Manufacture Id
code0 = *(pAddr); //cycle 4: Addr: X00 data = 0x01
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE1_OFFSET_2X16);
code1 = *pAddr; //cycle 4: Addr: X01, X - don't care. data = 0x227E
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE2_OFFSET_2X16);
code2 = *pAddr; //cycle 5: Addr: X0E data = 0x2223
pAddr = (unsigned short *)(baseaddr + DEVICE_CODE3_OFFSET_2X16);
code3 = *(pAddr); //cycle 6: Addr: X0F data = 0x2201
AMD_SEND_CMD(baseaddr, ACMD_READMODE);

Umm.. could you please point out which specific part of code (i. e . file name and line numbers, or snippet of the real code from the source file) you are talking about here?

I have problems following you, as for example I can find no such thing as AMD_SEND_CMD or ACMD_READMODE or LATCH_OFFSET anywhere in the whole source tree ?

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de You could end up being oddly sad and full of a strange, diffuse com- passion which would lead you to believe that it might be a good idea to wipe out the whole human race and start again with amoebas.
- Terry Pratchett, _Guards! Guards!_

#8 lore raw

Dear Peter Pan,

Quoted 3 lines · In message <[email protected]> you…

The part of code I given out is in my get_flash_size() function in my flash.c.

i
Ah. You're re-inventing the wheel one more time, it seems? Have fun...

Quoted 4 lines

This part of code is used to read out the Manufacture ID and Device ID of my nor flash.
This maybe have no contribution to the source tree, but maybe others that having the same problem can get a clue for such problems.

One likely reason for your problem is using plain pointer acesses while in fact you should be using proper accessor functions instead.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Is the glass half empty, half full, or twice as large as it needs to