Espressobin booting (Was: Re: [PATCH 1/5] arm: mvebu: Espressobin: Move env load addresses)

Andre Heider a.heider at gmail.com
Wed Aug 26 11:57:01 CEST 2020


Hi,

On 26/08/2020 10:31, Pali Rohár wrote:
> Hello!
> 
> On Wednesday 26 August 2020 09:30:11 Andre Heider wrote:
>> Pali,
>>
>> thank you for all these espressobin fixes, much appreciated!
>>
>> This isn't directly related to the patch I'm replying to, but since you seem
>> to be syncing down- with upstream:
>>
>> Upstream u-boot doesn't detect my sata ssd ("SATA link 0 timeout"), nor is
> 
> Could you try following Marvell SATA/AHCI patch?
> https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/2c1571432e4fd298be0236b53511f415bbdd21ac

will do that later and report my findings, thanks!

>> it able to run debian's kernel (hangs after "Starting kernel"). Both work
>> with armbian's downstream flash-image.bin.
>>
>> I'm using the espressobin v1 with these patches from the list on top of
> 
> Do you really have espressobin v1? I saw hw schemas and diagrams only
> for V3, V4, V5 and V7. And I tested only V5 as I do not have any other
> revisions.

Oh sorry, I meant the first public version, the one with ddr3 memory. 
Which would be the V5 schematics iirc.

>> 2020.07:
>> arm64: a37xx: pci: Depends on DM_GPIO
>> arm: mvebu: Espressobin: Update README.marvell file
>> arm: mvebu: Espressobin: Define console env
>> arm: mvebu: Espressobin: Define fdt_addr and kernel_addr env aliases
>> arm: mvebu: Espressobin: Change default loadaddr
>> arm: mvebu: Espressobin: Move env load addresses
>> arm: mvebu: Espressobin: Setup MTD partitions when booting kernel
>> arm: mvebu: Espressobin: Make SPI env offset compatible with Marvell's
>> U-Boot
>> arm: dts: a37x0: enable sd card support on espressobin
>> mmc: xenon: set signal voltage and max base clock
>> arm64: a37xx: pci: Assert PERST# signal when unloading driver
>> arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT
>> arm64: dts: armada-3720-espressobin: fix COMPHY nodes
>> arm: mvebu: Espressobin: Enable CONFIG_MVNETA
>> arm: mvebu: Espressobin: Disallow forwarding packets between wan and lan
>> ports
>>
>> Bootlog:
>>
>> TIM-1.0
>> WTMI-devel-18.12.1-
>> WTMI: system early-init
>> CPU VDD voltage default value: 1.108V
>> NOTICE:  Booting Trusted Firmware
>> NOTICE:  BL1: v2.3(): (Marvell-devel-18.12.0)
>> NOTICE:  BL1: Built : 06:12:46, Aug 26 2020
>> NOTICE:  BL1: Booting BL2
>> NOTICE:  BL2: v2.3(): (Marvell-devel-18.12.0)
>> NOTICE:  BL2: Built : 06:12:46, Aug 26 2020
>> NOTICE:  BL1: Booting BL31
>> NOTICE:  BL31: v2.3(): (Marvell-devel-18.12.0)
>> NOTICE:  BL31: Built : 06:12:46
>>
>> U-Boot 2020.07 (Aug 26 2020 - 06:12:46 +0000)
>>
>> DRAM:  1 GiB
>> Comphy-0: USB3_HOST0    5 Gbps
>> Comphy-1: PEX0          2.5 Gbps
>> Comphy-2: SATA0         5 Gbps
>> SATA link 0 timeout.
>> AHCI 0001.0300 32 slots 1 ports 6 Gbps 0x1 impl SATA mode
>> flags: ncq led only pmp fbss pio slum part sxs
>> PCIE-0: Link up
>> MMC:   sdhci at d0000: 0
>> Loading Environment from SPI Flash... SF: Detected w25q32dw with page size
>> 256 Bytes, erase size 4 KiB, total 4 MiB
>> OK
>> Model: Marvell Armada 3720 Community Board ESPRESSOBin
>> Net:   eth0: neta at 30000
>> Hit any key to stop autoboot:  0
>> MMC Device 1 not found
>> no mmc device at slot 1
>> switch to partitions #0, OK
>> mmc0 is current device
>> Scanning mmc 0:1...
>> Found U-Boot script /boot.scr
>> 2250 bytes read in 12 ms (182.6 KiB/s)
>> ## Executing script at 06d00000
>> 22079344 bytes read in 1219 ms (17.3 MiB/s)
>> 10671 bytes read in 24 ms (433.6 KiB/s)
>> 27689238 bytes read in 1555 ms (17 MiB/s)
>> Booting Debian 5.7.0-0.bpo.2-arm64 from mmc 0:1...
>> ## Flattened Device Tree blob at 06f00000
>>     Booting using the fdt blob at 0x6f00000
>>     Loading Ramdisk to 3e0be000, end 3fb26116 ... OK
>>     Loading Device Tree to 000000003e0b8000, end 000000003e0bd9ae ... OK
>>
>> Starting kernel ...
>> <hangs here>
> 
> Can you write which commands you have run to load & boot kernel?
> What are command line arguments for kernel?
> 
> Also have you reset env variables to default?

