1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #if CONFIG(ACPI_CONSOLE)
7 Name (UFLG, CONFIG(CONSOLE_SERIAL))
9 Method (LURT, 1, Serialized)
11 If (Arg0 == 0) { /* 0 = 0x3f8 */
13 } ElseIf (Arg0 == 1) { /* 1 = 0x2f8 */
15 } ElseIf (Arg0 == 2) { /* 2 = 0x3e8 */
17 } ElseIf (Arg0 == 3) { /* 3 = 0x2e8 */
23 #if CONFIG(DRIVERS_UART_8250MEM_32)
24 OperationRegion (UBAR, SystemMemory,
25 CONFIG_CONSOLE_UART_BASE_ADDRESS, 24)
26 Field (UBAR, AnyAcc, NoLock, Preserve)
28 TDR, 8, /* Transmit Data Register BAR + 0x000 */
30 IER, 8, /* Interrupt Enable Register BAR + 0x004 */
32 IIR, 8, /* Interrupt Identification Register BAR + 0x008 */
34 LCR, 8, /* Line Control Register BAR + 0x00C */
36 MCR, 8, /* Modem Control Register BAR + 0x010 */
38 LSR, 8, /* Line Status Register BAR + 0x014 */
42 OperationRegion (UBAR, SystemIO, LURT (CONFIG_UART_FOR_CONSOLE), 6)
43 Field (UBAR, ByteAcc, NoLock, Preserve)
45 TDR, 8, /* Transmit Data Register IO Port + 0x0 */
46 IER, 8, /* Interrupt Enable Register IO Port + 0x1 */
47 IIR, 8, /* Interrupt Identification Register IO Port + 0x2 */
48 LCR, 8, /* Line Control Register IO Port + 0x3 */
49 MCR, 8, /* Modem Control Register IO Port + 0x4 */
50 LSR, 8 /* Line Status Register IO Port + 0x5 */
54 Method (APRT, 1, Serialized)
59 Name(ADBG, Buffer(256) {0})
61 If (ObjectType(Arg0) == 1) { /* Integer */
62 ToHexString(Arg0, Local0)
64 } ElseIf (ObjectType(Arg0) == 2) { /* String */
66 } ElseIf (ObjectType(Arg0) == 3) { /* Buffer */
67 ToHexString(Arg0, ADBG)
69 ADBG = "This type of object is not supported"
72 While (DeRefOf(ADBG[INDX]) != 0)
76 LENG = INDX /* Length of the String */
79 /* Enable Baud Rate Divisor Latch, Set Word length to 8 bit*/
84 /* Configure baud rate to 115200 */
87 LCR = 0x03 /* Disable Baud Rate Divisor Latch */
94 /* Wait for the transmitter t to be ready */
103 TDR = DeRefOf (ADBG[INDX])