]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
xen/arm: Define WLEN_8 macro and use it in debug-pl011
authorMichal Orzel <michal.orzel@amd.com>
Fri, 18 Nov 2022 11:46:18 +0000 (12:46 +0100)
committerJulien Grall <jgrall@amazon.com>
Tue, 6 Dec 2022 18:19:50 +0000 (18:19 +0000)
At the moment, early printk code for pl011 uses a hardcoded value
for 8n1 LCR configuration. Define and use macro WLEN_8 for that purpose
(no parity and 1 stop bit are defined as 0).

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Julien Grall <julien@xen.org>
xen/arch/arm/arm32/debug-pl011.inc
xen/arch/arm/arm64/debug-pl011.inc
xen/arch/arm/include/asm/pl011-uart.h

index 214f68dc95bdac2ec257d14b7aa267bd5a165d9e..c527f1d4424d0583998a549c63f4dfe775695a1a 100644 (file)
@@ -29,7 +29,7 @@
         str   \rc, [\rb, #FBRD]     /* -> UARTFBRD (Baud divisor fraction) */
         mov   \rc, #(7372800 / CONFIG_EARLY_UART_PL011_BAUD_RATE / 16)
         str   \rc, [\rb, #IBRD]     /* -> UARTIBRD (Baud divisor integer) */
-        mov   \rc, #0x60            /* 8n1 */
+        mov   \rc, #WLEN_8          /* 8n1 */
         str   \rc, [\rb, #LCR_H]     /* -> UARTLCR_H (Line control) */
         ldr   \rc, =(RXE | TXE | UARTEN)      /* RXE | TXE | UARTEN */
         str   \rc, [\rb, #CR]     /* -> UARTCR (Control Register) */
index d82f2f1de19706ca638278d26e45dcb17c688754..6d60e78c8ba3123ca7dfb22b25276fc05bfd6287 100644 (file)
@@ -28,7 +28,7 @@
         strh  w\c, [\xb, #FBRD]      /* -> UARTFBRD (Baud divisor fraction) */
         mov   x\c, #(7372800 / CONFIG_EARLY_UART_PL011_BAUD_RATE / 16)
         strh  w\c, [\xb, #IBRD]      /* -> UARTIBRD (Baud divisor integer) */
-        mov   x\c, #0x60             /* 8n1 */
+        mov   x\c, #WLEN_8           /* 8n1 */
         str   w\c, [\xb, #LCR_H]     /* -> UARTLCR_H (Line control) */
         ldr   x\c, =(RXE | TXE | UARTEN)
         str   w\c, [\xb, #CR]        /* -> UARTCR (Control Register) */
index 57e9ec73ac19f5b73a0ac60a8d3fee9909ef1d54..5bb563ec0814c6723bb8d3476f6a1000aca6311f 100644 (file)
@@ -55,6 +55,7 @@
 
 /* LCR_H bits */
 #define SPS    (1<<7) /* Stick parity select */
+#define WLEN_8 (_AC(0x3, U) << 5) /* 8 bits word length */
 #define FEN    (1<<4) /* FIFO enable */
 #define STP2   (1<<3) /* Two stop bits select */
 #define EPS    (1<<2) /* Even parity select */