[U-Boot] arm: mvebu: ClearFog: booting u-boot from ssd?

Florian Klink flokli at flokli.de
Fri Feb 16 10:23:23 UTC 2018


Hey,

I tried getting ClearFog to load u-boot from a M.2 SSD (via SATA)

So I built u-boot-spl.kwb

> make clearfog_defconfig
> make -j4 ARCH=arm CROSS_COMPILE=arm-none-eabi-

dd'ed it on the SSD:
>  dd if=u-boot-spl.kwb of=/dev/sdX bs=512 seek=1

changed SW1 dip to 11100, and got this:

> BootROM - 1.73
> Booting from AHCI
> Probing HBA- 0 port 0  SATA device found
> BootROM: Bad header at offset 00000001
> BootROM: Bad header at offset 00000022
> BootROM: Bad header at offset 00001000
> BootROM: Bad header at offset 00002000
> BootROM: Bad header at offset 00003000
> BootROM: Bad header at offset 00004000
> BootROM: Bad header at offset 00005000
> BootROM: Bad header at offset 00006000
> BootROM: Bad header at offset 00007000
>
> Trying Uart

According to the clearfog wiki and uboot-armada38x src tree, there are separate
images for sd and sata, with the makefile there calling
> $(obj)tools/marvell/doimage -T mmc -D 0x0 -E 0x0 -G $(obj)tools/marvell/bin_hdr/bin_hdr.bin u-boot.bin u-boot.mmc
vs
> $(obj)tools/marvell/doimage -T sata -D 0x0 -E 0x0 -G $(obj)tools/marvell/bin_hdr/bin_hdr.bin u-boot.bin u-boot.sata

According to uboot-armada38x's tools/marvell/doimage_mv/doimage.c, this seems to
result in different

  hdr->blockID = IBR_HDR_SATA_ID; //0x78
  hdr->blockID = IBR_HDR_MMC_ID; //0xAE

and maybe another hdr->sourceAddr baked into the image header [1]

Mainline u-boot also knows about IBR_HDR_SATA_ID (tools/kwbimage.h),
and has a mapping in tools/kwbimage.c (boot_modes[]), which seems to decide
depending on the 'BOOT_FROM' setting in board/solidrun/clearfog/kwbimage.cfg
This is currently hardcoded to 'sdio' (which will be translated to 0xAE ==
IBR_HDR_MMC_ID).

Am I missing something completely obvious, or does this mean there need to be
different image headers depending on boot medium type BootROM tries to load
u-boot from (so it might be desirable to make this configurable)?

Are there already any efforts being taken on that? Most likely we'd also need to
enable SATA drivers, so u-boot is able to read the kernel, which might be on
that disk.

Regards,
Florian


[1]: https://github.com/coreboot/coreboot/blob/master/util/marvell/doimage_mv/doimage.c#L575


More information about the U-Boot mailing list