[U-Boot-Users] copy to flash ... outside available flash

Hi Group, I am trying to install a Ramdiskimage into the flash of a TQM823L Board. Somehow it seems uboot has problems to copy a image lager than 0x100000 Bytes into flash. Here is my flashinfo:
Bank # 1: AMD AM29LV160B (16 Mbit, bottom boot sect) Size: 4 MB in 35 Sectors Sector Start Addresses: 40000000 (RO) 40008000 (RO) 4000C000 (RO) 40010000 (RO) 40020000 (RO) 40040000 40060000 40080000 400A0000 400C0000 400E0000 40100000 40120000 40140000 40160000 40180000 401A0000 401C0000 401E0000 40200000 40220000 40240000 40260000 40280000 402A0000 402C0000 402E0000 40300000 40320000 40340000 40360000 40380000 403A0000 403C0000 403E0000
Bank # 2: AMD AM29LV160B (16 Mbit, bottom boot sect) Size: 4 MB in 35 Sectors Sector Start Addresses: 40400000 40408000 4040C000 40410000 40420000 40440000 40460000 40480000 404A0000 404C0000 404E0000 40500000 40520000 40540000 40560000 40580000 405A0000 405C0000 405E0000 40600000 40620000 40640000 40660000 40680000 406A0000 406C0000 406E0000 40700000 40720000 40740000 40760000 40780000 407A0000 407C0000 407E0000
This means I have 8 MB o flash. I can copy a Block of 0xFFFFF Bytes from the RAM for example to 0x40100000. and I can copy the same Block to 0x40200000 or to 0x40300000. But if I copy a block that is larger than 0xFFFFF to any location it claims that I copy outside available Flash. This is stupid and wrong. Ramdisk image size was 0x18CFC9 Baseaddress: 0x40100000 ramdisk size: + 0x0018CFC9 ------------------------------ end address 0x4028CFC9
And this adress is surely not outside my flash. What is going on here?
BTW I use U-Boot 1.1.4 (Sep 18 2006 - 13:38:13) on a PPC823 with 16MB RAM and 8 MB Flash.
Thanks for any input! Thomas

Hi Thomas,
u-boot-users-bounces@lists.sourceforge.net wrote on : [...]
This means I have 8 MB o flash. I can copy a Block of 0xFFFFF Bytes from the RAM for example to 0x40100000. and I can copy the same Block to 0x40200000 or to 0x40300000. But if I copy a block that is larger than 0xFFFFF to any location it claims that I copy outside available Flash. This is stupid and wrong. Ramdisk image size was 0x18CFC9 Baseaddress: 0x40100000 ramdisk size: + 0x0018CFC9
end address 0x4028CFC9
And this adress is surely not outside my flash. What is going on here?
Could you please post the commands you used to load the image and copy it to flash, including the returned error message?
Regards, Martin

Hi Thomas,
Thomas Ruschival wrote:
Hi Group, I am trying to install a Ramdiskimage into the flash of a TQM823L Board. Somehow it seems uboot has problems to copy a image lager than 0x100000 Bytes into flash. Here is my flashinfo:
Bank # 1: AMD AM29LV160B (16 Mbit, bottom boot sect) Size: 4 MB in 35 Sectors
(snip)
Bank # 2: AMD AM29LV160B (16 Mbit, bottom boot sect) Size: 4 MB in 35 Sectors Sector Start Addresses:
What flash driver are you using? This is not the output from standard cfi_flash.c
This means I have 8 MB o flash. I can copy a Block of 0xFFFFF Bytes from the RAM for example to 0x40100000. and I can copy the same Block to 0x40200000 or to 0x40300000. But if I copy a block that is larger than 0xFFFFF to any location it claims that I copy outside available Flash. This is stupid and wrong.
What is your exact cp command. Are you using cp.b or just cp? If you are using just cp your length is in multiples of dwords (4 bytes). Did you scale your size accordingly?
Also, I did not verify this but the cp command as it is implemented now probably requires the start and end address to reside in a single flash bank. Even if your two flashes have contiguous addresses assigned they are still two banks. If you need to copy to flash that spans over two banks you will probably need to split that into two operations.
Ramdisk image size was 0x18CFC9 Baseaddress: 0x40100000 ramdisk size: + 0x0018CFC9
end address 0x4028CFC9
And this adress is surely not outside my flash. What is going on here?
You are crossing flash banks and your write is not ending in the bank you started with.
Best regards, Tolunay