Yeah, I do reset the full env when switching between the flash images.

For the upstream version:
env default -a
setenv ethaddr f0:ad:4e:03:86:cd
setenv eth1addr f0:ad:4e:03:86:cd
setenv eth2addr f0:ad:4e:03:86:cd
setenv serverip 192.168.0.40
setenv ipaddr 192.168.0.2
saveenv

For the downstream version:
env default -a
env delete console
setenv fdt_addr_r 0x6000000
setenv kernel_addr_r 0x7000000
setenv ramdisk_addr_r 0x1100000
setenv ethaddr f0:ad:4e:03:86:cd
setenv eth1addr f0:ad:4e:03:86:cd
setenv eth2addr f0:ad:4e:03:86:cd
setenv serverip 192.168.0.40
setenv ipaddr 192.168.0.2
setenv fdt_addr 0x6000000
setenv kernel_addr 0x7000000
setenv loadaddr 0x8000000
setenv initrd_size 0x2000000
setenv initrd_addr 0x1100000
setenv scriptaddr 0x6d00000
setenv initrd_image uInitrd
setenv image_name Image
setenv boot_targets 'mmc0 usb sata mmc1'
setenv boot_prefixes '/ /boot/'
setenv bootcmd_mmc0 'setenv devnum 0; setenv devtype mmc; run 
scan_dev_for_boot;'
setenv bootcmd_mmc1 'setenv devnum 1; setenv devtype mmc; run 
scan_dev_for_boot;'
setenv bootcmd_sata 'setenv devnum 0; scsi scan; scsi dev 0; setenv 
devtype scsi; run scan_dev_for_boot;'
setenv bootcmd_usb 'setenv devnum 0; usb start;setenv devtype usb; run 
scan_dev_for_boot;'
setenv bootcmd 'for target in ${boot_targets}; do run bootcmd_${target}; 
done'
setenv scan_dev_for_boot 'for prefix in ${boot_prefixes}; do echo 
${prefix};run boot_a_script; done'
setenv boot_a_script 'ext4load ${devtype} ${devnum}:1 ${scriptaddr} 
${prefix}boot.scr;source ${scriptaddr};'
saveenv

Debian's boot.scr relies on u-boot's distro boot. Downstream still fails 
to enable it (even managed to break my patch to enable it...), so most 
of my env is to make it compatible again so I can use an unmodified 
userland.

Debian's script is rather boring then:

$ strings /boot/boot.scr
boot script
# flash-kernel: bootscr.uboot-generic
# Bootscript using the new unified bootcmd handling
# Expects to be called with the following environment variables set:
#  devtype              e.g. mmc/scsi etc
#  devnum               The device number of the given type
#  bootpart             The partition containing the boot files
#  distro_bootpart      The partition containing the boot files
#                       (introduced in u-boot mainline 2016.01)
#  prefix               Prefix within the boot partiion to the boot files
#  kernel_addr_r        Address to load the kernel to
#  fdt_addr_r           Address to load the FDT to
#  ramdisk_addr_r       Address to load the initrd to.
# The uboot must support the booti and generic filesystem load commands.
if test -n "${console}"; then
   setenv bootargs "${bootargs} console=${console}"
setenv bootargs  ${bootargs} root=LABEL=espresso-root
if test -z "${fk_kvers}"; then
    setenv fk_kvers '5.7.0-0.bpo.2-arm64'
# These two blocks should be the same apart from the use of
# ${fk_kvers} in the first, the syntax supported by u-boot does not
# lend itself to removing this duplication.
if test -n "${fdtfile}"; then
    setenv fdtpath dtbs/${fk_kvers}/${fdtfile}
else
    setenv fdtpath dtb-${fk_kvers}
if test -z "${distro_bootpart}"; then
   setenv partition ${bootpart}
else
   setenv partition ${distro_bootpart}
load ${devtype} ${devnum}:${partition} ${kernel_addr_r} 
${prefix}vmlinuz-${fk_kvers} \
&& load ${devtype} ${devnum}:${partition} ${fdt_addr_r} 
${prefix}${fdtpath} \
&& load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} 
${prefix}initrd.img-${fk_kvers} \
&& echo "Booting Debian ${fk_kvers} from ${devtype} 
${devnum}:${partition}..." \
&& booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}
load ${devtype} ${devnum}:${partition} ${kernel_addr_r} ${prefix}vmlinuz \
&& load ${devtype} ${devnum}:${partition} ${fdt_addr_r} ${prefix}dtb \
&& load ${devtype} ${devnum}:${partition} ${ramdisk_addr_r} 
${prefix}initrd.img \
&& echo "Booting Debian from ${devtype} ${devnum}:${partition}..." \
&& booti ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r}

Regards,
Andre


More information about the U-Boot mailing list