FreeBSD for ESPRESSOBin Marvell Armada 3700?

Thanks for your hints. Last time I followed the espressobin wiki for the toolchain setup. I checked again and noticed that I have to set
Code:
export PATH=/home/espressobin/toolchain/gcc-linaro-5.2-2015.11-2-x86_64_aarch64-linux-gnu/bin:$PATH

instead of:
Code:
export PATH=$PATH:/home/espressobin/toolchain/gcc-linaro-5.2-2015.11-2-x86_64_aarch64-linux-gnu/bin

so that the right toolchain is used. Compiling worked fine and I am able to boot now. Auto booting into freebsd works also. Nice work :)
 
FreeBSD 13.0 works out of the box!

Here are some easier directions to get started:
0. Build and flash the uboot firmware with EFI support using the git tree I posted.
1. Download the RPI aarch64 image. This image already has the EFI directory structure in place, as well as DTB in the fat boot partition.
2. Configure uboot:
setenv bootcmd 'load mmc 0:1 $fdt_addr dtb/marvell/armada-3720-espressobin.dtb; load mmc 0:1 $kernel_addr EFI/BOOT/bootaa64.efi; bootefi $kernel_addr $fdt_addr'
env save
3. You should be able to boot into FreeBSD 13. The EFI loader loads the device tree and passes to the kernel.
 
iucoen thank you for the work on this, I was able to follow your instructions and got up and running in no time.

tscho
Just wondering if you could share how you configured the vlans with ETHERSWITCHCFG(8).
"What I did is, configure VLANs sub-interfaces on the mvneta0 and than assign the ports to the Vlans"

I see ports 0 - 5 then 4 vlangroup

Right now it looks like all ports are members of each vlan group. Did you just remove all members of each vlangroup leaving just the ports assigned respectively?

Thanks
 
iucoen thank you for the work on this, I was able to follow your instructions and got up and running in no time.

tscho
Just wondering if you could share how you configured the vlans with ETHERSWITCHCFG(8).
"What I did is, configure VLANs sub-interfaces on the mvneta0 and than assign the ports to the Vlans"

I see ports 0 - 5 then 4 vlangroup

Right now it looks like all ports are members of each vlan group. Did you just remove all members of each vlangroup leaving just the ports assigned respectively?

Thanks
Sorry for the late answer. Somehow I did not get notified about your reply.

I'm still on FreeBSD 13.0-CURRENT but will switch soon to RELEASE, hopefully this doesn't change anything about my config. I've a rc.d script which I run at every start. It contains the following:

/sbin/etherswitchcfg config vlan_mode dot1q
/sbin/etherswitchcfg port1 pvid 1
/sbin/etherswitchcfg vlangroup0 vlan 1 members 0,1
/sbin/etherswitchcfg vlangroup33 vlan 33 members 0t,2t port2 pvid 33
/sbin/etherswitchcfg vlangroup10 vlan 10 members 0t,3 port3 pvid 10
/sbin/etherswitchcfg vlangroup101 vlan 101 members 0t,1t
/sbin/etherswitchcfg vlangroup120 vlan 3000 members 0t,1t
 
Sorry for the late answer. Somehow I did not get notified about your reply.

I'm still on FreeBSD 13.0-CURRENT but will switch soon to RELEASE, hopefully this doesn't change anything about my config. I've a rc.d script which I run at every start. It contains the following:
No worries thanks for sharing the startup script.
 
tscho

I tried creating a script in /etc/rc.d called switch and setting the permissions with chmod 555

#!/bin/sh
#

# PROVIDE: switch

. /etc/rc.subr

name="switch"
desc="configure ethernet switch mode and vlans"

/sbin/etherswitchcfg config vlan_mode dot1q
/sbin/etherswitchcfg port1 pvid 1
/sbin/etherswitchcfg vlangroup0 vlan 1 members 0,1
/sbin/etherswitchcfg vlangroup33 vlan 33 members 0t,2t port2 pvid 33
/sbin/etherswitchcfg vlangroup10 vlan 10 members 0t,3 port3 pvid 10
/sbin/etherswitchcfg vlangroup101 vlan 101 members 0t,1t
/sbin/etherswitchcfg vlangroup120 vlan 3000 members 0t,1t

sorry I'm pretty new to freeBSD so I'm not sure how the start up scripts need to be setup.
 
I more or less adopted the Practical rc.d scripting in BSD. This is the result. Not beautiful, but it works

#!/bin/sh
# PROVIDE: etherswitch
. /etc/rc.subr
. /etc/network.subr

name="etherswitch"
rcvar=ether_enable
start_cmd="ether_start"
start_precmd="ether_prestart"
start_postcmd="ether_poststart"
stop_cmd="ether_stop"

