[Work In Progress] OPNsense Ported into ARM Devices

Started by nekoprog, March 25, 2019, 11:55:58 AM

Previous topic - Next topic
Quote from: ryker@utanet.at on February 02, 2022, 05:02:25 PM
https://personalbsd.org/?page_id=2

Has anybody been able to get this image working on the NanoPi-R4S with 1GB throughput working on both Ports?  Also is there any instructions on how to connect 1st time and set up? 

Thank you all for the information and help on this port.  really exited to start using it in my home lab!!

May 21, 2022, 10:05:04 AM #301 Last Edit: May 21, 2022, 10:49:19 AM by john_matrix
Hello,
Can someone give me some hints to compile a build for Compute Module 4?
Because Makefile give me some errors, ex:

QuoteMakefile:43: *** missing separator.  Stop.
Makefile:61: *** recipe commences before first target.  Stop.

Is FreeBSD mandatory to compile or Debian can be used too?

Many thanks!

Edit: disregard previous message, I have installed a Freebsd VM and compiling seems to work better now :)

May 28, 2022, 05:37:40 AM #302 Last Edit: June 04, 2022, 07:58:14 PM by rcat
Here is a RockPro64 image for anyone interested. It includes a few additions in the image - vim, wireguard, ddclient, and mdns-repeater.
https://opnsense.one8three.xyz/opnsense/FreeBSD%3A13%3Aaarch64/22.1/images/

Also, a repo for pkg updates is hosted at https://opnsense.one8three.xyz/opnsense/
Not sure how often it'll get updated...maybe once a month or so.

More info here: https://one8three.xyz/2022/05/25/OPNsense-on-RockPro64.html

Quote from: PackElend on December 29, 2021, 10:11:43 PM
it is feasible to port OPNsense to an ARM Cortex-A72 (Marvell® ARMADA® 7040)?
There is a OpenWrt SNAPSHOT available for the Globalscale MOCHAbin (I do have dev board).
Moreover I have Debian and Ubuntu image.
What would be the way to go to port it?
thank you
stefan

Little progress on MOCHAbin.
FreeBSD started but Ethernet does not work.
What ideas?

https://dmesgd.nycbug.org/index.cgi?do=view&id=6609

SleepWaker



Here's what a custom build of OPNsense for MOCHAbin looks like.
It remains to add support for native Ethernet.

https://personalbsd.org/?p=1177

Can anyone help with booting 22.1.X on the nanopi R4S? I've downloaded an image from https://personalbsd.org/?page_id=2 and also from https://ftp.yrzr.tk/opnsense/FreeBSD%3A13%3Aaarch64/22.1/images/

Both have been extracted using xz and flashed using dd. The device boots and gives the following error on any image I try

Consoles: EFI console  
    Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk0p1:
FreeBSD/arm64 EFI loader, Revision 1.1

   Command line arguments: loader.efi
   Image base: 0xf0def000
   EFI version: 2.80
   EFI Firmware: Das U-Boot (rev 8225.1792)
   Console: comconsole (0)
   Load Path: /efi\boot\bootaa64.efi
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(0)/HD(1,0x01,0,0x8000,0x10000)
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(0)/HD(1,0x01,0,0x8000,0x10000)
Setting currdev to disk0p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(0)/HD(2,0x01,0,0x18000,0x5e8000)
Setting currdev to disk0p2:
ERROR: cannot open /boot/lua/loader.lua: no such file or directory.

This can't be done on good hardware and the right SD card.
My images are tested and work for many guys.
What SD card are you using?
Try OPNsense-22.1.9.
Coming soon 22.7.

I was able to run VMware ESXi on MOCHAbin 5G.
And OPNsense is on it.


Quote from: S199p.Wa1k9r on August 12, 2022, 06:26:45 PM
OPNsense 22.7


22.7 is currently broken - it was built with phalcon-5.0.0r3, it needs 5.0.0r2.

Hi,

Has anyone tested or know if it works on Nanopi r5s?

Thanks

Hi all, excited to join in on the fun here!

I currently have 22.7 running from yrzr.tx on an R4S. I now see from a few posts above that this version is broken  so I'll try 22.1.10 shortly. My hope is to replace my hp t730 for home use.

After enabling powerd and setting it to maximum cpu frequency scaling I am able to push around 400mbit in each direction through the unit in cursory iperf3 testing.
I have a Cisco T-Rex benchmarking setup and I plan to do more in depth testing - different packet sizes, number of flows, open states, etc.

