Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

board: sam5d3_xplained: Fix SPL boot from NAND #14

Closed
wants to merge 2 commits into from

Conversation

FabienLehoussel
Copy link

Signed-off-by: Fabien Lehoussel [email protected]

Please do not submit a Pull Request via github. Our project makes use of
mailing lists for patch submission and review. For more details please
see https://www.denx.de/wiki/U-Boot/Patches

@ehristev ehristev self-assigned this Feb 24, 2020
@ehristev
Copy link

Hi,

What was failing and how does your change fix it ?
Thanks

@FabienLehoussel
Copy link
Author

DTB read error

SPL boot cannot find dtb if CONFIG_SPL_SEPARATE_BSS is disable :

CONFIG_SPL_SEPARATE_BSS=n

RomBOOT
<debug_uart> Missing DTB
### ERROR ### Please RESET the board ###
RomBOOT

CONFIG_SPL_SEPARATE_BSS=y

RomBOOT
<debug_uart>
U-Boot SPL 2019.04-linux4sam_6.2-icp-dirty (Feb 24 2020 - 15:34:35 +0100)
Trying to boot from NAND
<debug_uart>

Uboot size

uboot size is incorrect.
Uboot SPL use CONFIG_SYS_MONITOR_LEN to read uboot from NAND : 0x80000
With sama5d3_xplained_nandflash_defconfig : u-boot.bin size is ~800Ko 0xC000
I had some logs :

RomBOOT
<debug_uart>
U-Boot SPL 2019.04-linux4sam_6.2-g88206ef-dirty (Feb 21 2020 - 16:20:45 +0100)
spl_board_init
spl_board_init Ok
spl_boot_device
Trying to boot from 0x0
Trying to boot from NAND
spl_load_image boot_device 4
spl: nand - using hw ecc
Load u-boot...
spl_nand_load_element, Offset 0x40000
spl_set_header_raw_uboot image entry point: 0x26F00000
nand_spl_load_image, Offset 0x40000 Size 0x8000 dest 0x26f00000
Jumping to U-Boot
loaded - jumping to U-Boot...
image entry point: 0x26f00000

So I increased size to 1MB : 0x100000

RomBOOT
<debug_uart>
U-Boot SPL 2019.04-linux4sam_6.2-g88206ef-dirty (Feb 24 2020 - 14:53:22 +0100)
spl_board_init
spl_board_init Ok
spl_boot_device
Trying to boot from 0x0
Trying to boot from NAND
spl_load_image boot_device 4
spl: nand - using hw ecc
Load u-boot...
spl_nand_load_element, Offset 0x40000
spl_set_header_raw_uboot image entry point: 0x26F00000
nand_spl_load_image, Offset 0x40000 Size 0x100000 dest 0x26F00000
Jumping to U-Boot
loaded - jumping to U-Boot...
image entry point: 0x26f00000
<debug_uart>

U-Boot 2019.04-linux4sam_6.2-g88206ef-dirty (Feb 24 2020 - 14:51:50 +0100)

CPU: SAMA5D36
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      132 MHz
DRAM:  dram_init
dram_init Ok
256 MiB
board_init
board_init Ok
NAND:  256 MiB
MMC:   Atmel mci: 0, Atmel mci: 1
Loading Environment from NAND...

@ehristev
Copy link

Can you please make 2 commits
one of them will fix the SIZE , to increase to 1 MB
second, to enable CONFIG_SPL_SEPARATE_BSS
Thanks !

@ehristev ehristev self-requested a review February 24, 2020 15:22
Copy link

@ehristev ehristev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed in main thread

@FabienLehoussel
Copy link
Author

Done !

@ehristev
Copy link

Hi,

I took the liberty to edit the commit messages of your commits and pushed them.
Thank you for the patch !
One last request, are you kind to test these changes on your board, but based on our new branch 2020.01-at91 ?
This is the future development branch and I would like to push your fixes to that branch as well. (new u-boot version).
Thanks !
Eugen

@FabienLehoussel
Copy link
Author

FabienLehoussel commented Feb 25, 2020

Works on 2020.01.

But you need to update patch 2

RomBOOT
<debug_uart>
U-Boot SPL 2020.01 (Feb 25 2020 - 10:35:47 +0100)
Trying to boot from NAND
<debug_uart>

U-Boot 2020.01 (Feb 25 2020 - 10:35:47 +0100)

CPU: SAMA5D36
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      132 MHz
DRAM:  256 MiB
NAND:  256 MiB
MMC:   Atmel mci: 0, Atmel mci: 1
Loading Environment from NAND... OK

@ehristev
Copy link

Thanks,
will push them to the new branch as well.

@ehristev ehristev closed this Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants