Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
MMIO serial console configuration help needed
« previous
next »
Print
Pages: [
1
]
Author
Topic: MMIO serial console configuration help needed (Read 1354 times)
dbyte
Newbie
Posts: 4
Karma: 0
MMIO serial console configuration help needed
«
on:
July 26, 2023, 03:21:51 am »
Hi,
Going a little nuts. I managed to boot and install OPNSense on my new server (SolidRun Bedrock v3000) and it is using a not so standard MMIO serial console. I can interrupt the loader at boot and add the appropriate hw.uart.console, but I am stumped on how to permanently configure this.
at initial boot I put this manually in the loader
hw.uart.console="mm:0xfedc9000,rs:2"
serial console works fine if i manually set it at boot time
I have tried adding it to tunables with no success and trying /boot/loader.conf.local
It appears to be using /dev/ttyu0 for the console when working.
OPNsense 23.7.r2-amd64
FreeBSD 13.2-RELEASE-p1
CPU type AMD Ryzen Embedded V3C18I 8-Core Processor (8 cores, 16 threads)
root@OPNsense:~ # dmesg | grep -i uart
uart0: <16x50 with 256 byte FIFO> iomem 0xfedc9000-0xfedc9fff,0xfedc7000-0xfedc7fff irq 3 flags 0x10 on acpi0
root@OPNsense:~ # sysctl -a | grep uart
uart0: <16x50 with 256 byte FIFO> iomem 0xfedc9000-0xfedc9fff,0xfedc7000-0xfedc7fff irq 3 flags 0x10 on acpi0
device uart_ns8250
device uart
debug.uart_force_poll: 0
debug.uart_poll_freq: 50
irq3: uart0:5 @cpu0(domain0): 0
dev.uart.0.rx_overruns: 0
dev.uart.0.pps_mode: 2
dev.uart.0.%parent: acpi0
dev.uart.0.%pnpinfo: _HID=AMDI0020 _UID=0 _CID=none
dev.uart.0.%location: handle=\_SB_.FUR0
dev.uart.0.%driver: uart
dev.uart.0.%desc: 16x50 with 256 byte FIFO
dev.uart.%parent:
Logged
dbyte
Newbie
Posts: 4
Karma: 0
Re: MMIO serial console configuration help needed
«
Reply #1 on:
July 30, 2023, 01:11:30 am »
So it appears to me to be a bug of some sort.
In Webconsole I added tunables
hw.uart.console environment mm:0xfedc9000,rs:2,bd:1
If I enable EFI console only, then I see all of the console output, but get no login
If I enable EFI and comconsole, then the console output freezes very soon after the boot starts and I get no login
/dev/ttyu0 is create either way and it is my MMIO serial connection
if I enable EFI console only and then go to the web GUI and enable serial, I get a login on console immediately. but on reboot, I get the full console freeze
Right now I have solved it this way
1. enable EFI console only
2. I modified /usr/local/etc/inc/system.inc
Line 1157
From
$on_off_secure_u = $serial_enabled ? (isset($config['system']['serialusb']) ? 'on' : 'onifconsole') . ' secure' : 'off secure';
---
To
$on_off_secure_u = $serial_enabled ? (isset($config['system']['serialusb']) ? 'on' : 'onifconsole') . ' secure' : 'onifexists secure';
Everything is working for me now, but not the right way to fix this problem
Logged
lior.jigalo@solid-run.com
Newbie
Posts: 1
Karma: 0
Re: MMIO serial console configuration help needed
«
Reply #2 on:
August 17, 2023, 09:56:52 am »
Hi dbyte,
I tried recreating your behaviour on a bedrock with a V3C44 CPU.
I was able to install Opnsense using the set hw.uart.console="mm:0xfedc9000,rs:2,bd:1" variable.
however, it seems like for me the console is ttyu2 not ttyu0.
"FreeBSD/amd64 (OPNsense.localdomain) (ttyu2)"
for me, to get t persistently work without having to use the uart variable each time i just created the /boot/loader.conf.local fileand pasted the following two lines just as you suggested.
hw.uart.console="mm:0xfedc9000,rs:2"
console="efi"
And after a reboot i do not need to do anything now.
Also i do get a login prompt without modifying /usr/local/etc/inc/system.inc.
I used OPNsense 23.7 serial
Lastly, since you seem to be A LOT more experienced than me in the freeBSD world, two questions:
where did you get this console variable
you said: "Everything is working for me now, but not the right way to fix this problem".
what will be the real right way to fix this problem?
Thanks,
Lior
Logged
dbyte
Newbie
Posts: 4
Karma: 0
Re: MMIO serial console configuration help needed
«
Reply #3 on:
August 21, 2023, 07:39:18 pm »
Thanks Lior for that information. I will give it a try again as using loader.conf.local would be a cleaner way of doing it.
I have a lot of experience in the UNIX world in general and even more searching the net for solutions
I originally found the console variable from
http://bsdimp.blogspot.com/2018/07/how-to-get-memory-mapped-serial-console.html
but he never fully detailed his solution or if it worked properly (This was from 2018)
The right way to fix this problem would be to detect MMIO devices in the OS itself (kernel or otherwise) It seems MMIO devices are not going to go away anytime soon.
Logged
dbyte
Newbie
Posts: 4
Karma: 0
Re: MMIO serial console configuration help needed
«
Reply #4 on:
August 26, 2024, 01:12:33 pm »
Well .. back to the drawing board. The latest release of OpenSense 24.7 (not sure when this broke) but I can no longer get the MMIO working using the above method. console logs give
ns8250: UART FCR is brokene FIFO> iomem 0xfedc9000-0xfedc9fff,0xfedc7000-0xfedc7fff irq 3 on acpi0
uart2: console (111111,n,8,1)
ioapic0: routing intpin 3 (ISA IRQ 3) to lapic 12 vector 54
uart2: fast interrupt
uart2: PPS capture mode: DCD
Also noted that my 10Gb SFP's (one Opt, One TP) both show up as having no link .. even though tcpdump will show traffic on both interfaces and I have link lights. I have tried a couple different brands with no change.
Logged
doktornotor
Hero Member
Posts: 709
Karma: 70
Re: MMIO serial console configuration help needed
«
Reply #5 on:
August 26, 2024, 01:27:35 pm »
Do NOT use loader.conf.local. Use the System Tunables GUI.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
MMIO serial console configuration help needed