Sunix serial PCIe driver - close but no banana
-
I have a few pfSense devices, some Netgate hardware and one on Dell/Intel hardware - guess which one I have the problem with?? Yes, I know!
This is a real longshot - its a FreeBSD driver question in essence. I have installed a Sunix 5427A PCI-e serial card in a working pfSense machine, which I can use for remote serial console access. Its a common accessory supplied by Dell for Optiplex systems. It doesn't work with pdSense 2.4.4-RELEASE-p3 (FreeBSD 11.2-RELEASE-p10).
The reason is FreeBSD does not support this particular flavour of Sunix card. I wondered if pfSense 2.5 might help me but as FreeBSD latest source does not list the vendor ID/device ID with my subdevice 0x0001 it seems pointless to expect an improvement.
I used "sysctl -a | grep 'uart.2'" and got the following:
dev.uart.2.wake: 0 dev.uart.2.pps_mode: 2 dev.uart.2.%parent: pci2 dev.uart.2.%pnpinfo: vendor=0x1fd4 device=0x1999 subvendor=0x1fd4 subdevice=0x0001 class=0x070004 dev.uart.2.%location: slot=0 function=0 dbsf=pci0:3:0:0 handle=\_SB_.PCI0.RP03.PXSX dev.uart.2.%driver: uart dev.uart.2.%desc: Sunix SER5xxxx Serial Port
This reveals vendor ID 0x1FD4, device ID 0x1999, subvendor ID 0x1FD4 and subdevice ID 0x0001.
After extensive digging around I've found the source file where the vendor and device IDs are checked here https://github.com/freebsd/freebsd/blob/master/sys/dev/puc/pucdata.c Most of the variations of this vendor's card are supported and while I am so close to a win, subdevice 0x0001 is not there. Subdevice ID 2, 4 and 8 are, but not 1. Argh!
The upshot is, even though the card is essentially similar to the 2, 4 and 8 port cousins the 1 port card is not supported. I post this here to help those that follow me avoid wasting time.
Before I give up - has anyone made one of this single port Sunix 5427A cards work with pfSense? What special incantation did you use?
Thanks,
-
The fact that shows up at all as dev.uart seem like it is already supported.
What makes you think it is not functional?
Does it appear in /dev as cuau2?
Have you tried connecting out of it to something else?
Steve
-
@stephenw10 thanks for the pointer and giving some confidence that this may be possible.
I have checked for the /dev/cuau2 which is there. Stty reported a baud rate of 9600, so I changed it to initialise at 115200 8N1 and will see what I can do. No comms at present with ser2net, so I need to check closer on the wiring of my null modem cable is crossing pins 2 and 3, and I have properly configured ser2net.
20 years ago I had all the necessary connectors, gender changers and serial patch boxes, all gone in the trash.
Watch this space!
-
What are you actually connecting to it to test?
The console will not appear on that port even if it's working perfectly. That always appears on com1 (uart0) unless you set it otherwise.
Check the output of
dmesg | grep uart
after boot.Steve
-
@stephenw10 I have checked and I am getting uart2. The motherboard does have integrated COM0, which I disabled in BIOS (it no longer appears in dmesg).
[2.4.4-RELEASE][admin@pfSense.lan]/root: dmesg | grep uart uart2: <Sunix SER5xxxx Serial Port> port 0xd020-0xd03f,0xd000-0xd01f irq 18 at device 0.0 on pci2
I have tried a search for 'uart' in netgate's docs pages, but did not see something to point me to how to change the serial device used. If you give me any clues as to how I can set the pfsense serial console on uart2, I will try that.
Thanks,
-
Two address ranges is interesting.
Try this, create the file /boot/loader.conf.local, if you don't have one already, and add to it:
comconsole_port="0xd020"
Make sure serial console is enabled in System > Advanced > Admin Access. Reboot.
Try the other range if that doesn't work.
When it does you will see in the boot log something like:
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0 uart1: console (115200,n,8,1)
But obviously with uart2 and your values.
Steve
-
I added the loader.conf.local with the single comconsole_port line. It worked! Nice. Thank you for your guidance, it is much appreciated.
-
Nice! That file will be kept across firmware upgrades but obviously not if you have to re-install. Could catch you out.
Steve
-
This post is deleted! -
What?
(smells like spam)
Edit: Yup!