MochaBin - trying to boot from M2 Sata

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

MochaBin - trying to boot from M2 Sata

Postby technosf » Mon Nov 14, 2022 6:17 am

I just got my MochaBin, and initially I am trying to boot from the sata M2 from uboot

The Mocha has Ubuntu 18.04 in NOR, but I want to get Arch installed, booting from the M2 or possibly the eMMC (thoughts on if this is a good idea welcome, plus how to do it). For the M2 I took the ArchLinuxARM-aarch64-latest and extracted it to a ext4 that has the boot flag set.

In Uboot the boot default for the NOR is:

$this->bbcode_second_pass_code('', 'mmc dev 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')

I took that and modified to map to the ALM layout:

$this->bbcode_second_pass_code('', 'scsi dev 0; ext4load scsi 0:1 $kernel_addr_r $image_name; ext4load scsi 0:1 $fdt_addr_r boot/dtbs/marvell/armada-7040-mochabin.dtb;setenv bootargs $console root=/dev/sda1 rw rootwait net.ifnames=0 biosdevname=0; booti $kernel_addr - $fdt_addr')

$image_name is boot/Image

$this->bbcode_second_pass_code('', 'Device 0: (1:0) Vendor: ATA Prod.: TEAM TM8PS7001T Rev: V071
Type: Hard Disk
Capacity: 976762.3 MB = 953.8 GB (2000409264 x 512)
... is now current device
40264192 bytes read in 10534 ms (3.6 MiB/s)
36117 bytes read in 1 ms (34.4 MiB/s)
Bad Linux ARM64 Image magic!')

I might load up the image to a USB and go that root, but expecting the same. Right now, I'm am stuck - would like some thoughts on which direction to go next.

Thank you!
[size=85] MochaBin 5G || NSA325 [/size]
technosf
 
Posts: 147
Joined: Sat Jan 08, 2011 10:54 pm

Re: MochaBin - trying to boot from M2 Sata

Postby technosf » Mon Nov 14, 2022 7:27 am

Solved the immediate issue - Had used $kernel_addr - $fdt_addr rather than $kernel_addr_r - $fdt_addr_r

This works:
$this->bbcode_second_pass_code('', 'scsi dev 0; ext4load scsi 0:1 $kernel_addr_r $image_name; ext4load scsi 0:1 $fdt_addr_r boot/dtbs/marvell/armada-7040-mochabin.dtb;setenv bootargs $console root=/dev/sda1 rw rootwait net.ifnames=0 biosdevname=0; booti $kernel_addr_r - $fdt_addr_r')

Although I am finding setenv bootcmd to be finicky... Complaints that the first command isn't found(?!?). Ended up with this to get it to boot to Sata without changing the jumpers:

$this->bbcode_second_pass_code('', 'setenv bootcmd 'true; scsi scan; scsi dev 0; ext4load scsi 0:1 $kernel_addr_r $image_name; ext4load scsi 0:1 $fdt_addr_r boot/dtbs/marvell/armada-7040-mochabin.dtb; setenv bootargs $console root=/dev/sda1 rw rootwait net.ifnames=0 biosdevname=0; booti $kernel_addr_r - $fdt_addr_r'
printenv bootcmd
saveenv')
[size=85] MochaBin 5G || NSA325 [/size]
technosf
 
Posts: 147
Joined: Sat Jan 08, 2011 10:54 pm

Re: MochaBin - trying to boot from M2 Sata

Postby jimduchek » Wed Dec 28, 2022 8:06 pm

Would suggest this minor adjustment to anyone else finding this:

$this->bbcode_second_pass_code('', '
setenv bootargs $console root=/dev/sda1 rw rootwait net.ifnames=0 biosdevname=0;
setenv bootcmd 'true; scsi scan; scsi dev 0; ext4load scsi 0:1 $kernel_addr_r $image_name; ext4load scsi 0:1 $fdt_addr_r boot/dtbs/marvell/armada-7040-mochabin.dtb; booti $kernel_addr_r - $fdt_addr_r'
saveenv')

Better to be able to edit the boot arguments later on without having to repaste the entire boot process. 'bootargs' will be saved with the saveenv, so there's no reason to do it in the bootcmd.
jimduchek
 
Posts: 5
Joined: Tue Aug 01, 2017 5:24 pm


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 7 guests