[U-Boot] T1040RDB u-boot chain load u-boot

Hello,
I have a u-boot-with-spl-pbl.bin booting off NAND, and now I would like to create another build of u-boot to be chain-loaded, and I would appreciate some assistance.
I'm using u-boot tag v2018.05, config T1040RDB_NAND_defconfig as base.
Here's what I tried
Scenario 1: Checking the defconfig, I see that CONFIG_SYS_TEXT_BASE=0x30001000, so I went ahead and tried: => tftp 30001000 u-boot.bin => go 30001000 ## Starting application at 0x30001000 ... and it hangs
Scenario 2: Different load address: => tftp 1000000 u-boot.bin => go 1000000 ## Starting application at 0x01000000 ... hang
Scenario 3: I was thinking that maybe I need to bump the load and text address by 8MB so it does not matches the currently running u-boot (which has CONFIG_SYS_TEXT_BASE=0x30001000), so I applied the following patch: --- a/configs/T1040RDB_NAND_defconfig +++ b/configs/T1040RDB_NAND_defconfig -CONFIG_SYS_TEXT_BASE=0x30001000 +CONFIG_SYS_TEXT_BASE=0x30801000
=> tftp 30801000 u-boot.bin => go 30801000 same hang also different address: => tftp 1000000 u-boot.bin => go 1000000 ## Starting application at 0x01000000 ...
Scenario 4: Remove RAMBOOT_PBL from defconfig: -CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL" +CONFIG_SYS_EXTRA_OPTIONS="SPL_FSL_PBL"
This results in a binary that is more than 3GB (??????)
Scenario 4.1: I noticed that CONFIG_SYS_TEXT_BASE affects the size of binary so I thought I can fix this by placing it near RAM end, 4 GB - 8 MB: -CONFIG_SYS_TEXT_BASE=0x30001000 +CONFIG_SYS_TEXT_BASE=0xFF800000 -CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL" +CONFIG_SYS_EXTRA_OPTIONS="SPL_FSL_PBL"
but the size of u-boot.bin is ~249 MB
I also went through, doc/README.ramboot-ppc85xx which describes what I need. Looking over ./arch/powerpc/cpu/mpc85xx/start.S, I see that CCSR relocation is happening but I can't tell to which value, which might explain why I get hangs. I'll have to investigate more.
Any ideas are appreciated.
Best regards, Nicolae

On Thu, Jun 7, 2018 at 10:46 PM Nicolae Rosia nicolae.rosia.oss@gmail.com wrote: <snip>
Scenario 4: Remove RAMBOOT_PBL from defconfig: -CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL" +CONFIG_SYS_EXTRA_OPTIONS="SPL_FSL_PBL"
This results in a binary that is more than 3GB (??????)
Scenario 4.1: I noticed that CONFIG_SYS_TEXT_BASE affects the size of binary so I thought I can fix this by placing it near RAM end, 4 GB - 8 MB: -CONFIG_SYS_TEXT_BASE=0x30001000 +CONFIG_SYS_TEXT_BASE=0xFF800000 -CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL" +CONFIG_SYS_EXTRA_OPTIONS="SPL_FSL_PBL"
but the size of u-boot.bin is ~249 MB
That's probably because there's some other fixed address in use (probably the reset vector). You'll want to adjust that address to match your new location or maybe use something like SKIP_LOW_LEVEL_INIT assuming powerpc has such a thing.

Hi,
The u-boot-spl.bin (written in nand) loads the u-boot.bin which was previously written in nand. When the board boots, this process is transparent to you. (The address for the u-boot.bin in nand is 0x40000). The load process is done through the spl routines that are used by the u-boot-spl.bin image to load the u-boot from offset 0x40000.
To summarize, the boot process is like this: PBL ----> (NAND -RCW) ----> u-boot-spl --->u-boot.bin
From the booted u-boot if you try to launch u-boot.bin which was transferred in a memory location by you, you will for sure get a hang because the u-boot.bin will try to reinitialize some blocks that were already initialized. You could end up taking the carpet from underneath your feet.
If you want to load another u-boot instance you will have probably to make changes in the u-boot.bin image.
Radu
-----Original Message----- From: Chris Packham [mailto:judge.packham@gmail.com] Sent: Friday, June 8, 2018 12:20 AM To: nicolae.rosia.oss@gmail.com Cc: u-boot u-boot@lists.denx.de; Priyanka Jain priyanka.jain@nxp.com; Radu-andrei Bulie radu-andrei.bulie@nxp.com Subject: Re: [U-Boot] T1040RDB u-boot chain load u-boot
On Thu, Jun 7, 2018 at 10:46 PM Nicolae Rosia nicolae.rosia.oss@gmail.com wrote: <snip>
Scenario 4: Remove RAMBOOT_PBL from defconfig: -CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL" +CONFIG_SYS_EXTRA_OPTIONS="SPL_FSL_PBL"
This results in a binary that is more than 3GB (??????)
Scenario 4.1: I noticed that CONFIG_SYS_TEXT_BASE affects the size of binary so I thought I can fix this by placing it near RAM end, 4 GB - 8 MB: -CONFIG_SYS_TEXT_BASE=0x30001000 +CONFIG_SYS_TEXT_BASE=0xFF800000 -CONFIG_SYS_EXTRA_OPTIONS="RAMBOOT_PBL,SPL_FSL_PBL" +CONFIG_SYS_EXTRA_OPTIONS="SPL_FSL_PBL"
but the size of u-boot.bin is ~249 MB
That's probably because there's some other fixed address in use (probably the reset vector). You'll want to adjust that address to match your new location or maybe use something like SKIP_LOW_LEVEL_INIT assuming powerpc has such a thing.
participants (3)
-
Chris Packham
-
Nicolae Rosia
-
Radu-andrei Bulie