From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org, ian.campbell@citrix.com
Cc: patches@linaro.org, Julien Grall <julien.grall@linaro.org>,
stefano.stabellini@eu.citrix.com
Subject: [PATCH v2 3/8] xen/arm: Use define instead of hardcoded value in debug-pl011
Date: Wed, 31 Jul 2013 16:38:23 +0100 [thread overview]
Message-ID: <1375285109-3053-4-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1375285109-3053-1-git-send-email-julien.grall@linaro.org>
Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
xen/arch/arm/arm32/debug-pl011.inc | 18 ++++++++++--------
xen/include/asm-arm/pl011-uart.h | 1 +
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/xen/arch/arm/arm32/debug-pl011.inc b/xen/arch/arm/arm32/debug-pl011.inc
index 8b085b8..6a64dbf 100644
--- a/xen/arch/arm/arm32/debug-pl011.inc
+++ b/xen/arch/arm/arm32/debug-pl011.inc
@@ -16,19 +16,21 @@
* GNU General Public License for more details.
*/
+#include <asm/pl011-uart.h>
+
/* PL011 UART initialization
* rb: register which contains the UART base address
* rc: scratch register 1
* rd: scratch register 2 (unused here) */
.macro early_uart_init rb, rc, rd
mov \rc, #(7372800 / EARLY_PRINTK_BAUD % 16)
- str \rc, [\rb, #0x28] /* -> UARTFBRD (Baud divisor fraction) */
+ str \rc, [\rb, #FBRD] /* -> UARTFBRD (Baud divisor fraction) */
mov \rc, #(7372800 / EARLY_PRINTK_BAUD / 16)
- str \rc, [\rb, #0x24] /* -> UARTIBRD (Baud divisor integer) */
+ str \rc, [\rb, #IBRD] /* -> UARTIBRD (Baud divisor integer) */
mov \rc, #0x60 /* 8n1 */
- str \rc, [\rb, #0x2C] /* -> UARTLCR_H (Line control) */
- ldr \rc, =0x00000301 /* RXE | TXE | UARTEN */
- str \rc, [\rb, #0x30] /* -> UARTCR (Control Register) */
+ str \rc, [\rb, #LCR_H] /* -> UARTLCR_H (Line control) */
+ ldr \rc, =(RXE | TXE | UARTEN) /* RXE | TXE | UARTEN */
+ str \rc, [\rb, #CR] /* -> UARTCR (Control Register) */
.endm
/* PL011 UART wait UART to be ready to transmit
@@ -36,8 +38,8 @@
* rc: scratch register */
.macro early_uart_ready rb, rc
1:
- ldr \rc, [\rb, #0x18] /* <- UARTFR (Flag register) */
- tst \rc, #0x8 /* Check BUSY bit */
+ ldr \rc, [\rb, #FR] /* <- UARTFR (Flag register) */
+ tst \rc, #BUSY /* Check BUSY bit */
bne 1b /* Wait for the UART to be ready */
.endm
@@ -45,7 +47,7 @@
* rb: register which contains the UART base address
* rt: register which contains the character to transmit */
.macro early_uart_transmit rb, rt
- str \rt, [\rb] /* -> UARTDR (Data Register) */
+ str \rt, [\rb, #DR] /* -> UARTDR (Data Register) */
.endm
/*
diff --git a/xen/include/asm-arm/pl011-uart.h b/xen/include/asm-arm/pl011-uart.h
index 8c4edd4..3332c51 100644
--- a/xen/include/asm-arm/pl011-uart.h
+++ b/xen/include/asm-arm/pl011-uart.h
@@ -45,6 +45,7 @@
/* FR bits */
#define TXFE (1<<7) /* TX FIFO empty */
#define RXFE (1<<4) /* RX FIFO empty */
+#define BUSY (1<<3) /* Transmit is not complete */
/* LCR_H bits */
#define SPS (1<<7) /* Stick parity select */
--
1.7.10.4
next prev parent reply other threads:[~2013-07-31 15:38 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 15:38 [PATCH v2 0/8] Emulate virtual UART for DOM0 and some UART clean up Julien Grall
2013-07-31 15:38 ` [PATCH v2 2/8] pl011: Move registers' definition in a separate file Julien Grall
2013-08-01 11:01 ` Tim Deegan
2013-07-31 15:38 ` Julien Grall [this message]
2013-07-31 15:38 ` [PATCH v2 4/8] xen/arm: New callback in uart_driver to retrieve serial information Julien Grall
2013-08-01 11:03 ` Tim Deegan
2013-08-01 12:24 ` Julien Grall
2013-07-31 15:38 ` [PATCH v2 5/8] xen/arm: Implement a virtual UART Julien Grall
2013-08-01 11:22 ` Tim Deegan
2013-08-01 12:43 ` Julien Grall
2013-08-01 15:42 ` Ian Campbell
2013-07-31 15:38 ` [PATCH v2 6/8] exynos4210: rename UTRSTAT_TX_EMPTY in UTRSTAT_TXFE Julien Grall
2013-07-31 15:38 ` [PATCH v2 7/8] exynos4210: Implement vuart_info callback Julien Grall
2013-07-31 15:38 ` [PATCH v2 8/8] pl011: " Julien Grall
2013-08-01 11:28 ` [PATCH v2 0/8] Emulate virtual UART for DOM0 and some UART clean up Tim Deegan
2013-08-01 12:20 ` Julien Grall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375285109-3053-4-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=patches@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).