linux-stable/drivers/tty/serial
Tobias Diedrich 3c5a87be17 serial: 8250_pci: Add Realtek 816a and 816b
These serial ports are exposed by the OOB-management-engine on
RealManage-enabled network cards (e.g. AMD DASH enabled systems using
Realtek cards).

Because these have 3 BARs, they fail the "num_iomem <= 1" check in
serial_pci_guess_board.

I've manually checked the two IOMEM regions and BAR 2 doesn't seem to
respond to reads, but BAR 4 seems to be an MMIO version of the IO ports
(untested).

With this change, the ports are detected:
0000:02:00.1: ttyS0 at I/O 0x2200 (irq = 82, base_baud = 115200) is a 16550A
0000:02:00.2: ttyS1 at I/O 0x2100 (irq = 55, base_baud = 115200) is a 16550A

lspci output:
02:00.1 0700: 10ec:816a (rev 0e) (prog-if 02 [16550])
        Subsystem: 17aa:5082
        Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort+ <TAbort- <MAbort- >SERR- <PERR- INTx-
        Interrupt: pin B routed to IRQ 82
        IOMMU group: 11
        Region 0: I/O ports at 2200 [size=256]
        Region 2: Memory at fd715000 (64-bit, non-prefetchable) [size=4K]
        Region 4: Memory at fd704000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [40] Power Management version 3
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
                Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
                Address: 0000000000000000  Data: 0000
        Capabilities: [70] Express (v2) Endpoint, MSI 01
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 <64us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset- SlotPowerLimit 0.000W
                DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 512 bytes
                DevSta: CorrErr+ NonFatalErr- FatalErr- UnsupReq+ AuxPwr+ TransPend-
                LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 <64us
                        ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
                LnkCtl: ASPM L1 Enabled; RCB 64 bytes, Disabled- CommClk+
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s (ok), Width x1 (ok)
                        TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
                DevCap2: Completion Timeout: Range ABCD, TimeoutDis+ NROPrPrP- LTR+
                         10BitTagComp- 10BitTagReq- OBFF Via message/WAKE#, ExtFmt- EETLPPrefix-
                         EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
                         FRS- TPHComp- ExtTPHComp-
                         AtomicOpsCap: 32bit- 64bit- 128bitCAS-
                DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis- LTR- OBFF Disabled,
                         AtomicOpsCtl: ReqEn-
                LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete- EqualizationPhase1-
                         EqualizationPhase2- EqualizationPhase3- LinkEqualizationRequest-
                         Retimer- 2Retimers- CrosslinkRes: unsupported
        Capabilities: [b0] MSI-X: Enable- Count=4 Masked-
                Vector table: BAR=4 offset=00000000
                PBA: BAR=4 offset=00000800
        Capabilities: [d0] Vital Product Data
                Not readable
        Capabilities: [100 v2] Advanced Error Reporting
                UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
                UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
                CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
                CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- AdvNonFatalErr+
                AERCap: First Error Pointer: 00, ECRCGenCap+ ECRCGenEn- ECRCChkCap+ ECRCChkEn-
                        MultHdrRecCap- MultHdrRecEn- TLPPfxPres- HdrLogCap-
                HeaderLog: 00000000 00000000 00000000 00000000
        Capabilities: [160 v1] Device Serial Number 00-00-00-00-00-00-00-00
        Capabilities: [170 v1] Latency Tolerance Reporting
                Max snoop latency: 0ns
                Max no snoop latency: 0ns
        Capabilities: [178 v1] L1 PM Substates
                L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+
                          PortCommonModeRestoreTime=150us PortTPowerOnTime=150us
                L1SubCtl1: PCI-PM_L1.2- PCI-PM_L1.1- ASPM_L1.2- ASPM_L1.1-
                           T_CommonMode=0us LTR1.2_Threshold=0ns
                L1SubCtl2: T_PwrOn=10us
02:00.2 0700: 10ec:816b (rev 0e)
[...same...]

