diff mbox

[7/8] exynos4210: Implement serial_info callback

Message ID 1374771574-7848-8-git-send-email-julien.grall@linaro.org
State Superseded, archived
Headers show

Commit Message

Julien Grall July 25, 2013, 4:59 p.m. UTC
Signed-off-by: Julien Grall <julien.grall@linaro.org>
---
 xen/drivers/char/exynos4210-uart.c    |   15 +++++++++++++++
 xen/include/asm-arm/exynos4210-uart.h |    1 +
 2 files changed, 16 insertions(+)
diff mbox

Patch

diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index f7971da..9ed70c2 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -33,6 +33,7 @@  static struct exynos4210_uart {
     struct dt_irq irq;
     void *regs;
     struct irqaction irqaction;
+    struct serial_info info;
 } exynos4210_com = {0};
 
 /* These parity settings can be ORed directly into the ULCON. */
@@ -281,6 +282,13 @@  static const struct dt_irq __init *exynos4210_uart_dt_irq(struct serial_port *po
     return &uart->irq;
 }
 
+static const struct serial_info *exynos4210_uart_info(struct serial_port *port)
+{
+    struct exynos4210_uart *uart = port->uart;
+
+    return &uart->info;
+}
+
 static struct uart_driver __read_mostly exynos4210_uart_driver = {
     .init_preirq  = exynos4210_uart_init_preirq,
     .init_postirq = exynos4210_uart_init_postirq,
@@ -292,6 +300,7 @@  static struct uart_driver __read_mostly exynos4210_uart_driver = {
     .getc         = exynos4210_uart_getc,
     .irq          = exynos4210_uart_irq,
     .dt_irq_get   = exynos4210_uart_dt_irq,
+    .info         = exynos4210_uart_info,
 };
 
 /* TODO: Parse UART config from the command line */
@@ -337,6 +346,12 @@  static int __init exynos4210_uart_init(struct dt_device_node *dev,
         return res;
     }
 
+    uart->info.base_addr = addr;
+    uart->info.size = size;
+    uart->info.data_off = UTXH;
+    uart->info.status_off = UTRSTAT;
+    uart->info.status = UTRSTAT_TXE | UTRSTAT_TXFE;
+
     /* Register with generic serial driver. */
     serial_register_uart(SERHND_DTUART, &exynos4210_uart_driver, uart);
 
diff --git a/xen/include/asm-arm/exynos4210-uart.h b/xen/include/asm-arm/exynos4210-uart.h
index bd9a4be..e2ab4a4 100644
--- a/xen/include/asm-arm/exynos4210-uart.h
+++ b/xen/include/asm-arm/exynos4210-uart.h
@@ -88,6 +88,7 @@ 
 
 /* UTRSTAT */
 #define UTRSTAT_TXFE            (1 << 1)
+#define UTRSTAT_TXE             (1 << 2)
 
 /* URHX */
 #define URXH_DATA_MASK  (0xff)