FreeBSD for ESPRESSOBin Marvell Armada 3700?

KDragon75

New Member


Messages: 19

Hello everyone, I'm quite green with the ARM and SBC scene and need some help getting started. I recently got an ESPRESSObin as the title may suggest. In retrospect, this is not the best supported board out there. I do know it will happily run FreeBSD as the pfSene project/Netgate is using in in there production SG-1100.

I need to know more about building the images and if the FreeBSD is statically linked to the load address (Is that the correct terminology?). I would love to find a guide that not only walks me through the process of building a full system image but also explains the entire process and why each step is what it is.

I know this is a bit open ended and I may be missing a lot of basics here but I appreciate any and all help and links.
 

Phishfry

Son of Beastie

Reaction score: 1,633
Messages: 4,689

Yes but this is not a supported platform.
So my advice is use OpenWRT until this board is supported.
You see Netgate has no real reason to contribute back until they break even on development costs.
Jim had to pay somebody on his staff to port this board to FreeBSD.
So I expect we will see support one day but not soon. Perhaps a private push as I saw mailing list chatter.
 
OP
OP
KDragon75

KDragon75

New Member


Messages: 19

I'm not looking to make this into a firewall using prebuilt systems. My goal is simply to boot to FreeBSD in any capacity. I have access to the pfSense images as we have one of the SG-1100 units at work that I get to tinker with. However, I am unable to get even the recovery image to boot. Presently I get stuck with the below messages. I also get the same when using the aarch64 installer image.
Code:
>> FreeBSD EFI boot block
   Loader path: /boot/loader.efi

   Initializing modules: UFS
   Probing 1 block devices.... done
    UFS found no partitions
Failed to load '/boot/loader.efi'
panic: No bootable partitions found!
## Application terminated, r = -22
So It looks like bootaa64.efi is running but for whatever reason, but for whatever reason it will not find /boot/loader.efi. Does bootaa64.efi contain the UFS module or is this still depending on the uboot environment? Everything in uboot is set to load form FAT partitions.

slice 1 (FAT)
/efi/bootaa64.efi
/armada-3700.dtb
slice 2 (UFS)
/boot/loader.efi
/the reset of the system

Again, I am new to SBCs and UEFI for that mattor. This is intended as a learning exercise more than anything.
 
OP
OP
KDragon75

KDragon75

New Member


Messages: 19

Now that I have had some time to look into this, I see /efi/bootaa64.efi is what's running. I have this all on the sdcard at this point with the same layout as before but it still does not see the UFS partition. Does bootaa64.efi have it's own UFS driver or does this still depend on das uboot for file system access? If the latter is the case, I need to re build uboot with ufs or preferably ZFS.
 
OP
OP
KDragon75

KDragon75

New Member


Messages: 19

Everything I'm reading would suggest this is setup correctly and should at least get to the loader.efi but it's not. Does anyone have any ideas?
 

khantroll

New Member


Messages: 11

Hi KDragon! Have you made any progress on this? I'm trying to get there too, with a goal of eventually getting OPNSense running on top of it, but I'm new to the Espressobin.
 

ucomp

Active Member

Reaction score: 35
Messages: 200

