[U-Boot] [RFC] arm926ejs: fix jump to RAM nand_boot

Wolfgang Denk
2010-11-01T19:23:17Z

Dear Albert ARIBAUD,

In message <4CCEF2E4.5080003@free.fr> you wrote:
>
> Also, I understand why the second RFC change I did was harmful to tx25.
> Contrary to u-boot itself, u-boot-spl is not compiled to be position
> independent; it actually loads at a given address then copies itself,
> without relocating, to its home location.

It copies _itself_? Not the U-Boot payload?

Heiko, is this intentional? Do we really first load the whole image,
then copy the U-Boot payload to some other address, then relocate it
to yet another one?

> I also think I might have found out what hit tx25.
>
> include/configs/tx25 defines the size of u-boot which SPL will use to
> load from NAND into RAM. currently it is defined thus:
>
> #define CONFIG_SYS_NAND_U_BOOT_SIZE 0x30000

Arghh...

> Wolfgang, please try the following:
>
> - on u-boot-testing, branch reloc_tests, revert commit 7fab02d...
> (that's "arm926ejs: fix jump to RAM nand_boot") as this 'fix' is a mistake.
>
> - in include/configs/tx25.h, increasing CONFIG_SYS_NAND_U_BOOT_SIZE to
> 0x31000
>
> Let me know if building tx25 after these two corrections makes things
> better.

Bingo.

Both the ELDK and the CS compiled versions run fine now:

with ELDK:

U-Boot 2010.12-rc1-00030-g7fec359 (Nov 01 2010 - 20:13:53)

U-Boot code: 81200000 -> 81224E64 BSS: -> 8122DF68
CPU: Freescale i.MX25 at 399 MHz

monitor len: 0002DF68
ramsize: 02000000
TLB table at: 81ff0000
Top of RAM usable for U-Boot at: 81ff0000
Reserving 183k for U-Boot at: 81fc2000
Reserving 1024k for malloc() at: 81ec2000
Reserving 24 Bytes for Board Info at: 81ec1fe8
Reserving 92 Bytes for Global Data at: 81ec1f8c
New Stack Pointer is: 81ec1f88
RAM Configuration:
Bank #0: 80000000 32 MiB
relocation Offset is: 00dc2000
monitor flash len: 00024E64
Now running in RAM - U-Boot at: 81fc2000
...

with CS:

U-Boot 2010.12-rc1-00030-g7fec359 (Nov 01 2010 - 20:18:09)

U-Boot code: 81200000 -> 812237E8 BSS: -> 8122C8F0
CPU: Freescale i.MX25 at 399 MHz

monitor len: 0002C8F0
ramsize: 02000000
TLB table at: 81ff0000
Top of RAM usable for U-Boot at: 81ff0000
Reserving 178k for U-Boot at: 81fc3000
Reserving 1024k for malloc() at: 81ec3000
Reserving 24 Bytes for Board Info at: 81ec2fe8
Reserving 92 Bytes for Global Data at: 81ec2f8c
New Stack Pointer is: 81ec2f88
RAM Configuration:
Bank #0: 80000000 32 MiB
relocation Offset is: 00dc3000
monitor flash len: 000237E8
Now running in RAM - U-Boot at: 81fc3000
...

Note that the CS tool chain gives somewhat smaller code...

Thanks a lot!

Guess we should submit the temporary changes now as formal patches?

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 go slow, be gentle. It's no one-way street -- you know how you
feel and that's all. It's how the girl feels too. Don't press. If the
girl feels anything for you at all, you'll know.
-- Kirk, "Charlie X", stardate 1535.8