[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 3/3] xen/arm: Define WLEN_8 macro and use it in debug-pl011


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 18 Nov 2022 12:46:18 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BLyLFkVOT6VDwHO40q+5e8h3AFqIk0VudNJgD0mykWM=; b=XZuUah50qEbm4QeldakUYzzKCQqa56wNge18j0Bb5/nYQqXWr3KszLEdTcF2bUsDbTqw+ODTig8liViSWl+51xtg+fjB9WhdA63ZxVCjQrvD3rPUOdqKlUl4rcjUMWVv6aKs1293ilWVuA8/byh8STC7fzlSdopHkdX6eICBJVPKdyAJW0jTA0aBxMNPFDciA/nr8QOeeoZ4eNyqgy/FADoAJPBOuSC2J9uRRSK+opotKZzjoMpWZDcHar8VikRgXNFyjt2m28P47dJyGy0BZDo4rFOcUR4KSs6IcDlNI9cUcACCTTaQ3Yq0zziPmQCV2RHP2sgnSPxfnaia8cN0UA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DNslExaHwLxCIlRRrIFAKZ+bOJn4Hpf+eBD+YsBKEhvDji2q7K+u2l9ita1Ndex5n1KBttfFkWKisg2Mzpqbj1jzoOwog2xXNTDC6rQ+wid/pJpUa6plE2V281Kbk6+IAXFFooD23WC/CcX+6Q+KB3hdZI3Y70a+vWsWX67fe5nXHOWdo1+rKQhBEngnsr2eE8xG8GejgRFTjEuTcWAnakdf/DKjbM7DVJKJQHexm4jijAtl6+lwReCKIJRJC03lkwheYL42b96DvIGUvtOjht3FIDca4KXFJinOzeLjpEqfHawSnPfEAOOymGgnLKR9o+UsH/3YFKvSB3bb1FFjIg==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 18 Nov 2022 11:47:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxx>
---
 xen/arch/arm/arm32/debug-pl011.inc    | 2 +-
 xen/arch/arm/arm64/debug-pl011.inc    | 2 +-
 xen/arch/arm/include/asm/pl011-uart.h | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/arm32/debug-pl011.inc 
b/xen/arch/arm/arm32/debug-pl011.inc
index 214f68dc95bd..c527f1d4424d 100644
--- a/xen/arch/arm/arm32/debug-pl011.inc
+++ b/xen/arch/arm/arm32/debug-pl011.inc
@@ -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) */
diff --git a/xen/arch/arm/arm64/debug-pl011.inc 
b/xen/arch/arm/arm64/debug-pl011.inc
index d82f2f1de197..6d60e78c8ba3 100644
--- a/xen/arch/arm/arm64/debug-pl011.inc
+++ b/xen/arch/arm/arm64/debug-pl011.inc
@@ -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) */
diff --git a/xen/arch/arm/include/asm/pl011-uart.h 
b/xen/arch/arm/include/asm/pl011-uart.h
index 57e9ec73ac19..5bb563ec0814 100644
--- a/xen/arch/arm/include/asm/pl011-uart.h
+++ b/xen/arch/arm/include/asm/pl011-uart.h
@@ -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 */
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.