I have been struggling to get the OPNsense serial boot console working with the serial-over-LAN (SOL) capability in the Intel ME. I can verify that the SOL device is working correctly, but the operating system refuses to redirect boot messages over the interface. They always display on the hardware UART (COM1) on 0x3F8. I'm running OPNsense 26.7.7.
Here's what I've done so far. Hoping for some guidance on what to do next. I know it's a long post...
FreeBSD 15.1 did not support the SOL UART on this machine natively, so I had to recompile the kernel to add the following line in /usr/src/sys/dev/uart/uart_bus_pci.c:
{ 0x8086, 0xa363, 0xffff, 0, "300/C240 Series Chipset Family Keyboard and Text (KT) Redirection", 0x10 | PCI_NO_MSI }
After doing that, the system assigned "uart2" to the device. Previously, this had a name of "none" and the kernel would not load a driver. dmesg also shows the device loading at boot. This is good, but note how the console is attached to uart0--more on that later.
# pciconf -l
...
uart2@pci0:0:22:3: class=0x070002 rev=0x10 hdr=0x00 vendor=0x8086 device=0xa363 subvendor=0x1028 subdevice=0x0860
...
# dmesg | grep uart
[1] uart2: <300/C240 Series Chipset Family Keyboard and Text (KT) Redirection> port 0x30a0-0x30a7 mem 0x91137000-0x91137fff at device 22.3 on pci0
[1] uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
[1] uart0: console (115200,n,8,1)
I configured the console and set some tunables to force the console to use the SOL interface. Note that the IO address correctly references the device address of uart2 (0x30a0). This is all based on guidance from various sources: (1) (https://forum.opnsense.org/index.php?topic=48966.0), (2) (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203750), and (3) (https://kb.unixservertech.com/unix/freebsd/ipmi_sol).
console.png
tunable.png
I also added a flag for uart2 to /boot/device.hints at the recommendation of the uart(4) (https://man.freebsd.org/cgi/man.cgi?query=uart&sektion=4&apropos=0&manpath=FreeBSD+15.1-RELEASE+and+Ports.quarterly) man page. (Although, I don't think this had any effect because the flag didn't show up in dmesg above for uart2.)
hint.uart.2.flags="0x10"
And yet, OPNsense continues to use the physical serial port (0x3F8) to output boot messages and provide serial console access. It does not honor comconsole_port. I see no output on the SOL interface when connected with MeshCommander or amtterm during boot--but it does show up on the physical serial port that I have connected to another system for testing.
# kenv | grep comconsole_port
comconsole_port="0x30a0"
# ps aux | grep getty
root 72550 0.0 0.0 14132 2552 u0 Is+ 09:36 0:00.00 /usr/libexec/getty 3wire.115200 ttyu0
root 48294 0.0 0.0 14132 2540 v0 Is+ 09:05 0:00.00 /usr/libexec/getty Pc ttyv0
root 48571 0.0 0.0 14132 2548 v1 Is+ 09:05 0:00.00 /usr/libexec/getty Pc ttyv1
root 48578 0.0 0.0 14132 2544 v2 Is+ 09:05 0:00.00 /usr/libexec/getty Pc ttyv2
root 48641 0.0 0.0 14132 2544 v3 Is+ 09:05 0:00.00 /usr/libexec/getty Pc ttyv3
root 48739 0.0 0.0 14132 2544 v4 Is+ 09:05 0:00.00 /usr/libexec/getty Pc ttyv4
root 48957 0.0 0.0 14132 2544 v5 Is+ 09:05 0:00.00 /usr/libexec/getty Pc ttyv5
root 48965 0.0 0.0 14132 2544 v6 Is+ 09:05 0:00.00 /usr/libexec/getty Pc ttyv6
root 49239 0.0 0.0 14132 2552 v7 Is+ 09:05 0:00.00 /usr/libexec/getty Pc ttyv7
root 20762 0.0 0.0 14088 2616 0 S+ 10:12 0:00.00 grep getty
I know the SOL interface is working because I can echo text to /dev/ttyu2 and see it printed in amtterm on a different system. I can also get a full serial console going if I modify /etc/ttys as described here (https://forum.opnsense.org/index.php?topic=6702.0). I have not tried patching the code as suggested in that link, but I also don't think it's necessary because the console is already supposed to be redirected to 0x30a0 and the "onifconsole" flag should work the same way it does for ttyu0 with the standard serial port.
The only setting I haven't been able to change is the one for comconsole_pcidev as discussed in the loader(8) (https://man.freebsd.org/cgi/man.cgi?query=loader&sektion=8&apropos=0&manpath=FreeBSD+13.1-RELEASE+and+Ports) man page. This bug report (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203750) and this guide (https://blog.ignoranthack.me/index8cf7.html?p=51) provide evidence that comconsole_pcidev=0:22:3 is the correct value to use here--which also matches my system per pciconf above--but I receive an "invalid pcidev" message on bootup when I try that. I haven't been able to figure out how to set this loader tunable.
I'm pretty perplexed at this point. I can't think of anything else to try to force the console to use the SOL interface at boot. There seems to be evidence (on the vanilla FreeBSD side, at least) of this working. Is there something I'm missing? I'd appreciate any help!