1 /* SPDX-License-Identifier: GPL-2.0-only */
3 /* ========================== UART ========================== */
6 * Generic setup for 16550A compatible UARTs.
8 * Controlled by the following preprocessor defines:
10 * SUPERIO_CHIP_NAME The name of the Super I/O chip (unique, required)
11 * SUPERIO_UART_LDN The logical device number on the Super I/O
12 * chip for this UART (required)
13 * SUPERIO_UART_DDN A string literal that identifies the dos device
14 * name (DDN) of this uart (e.g. "COM1", optional)
15 * SUPERIO_UART_PM_REG Identifier of a 1-bit register to power down
17 * SUPERIO_UART_PM_VAL The value for SUPERIO_UART_PM_REG to power the logical
18 * device down (required if SUPERIO_UART_PM_REG is defined)
19 * SUPERIO_UART_PM_LDN The logical device number to access the PM_REG
20 * bit (required if SUPERIO_UART_PM_REG is defined)
25 #ifndef SUPERIO_CHIP_NAME
26 # error "SUPERIO_CHIP_NAME is not defined."
29 #ifndef SUPERIO_UART_LDN
30 # error "SUPERIO_UART_LDN is not defined."
33 Device (SUPERIO_ID(SER, SUPERIO_UART_LDN)) {
34 Name (_HID, EisaId ("PNP0501"))
35 Name (_UID, SUPERIO_UID(SER, SUPERIO_UART_LDN))
36 #ifdef SUPERIO_UART_DDN
37 Name (_DDN, SUPERIO_UART_DDN)
42 PNP_GENERIC_STA(SUPERIO_UART_LDN)
47 PNP_GENERIC_DIS(SUPERIO_UART_LDN)
50 #ifdef SUPERIO_UART_PM_REG
52 PNP_GENERIC_PSC(SUPERIO_UART_PM_REG, SUPERIO_UART_PM_VAL, SUPERIO_UART_PM_LDN)
56 PNP_GENERIC_PS0(SUPERIO_UART_PM_REG, SUPERIO_UART_PM_VAL, SUPERIO_UART_PM_LDN)
60 PNP_GENERIC_PS3(SUPERIO_UART_PM_REG, SUPERIO_UART_PM_VAL, SUPERIO_UART_PM_LDN)
68 Method (_CRS, 0, Serialized)
70 Name (CRS, ResourceTemplate () {
71 IO (Decode16, 0x0000, 0x0000, 0x08, 0x08, IO0)
74 ENTER_CONFIG_MODE (SUPERIO_UART_LDN)
75 PNP_READ_IO(PNP_IO0, CRS, IO0)
76 PNP_READ_IRQ(PNP_IRQ0, CRS, IR0)
81 Name (_PRS, ResourceTemplate ()
83 StartDependentFn (0,0) {
84 IO (Decode16, 0x03f8, 0x03f8, 0x08, 0x08)
85 IRQNoFlags () {3,4,5,7,9,10,11,12}
87 StartDependentFn (0,0) {
88 IO (Decode16, 0x02f8, 0x02f8, 0x08, 0x08)
89 IRQNoFlags () {3,4,5,7,9,10,11,12}
91 StartDependentFn (1,0) {
92 IO (Decode16, 0x03e8, 0x03e8, 0x08, 0x08)
93 IRQNoFlags () {3,4,5,7,9,10,11,12}
95 StartDependentFn (1,0) {
96 IO (Decode16, 0x02e8, 0x02e8, 0x08, 0x08)
97 IRQNoFlags () {3,4,5,7,9,10,11,12}
99 StartDependentFn (2,0) {
100 IO (Decode16, 0x0100, 0x0ff8, 0x08, 0x08)
101 IRQNoFlags () {3,4,5,7,9,10,11,12}
106 Method (_SRS, 1, Serialized)
108 Name (TMPL, ResourceTemplate () {
109 IO (Decode16, 0x0000, 0x0000, 0x00, 0x00, IO0)
112 ENTER_CONFIG_MODE (SUPERIO_UART_LDN)
113 PNP_WRITE_IO(PNP_IO0, Arg0, IO0)
114 PNP_WRITE_IRQ(PNP_IRQ0, Arg0, IR0)
115 PNP_DEVICE_ACTIVE = 1