xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Dirk Behme <dirk.behme@de.bosch.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>,
	Iurii Konovalenko <iurii.konovalenko@globallogic.com>
Subject: Re: [PATCH 3/3] xen/arm: drivers: scif: Add clock auto detection
Date: Tue, 21 Jun 2016 13:33:07 +0100	[thread overview]
Message-ID: <57693403.9060109@arm.com> (raw)
In-Reply-To: <cd34add7-5999-595e-663d-c00985d9219f@de.bosch.com>

On 21/06/16 13:30, Dirk Behme wrote:
>>> diff --git a/xen/drivers/char/scif-uart.c b/xen/drivers/char/scif-uart.c
>>> index bc157fe..678f46b 100644
>>> --- a/xen/drivers/char/scif-uart.c
>>> +++ b/xen/drivers/char/scif-uart.c
>>> @@ -107,8 +107,19 @@ static void __init scif_uart_init_preirq(struct
>>> serial_port *port)
>>>       scif_readw(uart, SCIF_SCLSR);
>>>       scif_writew(uart, SCIF_SCLSR, 0);
>>>
>>> -    /* Select Baud rate generator output as a clock source */
>>> -    scif_writew(uart, SCIF_SCSCR, SCSCR_CKE10);
>>> +    /*
>>> +     * Select Baud rate generator output as a clock source
>>> +     * The clock source can be an internal or external clock.
>>> +     * Depending on this the DL register is either 0 or contains
>>> +     * the divisor. I.e. we can use this to detect the clock
>>> +     * source and based on this can configure the CKE[1:0] bits
>>> +     * of the SCSCR register.
>>> +     */
>>> +    if ( scif_readw(uart, SCIF_DL) )
>>> +        scif_writew(uart, SCIF_SCSCR, SCSCR_CKE10); /* External clk */
>>> +    else
>>> +        scif_writew(uart, SCIF_SCSCR, SCSCR_CKE00); /* Internal clk */
>>
>> Why would we need to select the baud rate generator if the baud has been
>> configured by the firmware?
>
>
> Just to get the correct understanding: The proposal is to just remove
> the code which (wrongly) overwrites the correct settings done by the
> firmware?
>
> I.e. instead of doing the same thing the firmware is already doing,
> again (the if .. else ), the proposal is simply dropping the
>
>
>   -    /* Select Baud rate generator output as a clock source */
>   -    scif_writew(uart, SCIF_SCSCR, SCSCR_CKE10);
>
> ?

Yes. However I don't have any spec in hand so I am not sure if it is 
correct.

Regards,

-- 
Julien Grall

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

  reply	other threads:[~2016-06-21 12:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21  9:15 [PATCH 1/3] xen/arm: drivers: scif: Remove dead code Dirk Behme
2016-06-21  9:15 ` [PATCH 2/3] xen/arm: drivers: scif: Remove unused variables Dirk Behme
2016-06-21 12:17   ` Julien Grall
2016-06-21  9:15 ` [PATCH 3/3] xen/arm: drivers: scif: Add clock auto detection Dirk Behme
2016-06-21 12:20   ` Julien Grall
2016-06-21 12:30     ` Dirk Behme
2016-06-21 12:33       ` Julien Grall [this message]
2016-06-21 10:16 ` [PATCH 1/3] xen/arm: drivers: scif: Remove dead code Oleksandr Tyshchenko
2016-06-21 12:15   ` Julien Grall
2016-06-21 12:54     ` Oleksandr Tyshchenko
2016-06-21 13:01       ` Dirk Behme
2016-06-21 13:22         ` Oleksandr Tyshchenko
2016-06-21 13:07       ` Julien Grall
2016-06-21 13:11         ` Oleksandr Tyshchenko

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=57693403.9060109@arm.com \
    --to=julien.grall@arm.com \
    --cc=dirk.behme@de.bosch.com \
    --cc=iurii.konovalenko@globallogic.com \
    --cc=oleksandr.tyshchenko@globallogic.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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).