From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
"patches@linaro.org" <patches@linaro.org>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH V2 21/33] xen/arm: Use device tree API in pl011 UART driver
Date: Wed, 08 May 2013 17:23:39 +0100 [thread overview]
Message-ID: <518A7C0B.7010500@linaro.org> (raw)
In-Reply-To: <1368026240.17285.23.camel@zakaz.uk.xensource.com>
On 05/08/2013 04:17 PM, Ian Campbell wrote:
> On Wed, 2013-05-08 at 03:33 +0100, Julien Grall wrote:
>> @@ -227,32 +239,56 @@ static struct uart_driver __read_mostly pl011_driver = {
>> .tx_ready = pl011_tx_ready,
>> .putc = pl011_putc,
>> .getc = pl011_getc,
>> - .irq = pl011_irq
>> + .irq = pl011_irq,
>> + .dt_irq_get = pl011_dt_irq,
>> };
>>
>> -/* TODO: Parse UART config from device-tree or command-line */
>> -
>> -void __init pl011_init(int index, unsigned long register_base_address)
>> +/* TODO: Parse UART config from the command line */
>> +static int __init pl011_uart_init(struct dt_device_node *dev,
>> + const void *data)
>> {
>> + const struct serial_arm_defaults *defaults = data;
>> struct pl011 *uart;
>> + int res;
>>
>> - if ( (index < 0) || (index > 1) )
>> - return;
>> + if ( (defaults->index < 0) || (defaults->index > 1) )
>> + return -EINVAL;
>>
>> - uart = &pl011_com[index];
>> + uart = &pl011_com[defaults->index];
>>
>> uart->clock_hz = 0x16e3600;
>> uart->baud = 38400;
>> uart->data_bits = 8;
>> uart->parity = PARITY_NONE;
>> uart->stop_bits = 1;
>> - uart->irq = 37; /* TODO Need to find this from devicetree */
>> - uart->regs = (uint32_t *) register_base_address;
>> + uart->regs = (uint32_t *) defaults->register_base_address;
>
> Should this not come from struct dt_device_node?
>
> Perhaps the driver needs to be instantiating its own FIXMAP mapping
> instead of doing it in common code? In fact can we not get rid of the
> fixmap for the runtime (not early) console and use the ioremap stuff
> which Stefano just enabled with his vmap patches, or the early_ioremap
> stuff if necessary.
Right. I will use ioremap in the next patch series.
> That does then call into question the whole serial_arm_defaults thing.
> Perhaps index should just be the order in which they are registered (and
> at the moment it is effectively hardcoded to 0 anyway)
I'm thinking about using serial_arm_defaults for baud rate,... For the
moment the different values are hardcoded.
{arm,dt}_init_uart will parse the dtuart parameters on the command line
and then fill serial_arm_defaults.
--
Julien
next prev parent reply other threads:[~2013-05-08 16:23 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 2:33 [PATCH V2 00/33] Support multiple ARM platforms in Xen Julien Grall
2013-05-08 2:33 ` [PATCH V2 01/33] xen/arm: lr must be included in range [0-nr_lr( Julien Grall
2013-05-08 2:33 ` [PATCH V2 02/33] xen/arm: don't allow dom0 to access to vpl011 UART0 memory range Julien Grall
2013-05-08 2:33 ` [PATCH V2 03/33] xen/arm: Remove duplicated GICD_ICPIDR2 definition Julien Grall
2013-05-08 2:33 ` [PATCH V2 04/33] xen/arm: Bump early printk internal buffer to 512 Julien Grall
2013-05-08 13:00 ` Ian Campbell
2013-05-09 14:32 ` Julien Grall
2013-05-09 14:46 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 05/33] xen/arm: Fix early_panic when EARLY_PRINTK is disabled Julien Grall
2013-05-08 2:33 ` [PATCH V2 06/33] xen/arm: Load dtb after dom0 kernel Julien Grall
2013-05-08 2:33 ` [PATCH V2 07/33] xen/arm: Create a hierarchical device tree Julien Grall
2013-05-08 13:11 ` Ian Campbell
2013-05-08 13:34 ` Julien Grall
2013-05-08 13:41 ` Ian Campbell
2013-05-08 15:15 ` Julien Grall
2013-05-08 15:34 ` Ian Campbell
2013-05-09 14:38 ` Julien Grall
2013-05-09 14:43 ` Ian Campbell
2013-05-09 14:55 ` Julien Grall
2013-05-08 13:52 ` Ian Campbell
2013-05-08 15:22 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 08/33] xen/arm: Add helpers to use the " Julien Grall
2013-05-08 13:18 ` Ian Campbell
2013-05-08 15:31 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 09/33] xen/arm: Add helpers to retrieve an address from " Julien Grall
2013-05-08 13:23 ` Ian Campbell
2013-05-08 15:32 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 10/33] xen/arm: Add helpers to retrieve an interrupt description " Julien Grall
2013-05-08 13:30 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 11/33] xen/arm: Introduce gic_route_dt_irq Julien Grall
2013-05-08 13:31 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 12/33] xen/arm: Introduce gic_irq_xlate Julien Grall
2013-05-08 13:32 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 13/33] xen/arm: Introduce setup_dt_irq Julien Grall
2013-05-08 13:35 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 14/33] xen/arm: Introduce request_dt_irq Julien Grall
2013-05-08 13:41 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 15/33] xen/arm: Use hierarchical device tree to retrieve GIC information Julien Grall
2013-05-08 13:46 ` Ian Campbell
2013-05-08 15:49 ` Julien Grall
2013-05-08 15:56 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 16/33] xen/arm: Retrieve timer interrupts from the device tree Julien Grall
2013-05-08 13:50 ` Ian Campbell
2013-05-08 15:53 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 17/33] xen/arm: Don't hardcode VGIC informations Julien Grall
2013-05-08 2:33 ` [PATCH V2 18/33] xen/arm: Introduce a generic way to use a device from the device tree Julien Grall
2013-05-08 13:52 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 19/33] xen/arm: New callback in uart_driver to get device tree interrupt structure Julien Grall
2013-05-08 2:33 ` [PATCH V2 20/33] xen/arm: Add generic UART to get the device in the device tree Julien Grall
2013-05-08 14:01 ` Ian Campbell
2013-05-08 15:58 ` Julien Grall
2013-05-08 16:41 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 21/33] xen/arm: Use device tree API in pl011 UART driver Julien Grall
2013-05-08 15:17 ` Ian Campbell
2013-05-08 16:23 ` Julien Grall [this message]
2013-05-08 16:43 ` Ian Campbell
2013-05-08 16:55 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 22/33] xen/arm: Use the device tree to map the address range and IRQ to dom0 Julien Grall
2013-05-08 15:28 ` Ian Campbell
2013-05-08 16:59 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 23/33] xen/arm: Allow Xen to run on multiple platform without recompilation Julien Grall
2013-05-08 15:32 ` Ian Campbell
2013-05-08 15:35 ` Ian Campbell
2013-05-08 16:32 ` Julien Grall
2013-05-08 16:38 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 24/33] xen/arm: WORKAROUND 1:1 memory mapping for dom0 Julien Grall
2013-05-08 15:54 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 25/33] xen/arm: Add versatile express platform Julien Grall
2013-05-08 2:33 ` [PATCH V2 26/33] xen/arm: remove request_irq Julien Grall
2013-05-09 9:59 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 27/33] xen/arm: remove setup_irq Julien Grall
2013-05-09 10:00 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 28/33] xen/arm: Don't use pl011 UART by default for early printk Julien Grall
2013-05-09 10:10 ` Ian Campbell
2013-05-09 13:14 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 29/33] xen/arm: Add exynos 4210 UART support Julien Grall
2013-05-09 10:13 ` Ian Campbell
2013-05-09 18:33 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 30/33] xen/arm: Add Exynos 4210 UART support for early printk Julien Grall
2013-05-09 10:16 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 31/33] xen/arm: Add platform specific code for the exynos5 Julien Grall
2013-05-09 10:19 ` Ian Campbell
2013-05-09 13:03 ` Julien Grall
2013-05-08 2:33 ` [PATCH V2 32/33] xen/arm: WORKAROUND Support kick cpus and switch to hypervisor " Julien Grall
2013-05-09 10:24 ` Ian Campbell
2013-05-08 2:33 ` [PATCH V2 33/33] xen/arm64: Remove hardcoded value for gic in assembly code Julien Grall
2013-05-08 7:03 ` [PATCH V2 00/33] Support multiple ARM platforms in Xen Gihun Jung
2013-05-08 11:01 ` 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=518A7C0B.7010500@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=Stefano.Stabellini@eu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.