Uboot SPL for sama5d3 xplained


#1

I am trying to get the uboot SPL running on my sama5d3 xplained board. I can get the at91bootstrap boot.bin to function (provide me debug feedback) but I would like to use uboot. When I follow the instructions (and everything does compile fine) and create the boot.bin for uboot SPL all I get is the RomBOOT response. Is there a way to turn on debug or other method to see console feedback for the uboot SPL? I am using an SD card in the MCI0 slot. Could you share a functioning boot.bin as a sanity check?


#2

@photonthunder I’ve been using U-Boot SPL for this board in my directions hosted here:

https://www.digikey.com/eewiki/display/linuxonarm/ATSAMA5D3+Xplained

Here’s the u-boot specific part:

https://www.digikey.com/eewiki/display/linuxonarm/ATSAMA5D3+Xplained#ATSAMA5D3Xplained-Bootloader:U-Boot

Regards,


#3

@RobertCNelson thanks for the response. I followed your instructions and created the boot.bin and everything is fine as far as compiling and such. I am copying the boot.bin to my existing functional SD card, could there be something in that copy that makes the uboot SPL non-functional? That is why I was hoping to get a boot.bin so I could identify if it was something with the SD card or something with the compilation.


#4

Sadly serial comes up way late in spl:

Best bet is to use a jtag to help track where you issue is coming from.

Regards,


#5

I wouldn’t mind trying to debug this using JTAG, but from what I read the only option is Atmel Studio on Windows? Previous work I have done I have just used a test pin to help me locate the bug but I can’t even get that to work. Has to be something simple because I am not changing anything in code, even using the same compiler version.


#6

For some reason the nandheader is being added to the top of the boot.bin for the mmc/SD build.

ls -l boot.bin
-rw-r–r-- 1 nelson nelson 62686 Dec 5 12:25 boot.bin

hexdump boot.bin | head
0000000 2405 c090 2405 c090 2405 c090 2405 c090
*
00000d0 000f ea00 f014 e59f f014 e59f f014 e59f
00000e0 f014 e59f f40e 0000 f014 e59f f014 e59f
00000f0 0040 0030 0040 0030 0040 0030 0040 0030
0000100 0040 0030 0040 0030 0040 0030 beef dead
0000110 fffe eaff 002a ea00 0000 e10f 101f e200
0000120 001a e331 001f 13c0 0013 1380 00c0 e380
0000130 f000 e129 0f10 ee11 0a02 e3c0 0f10 ee01
0000140 0078 e59f 0f10 ee0c 0006 eb00 001a eb00

So I just removed it and then it works:

dd bs=208 skip=1 if=boot.bin of=bootShort.bin

hexdump bootShort.bin | head
0000000 000f ea00 f014 e59f f014 e59f f014 e59f
0000010 f014 e59f f40e 0000 f014 e59f f014 e59f
0000020 0040 0030 0040 0030 0040 0030 0040 0030
0000030 0040 0030 0040 0030 0040 0030 beef dead
0000040 fffe eaff 002a ea00 0000 e10f 101f e200
0000050 001a e331 001f 13c0 0013 1380 00c0 e380
0000060 f000 e129 0f10 ee11 0a02 e3c0 0f10 ee01
0000070 0078 e59f 0f10 ee0c 0006 eb00 001a eb00
0000080 01b6 eb00 0f15 ee07 0f9a ee07 0f95 ee07
0000090 ff1e e12f ffeb eaff 0000 e3a0 0f17 ee08

ls -l bootShort.bin
-rw-r–r-- 1 nelson nelson 62478 Dec 5 12:54 bootShort.bin


#7

Okay getting somewhere, 2017.09 boot’s, starting git bisect now…

RomBOOT
<debug_uart> 
U-Boot SPL 2017.09-dirty (Dec 05 2018 - 13:23:36)
Trying to boot from MMC1
reading u-boot.img
reading u-boot.img
<debug_uart> 

U-Boot 2017.09-dirty (Dec 05 2018 - 13:23:36 -0600)

