xen/arm: Define WLEN_8 macro and use it in debug-pl011

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>
This commit is contained in:
Michal Orzel authored and Julien Grall committed 2022-12-06 18:19:50 +00:00
1 parent dae2839c54
commit 3d0290e528
3 files changed
+3 -2

No files matched your search

+1 -1
View 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) */
+1 -1
View 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) */
+1
View 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 */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.