I connected a GPS receiver to TTY00 on a AMD 5600G motherboard with B550 
chipset.

Every burst from the receiver caused overruns.
I don't have docs for the B550 but the comment in com_acpi.c about Synopsys 
Designware
suggested that the serial port implementation would likely include fifos.

The following patch removed the overruns:

Index: com_acpi.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/com_acpi.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 com_acpi.c
--- com_acpi.c  28 Jun 2022 21:02:14 -0000      1.10
+++ com_acpi.c  5 Nov 2022 04:37:07 -0000
@@ -98,7 +98,7 @@ com_acpi_attach(struct device *parent, s
 
        if (com_acpi_is_designware(aaa->aaa_dev)) {
                intr = com_acpi_intr_designware;
-               sc->sc.sc_uarttype = COM_UART_16550;
+               sc->sc.sc_uarttype = COM_UART_16550A;
                sc->sc.sc_reg_width = acpi_getpropint(sc->sc_node,
                    "reg-io-width", 4);
                sc->sc.sc_reg_shift = acpi_getpropint(sc->sc_node,
===================================================================

Pages 128-129 of the Designware spec show a feature test register which if 
present
would confirm the presence of the fifo. This would be chip type & version 
dependent.
I haven't tried it & it would take workXXXXX I don't believe it's necessary.

#define com_cpr (0xF4 >> 2)
#define FIFO_MODE    0xFF0000
                unsigned int cpr;
                cpr = com_read_reg(&sc->sc, com_cpr);
                if (cpr != 0 && (cpr & FIFO_MODE) == 0)
                        sc->sc.sc_uarttype = COM_UART_16550;
                else
                        sc->sc.sc_uarttype = COM_UART_16550A;

much trimmed dmesg:

[7.2 release]
com0: 84 silo overflows, 0 ibuf overflows
com0: 82 silo overflows, 0 ibuf overflows
com0: 70 silo overflows, 0 ibuf overflows
com0: 86 silo overflows, 0 ibuf overflows
com0: 80 silo overflows, 0 ibuf overflows
com0: 80 silo overflows, 0 ibuf overflows
com0: 67 silo overflows, 0 ibuf overflows
com0: 72 silo overflows, 0 ibuf overflows
com0: 68 silo overflows, 0 ibuf overflows
com0: 57 silo overflows, 0 ibuf overflows
com0: 146 silo overflows, 0 ibuf overflows
com0: 256 silo overflows, 0 ibuf overflows
com0: 181 silo overflows, 0 ibuf overflows
com0: 130 silo overflows, 0 ibuf overflows
com0: 119 silo overflows, 0 ibuf overflows
com0: 134 silo overflows, 0 ibuf overflows
com0: 157 silo overflows, 0 ibuf overflows
com0: 220 silo overflows, 0 ibuf overflows
com0: 60 silo overflows, 0 ibuf overflows
syncing disks... done


modified version
OpenBSD 7.2-stable (lm) #0: Fri Nov  4 23:40:50 EDT 2022
    g...@eight.oat.com:/usr/src/sys/arch/amd64/compile/lm
real mem = 67997949952 (64847MB)
avail mem = 65919741952 (62865MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.3 @ 0xe6cc0 (33 entries)
bios0: vendor American Megatrends International, LLC. version "P2.10" date 
08/02/2021
bios0: ASRock B550 Phantom Gaming 4
acpi0 at bios0: ACPI 6.0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT SSDT SSDT FIDT MCFG AAFT HPET TPM2 SSDT CRAT CDIT 
SSDT SSDT SSDT SSDT WSMT APIC SSDT SSDT SSDT SSDT FPDT
acpi0: wakeup devices GP17(S4) XHC0(S4) XHC1(S4) GPP0(S4) GPP3(S4) PTXH(S4) 
PT20(S4) PT24(S4) PT26(S4) PT27(S4) PT28(S4) PT29(S4)
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimcfg0 at acpi0
acpimcfg0: addr 0xf0000000, bus 0-127
acpihpet0 at acpi0: 14318180 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD Ryzen 5 5600G with Radeon Graphics, 3892.75 MHz, 19-50-00
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,PQM,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA,UMIP,PKU,IBPB,IBRS,STIBP,SSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 512KB 64b/line 
8-way L2 cache, 16MB 64b/line 16-way L3 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=1.1, IBE
cpu11 at mainbus0: apid 11 (application processor)
cpu11: AMD Ryzen 5 5600G with Radeon Graphics, 3892.69 MHz, 19-50-00
cpu11: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,RDRAND,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TCE,TOPEXT,CPCTR,DBKP,PCTRL3,MWAITX,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,PQM,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA,UMIP,PKU,IBPB,IBRS,STIBP,SSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu11: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 512KB 64b/line 
8-way L2 cache, 16MB 64b/line 16-way L3 cache
cpu11: smt 1, core 5, package 0
ioapic0 at mainbus0: apid 13 pa 0xfec00000, version 21, 24 pins
ioapic1 at mainbus0: apid 14 pa 0xfec01000, version 21, 32 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (GPP6)
acpiprt2 at acpi0: bus -1 (GPP7)
acpiprt3 at acpi0: bus -1 (GPP8)
acpiprt4 at acpi0: bus -1 (GPP9)
acpiprt5 at acpi0: bus 4 (GP17)
acpiprt6 at acpi0: bus -1 (GPP0)
acpiprt7 at acpi0: bus -1 (GP18)
acpiprt8 at acpi0: bus -1 (GPP4)
acpiprt9 at acpi0: bus -1 (GPP5)
acpiprt10 at acpi0: bus 1 (GPP3)
acpipci0 at acpi0 PCI0: 0x00000010 0x00000011 0x00000000
acpicmos0 at acpi0
com0 at acpi0 UAR1 (PNP0501) addr 0x3f8/0x8 irq 4: ns16550a, 16 byte fifo
acpibtn0 at acpi0: PWRB
amdgpio0 at acpi0 GPIO uid 0 addr 0xfed81500/0x400 irq 7, 184 pins
tpm0 at acpi0 TPM_: unsupported TPM2 start method 2
"ACPI0010" at acpi0 not configured
acpicpu0 at acpi0: C1(@1 halt!), PSS
acpicpu1 at acpi0: C1(@1 halt!), PSS
amdgpu0: 1920x1200, 32bpp
wsdisplay0 at amdgpu0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wskbd2: connecting to wsdisplay0
wskbd3: connecting to wsdisplay0

wsdisplay0: screen 1-5 added (std, vt100 emulation)

1 hour with GPS connected and no overruns

geoff steckel

Reply via email to