I'm unable to use "COM3" on a Intel Atom S1260 server, which is a HSUART. It has no device entry in uart_bus_pci.c. Unfortunately, while I'm able to get the device to show up if I add it, I can't communicate with it using cu. I'm able to get two different USB serial devices to talk using the same null modem cable and the same commands (minus the devices), so I don't suspect it's the device. I *assume* this applies to CURRENT as well. To test, I added `{ 0x8086, 0x0c5f, 0xffff, 0, "Atom Processor S1200 UART", 0x10},` to uart_bus_pci.c. The driver is loaded with this change, however it doesn't seem to function. ```uart2@pci0:0:20:0: class=0x070002 rev=0x02 hdr=0x00 vendor=0x8086 device=0x0c5f subvendor=0x15d9 subdevice=0x0651 vendor = 'Intel Corporation' device = 'Atom Processor S1200 UART' class = simple comms subclass = UART ``` If I use this change, like some other Intel serial devices, it does not load the module and says "no driver attached". ```{ 0x8086, 0x0c5f, 0xffff, 0, "Atom Processor S1200 UART", 0x10, 24 * DEFAULT_RCLK, 2 }, ``` Not sure how to proceed with this. Would appreciate any pointers. Related: https://forums.freebsd.org/threads/intel-pci-serial-port-no-driver-attached.30252/ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207910 https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/atom-processor-s1200-datasheet-vol-1.pdf https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/atom-processor-s1200-datasheet-vol-2.pdf
I just verified that this is working on a hardware level by booting Linux Mint and testing the port. dmesg (from Linux) said: "ttyS4 at I/O 0xf000 (irq = 16, base_baud = 115200) is a 16550A"
I tried to force IRQ 16 (FreeBSD uses 32) with device.hints, but it stays at IRQ 32. I'm not sure if this is a problem or not.
From FreeBSD, dmesg also shows IRQ 16. But sysctl -a seems to say that IRQ 32 is in use for the uart. I've had no luck forcing it to use IRQ 16. But... with debug.uart_force_poll = 1, it works! So it does seem to be some kind of buggy IRQ handling issue, if I'm not mistaken.
Created attachment 249917 [details] Atom S1200 UART support
I got it working! Patch is attached.
Pull request on Github: https://github.com/freebsd/freebsd-src/pull/1164
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1f2776e123603042944aad9f41ceb46b5b28d8ae commit 1f2776e123603042944aad9f41ceb46b5b28d8ae Author: Henrich Hartzer <henrichhartzer@tuta.io> AuthorDate: 2024-04-19 22:52:49 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-04-19 22:52:51 +0000 Add support for Intel Atom S1200 UART PR: 278316 Signed-off-by: Henrich Hartzer <henrichhartzer@tuta.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1164 sys/dev/uart/uart_bus_pci.c | 2 ++ 1 file changed, 2 insertions(+)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=c7a5881d7a6a37881bb65837e42829ee68a3883c commit c7a5881d7a6a37881bb65837e42829ee68a3883c Author: Henrich Hartzer <henrichhartzer@tuta.io> AuthorDate: 2024-04-19 22:52:49 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-04-24 23:57:55 +0000 Add support for Intel Atom S1200 UART PR: 278316 Signed-off-by: Henrich Hartzer <henrichhartzer@tuta.io> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1164 (cherry picked from commit 1f2776e123603042944aad9f41ceb46b5b28d8ae) sys/dev/uart/uart_bus_pci.c | 2 ++ 1 file changed, 2 insertions(+)
I'm going to close this out since this should be fixed in 14.1 and newer. Thank you so much, Warner!