Signed-off-by: Tobias Diedrich <tobiasdiedrich@gmail.com>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200914173628.GA22508@yamamaya.is-a-geek.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-16 13:23:33 +02:00
..
8250 serial: 8250_pci: Add Realtek 816a and 816b 2020-09-16 13:23:33 +02:00
cpm_uart tty: serial: cpm_uart: Fix behaviour for non existing GPIOs 2020-06-27 13:50:51 +02:00
jsm tty: serial: Replace HTTP links with HTTPS ones 2020-07-21 20:04:54 +02:00
21285.c tty: serial: 21285: stop using the unused[] variable from struct uart_port 2019-12-19 20:10:28 +01:00
altera_jtaguart.c serial: altera_jtaguart: Replace HTTP links with HTTPS ones 2020-07-21 20:04:54 +02:00
altera_uart.c
amba-pl010.c tty/serial: Migrate amba-pl01* to use has_sysrq 2019-12-18 15:04:44 +01:00
amba-pl011.c serial: pl011: Fix oops on -EPROBE_DEFER 2020-08-18 13:32:27 +02:00
amba-pl011.h
apbuart.c tty/serial: Migrate apbuart to use has_sysrq 2019-12-18 15:04:44 +01:00
apbuart.h
ar933x_uart.c serial: Allow uart_get_rs485_mode() to return errno 2020-05-15 14:47:05 +02:00
arc_uart.c tty/serial: Migrate arc_uart to use has_sysrq 2019-12-18 15:04:45 +01:00
atmel_serial.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
atmel_serial.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
bcm63xx_uart.c Revert "tty: serial: bcm63xx: fix missing clk_put() in bcm63xx_uart" 2020-05-04 11:49:57 +02:00
clps711x.c tty/serial: Migrate clps711x to use has_sysrq 2019-12-18 15:04:46 +01:00
digicolor-usart.c
dz.c TTY/Serial driver updates for 5.6-rc1 2020-01-29 10:13:27 -08:00
dz.h
earlycon-arm-semihost.c
earlycon-riscv-sbi.c
earlycon.c serial: earlycon: prefer EARLYCON_DECLARE() variant 2020-03-07 09:52:01 +01:00
efm32-uart.c tty: serial: efm32: fix spelling mistake "reserverd" -> "reserved" 2020-02-19 11:38:58 +01:00
fsl_linflexuart.c tty/serial: Migrate fsl_linflexuart to use has_sysrq 2019-12-18 15:04:48 +01:00
fsl_lpuart.c tty: serial: fsl_lpuart: minimum baud rate support 2020-06-27 13:52:29 +02:00
icom.c
icom.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
ifx6x60.c tty: serial: ifx6x60: Convert to GPIO descriptors 2020-03-12 10:03:54 +01:00
ifx6x60.h tty: serial: ifx6x60: Convert to GPIO descriptors 2020-03-12 10:03:54 +01:00
imx.c tty: serial: imx: enable imx serial console port as module 2020-07-29 17:10:59 +02:00
imx_earlycon.c tty: serial: imx: add imx earlycon driver 2020-07-29 17:11:02 +02:00
ip22zilog.c tty/serial: Migrate ip22zilog to use has_sysrq 2019-12-18 15:04:50 +01:00
ip22zilog.h
Kconfig tty: serial: imx: add dependence and build for earlycon 2020-08-18 13:54:34 +02:00
kgdb_nmi.c kdb: Switch to use safer dbg_io_ops over console APIs 2020-06-26 15:40:16 +01:00
kgdboc.c Linux 5.8-rc6 2020-07-20 09:39:11 +02:00
lantiq.c serial: lantiq: Make driver modular 2020-05-15 12:22:19 +02:00
lpc32xx_hs.c serial: lpc32xx_hs: Drop surplus include 2020-04-16 16:12:33 +02:00
Makefile tty: serial: imx: add dependence and build for earlycon 2020-08-18 13:54:34 +02:00
max310x.c
max3100.c
mcf.c
men_z135_uart.c
meson_uart.c TTY/Serial driver updates for 5.6-rc1 2020-01-29 10:13:27 -08:00
milbeaut_usio.c tty/serial: Migrate milbeaut_usio to use has_sysrq 2019-12-18 15:04:51 +01:00
mpc52xx_uart.c tty/serial: mpc52xx_uart: Don't zero port->sysrq 2019-12-18 15:04:52 +01:00
mps2-uart.c
msm_serial.c serial: msm_serial: add sparse context annotation 2020-07-24 10:44:27 +02:00
mux.c TTY/Serial driver updates for 5.6-rc1 2020-01-29 10:13:27 -08:00
mvebu-uart.c tty:serial:mvebu-uart:fix a wrong return 2020-03-05 21:26:34 +01:00
mxs-auart.c serial: mxs-auart: add missed iounmap() in probe failure and remove 2020-07-10 14:44:46 +02:00
omap-serial.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
owl-uart.c tty: serial: owl: add "much needed" clk_prepare_enable() 2020-04-23 15:46:30 +02:00
pch_uart.c serial: pch_uart: use generic power management 2020-07-21 20:04:54 +02:00
pic32_uart.c serial: pic32_uart: Use uart_console() helper 2020-03-12 10:00:22 +01:00
pic32_uart.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
pmac_zilog.c serial: pmac_zilog: add sparse context annotation 2020-07-24 10:44:27 +02:00
pmac_zilog.h
pnx8xxx_uart.c tty/serial: Migrate pnx8xxx_uart to use has_sysrq 2019-12-18 15:04:57 +01:00
pxa.c tty/serial: Migrate pxa to use has_sysrq 2019-12-18 15:04:57 +01:00
qcom_geni_serial.c tty: serial: qcom_geni_serial: Drop __init from qcom_geni_console_setup 2020-08-18 13:25:58 +02:00
rda-uart.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
rp2.c
sa1100.c tty/serial: Migrate sa1100 to use has_sysrq 2019-12-18 15:04:59 +01:00
samsung_tty.c serial: samsung: Removes the IRQ not found warning 2020-08-18 13:53:42 +02:00
sb1250-duart.c TTY/Serial driver updates for 5.6-rc1 2020-01-29 10:13:27 -08:00
sc16is7xx.c sched,serial: Convert to sched_set_fifo() 2020-06-15 14:10:23 +02:00
sccnxp.c tty/serial: Migrate sccnxp to use has_sysrq 2019-12-18 15:05:00 +01:00
serial-tegra.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
serial_core.c serial: core: fix console port-lock regression 2020-09-16 13:22:44 +02:00
serial_mctrl_gpio.c
serial_mctrl_gpio.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
serial_txx9.c tty/serial: Migrate serial_txx9 to use has_sysrq 2019-12-18 15:05:01 +01:00
sh-sci.c Revert "serial: sh-sci: Initialize spinlock for uart console" 2020-07-21 18:21:49 +02:00
sh-sci.h serial: sh-sci: Drop unused include 2020-04-16 16:13:34 +02:00
sifive.c Revert "tty: serial: add missing spin_lock_init for SiFive serial console" 2020-07-21 18:21:49 +02:00
sirfsoc_uart.c
sirfsoc_uart.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
sprd_serial.c serial: sprd: remove redundant sprd_port cleanup 2020-03-18 12:20:04 +01:00
st-asc.c tty: st-asc: switch to using devm_gpiod_get() 2020-01-10 14:01:33 +01:00
stm32-usart.c serial: stm32: avoid kernel warning on absence of optional IRQ 2020-08-18 13:32:28 +02:00
stm32-usart.h tty: serial: Add modem control gpio support for STM32 UART 2020-05-15 12:24:15 +02:00
suncore.c
sunhv.c Revert "serial: sunhv: Initialize lock for non-registered console" 2020-07-21 18:21:49 +02:00
sunsab.c serial: sunsab: Return proper error code from console ->setup() hook 2020-06-25 14:21:28 +02:00
sunsab.h
sunsu.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sunzilog.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
sunzilog.h
tegra-tcu.c
timbuart.c
timbuart.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
uartlite.c tty: serial: uartlite: Replace HTTP links with HTTPS ones 2020-07-21 20:04:54 +02:00
ucc_uart.c ARM: SoC-related driver updates 2020-02-08 14:04:19 -08:00
vr41xx_siu.c tty/serial: Migrate vr41xx_siu to use has_sysrq 2019-12-18 15:05:09 +01:00
vt8500_serial.c tty/serial: Migrate vt8500_serial to use has_sysrq 2019-12-18 15:05:09 +01:00
xilinx_uartps.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
zs.c TTY/Serial driver updates for 5.6-rc1 2020-01-29 10:13:27 -08:00
zs.h