FreeBSD on Marvell ARMADA 7040/8040

Should I keep porting FreeBSD to this board?


  • Total voters
    3
Hi All!
Can anyone share their experience using FreeBSD on Marvell ARMADA 7040/8040 boards?
Does Ethernet work on boards like MACCHIATObin
DOUBLE SHOT, SINGLE SHOT, CLEARFOG GT 8K

I have a new MOCHAbin board on A7040.
Mochabin-5G-SBC.jpg


It's pretty simple and powerful enough to install OPNsense on it. MOCHAbin wiki

But there are several problems, I have not yet been able to make Ethernet and PCIe care.
Here is the dmesg log.


Is it possible to get Ethernet to work?

;)
 
I have noticed that with many Arm boards. Network support comes last.
PCIe care.
That would require a PCIe bus driver on FreeBSD.
Unfortunately they are not common to all Arm boards.
Each platform needs their own it seems.

I wish we had a PCIe bus driver for iMX6.
Without PCIe slot support it makes my Hummingboards only half usable.
I just bring myself to get Linux running on them.

There is a FreeBSD PCIe Bus driver for Rockchip Rock64Pro/Quartz.
Very jealous.

I see your board has MikoBus. On Hummingboard those are muxxed with GPIO pins.
 
The PCIe driver is present on the system and is not working properly.
That's what I see:

Code:
root@MOCHAbin:~ # pciconf -lvcBb
pcib1@pci0:0:0:0:       class=0x060400 rev=0x00 hdr=0x01 vendor=0x11ab device=0x0110 subvendor=0x0000 subdevice=0x0000
    vendor     = 'Marvell Technology Group Ltd.'
    device     = '88F8040 PCI Express controller'
    class      = bridge
    subclass   = PCI-PCI
    bar   [10] = type Memory, range 64, base 0, size 1048576, enabled
    bus range  = 1-255
    window[1c] = type I/O Port, range 32, addr 0xfffff000-0xfff, disabled
    window[20] = type Memory, range 32, addr 0xfff00000-0xfffff, disabled
    window[24] = type Prefetchable Memory, range 64, addr 0xfffffffffff00000-0xfffff, disabled
    cap 01[40] = powerspec 3  supports D0 D1 D2 D3  current D0
    cap 05[50] = MSI supports 32 messages, 64 bit, vector masks 
    cap 10[70] = PCI-Express 2 root port max data 128(256) RO NS ARI disabled
                 max read 128
                 link x1(x1) speed 2.5(8.0) ASPM disabled(L0s/L1)
    cap 11[b0] = MSI-X supports 1 message
                 Table in map 0x10[0x0], PBA in map 0x18[0x0]
    ecap 0001[100] = AER 2 0 fatal 1 non-fatal 0 corrected
    ecap 0019[158] = PCIe Sec 1 lane errors 0
    ecap 0017[1a8] = TPH Requester 1
    ecap 001e[23c] = L1 PM Substates 1
root@MOCHAbin:~ #

But

Code:
pcib0: <Marvell Armada8K PCI-E Controller> mem 0xf2640000-0xf264ffff,0xf8f00000-0xf8f7ffff irq 25 on simplebus2
pcib0: Cannot get phy[0]
pcib0: Bus is cache-coherent
pcib0: Using iATU legacy mode
pcib0: Detected outbound iATU regions: 8
pci0: <PCI bus> on pcib0
pci0: domain=0, physical bus=0
found-> vendor=0x11ab, dev=0x0110, revid=0x00
        domain=0, bus=0, slot=0, func=0
        class=06-04-00, hdrtype=0x01, mfdev=0
        cmdreg=0x0107, statreg=0x0010, cachelnsz=0 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
        intpin=a, irq=255
        powerspec 3  supports D0 D1 D2 D3  current D0
        MSI supports 32 messages, 64 bit, vector masks
        MSI-X supports 1 message in maps 0x10 and 0x18
        map[10]: type Memory, range 64, base 0, size 20, enabled
        secbus=1, subbus=255
pcib1: <PCI-PCI bridge> at device 0.0 on pci0
pcib0: failed to reserve resource for pcib1
pcib1: failed to allocate initial I/O port window: 0-0xfff
pcib0: failed to reserve resource for pcib1
pcib1: failed to allocate initial memory window: 0-0xfffff
pcib0: failed to reserve resource for pcib1
pcib1: failed to allocate initial prefetch window: 0-0xfffff
pcib1:   domain            0
pcib1:   secondary bus     1
pcib1:   subordinate bus   255
pci1: <PCI bus> on pcib1
pcib1: allocated bus range (1-1) for rid 0 of pci1
pci1: domain=0, physical bus=1
 
Does u-boot see anything PCIe? SerDES should show if PCIe is working.
I am talking out my ass. I have no PCIe bus on any Arm board.
I have researched it well.
Here is an example.
 
pcib0: <Marvell Armada8K PCI-E Controller>
Searching that brought up this:
That u-boot is showing real promise:
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
So Comphy #0 is ethernet and Comphy #4 looks like the 10G.
Net: eth0: mvpp2-0 [PRIME], eth1: mvpp2-1, eth2: mvpp2-2

With U-Boot working correctly you are half way there.
Am I citing your website here or is that somebody else?
 
Searching that brought up this:
That u-boot is showing real promise:

So Comphy #0 is ethernet and Comphy #4 looks like the 10G.


With U-Boot working correctly you are half way there.
Am I citing your website here or is that somebody else?
Yes, this is my site!

In fact, everything looks like this.
1. Marvell U-boot is installed in the box in SPI flash and the bootefi command does not work correctly in it (it does not work at all)
The log can be viewed here

Therefore, FreeBSD will not start.

2. I compiled EDK2 UEFI BootLoader (not quite clean yet ;))
It runs FreeBSD from USB or SATA just fine.
The log can be viewed here

I think I figured out how to solve the problem with PCIe, you just need to
create correct DTS file for EDK2 UEFI. (where only one PCIe port is enabled).

Thanks for the hints.

It will be more difficult to solve the problem with Ethernet, since there is currently no driver in FreeBSD.
Might have to port from Linux, but I'll check out the NetBSD and OpenBSD source code as well.
If anyone has any ideas or experience of porting from Linux
please let me know (I'm a complete layman in the Linux kernel :mad:)
 
SleepWalker According to this diagram:

cfcb06d0fe6e83834e8d700da485a333_original.jpg

The OPNsense codebase is quite outdated. The latest release of FreeBSD has more enhancements to support SGMII for Topaz


and

There is some things small changes i see that needs to be done. (after reading linux's driver)
I had also been working on Quectel 5G LTE m.2 support (which is simple, thanks to linux's getting early driver support) and E1512.
 
Back
Top