When initially testing on openwrt I was able to pin irqs and receive queues for the two nics to the faster A72 cores which was a notable improvement.
Is this possible in opnsense/freebsd? I did a bit of googling and didn't find any definitive answers.

I also have two R4SE's (I dream of HA firewall at home) with 32gb of emmc onboard.
I have tried flashing a few different opnsense images using rkdevtool with no success yet (I didn't really expect it to justwork).
Anyone have any ideas on that? It seems the tool wants the image split into various partitions, but it does allow me to just flash the whole image starting at 0x0.
I haven't dived into the image build process but I'm sure I'll dig into that soon.
I have a 3v3 rs232 adapter on the way so I'll be able to get a console on these things soon.

Anyway, happy to test/help/etc!

September 18, 2022, 06:17:59 AM #312 Last Edit: September 18, 2022, 09:28:31 PM by goos
Can someone share their (working) dts for the R4S and/or R4SE?

I've tried both mainline u-boot and the friendlyarm vendor versions.
Both cause a kernel panic when devmatch fires.


Starting device manager...Fatal data abort:
  x0:                0
  x1: ffffa0000758a000
  x2:                3
  x3: ffff0000da33f650 ($d.10 + d8f61078)
  x4: ffff0000da33f5d8 ($d.10 + d8f61000)
<snip>


EDIT - nevermind, I got it working on both the r4s and r4se!

The tl;dr to the last 10 hours of my life is that in the version of rk3399.dtsi that is in u-boot repos, someone fatfingered the first chunk of the pcie address range (I think that's what this field is for). see below

The "ranges" field under "pcie0: pcie@f8000000" needs to start with 0x83000000, not 0x82000000, such that it reads like this:

pcie0: pcie@f8000000 {
<snip>
ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000
  0x81000000 0x0 0xfbe00000 0x0 0xfbe00000 0x0 0x100000>;
<snip>


Made that switch and mostly good now. I'm seeing the same issue I saw in openwrt 21.x where the re0 interface disappears sometimes on soft reboots. The openwrt folks have this patch, I glanced through the freebsd kernel sources and it might be possible to duplicate the effects? I'm not sure how setting the mmc voltage effects the pcie nic though  ???
https://github.com/immortalwrt/immortalwrt/blob/master/target/linux/rockchip/patches-5.15/107-mmc-core-set-initial-signal-voltage-on-power-off.patch

EDIT EDIT - A-HA: (why wasn't this mainlined?)
https://github.com/friendlyarm/kernel-rockchip/commit/8efe01b4386ab38a36b99cfdc1dc02c38a8898c3

Quote from: efetropy on November 14, 2021, 04:32:49 PM
[snip]
EDIT: After another run, I managed to build the world and kernel successfully. Currently compiling packages – stay tuned for further updates.
Packages also compiled (and took quite a long time) and required a lot of space.
With some little changes, I managed to make an image. Booting worked on my CM4. I won't provide an image here as this was just to see whether compilation works or not

Hi.
I#m looking at this myself as I have some spare CM4 collecting dust.  Do you still have any notes on how you got this done ? Not well versed in compiling FreeeBSD at all, so any help is much appreciated :)

regs,

peram

Hi All. I have a few NanoPI R4SE (the enterprise ones w/ eMMC and consistent MAC). As such, the usual instructions for getting OPNsense running on this is not entirely the same as the R4S (without eMMC). Since the R5S does have the eMMC I've ported some of the u-boot commands from there to try on the R4SE.

Does anyone have a command sequence for writing to the TF card that will successfully boot the 22.1.x OPNsense image?

Here's my current command sequence:

   1 │ # Boot from SD/TF Card                                                                                                                                                                                                                                                                                                                                                                                                             
   2 │ sudo dd if=u-boot/idbloader.img of=/dev/sda conv=sync seek=64 status=progress
   3 │ sudo dd if=u-boot/u-boot.itb of=/dev/sda conv=sync seek=16384 status=progress
   4 │ sudo dd if=OPNsense-22.1.9-OpenSSL-aarch64-NanoPi-R4S-20220626.img of=/dev/sda conv=sync seek=32768 status=progress


Result, it tries to boot and u-boot does its typical process but then errors with:

Failed to initialize SPI flash at 0:0 (error