Booting MOCHAbin-5g Marvell board from GlobalscaleTech

From: Tom Pusateri <pusateri_at_ncopen.org>
Date: Fri, 11 Mar 2022 05:02:13 UTC
I loaded the FreeBSD 13.0 (and also tried 14.0-current snapshot) on a 
USB stick and tried to boot it on the new MOCHAbin-5g.

https://globalscaletechnologies.com/product/mochabin/ It paniced booting 
the EFI file. Any ideas what to try next? Marvell>> usb start starting 
USB... USB0: Register 2000120 NbrPorts 2 Starting the controller USB 
XHCI 1.00 USB1: Register 2000120 NbrPorts 2 Starting the controller USB 
XHCI 1.00 scanning bus 0 for devices... 4 USB Device(s) found scanning 
bus 1 for devices... 5 USB Device(s) found scanning usb for storage 
devices... 1 Storage Device(s) found
Marvell>> fatload usb 0 0x6000000 EFI/BOOT/bootaa64.efi
1259212 bytes read in 59 ms (20.4 MiB/s) Marvell>> bootefi 0x6000000
## Starting EFI application at 06000000 ...
WARNING: using memory device/image path, this may confuse some payloads!
Scanning disksdhci@6e0000.blk...
Scanning disk usb_mass_storage.lun0...
Found 5 disks
"Synchronous Abort" handler, esr 0x96000046
elr: 0000000000063728 lr : 000000000005b51c (reloc)
elr: 000000007ff9c728 lr : 000000007ff9451c
x0 : 00000000bffff000 x1 : 0000000000000000
x2 : 000000000000001f x3 : 00000000bffff018
x4 : 00000000bffff008 x5 : 0000000000000000
x6 : 0000000000000003 x7 : 00000000bffff020
x8 : 000000007f900000 x9 : 0000000000000008
x10: 0000000000000006 x11: 0000000000000006
x12: 000000000001869f x13: 0000000000000003
x14: 0000000000000000 x15: 00000000ffffffff
x16: 0000000000000000 x17: 0000000000000001
x18: 000000007f628dd0 x19: 00000000bffff000
x20: 000000007e624040 x21: 000000007e624040
x22: 0000000006000000 x23: 0000000000000000
x24: 000000007f624bc0 x25: 000000007ffa4000
x26: 0000000000000000 x27: 0000000000000000
x28: 000000007f717870 x29: 000000007f624b60

Resetting CPU ...

resetting ...

BootROM - 2.03
Starting CP-0 IOROM 1.07
Booting from SPI NOR flash 1 (0x32)
Found valid image at boot postion 0x000
lmv_ddr: mv_ddr-devel-18.12.0-g2e20f5d (Dec 30 2021 - 16:08:48)
mv_ddr: scrubbing memory...
mv_ddr: completed successfully
llBL2: Initiating SCP_BL2 transfer to SCP
ll

U-Boot 2018.03-devel-18.12.3-ga49bd540df (Dec 30 2021 - 16:06:18 +0800)

Model: Marvell Armada 7040 Mochabin development board
SoC: Armada7040-B0; AP806-B0; CP115-A0
Clock:  CPU     1400 [MHz]
	DDR     800  [MHz]
	FABRIC  800  [MHz]
	MSS     200  [MHz]
LLC Enabled (Exclusive Mode)
DRAM:  8 GiB
Bus spi@700680 CS0 configured for direct access 00000000f9000000:0x1000000
SF: Detected w25q32bv with page size 256 Bytes, erase size 4 KiB, total 4 MiB
EEPROM configuration pattern not detected.
Comphy chip #0:
Comphy-0: SGMII1        3.125 Gbps
Comphy-1: USB3_HOST0
Comphy-2: SATA0
Comphy-3: SATA1
Comphy-4: SFI0          10.3125 Gbps
Comphy-5: PEX2
UTMI PHY 0 initialized to USB Host0
UTMI PHY 1 initialized to USB Host1
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0000 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq led only pmp fbss pio slum part sxs
PCIE-0: Link up (Gen1-x1, Bus0)
MMC:   sdhci@6e0000: 0
Loading Environment from SPI Flash... OK
Model: Marvell Armada 7040 Mochabin development board
Net:   eth0: mvpp2-0 [PRIME], eth1: mvpp2-1, eth2: mvpp2-2
Hit any key to stop autoboot:  0
Marvell>>
Marvell>> help
?       - alias for 'help'
avs     - Set/Get Adaptive Voltage Scaling (AVS) value