ether_prestart()
{
/sbin/etherswitchcfg config vlan_mode dot1q
/sbin/etherswitchcfg port1 pvid 1
/sbin/etherswitchcfg vlangroup0 vlan 1 members 0,1
/sbin/etherswitchcfg vlangroup33 vlan 33 members 0t,2t port2 pvid 33
/sbin/etherswitchcfg vlangroup10 vlan 10 members 0t,3 port3 pvid 10
/sbin/etherswitchcfg vlangroup101 vlan 101 members 0t,1t
/sbin/etherswitchcfg vlangroup120 vlan 3000 members 0t,1t
}

ether_start()
{
}

ether_poststart()
{
}

ether_stop()
{
}

load_rc_config $name

run_rc_command $*
 
I more or less adopted the Practical rc.d scripting in BSD. This is the result. Not beautiful, but it works

There is an easier way... You don't need to create a separate service. Just create a script called /etc/start_if.mvneta0 , and this script will be executed as part of bringing up the mvneta0 interface. Also the MAC address is randomly generated on every boot, so you probably want to fix that in this script as well in the first line:
ifconfig mvneta0 ether "<mac address of your device>"
 
I more or less adopted the Practical rc.d scripting in BSD. This is the result. Not beautiful, but it works
tscho Thanks for the startup script. I implemented it and it looks like it's causing a kernal panic on boot up. Just wondering if you had any issues like this. I added ether_enable="Yes" to /etc/defaults/rc.conf and put your script in /etc/rc.d/

I'll be re-applying the RPI aarch64 image and I'll use a different SD card in the event I have a bad image/card.

I'll also try to execute the etherswitchcfg commands in the script one at a time to try and see what one may be causing the kernal panic.

Thanks again for all the assistance
 
tscho Thanks for the startup script. I implemented it and it looks like it's causing a kernal panic on boot up. Just wondering if you had any issues like this. I added ether_enable="Yes" to /etc/defaults/rc.conf and put your script in /etc/rc.d/

I'll be re-applying the RPI aarch64 image and I'll use a different SD card in the event I have a bad image/card.

I'll also try to execute the etherswitchcfg commands in the script one at a time to try and see what one may be causing the kernal panic.

Thanks again for all the assistance
I didn't have any problems at all. Maybe you can try what Crisfbsd suggested
 
Hello. I am a new freebsd user.
I bought an ESPRESSOBIN v7 board and installed FreeBsd 12 OS on it. I tried to connect ESPRESSOBIN to PLX8311 (PCI - brigde of broadcom) via MiniPCIe but didn't get the expected result.
Please guide me how to connect ESPRESSOBIN to PLX8311 on FreeBsd.
 
This is the log after booting up my FreeBsd 12.2, The Armada 3700 PCIe Bus Controller driver did not show up there. What can i do to get the driver up? or someone has driver's files please help me to solve this. Tks!!!
 

Attachments

  • logboot.txt
    6.9 KB · Views: 138
I had tried a v5 maby a year ago and don't remember PCI bridge or PLX8311. Finally after some time the 13.0 version had the drivers for the Topaz switch. The 12.2 booted (as the 13 does now) using the device tree -file. Have you tried that? The u-boot can be used from the serial line. The device tree file can be tested. I've compiled the device tree in the kernel and don't (anymore) remember having problems with the PCI bridge. How about the device tree file? (Sorry I don't at the moment have access to check this from the board.)

esc
 
I had tried a v5 maby a year ago and don't remember PCI bridge or PLX8311. Finally after some time the 13.0 version had the drivers for the Topaz switch. The 12.2 booted (as the 13 does now) using the device tree -file. Have you tried that? The u-boot can be used from the serial line. The device tree file can be tested. I've compiled the device tree in the kernel and don't (anymore) remember having problems with the PCI bridge. How about the device tree file? (Sorry I don't at the moment have access to check this from the board.)

esc
- this is the uboot result:
Scanning PCI devices on bus 0
BusDevFun VendorId DeviceId Device Class Sub-Class
_____________________________________________________________
00.00.00 0x10b5 0x8111 Bridge device 0x04

- I used device tree armada-3720-espressobin-v7.dts in FreeBsd source version 13.0. After booting system, execute the pciconf -lv command, the result did not show anything as it did by uboot
root@:~ # pciconf -lv

root@:~ #

- I wonder if I correctly used device tree? Or could you please guild me to use device tree as you did. Tks so much!
 
A good source of information was this URL . It was everything I've found right now from the old bookmarks. The Linux for example the Armbian instructions are good here as well considering the .dtb or .dts -files. The U-Boot is the same. It looks like the boot loader was already found, is the kernel booting? Should the file go as a parameter to it? (Actually I don't remember). Thanks. 😁 Its nice there are many using the same device.
 