Code:
>>....
Failed to load '/boot/loader.efi'
..
This message is familiar to me from Rock64 ....
don`t know the details of the EspressoBin but the Rock64 then only worked on Netboot / no SD card support :
 

tscho

New Member

Reaction score: 2
Messages: 15

Hi there. I just ordered one of this boards. Do you have any update yet? As soon mine arrived I’ll try to install FreeBSD and post my result
 

RobCrowston

New Member

Reaction score: 14
Messages: 16

Now that I have had some time to look into this, I see /efi/bootaa64.efi is what's running. I have this all on the sdcard at this point with the same layout as before but it still does not see the UFS partition. Does bootaa64.efi have it's own UFS driver or does this still depend on das uboot for file system access? If the latter is the case, I need to re build uboot with ufs or preferably ZFS.
Minimal implementations of the UFS and ZFS drivers for the EFI bootloader are in /usr/src/stand/efi/boot1/, with some pieces in /usr/src/stand/libsa/. These are part of the ingredients to make bootaa64.efi.
How are you building u-boot? Did you build it in the way that EspressoBin recommends?

Can you enumerate the partitions on the disk yourself at the U-Boot prompt, before you attempt to boot FreeBSD?
 
OP
OP
KDragon75

KDragon75

New Member


Messages: 19

Minimal implementations of the UFS and ZFS drivers for the EFI bootloader are in /usr/src/stand/efi/boot1/, with some pieces in /usr/src/stand/libsa/. These are part of the ingredients to make bootaa64.efi.
How are you building u-boot? Did you build it in the way that EspressoBin recommends?

Can you enumerate the partitions on the disk yourself at the U-Boot prompt, before you attempt to boot FreeBSD?
I have not built uboot from scratch. This getting a bit out of my depth.
 

escape

Member

Reaction score: 2
Messages: 65

Some experiences with the EspressoBIN and FreeBSD. First of all the uBoot needs to be updated. The Armbian project has some preconfigured available.

In v5 the Topaz switch is configurable from uBoot. It works as a switch. First port index '0' is connected to the CPU, indexes 1 to 3 are the visible RJ45 ports and the last ones are management ports to be configured as a serial management port if read from the available document. Is there a serial management tool to get and set register addresses of the switch chip of the board from the FreeBSD? It looks like it is a MII interface ('SNI' mentioned).

There is no documentation available from Marvell to use the network chip unless you are a corporate user. The only document found was "Marvell Link Street 88E6060". It is older and similar. In uBoot and Linux source code the same code is used for both of the models. The document describes memory addresses and bits in them to configure the switch. There is a remark of restricted material to be accessed with NDA and a placeholder of information not shown.

There is a 'switch' command in uboot. For example switch write 0 0x04 0x7E disables the forwarding of the packets from the CPU interface, the mvneta0. There is no setting available to set the port to be used separately. It could be the isolation setting not available in 6060. This v5 is not a community router board. And not to mention, the board is first a switch before it is configured. It looks like the v5 is just a switch.

It looks like the instructions to use the board are secret and closed from the community users. EspressoBIN v5 is a good NAS or similar device. It should not be considered as a community card based firewall or a router.

The release of the community card should help in developing the commercial products. Maby some kind of a community support rating should be given by the communities with explanations to recognize these issues before anyone uses time buying the card and using the time to configure it. For example the Netgate pfSense (as a commercial product) looks like a good product to buy to be used as a firewall and a router. It uses the same board. How is it different? There is no sense in the community card v5.

Ok. And as a remark, the SCSI SATA/PATA -disk is available only from the uBoot in FreeBSD version 12.1. The FreeBSD does not give access with the current device tree file (if it has anything to do with it) or with the added 'ada' support compiled in the kernel.
 

tscho

New Member

Reaction score: 2
Messages: 15

I own a V7 and if I got it right the things which differentiates from v5 to v7 are small things like RAM size, CPU speed and some details like JTAG etc.

Why did you have to update the uBoot? My v7 booted slightly adjusted 13 HEAD with the shipped uBoot. What I didn't figure out is, how to boot the kernel automatically, I always need to issue the following. Does your ESPRESSObin auto boots after you updated uBoot?
Code:
set currdev=disk0p2
boot
I think the switch is not different from v5 to v7. I can change the ports configuration of the switch with ETHERSWITCHCFG(8). What I did is, configure VLANs sub-interfaces on the mvneta0 and than assign the ports to the VLANS. I'm planing to switch my router with the ESPRESSObin in the upcoming days
 

escape

Member

Reaction score: 2
Messages: 65

The installer made the correct settings. It boots directly to login -prompt. It created /dev/da0p1 and /dev/da0s2 partitions. Note the 'p' and 's' the installer gave. Additionally I had to copyboot1.efi as a first file in the FAT partition as boot/efi/BOOTaa64.efi. As a second file the startup.nsh. In UEFI the order is first with a correct filename, if not found, it boots from the first file in the disk. Instructions in URL uses loader.efi instead. The used efi -file here may be from the installer.

It may be possible to apply /boot.config:
Code:
0:da(0,2,)/boot/loader
in it. The man page man -S8 boot and man -S8 boot.config.

Finally in partitioning only GPT partition table works as mentioned in the installer. MSB won't work. There are only slice-numbers. The 'a' -partition is missing from the installer installed system. If read from the man -page, the boot.config is read from the 'a' -partition. It could be it is not found. I have not tried adding a bsdlabel in /dev/da0s2, bsdlabel -w /dev/da0s2.

I will compile the etherswitch -tool and try it :).
 

escape

Member

Reaction score: 2
Messages: 65

Did I mention the device tree? It had to be copied from the obj -directory. I'm using
Code:
setenv fdt_name /dtb/marvell/armada-3720-espressobin.dtb
setenv bootcmd 'mmc rescan; usb start; scsi reset; fatload mmc 0:1 $kernel_addr $image_name; fatload mmc 0:1 $fdt_addr $fdt_name; bootefi $kernel_addr $fdt_addr'
saveenv
from the uboot. What everything is found using it would be good to know. What are the correct memory ranges would be good to know.
 

tscho

New Member

Reaction score: 2
Messages: 15

I still can't get my had around with autoboot. What I figured out so far is, that I actually created the the partition as da0s2. I can also start manually with the following command set bootargs "rootdev=disk0s2";mmc dev 0; fatload mmc 0:1 $kernel_addr $image_name;fatload mmc 0:1 $fdt_addr $fdt_name; bootefi $kernel_addr $fdt_addr

It doesn't make a difference if I write disk0s2 or disk0p2, it boots. Wit the command you posted, which is similar to the one I had before I get the following:


## Starting EFI application at 07000000 ...
WARNING: using memory device/image path, this may confuse some payloads!
Scanning disk sdhci@d0000.blk...
Card did not respond to voltage select!
Scanning disk sdhci@d8000.blk...
Disk sdhci@d8000.blk not ready
Found 3 disks
Consoles: EFI console
Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk0:


You mentioned the installer. How did you set up your ESPRESSObin? Do you also use FreeBSD HEAD?
 

escape

Member

Reaction score: 2
Messages: 65

can't get my had around with autoboot.
I've checked this. The BOOTaa64.efi was from the 12.1-RELEASE installation media. It had the same partitions. The currdev or rootfs is usually changed from the loader.conf. I had tried the same with the same results.
 
Top