[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/8] xen/arm: New callback in uart_driver to retrieve serial information



On Thu, 2013-07-25 at 17:59 +0100, Julien Grall wrote:
> 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.

The serial_info name makes me think it is going to contain the baud
rate, parity bits etc.

Since this is (I suppose) going to be used by your vuart code perhaps
vuart_info?

> 
> Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
> CC: Keir Fraser <keir@xxxxxxx>
> ---
>  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);



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.