A good source of information was this URL . It was everything I've found right now from the old bookmarks. The Linux for example the Armbian instructions are good here as well considering the .dtb or .dts -files. The U-Boot is the same. It looks like the boot loader was already found, is the kernel booting? Should the file go as a parameter to it? (Actually I don't remember). Thanks. 😁 Its nice there are many using the same device.
Tks for your reply.
I could not find “pcie bus controler driver” from kernel booting.
I read the intruction from your link but there are some issues i did not get it. Could you please explain and help me to solve it?
- The first issue is which “pcie bus controler driver” you used?
- Second is: what your device -tree is? Can you share the device tree parameters for me
Thank you :):):)
 
Hey!
What do you think of the MochaBin-5G SBC

How difficult will it be to port FreeBSD to a Marvell Armada 7040
 
Hi!
I am trying to run FreeBSD 13.0-RELEASE on MochaBin-5G.
I installed OS on SATA disk. And I try
BootROM - 2.03 Starting AP IOROM 1.02 Booting from eMMC 0 Found valid image at boot postion 0x002 lmv_ddr: mv_ddr-devel-18.12.0-g2e20f5d (May 27 2022 - 18:06:24) mv_ddr: completed successfully BL2: Initiating SCP_BL2 transfer to SCP U-Boot 2018.03-devel-18.12.3-g926d08c7ce (May 27 2022 - 17:55:54 +0000) 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. Target spinup took 0 ms. 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>> scsi scan scanning bus for devices... Device 0: (1:0) Vendor: ATA Prod.: NT-256 Rev: SN95 Type: Hard Disk Capacity: 244198.3 MB = 238.4 GB (500118192 x 512) Marvell>> load scsi 0 $kernel_addr_r efi/boot/bootaa64.efi 262620 bytes read in 26 ms (46.3 MiB/s) Marvell>> bootefi $kernel_addr_r ## Starting EFI application at 07000000 ... Scanning disk sdhci@6e0000.blk... Scanning disk ahci_scsi.id1lun0... 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: 0000000000000022 x14: 0000000000000000 x15: 00000000ffffffff x16: 0000000000000001 x17: 0000000000000008 x18: 000000007f628dd0 x19: 00000000bffff000 x20: 000000007e620040 x21: 000000007e61f040 x22: 0000000007000000 x23: 0000000000000000 x24: 000000007f6249e0 x25: 000000007ffa4000 x26: 0000000000000000 x27: 0000000000000000 x28: 000000007f6c4670 x29: 000000007f624980 Resetting CPU ... resetting ...
GlobalScale U-boot does not work correctly with efi.
Any ideas?
 
FreeBSD 13.0 works out of the box!

Here are some easier directions to get started:
0. Build and flash the uboot firmware with EFI support using the git tree I posted.

Can you please elaborate on the uboot steps?
I bought a second board after the USB OTG connector fell of the first board.

EspressoBin 5.01 1G 2CS. No emmc.

So I have built u-boot for Hummingboard in the past and I want to try and build it for Espressobin.
I see you using Linero to compile. What were the blockers for building on Freebsd?
Should I use the newest u-boot or try with an older tree?

What about the blob it produces? Do you simply flash it to the first sectors of the disk or do you place the file on the EFI fat partition?

My SPI has an old version on it and I am struggling with that.
I need to know u-boot fine details for this board.
I am using SATA recovery method and so far my first two files have failed me.
So I reverted to the boot jumpers, where I found out the manual is either wrong or wonky.
Much like this thread alludes to.

I really want to run FreeBSD on this board.
I was surprised there is no GENERICSD card image for aarch64.
Scraping junk from RPi image felt odd.

What are fellow EspressoBin users booting from?
SD Card is giving me fits.
I moved on to SATA and USB for the time being.
Do you use the SPI? I assumed you could disable the SPI from jumpers but that seems elusive.

Are your boot jumper settings correct with Espressobin Wiki pictures?

I know that FreeBSD-13.1 is broken for this platform and I am using 13.0-RELEASE
 
I can pull up this screen. It is the only menu I can get:
Code:
E
>?
h/? - print this help screen
r yyyyyyyy - read register/memory at address yyyyyyyy in hex
w yyyyyyyy zzzzzzzz - write zzzzzzzz to address yyyyyyyy in hex
j yyyyyyyy - jump to address yyyyyyyy in hex
x y - change the boot mode, where y is in hex
a - UART control passed to AP CPU ROM
c - UART control passed to CM3 CPU ROM
>
E
>

I do have a setting with jumpers where I see a series of carrots onscreen >>>>>>>>>>>>>>>
Nothing comes up. Escape key press twice fastly will bring up an exclamation point >>>>>>>>>>>>>!
Perhaps this is a tftp boot.

I had a working u-boot screen with the original SD card. Unfortunatly I overwrote it.
 
Back
Top