Skip to contentSkip to conversation

board: sama5d3_xplained: Fix SPL DTB read from NAND

PATCH New Eugen Hristev 1 participant 3 messages Feb 25, 2020 – Mar 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 board: sama5d3_xplained: Fix SPL DTB read from NAND

From: Fabien Lehoussel <[email protected]>

SPL boot cannot find dtb if CONFIG_SPL_SEPARATE_BSS is disabled :

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>

---
 configs/sama5d3_xplained_nandflash_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/sama5d3_xplained_nandflash_defconfig +1 -0
index 9ad05f5ffd..bfc639975d 100644
@@ -24,6 +24,7 @@ CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,768k(uboot)ro,256K(env_redundant),256k(env),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=6 root=ubi0:rootfs"
 # CONFIG_DISPLAY_BOARDINFO is not set
+CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_NAND_SUPPORT=y
 CONFIG_HUSH_PARSER=y
 CONFIG_CMD_BOOTZ=y
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 board: sama5d3_xplained: Fix SPL DTB read from NAND

Quoted 15 lines · Eugen Hristev

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

From: Fabien Lehoussel <[email protected]>

SPL boot cannot find dtb if CONFIG_SPL_SEPARATE_BSS is disabled :

CONFIG_SPL_SEPARATE_BSS=n

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

CONFIG_SPL_SEPARATE_BSS=y

Quoted 8 lines

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>

---

Applied this and patch 2/2 to u-boot-atmel/master
Thanks !

#2 lore raw

PATCH 2/2 board: sama5d3_xplained: Fix uboot size when loaded from NAND by SPL

In reply to Eugen Hristev

From: Fabien Lehoussel <[email protected]>

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 0xC0000

So I increased size to 1MB : 0x100000

---
 include/configs/sama5d3_xplained.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/configs/sama5d3_xplained.h +3 -1
index 696933da73..42c14007c0 100644
@@ -9,6 +9,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#include <linux/sizes.h>
 #include "at91-sama5_common.h"
 
 /*
@@ -64,7 +65,8 @@
 #define CONFIG_SYS_SPL_MALLOC_START	0x20080000
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x80000
 
-#define CONFIG_SYS_MONITOR_LEN		(512 << 10)
+/* size of u-boot.bin to load */
+#define CONFIG_SYS_MONITOR_LEN		(2 * SZ_512K)
 
 #ifdef CONFIG_SD_BOOT
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
Signature · 1 line
2.20.1