CPU: SAMA5D36
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      132 MHz
DRAM:  256 MiB
NAND:  atmel_nand: Fail to initialize #0 chip0 MiB
MMC:   Atmel mci: 0, Atmel mci: 1
reading uboot.env

** Unable to read "uboot.env" from mmc0:1 **
Using default environment

In:    serial@ffffee00
Out:   serial@ffffee00
Err:   serial@ffffee00
Net:   
Error: ethernet@f0028000 address not set.
No ethernet found.
Press SPACE to abort autoboot in 3 seconds
reading /dtbs/at91-sama5d3_xplained.dtb
** Unable to read file /dtbs/at91-sama5d3_xplained.dtb **
reading zImage
** Unable to read file zImage **

Regards,


#8

git bisect is pointing to:

Which looks clean:

Regards,


#9

Got it! Will post in the u-boot forum:

=> RomBOOT
<debug_uart> 
U-Boot spl 2019.01-rc1-00021-g2e2a2a5d4f-dirty (Dec 05 2018 - 14:30:22 -0600)
Trying to boot from MMC1
<debug_uart> 

U-Boot 2019.01-rc1-00021-g2e2a2a5d4f-dirty (Dec 05 2018 - 14:30:22 -0600)

CPU: SAMA5D36
Crystal frequency:       12 MHz
CPU clock        :      528 MHz
Master clock     :      132 MHz
DRAM:  256 MiB
NAND:  atmel_nand: Fail to initialize #0 chip0 MiB
MMC:   Atmel mci: 0, Atmel mci: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@ffffee00
Out:   serial@ffffee00
Err:   serial@ffffee00
Net:   
Error: ethernet@f0028000 address not set.
eth-1: ethernet@f0028000
Error: ethernet@f802c000 address not set.
, eth-1: ethernet@f802c000
Hit any key to stop autoboot:  0 
** Unable to read file at91-sama5d3_xplained.dtb **
** Unable to read file zImage **
=> 
diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
index d0d8087ca3..f87713319d 100644
--- a/include/configs/sama5d3_xplained.h
+++ b/include/configs/sama5d3_xplained.h
@@ -80,7 +80,6 @@
 #elif CONFIG_NAND_BOOT
 #define CONFIG_SPL_NAND_DRIVERS
 #define CONFIG_SPL_NAND_BASE
-#endif
 #define CONFIG_SYS_NAND_U_BOOT_OFFS    0x40000
 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
 #define CONFIG_SYS_NAND_PAGE_SIZE      0x800
@@ -91,3 +90,5 @@
 #define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER
 
 #endif
+
+#endif

This commit moved the #endif into the middle of the nand section:

before

#ifdef CONFIG_SYS_USE_MMC
#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"

#elif CONFIG_SYS_USE_NANDFLASH
#define CONFIG_SPL_NAND_DRIVERS
#define CONFIG_SPL_NAND_BASE
#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x40000
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_PAGE_SIZE	0x800
#define CONFIG_SYS_NAND_PAGE_COUNT	64
#define CONFIG_SYS_NAND_OOBSIZE		64
#define CONFIG_SYS_NAND_BLOCK_SIZE	0x20000
#define CONFIG_SYS_NAND_BAD_BLOCK_POS	0x0
#define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER

#endif

after

#ifdef CONFIG_SD_BOOT
#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME	"u-boot.img"

#elif CONFIG_NAND_BOOT
#define CONFIG_SPL_NAND_DRIVERS
#define CONFIG_SPL_NAND_BASE
#endif
#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x40000
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_PAGE_SIZE	0x800
#define CONFIG_SYS_NAND_PAGE_COUNT	64
#define CONFIG_SYS_NAND_OOBSIZE		64
#define CONFIG_SYS_NAND_BLOCK_SIZE	0x20000
#define CONFIG_SYS_NAND_BAD_BLOCK_POS	0x0
#define CONFIG_SPL_GENERATE_ATMEL_PMECC_HEADER

#endif

Regards,


#10

Appreciate you taking the time to look into this and finding the issue.