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 2/8] pl011: Move registers' definition in a separate file
Date: Thu, 25 Jul 2013 17:59:28 +0100 [thread overview]
Message-ID: <1374771574-7848-3-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1374771574-7848-1-git-send-email-julien.grall@linaro.org>
---
xen/drivers/char/pl011.c | 48 +----------------------
xen/include/asm-arm/pl011-uart.h | 80 ++++++++++++++++++++++++++++++++++++++
2 files changed, 81 insertions(+), 47 deletions(-)
create mode 100644 xen/include/asm-arm/pl011-uart.h
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 9456f20..fd87e68 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -28,6 +28,7 @@
#include <asm/device.h>
#include <xen/mm.h>
#include <xen/vmap.h>
+#include <asm/pl011-uart.h>
static struct pl011 {
unsigned int baud, clock_hz, data_bits, parity, stop_bits;
@@ -41,53 +42,6 @@ static struct pl011 {
/* bool_t probing, intr_works; */
} pl011_com = {0};
-/* PL011 register addresses */
-#define DR (0x00)
-#define RSR (0x04)
-#define FR (0x18)
-#define ILPR (0x20)
-#define IBRD (0x24)
-#define FBRD (0x28)
-#define LCR_H (0x2c)
-#define CR (0x30)
-#define IFLS (0x34)
-#define IMSC (0x38)
-#define RIS (0x3c)
-#define MIS (0x40)
-#define ICR (0x44)
-#define DMACR (0x48)
-
-/* CR bits */
-#define RXE (1<<9) /* Receive enable */
-#define TXE (1<<8) /* Transmit enable */
-#define UARTEN (1<<0) /* UART enable */
-
-/* FR bits */
-#define TXFE (1<<7) /* TX FIFO empty */
-#define RXFE (1<<4) /* RX FIFO empty */
-
-/* LCR_H bits */
-#define SPS (1<<7) /* Stick parity select */
-#define FEN (1<<4) /* FIFO enable */
-#define STP2 (1<<3) /* Two stop bits select */
-#define EPS (1<<2) /* Even parity select */
-#define PEN (1<<1) /* Parity enable */
-#define BRK (1<<0) /* Send break */
-
-/* Interrupt bits (IMSC, MIS, ICR) */
-#define OEI (1<<10) /* Overrun Error interrupt mask */
-#define BEI (1<<9) /* Break Error interrupt mask */
-#define PEI (1<<8) /* Parity Error interrupt mask */
-#define FEI (1<<7) /* Framing Error interrupt mask */
-#define RTI (1<<6) /* Receive Timeout interrupt mask */
-#define TXI (1<<5) /* Transmit interrupt mask */
-#define RXI (1<<4) /* Receive interrupt mask */
-#define DSRMI (1<<3) /* nUARTDSR Modem interrupt mask */
-#define DCDMI (1<<2) /* nUARTDCD Modem interrupt mask */
-#define CTSMI (1<<1) /* nUARTCTS Modem interrupt mask */
-#define RIMI (1<<0) /* nUARTRI Modem interrupt mask */
-#define ALLI OEI|BEI|PEI|FEI|RTI|TXI|RXI|DSRMI|DCDMI|CTSMI|RIMI
-
/* These parity settings can be ORed directly into the LCR. */
#define PARITY_NONE (0)
#define PARITY_ODD (PEN)
diff --git a/xen/include/asm-arm/pl011-uart.h b/xen/include/asm-arm/pl011-uart.h
new file mode 100644
index 0000000..8c4edd4
--- /dev/null
+++ b/xen/include/asm-arm/pl011-uart.h
@@ -0,0 +1,80 @@
+/*
+ * xen/include/asm-arm/pl011-uart.h
+ *
+ * Common constant definition between early printk and the UART driver
+ * for the pl011 UART
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011 Citrix Systems.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __ASM_ARM_PL011_H
+#define __ASM_ARM_PL011_H
+
+/* PL011 register addresses */
+#define DR (0x00)
+#define RSR (0x04)
+#define FR (0x18)
+#define ILPR (0x20)
+#define IBRD (0x24)
+#define FBRD (0x28)
+#define LCR_H (0x2c)
+#define CR (0x30)
+#define IFLS (0x34)
+#define IMSC (0x38)
+#define RIS (0x3c)
+#define MIS (0x40)
+#define ICR (0x44)
+#define DMACR (0x48)
+
+/* CR bits */
+#define RXE (1<<9) /* Receive enable */
+#define TXE (1<<8) /* Transmit enable */
+#define UARTEN (1<<0) /* UART enable */
+
+/* FR bits */
+#define TXFE (1<<7) /* TX FIFO empty */
+#define RXFE (1<<4) /* RX FIFO empty */
+
+/* LCR_H bits */
+#define SPS (1<<7) /* Stick parity select */
+#define FEN (1<<4) /* FIFO enable */
+#define STP2 (1<<3) /* Two stop bits select */
+#define EPS (1<<2) /* Even parity select */
+#define PEN (1<<1) /* Parity enable */
+#define BRK (1<<0) /* Send break */
+
+/* Interrupt bits (IMSC, MIS, ICR) */
+#define OEI (1<<10) /* Overrun Error interrupt mask */
+#define BEI (1<<9) /* Break Error interrupt mask */
+#define PEI (1<<8) /* Parity Error interrupt mask */
+#define FEI (1<<7) /* Framing Error interrupt mask */
+#define RTI (1<<6) /* Receive Timeout interrupt mask */
+#define TXI (1<<5) /* Transmit interrupt mask */
+#define RXI (1<<4) /* Receive interrupt mask */
+#define DSRMI (1<<3) /* nUARTDSR Modem interrupt mask */
+#define DCDMI (1<<2) /* nUARTDCD Modem interrupt mask */
+#define CTSMI (1<<1) /* nUARTCTS Modem interrupt mask */
+#define RIMI (1<<0) /* nUARTRI Modem interrupt mask */
+#define ALLI OEI|BEI|PEI|FEI|RTI|TXI|RXI|DSRMI|DCDMI|CTSMI|RIMI
+
+#endif /* __ASM_ARM_PL011_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
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 ` Julien Grall [this message]
2013-07-29 16:24 ` [PATCH 2/8] pl011: Move registers' definition in a separate file 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 ` [PATCH 3/8] xen/arm: Use define instead of hardcoded value in debug-pl011 Julien Grall
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-3-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).