All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Oleksandr Tyshchenko <oleksandr.tyshchenko@globallogic.com>
Cc: Iurii Konovalenko <iurii.konovalenko@globallogic.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Ian Campbell <ian.campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v2 2/3] xen/arm: Add new driver for R-Car Gen2 UART
Date: Thu, 22 Jan 2015 18:09:33 +0000	[thread overview]
Message-ID: <54C13CDD.6080205@linaro.org> (raw)
In-Reply-To: <CAJEb2DHUcJehRns+GToTRicHFHxVJUo8-HdR5V0pUpV-86iFXA@mail.gmail.com>

On 22/01/15 17:43, Oleksandr Tyshchenko wrote:
> On Thu, Jan 22, 2015 at 7:27 PM, Oleksandr Tyshchenko
> <oleksandr.tyshchenko@globallogic.com> wrote:
>> On Thu, Jan 22, 2015 at 7:02 PM, Julien Grall <julien.grall@linaro.org> wrote:
>>> On 22/01/15 16:55, Oleksandr Tyshchenko wrote:
>>>> On Thu, Jan 22, 2015 at 6:49 PM, Julien Grall <julien.grall@linaro.org> wrote:
>>>>> On 22/01/15 16:44, Oleksandr Tyshchenko wrote:
>>>>>> I understand, then I will implement local delay func in uart driver
>>>>>> based on READ_SYSREG64(CNTPCT_EL0).
>>>>>
>>>>> Unless I miss something, udelay should work in your case even if the
>>>>> xen_init_time is not called.
>>>> Unfortunately, no. If I understand correctly the var "cpu_khz" (used
>>>> in ticks_to_ns()) is initialized in init_xen_time().
>>>
>>> Hrm, right. I looked too quickly to the function.
>>>
>>> I don't like the idea to use READ_SYSREG64(CNTPCT_EL0) in the UART drivers.
>>>
>>> Does the udelay necessary here? If yes, maybe we should either split the
>>> xen_init_time in 2 parts or create a udelay_tick function to use when
>>> timer is not set.
>>>
>>> I'm not sure what is the best one.
>>>
>>> Regards,
>>>
>>> --
>>> Julien Grall
>>
>> According to the TRM for this family we need to add delay after
>> changing baudrate before continuing init sequence.
>> I tried without udelay and it is worked fine. But, if the TRM says we
>> need to follow this.
>>
>> --
>>
>> Oleksandr Tyshchenko | Embedded Dev
>> GlobalLogic
>> www.globallogic.com
> 
> I would prefer a first variant. In xen_init_time_1() initialize
> "cpu_khz" and "boot_count" only.
> 
>  cpu_khz = READ_SYSREG32(CNTFRQ_EL0) / 1000;
>  boot_count = READ_SYSREG64(CNTPCT_EL0);
> 
> In xen_init_time_2() perform all initialization as it was done for
> this moment and correct "cpu_khz" if node is present.
> 
> What do you think?
> 

The clock-frequency property is usually present when CNTFRQ_EL0 is
invalid. So the udelay won't work correctly for those board.

Also, some platform may need to have specific initialization for timer
before been able to access it. (see platform_init_time).

So we need to move at least to move preinit_xen_time:
	platform_init()
        read property clock-frequency
	cpu_khz = ...
	boot_count = ...

init_xen_time would contain:
	retrieve IRQs
	print messages

Regards,

-- 
Julien Grall

  reply	other threads:[~2015-01-22 18:09 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 14:16 [PATCH v2 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Iurii Konovalenko
2015-01-21 14:16 ` [PATCH v2 1/3] xen/arm: Add R-Car Gen2 support for early printk Iurii Konovalenko
2015-01-22 14:29   ` Julien Grall
2015-01-21 14:16 ` [PATCH v2 2/3] xen/arm: Add new driver for R-Car Gen2 UART Iurii Konovalenko
2015-01-22 14:44   ` Julien Grall
2015-01-22 16:04     ` Oleksandr Tyshchenko
2015-01-22 16:18       ` Julien Grall
2015-01-22 16:44         ` Oleksandr Tyshchenko
2015-01-22 16:49           ` Julien Grall
2015-01-22 16:55             ` Oleksandr Tyshchenko
2015-01-22 17:02               ` Julien Grall
2015-01-22 17:27                 ` Oleksandr Tyshchenko
2015-01-22 17:43                   ` Oleksandr Tyshchenko
2015-01-22 18:09                     ` Julien Grall [this message]
2015-01-22 18:33                       ` Oleksandr Tyshchenko
2015-01-23 15:54                         ` Oleksandr Tyshchenko
2015-01-21 14:16 ` [PATCH v2 3/3] xen/arm: Introduce support for Renesas R-Car Gen2 platform Iurii Konovalenko
2015-01-22 14:49   ` Julien Grall
2015-01-21 14:18 ` [PATCH v2 0/3] arm: introduce basic Renesas R-Car Gen2 platform support Iurii Konovalenko
2015-01-22 14:52 ` Julien Grall
2015-01-23 11:27   ` Iurii Konovalenko
2015-01-23 11:47     ` Julien Grall
2015-01-23 12:12       ` Iurii Konovalenko
2015-01-23 12:19         ` Julien Grall
2015-01-23 13:20           ` Iurii Konovalenko
2015-01-23 13:53             ` Julien Grall
2015-01-23 14:32               ` Iurii Konovalenko

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=54C13CDD.6080205@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=ian.campbell@citrix.com \
    --cc=iurii.konovalenko@globallogic.com \
    --cc=oleksandr.tyshchenko@globallogic.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.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.