In message 4558A10C.8090207@orkun.us you wrote:
What flash driver are you using? This is not the output from standard cfi_flash.c
That's an old custom flash driver. IIRC, the very first one ever in U-Boot resp. PPCBoot.
What is your exact cp command. Are you using cp.b or just cp? If you are
That's muy guess, too.
Also, I did not verify this but the cp command as it is implemented now probably requires the start and end address to reside in a single flash bank. Even if your two flashes have contiguous addresses assigned they are still two banks. If you need to copy to flash that spans over two banks you will probably need to split that into two operations.
No, this should NOT be necessary.
[And if it was, I'd consider it a bug.]
Best regards,
Wolfgang Denk

In message 20061113115625.6c0d99ca@localhost you wrote:
I am trying to install a Ramdiskimage into the flash of a TQM823L Board. Somehow it seems uboot has problems to copy a image lager than 0x100000 Bytes into flash. Here is my flashinfo:
No, it does not. At least not here.
This means I have 8 MB o flash. I can copy a Block of 0xFFFFF Bytes from the RAM for example to 0x40100000. and I can copy the same Block to 0x40200000 or to 0x40300000.
Right.
But if I copy a block that is larger than 0xFFFFF to any location it claims that I copy outside available Flash. This is stupid and wrong. Ramdisk image size was 0x18CFC9 Baseaddress: 0x40100000 ramdisk size: + 0x0018CFC9
end address 0x4028CFC9
And this adress is surely not outside my flash. What is going on here?
You must be doing something awfully wrong, like using "cp" instead of "cp.b". Unfortunately you don't provide the exact command you used, so I can only guess. But I bet a case of beer that it's a PEBKAC.
Best regards,
Wolfgang Denk

Here are the commands I loaded the image with: now I got a different error. It claim the flash wasn't erased?
1.) load image loadb 100000 // here I am sending the image
## Total Size = 0x0018cfc9 = 1626057 Bytes ## Start Addr = 0x00100000
2.) Verify The Image => imi
## Checking Image at 00100000 ... Image Name: Simple Embedded Linux Framework Created: 2005-06-07 12:59:15 UTC Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size: 1625993 Bytes = 1.6 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK
3.) erase the flash => erase 40100000 403FFFFF .............. done Erased 24 sectors
4.) Copying the image => cp 100000 40100000 18cfc9 Copy to Flash... Flash not Erased
What is this?? Now I can't even copy things into flash. After copying for a while it brings this error.
Second attempt: istead of erasing 40100000 to 403FFFFF I erase what is needed : => erase 4010000 +18CFC9 ...... done Erased 13 sectors
=> cp 100000 40100000 18CFC9 Copy to Flash... Flash not Erased
I have no clue what is going on here? Any input for me?
thanks in advance Thomas

In message 20061114104800.6dfba789@localhost you wrote:
Here are the commands I loaded the image with: now I got a different error. It claim the flash wasn't erased?
Correct error message.
=> cp 100000 40100000 18cfc9 Copy to Flash... Flash not Erased
Please RTFM about the correct use of the cp (resp. the cp.b) command.
I have no clue what is going on here? Any input for me?
There were already two postings on this list which pointed out that you are using hte "cp" command with wrong length parameter.
Please RTFM!!!! (ideally *before* posting)
Best regards,
Wolfgang Denk
participants (5)
-
Demke Torsten-atd012
-
Martin Krause
-
Thomas Ruschival
-
Tolunay Orkun
-
Wolfgang Denk