* [PATCH] pl011: early_panic if baud rate not set in hardware
@ 2013-08-22 16:01 Ian Campbell
2013-08-22 16:34 ` Julien Grall
0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2013-08-22 16:01 UTC (permalink / raw)
To: xen-devel; +Cc: julien.grall, tim, Ian Campbell, stefano.stabellini
Now that the driver defaults to BAUD_AUTO this can happen if the early uart !=
console or if early printk isn't in use.
The following division by zero causes a trap but that uses regular printk and
not early_printk, so it is never seen.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
xen/drivers/char/pl011.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 0e1eb64..7eb90b0 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -104,6 +104,8 @@ static void __init pl011_init_preirq(struct serial_port *port)
{
/* Baud rate already set: read it out from the divisor latch. */
divisor = (pl011_read(uart, IBRD) << 6) | (pl011_read(uart, FBRD));
+ if (!divisor)
+ early_panic("pl011: No Baud rate configured\n");
uart->baud = (uart->clock_hz << 2) / divisor;
}
/* This write must follow FBRD and IBRD writes. */
--
1.7.2.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] pl011: early_panic if baud rate not set in hardware
2013-08-22 16:01 [PATCH] pl011: early_panic if baud rate not set in hardware Ian Campbell
@ 2013-08-22 16:34 ` Julien Grall
2013-08-22 18:49 ` Ian Campbell
2013-08-27 13:46 ` Ian Campbell
0 siblings, 2 replies; 6+ messages in thread
From: Julien Grall @ 2013-08-22 16:34 UTC (permalink / raw)
To: Ian Campbell; +Cc: stefano.stabellini, tim, xen-devel
On 08/22/2013 05:01 PM, Ian Campbell wrote:
> Now that the driver defaults to BAUD_AUTO this can happen if the early uart !=
> console or if early printk isn't in use.
Does the fast model set correctly the baud rate?
> The following division by zero causes a trap but that uses regular printk and
> not early_printk, so it is never seen.
That's annoying. I often have this problem, is there any plan to support
early print in printk?
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
> ---
> xen/drivers/char/pl011.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
> index 0e1eb64..7eb90b0 100644
> --- a/xen/drivers/char/pl011.c
> +++ b/xen/drivers/char/pl011.c
> @@ -104,6 +104,8 @@ static void __init pl011_init_preirq(struct serial_port *port)
> {
> /* Baud rate already set: read it out from the divisor latch. */
> divisor = (pl011_read(uart, IBRD) << 6) | (pl011_read(uart, FBRD));
> + if (!divisor)
> + early_panic("pl011: No Baud rate configured\n");
> uart->baud = (uart->clock_hz << 2) / divisor;
> }
> /* This write must follow FBRD and IBRD writes. */
>
--
Julien Grall
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pl011: early_panic if baud rate not set in hardware
2013-08-22 16:34 ` Julien Grall
@ 2013-08-22 18:49 ` Ian Campbell
2013-08-22 21:09 ` Julien Grall
2013-08-27 13:46 ` Ian Campbell
1 sibling, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2013-08-22 18:49 UTC (permalink / raw)
To: Julien Grall; +Cc: stefano.stabellini, tim, xen-devel
On Thu, 2013-08-22 at 17:34 +0100, Julien Grall wrote:
> On 08/22/2013 05:01 PM, Ian Campbell wrote:
> > Now that the driver defaults to BAUD_AUTO this can happen if the early uart !=
> > console or if early printk isn't in use.
>
> Does the fast model set correctly the baud rate?
No.
> > The following division by zero causes a trap but that uses regular printk and
> > not early_printk, so it is never seen.
>
> That's annoying. I often have this problem, is there any plan to support
> early print in printk?
TBH I thought it was somewhere (far down) your todo list. Maybe I'll
have a poke at it tomorrow.
>
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Acked-by: Julien Grall <julien.grall@linaro.org>
> > ---
> > xen/drivers/char/pl011.c | 2 ++
> > 1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
> > index 0e1eb64..7eb90b0 100644
> > --- a/xen/drivers/char/pl011.c
> > +++ b/xen/drivers/char/pl011.c
> > @@ -104,6 +104,8 @@ static void __init pl011_init_preirq(struct serial_port *port)
> > {
> > /* Baud rate already set: read it out from the divisor latch. */
> > divisor = (pl011_read(uart, IBRD) << 6) | (pl011_read(uart, FBRD));
> > + if (!divisor)
> > + early_panic("pl011: No Baud rate configured\n");
> > uart->baud = (uart->clock_hz << 2) / divisor;
> > }
> > /* This write must follow FBRD and IBRD writes. */
> >
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pl011: early_panic if baud rate not set in hardware
2013-08-22 18:49 ` Ian Campbell
@ 2013-08-22 21:09 ` Julien Grall
2013-08-23 0:41 ` Chen Baozi
0 siblings, 1 reply; 6+ messages in thread
From: Julien Grall @ 2013-08-22 21:09 UTC (permalink / raw)
To: Ian Campbell; +Cc: Stefano Stabellini, tim, xen-devel@lists.xen.org
On 22 August 2013 19:49, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Thu, 2013-08-22 at 17:34 +0100, Julien Grall wrote:
>> On 08/22/2013 05:01 PM, Ian Campbell wrote:
>> > Now that the driver defaults to BAUD_AUTO this can happen if the early uart !=
>> > console or if early printk isn't in use.
>>
>> Does the fast model set correctly the baud rate?
>
> No.
Ok. So we need U-boot to boot Xen on the fast model.
>
>> > The following division by zero causes a trap but that uses regular printk and
>> > not early_printk, so it is never seen.
>>
>> That's annoying. I often have this problem, is there any plan to support
>> early print in printk?
>
> TBH I thought it was somewhere (far down) your todo list. Maybe I'll
> have a poke at it tomorrow.
It's not on my priority list :). I would be happy if someone work on this item.
>>
>> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> Acked-by: Julien Grall <julien.grall@linaro.org>
>> > ---
>> > xen/drivers/char/pl011.c | 2 ++
>> > 1 files changed, 2 insertions(+), 0 deletions(-)
>> >
>> > diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
>> > index 0e1eb64..7eb90b0 100644
>> > --- a/xen/drivers/char/pl011.c
>> > +++ b/xen/drivers/char/pl011.c
>> > @@ -104,6 +104,8 @@ static void __init pl011_init_preirq(struct serial_port *port)
>> > {
>> > /* Baud rate already set: read it out from the divisor latch. */
>> > divisor = (pl011_read(uart, IBRD) << 6) | (pl011_read(uart, FBRD));
>> > + if (!divisor)
>> > + early_panic("pl011: No Baud rate configured\n");
>> > uart->baud = (uart->clock_hz << 2) / divisor;
>> > }
>> > /* This write must follow FBRD and IBRD writes. */
>> >
>>
>>
>
>
--
Julien Grall
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pl011: early_panic if baud rate not set in hardware
2013-08-22 21:09 ` Julien Grall
@ 2013-08-23 0:41 ` Chen Baozi
0 siblings, 0 replies; 6+ messages in thread
From: Chen Baozi @ 2013-08-23 0:41 UTC (permalink / raw)
To: Julien Grall
Cc: xen-devel@lists.xen.org, tim, Ian Campbell, Stefano Stabellini
On Aug 23, 2013, at 5:09 AM, Julien Grall <julien.grall@linaro.org> wrote:
> On 22 August 2013 19:49, Ian Campbell <Ian.Campbell@citrix.com> wrote:
>> On Thu, 2013-08-22 at 17:34 +0100, Julien Grall wrote:
>>> On 08/22/2013 05:01 PM, Ian Campbell wrote:
>>>> Now that the driver defaults to BAUD_AUTO this can happen if the early uart !=
>>>> console or if early printk isn't in use.
>>>
>>> Does the fast model set correctly the baud rate?
>>
>> No.
>
> Ok. So we need U-boot to boot Xen on the fast model.
Some one posted a ARM64 support for fast model on u-boot recently.
See: http://lists.denx.de/pipermail/u-boot/2013-August/161120.html
Hope it would be helpful.
Cheers,
Baozi
>
>>
>>>> The following division by zero causes a trap but that uses regular printk and
>>>> not early_printk, so it is never seen.
>>>
>>> That's annoying. I often have this problem, is there any plan to support
>>> early print in printk?
>>
>> TBH I thought it was somewhere (far down) your todo list. Maybe I'll
>> have a poke at it tomorrow.
>
> It's not on my priority list :). I would be happy if someone work on this item.
>
>>>
>>>> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>>> Acked-by: Julien Grall <julien.grall@linaro.org>
>>>> ---
>>>> xen/drivers/char/pl011.c | 2 ++
>>>> 1 files changed, 2 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
>>>> index 0e1eb64..7eb90b0 100644
>>>> --- a/xen/drivers/char/pl011.c
>>>> +++ b/xen/drivers/char/pl011.c
>>>> @@ -104,6 +104,8 @@ static void __init pl011_init_preirq(struct serial_port *port)
>>>> {
>>>> /* Baud rate already set: read it out from the divisor latch. */
>>>> divisor = (pl011_read(uart, IBRD) << 6) | (pl011_read(uart, FBRD));
>>>> + if (!divisor)
>>>> + early_panic("pl011: No Baud rate configured\n");
>>>> uart->baud = (uart->clock_hz << 2) / divisor;
>>>> }
>>>> /* This write must follow FBRD and IBRD writes. */
>>>>
>>>
>>>
>>
>>
>
>
>
> --
> Julien Grall
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] pl011: early_panic if baud rate not set in hardware
2013-08-22 16:34 ` Julien Grall
2013-08-22 18:49 ` Ian Campbell
@ 2013-08-27 13:46 ` Ian Campbell
1 sibling, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2013-08-27 13:46 UTC (permalink / raw)
To: Julien Grall; +Cc: stefano.stabellini, tim, xen-devel
On Thu, 2013-08-22 at 17:34 +0100, Julien Grall wrote:
> On 08/22/2013 05:01 PM, Ian Campbell wrote:
> > Now that the driver defaults to BAUD_AUTO this can happen if the early uart !=
> > console or if early printk isn't in use.
>
> Does the fast model set correctly the baud rate?
>
> > The following division by zero causes a trap but that uses regular printk and
> > not early_printk, so it is never seen.
>
> That's annoying. I often have this problem, is there any plan to support
> early print in printk?
I didn't get to this like I thought I might last week
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Acked-by: Julien Grall <julien.grall@linaro.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-08-27 13:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 16:01 [PATCH] pl011: early_panic if baud rate not set in hardware Ian Campbell
2013-08-22 16:34 ` Julien Grall
2013-08-22 18:49 ` Ian Campbell
2013-08-22 21:09 ` Julien Grall
2013-08-23 0:41 ` Chen Baozi
2013-08-27 13:46 ` Ian Campbell
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.