From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, ian.campbell@citrix.com,
Julien Grall <julien.grall@linaro.org>,
Stefano.Stabellini@eu.citrix.com
Subject: [PATCH 3/8] xen/arm: Use define instead of hardcoded value in debug-pl011
Date: Thu, 25 Jul 2013 17:59:29 +0100 [thread overview]
Message-ID: <1374771574-7848-4-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1374771574-7848-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-25 16:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 16:59 [PATCH 0/8] Emulate virtual UART for DOM0 and some UART clean up Julien Grall
2013-07-25 16:59 ` [PATCH 2/8] pl011: Move registers' definition in a separate file Julien Grall
2013-07-29 16:24 ` Ian Campbell
2013-07-29 16:35 ` Julien Grall
2013-07-30 10:00 ` Ian Campbell
2013-07-30 10:19 ` Julien Grall
2013-07-25 16:59 ` Julien Grall [this message]
2013-07-25 16:59 ` [PATCH 4/8] xen/arm: New callback in uart_driver to retrieve serial information Julien Grall
2013-07-29 16:29 ` Ian Campbell
2013-07-29 16:36 ` Julien Grall
2013-07-25 16:59 ` [PATCH 5/8] xen/arm: Implement a virtual UART Julien Grall
2013-07-29 16:26 ` Ian Campbell
2013-07-29 16:40 ` Julien Grall
2013-07-30 10:07 ` Ian Campbell
2013-07-25 16:59 ` [PATCH 6/8] exynos4210: rename UTRSTAT_TX_EMPTY in UTRSTAT_TXFE Julien Grall
2013-07-29 16:27 ` Ian Campbell
2013-07-29 16:46 ` Julien Grall
2013-07-25 16:59 ` [PATCH 7/8] exynos4210: Implement serial_info callback Julien Grall
2013-07-25 16:59 ` [PATCH 8/8] pl011: " Julien Grall
[not found] ` <1374771574-7848-2-git-send-email-julien.grall@linaro.org>
2013-07-29 16:23 ` [PATCH 1/8] pl011: Use ioreadl/iowritel Ian Campbell
2013-07-29 16:30 ` 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=1374771574-7848-4-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=patches@linaro.org \
--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).