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

[PATCH] xen/arm: debug-pl011.inc: Use macros instead of hardcoded values


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 24 Oct 2022 12:05:36 +0200
  • 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=Jxdh7z1RpU2y6bgq109Srd+Y2p8XscsWMuLz0iwZ6eg=; b=ENoswiOFlTQ+V5LeUWuR7Wk/XbRR2pij47eyCHmsNC1rlFfS08rUD6kSxZG7Yz/IB4R9dYyRBXPUWqy6oK2JNeRkiv6j3P4m6JsSSGV69soeXdYVYN6O4JU/683IGiO0IUYGcDl3B8Ff/8TalqlelTSU3ymfE0NozLKEE+o/T2q/x6C/KZdT/9LhQzmaF6Tk4qB/eE1O5U6PKfnQUu34GkEYqr4xenOVdVwlp+whlM9FUG+uQfYQIjKVsne9vpYfmWQHwQWSeVgOQoJLnPmprY01p5lfPpPfMDH8mRg2gOXQx3Rgi3Adg0XgDvijjkMzJwJdwWuqMZQTb7tmgblcGg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=giqtVBAxTHKspMB9wB24mQFQHYWe45oZpxMLgvyzz62TILr+sxlRpbJA1odjxhvukp5sUX0N1wugKuCUJkG2Cj5f0x8cWpE/GJwmNLs+oy1nNXBdV1Mc0V6m8NG7r9IXjqcrQsVYQI8fJtKNDYzvBGa7nYQThAp4HpN7aedp7ivPSIYbMDJ0DVKbe2KSQTUGYjDR9F83K8QRwwpX1eS15syZlMc/mI/13Vi1mNCdEn7Zu45SYau7irfF+6TB/OW8CfnP6fhpduMDPYRYuuylnkM1sT+KHfq9KhjQLQDKDfb1tu+68kqNbBiR973gtV8Dl0/lFnkC0NXm0f5FPRQZhQ==
  • 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: Mon, 24 Oct 2022 10:05:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Make use of the macros defined in asm/pl011-uart.h instead of hardcoding
the values. Also, take the opportunity to fix the file extension in a
top-level comment.

No functional change intended.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/arm64/debug-pl011.inc | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/arm64/debug-pl011.inc 
b/xen/arch/arm/arm64/debug-pl011.inc
index 1928a2e3ffbb..d82f2f1de197 100644
--- a/xen/arch/arm/arm64/debug-pl011.inc
+++ b/xen/arch/arm/arm64/debug-pl011.inc
@@ -1,5 +1,5 @@
 /*
- * xen/arch/arm/arm64/debug-pl011.S
+ * xen/arch/arm/arm64/debug-pl011.inc
  *
  * PL011 specific debug code
  *
@@ -16,6 +16,8 @@
  * GNU General Public License for more details.
  */
 
+ #include <asm/pl011-uart.h>
+
 /*
  * PL011 UART initialization
  * xb: register which containts the UART base address
@@ -23,13 +25,13 @@
  */
 .macro early_uart_init xb, c
         mov   x\c, #(7372800 / CONFIG_EARLY_UART_PL011_BAUD_RATE % 16)
-        strh  w\c, [\xb, #0x28]      /* -> UARTFBRD (Baud divisor fraction) */
+        strh  w\c, [\xb, #FBRD]      /* -> UARTFBRD (Baud divisor fraction) */
         mov   x\c, #(7372800 / CONFIG_EARLY_UART_PL011_BAUD_RATE / 16)
-        strh  w\c, [\xb, #0x24]      /* -> UARTIBRD (Baud divisor integer) */
+        strh  w\c, [\xb, #IBRD]      /* -> UARTIBRD (Baud divisor integer) */
         mov   x\c, #0x60             /* 8n1 */
-        str   w\c, [\xb, #0x2C]      /* -> UARTLCR_H (Line control) */
-        ldr   x\c, =0x00000301       /* RXE | TXE | UARTEN */
-        str   w\c, [\xb, #0x30]      /* -> UARTCR (Control Register) */
+        str   w\c, [\xb, #LCR_H]     /* -> UARTLCR_H (Line control) */
+        ldr   x\c, =(RXE | TXE | UARTEN)
+        str   w\c, [\xb, #CR]        /* -> UARTCR (Control Register) */
 .endm
 
 /*
@@ -39,8 +41,8 @@
  */
 .macro early_uart_ready xb, c
 1:
-        ldrh  w\c, [\xb, #0x18]      /* <- UARTFR (Flag register) */
-        tst   w\c, #0x8              /* Check BUSY bit */
+        ldrh  w\c, [\xb, #FR]        /* <- UARTFR (Flag register) */
+        tst   w\c, #BUSY             /* Check BUSY bit */
         b.ne  1b                     /* Wait for the UART to be ready */
 .endm
 
@@ -50,7 +52,7 @@
  * wt: register which contains the character to transmit
  */
 .macro early_uart_transmit xb, wt
-        strb  \wt, [\xb]             /* -> UARTDR (Data Register) */
+        strb  \wt, [\xb, #DR]        /* -> UARTDR (Data Register) */
 .endm
 
 /*
-- 
2.25.1




 


Rackspace

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