base    - print or set address offset
bdinfo  - print Board Info structure
blkcache- block cache diagnostics and control
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootefi - Boots an EFI payload from memory
bootelf - Boot from an ELF image in memory
booti   - boot arm64 Linux Image image from memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
bubt    - Burn a u-boot image to flash
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dcache  - enable or disable data cache
dhcp    - boot image via network using DHCP/TFTP protocol
dm      - Driver model low level access
echo    - echo args to console
editenv - edit environment variable
env     - environment handling commands
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
ext4size- determine a file's size
ext4write- create a file in the root directory
false   - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fatsize - determine a file's size
fdt     - flattened device tree utility commands
fstype  - Look up a filesystem type
go      - start application at address 'addr'
gpio    - query and control gpio pins
gzwrite - unzip and write memory to block device
help    - print command description/usage
hw_info - hw_info

i2c     - I2C sub-system
icache  - enable or disable instruction cache
iminfo  - print header information for application image
imxtract- extract a part of a multi-image
ir      - ir	- Reading and changing internal register values.

itest   - return true/false on integer compare
led     - manage LEDs
load    - load binary file from a filesystem
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
ls      - list files in a directory (default /)
lzmadec - lzma uncompress a memory region
map     - Display address decode windows

md      - memory display
mdio    - MDIO utility commands
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mw      - memory write (fill)
nfs     - boot image via network using NFS protocol
nm      - memory modify (constant address)
part    - disk partition related commands
pci     - list and access PCI Configuration Space
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
pxe     - commands to get and boot from pxe files
regulator- uclass operations
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
rx_training- rx_training <cp id> <comphy id>

save    - save file to a filesystem
saveenv - save environment variables to persistent storage
scsi    - SCSI sub-system
scsiboot- boot from SCSI device
setenv  - set environment variables
setexpr - set environment variable as the result of eval expression
sf      - SPI flash sub-system
showvar - print local hushshell variables
size    - determine a file's size
sleep   - delay execution for some time
source  - run script from memory
sspi    - SPI utility command
switch  - Switch Access commands
sysboot - command to get and boot from syslinux files
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
time    - run commands and summarize execution time
true    - do nothing, successfully
tsen    - tsen - Display the SoC temperature.

unzip   - unzip a memory region
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
Marvell>>

Marvell>> printenv
arch=arm
baudrate=115200
board=mvebu_armada-8k
board_name=mvebu_armada-8k
bootcmd=ev 0; ext4load mmc 0:1 $kernel_addr_r $image_name; ext4load mmc 0:1 $fdt_addr_r $fdt_name; setenv bootargs $console root=PARTUUID=89708921-01 rw rootwait net.ifnames=0 biosdevname=0; booti $kernel_addr_r - $fdt_addr_r
bootdelay=2
console=console=ttyS0,115200 earlycon=uart8250,mmio32,0xf0512000
cpu=armv8
eth1addr=00:51:82:11:22:01
eth2addr=00:51:82:11:22:02
ethact=mvpp2-0
ethaddr=00:51:82:11:22:00
ethprime=eth0
extra_params=pci=pcie_bus_safe
fdt_addr_r=0x6f00000
fdt_high=0xffffffffffffffff
fdt_name=boot/armada-7040-mochabin.dtb
fdtcontroladdr=7f625230
gatewayip=10.4.50.254
get_images=tftpboot $kernel_addr_r $image_name; tftpboot $fdt_addr_r $fdt_name; run get_ramfs
get_ramfs=if test "${ramfs_name}" != "-"; then setenv ramdisk_addr_r 0x8000000; tftpboot $ramdisk_addr_r $ramfs_name; else setenv ramdisk_addr_r -;fi
hostname=marvell
image_name=boot/Image
initrd_addr=0xa00000
initrd_size=0x2000000
ipaddr=0.0.0.0
kernel_addr_r=0x7000000
loadaddr=0x6000000
netdev=eth0
netmask=255.255.255.0
ramdisk_addr_r=0x8000000
ramfs_name=-
root=root=/dev/nfs rw
rootpath=/srv/nfs/
serverip=0.0.0.0
set_bootargs=setenv bootargs $console $root ip=$ipaddr:$serverip:$gatewayip:$netmask:$hostname:$netdev:none nfsroot=$serverip:$rootpath,tcp,v3 $extra_params $cpuidle
soc=mvebu
stderr=serial@512000
stdin=serial@512000
stdout=serial@512000
vendor=Marvell

Environment size: 1511/65532 bytes

Marvell>> help bootefi
bootefi - Boots an EFI payload from memory

Usage:
bootefi <image address> [fdt address]
   - boot EFI payload stored at address <image address>.
     If specified, the device tree located at <fdt address> gets
     exposed as EFI configuration table.
bootefi bootmgr [fdt addr]
   - load and boot EFI payload based on BootOrder/BootXXXX variables.

     If specified, the device tree located at <fdt address> gets
     exposed as EFI configuration table.

Marvell>> help usbboot
usbboot - boot from USB device

Usage:
usbboot loadAddr dev:part

Marvell>> usb storage
   Device 0: Vendor: Monster  Rev: PMAP Prod: MONSTER DIGITAL
             Type: Removable Hard Disk
             Capacity: 59082.0 MB = 57.6 GB (120999936 x 512)