Bug 278316 - Intel Atom S1200 (Centerton) serial UART not working
Summary: Intel Atom S1200 (Centerton) serial UART not working
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.0-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-11 22:05 UTC by Henrich Hartzer
Modified: 2024-04-28 20:09 UTC (History)
0 users

See Also:


Attachments
Atom S1200 UART support (656 bytes, patch)
2024-04-11 23:18 UTC, Henrich Hartzer
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henrich Hartzer 2024-04-11 22:05:51 UTC
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
Comment 1 Henrich Hartzer 2024-04-11 22:16:24 UTC
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"
Comment 2 Henrich Hartzer 2024-04-11 22:36:22 UTC
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.
Comment 3 Henrich Hartzer 2024-04-11 23:00:57 UTC
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.
Comment 4 Henrich Hartzer 2024-04-11 23:18:15 UTC
Created attachment 249917 [details]
Atom S1200 UART support
Comment 5 Henrich Hartzer 2024-04-11 23:18:27 UTC
I got it working! Patch is attached.
Comment 6 Henrich Hartzer 2024-04-11 23:24:55 UTC
Pull request on Github: https://github.com/freebsd/freebsd-src/pull/1164
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-04-19 23:13:52 UTC
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(+)
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-04-24 23:59:39 UTC
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(+)
Comment 9 Henrich Hartzer 2024-04-28 20:09:41 UTC
I'm going to close this out since this should be fixed in 14.1 and newer.

Thank you so much, Warner!