From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, Keir Fraser <keir@xen.org>,
ian.campbell@citrix.com, Julien Grall <julien.grall@linaro.org>,
Stefano.Stabellini@eu.citrix.com
Subject: [PATCH 4/8] xen/arm: New callback in uart_driver to retrieve serial information
Date: Thu, 25 Jul 2013 17:59:30 +0100 [thread overview]
Message-ID: <1374771574-7848-5-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1374771574-7848-1-git-send-email-julien.grall@linaro.org>
There is no way to retrieve basic informations (base address, size, ....) for
an UART. This callback will be used later to partially emulate the real UART
for DOM0 on ARM.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
CC: Keir Fraser <keir@xen.org>
---
xen/drivers/char/serial.c | 8 ++++++++
xen/include/xen/serial.h | 13 +++++++++++++
2 files changed, 21 insertions(+)
diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c
index e1c3f47..7640f8e 100644
--- a/xen/drivers/char/serial.c
+++ b/xen/drivers/char/serial.c
@@ -497,6 +497,14 @@ const struct dt_irq __init *serial_dt_irq(int idx)
return NULL;
}
+const struct serial_info *serial_info(int idx)
+{
+ if ( (idx >= 0) && (idx < ARRAY_SIZE(com)) &&
+ com[idx].driver && com[idx].driver->info )
+ return com[idx].driver->info(&com[idx]);
+
+ return NULL;
+}
void serial_suspend(void)
{
diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h
index 9caf776..c312032 100644
--- a/xen/include/xen/serial.h
+++ b/xen/include/xen/serial.h
@@ -32,6 +32,14 @@ enum serial_port_state {
serial_initialized
};
+struct serial_info {
+ unsigned long base_addr; /* Base address of the UART */
+ unsigned long size; /* Size of the memory region */
+ unsigned long data_off; /* Data register offset */
+ unsigned long status_off; /* Status register offset */
+ unsigned long status; /* Ready status value */
+};
+
struct serial_port {
/* Uart-driver parameters. */
struct uart_driver *driver;
@@ -74,6 +82,8 @@ struct uart_driver {
int (*irq)(struct serial_port *);
/* Get IRQ device node for this port's serial line: returns NULL if none. */
const struct dt_irq *(*dt_irq_get)(struct serial_port *);
+ /* Get serial information */
+ const struct serial_info *(*info)(struct serial_port *);
};
/* 'Serial handles' are composed from the following fields. */
@@ -127,6 +137,9 @@ int serial_irq(int idx);
/* Return irq device node for specified serial port (identified by index). */
const struct dt_irq *serial_dt_irq(int idx);
+/* Retrieve basic UART information (base address, size, ...) */
+const struct serial_info* serial_info(int idx);
+
/* Serial suspend/resume. */
void serial_suspend(void);
void serial_resume(void);
--
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 ` [PATCH 3/8] xen/arm: Use define instead of hardcoded value in debug-pl011 Julien Grall
2013-07-25 16:59 ` Julien Grall [this message]
2013-07-29 16:29 ` [PATCH 4/8] xen/arm: New callback in uart_driver to retrieve serial information 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-5-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=keir@xen.org \
--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).