FreeBSD for ESPRESSOBin Marvell Armada 3700?

iucoen

New Member

Reaction score: 7
Messages: 11

Code:
cp /mnt/boot/loader.efi /root/bootaa64.efi

You copied the wrong efi file. You should copy /boot/boot1.efi to bootaa64.efi. boot1.efi then loads loader.efi, and it tells loader.efi which partition it's loaded from, so loader.efi can then load the kernel.
 

napyk

New Member


Messages: 4

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 :)
 

iucoen

New Member

Reaction score: 7
Messages: 11

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.
 

Chrisfbsd

New Member


Messages: 4

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
 

tscho

New Member

Reaction score: 2
Messages: 18

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
 

Chrisfbsd

New Member


Messages: 4

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.
 

Chrisfbsd

New Member


Messages: 4

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.
 

tscho

New Member

Reaction score: 2
Messages: 18

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 $*
 

iucoen

New Member

Reaction score: 7
Messages: 11

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>"
 

Chrisfbsd

New Member


Messages: 4

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

New Member

Reaction score: 2
Messages: 18

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
 

Phanlink43

New Member


Messages: 5

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.
 

Phanlink43

New Member


Messages: 5

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: 13

escape

Member

Reaction score: 5
Messages: 76

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
 

Phanlink43

New Member


Messages: 5

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!
 

escape

Member

Reaction score: 5
Messages: 76

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.
 

Phanlink43

New Member


Messages: 5

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 :):):)
 

SleepWalker

Member

Reaction score: 43
Messages: 42

Hey!
What do you think of the MochaBin-5G SBC

How difficult will it be to port FreeBSD to a Marvell Armada 7040
 
Top