linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jon-hunter@ti.com (Jon Hunter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 3/3] ARM: OMAP2+: onenand: prepare for gpmc driver migration
Date: Tue, 10 Jul 2012 12:15:28 -0500	[thread overview]
Message-ID: <4FFC6330.1040409@ti.com> (raw)
In-Reply-To: <C8443D0743D26F4388EA172BF4E2A7A93E9A669D@DBDE01.ent.ti.com>

Hi Afzal,

On 07/10/2012 08:47 AM, Mohammed, Afzal wrote:
> Hi Tony,
> 
> On Tue, Jul 10, 2012 at 18:47:34, Tony Lindgren wrote:
>> * Mohammed, Afzal <afzal@ti.com> [120710 03:09]:
>>> On Tue, Jul 10, 2012 at 15:15:38, Tony Lindgren wrote:
>>>> * Mohammed, Afzal <afzal@ti.com> [120709 23:24]:
> 
>>>>> For the peripherals requiring retime, we cannot (as otherwise whatever
>>>>> retime does would have to be manually done based on the knowledge of
>>>>> boot time gpmc clock period to calculate gpmc timings to be fed to DT)
>>>>> pass gpmc timings via device tree, right ?
>>>>
>>>> We can still do it when the connected peripheral probe registers with
>>>> gpmc.
> 
> Were you actually referring to updating kernel view of device tree nodes, and
> not the device tree file (not sure whether it is really possible) ?

I believe that Tony is suggesting performing the retime at probe time.
In the case of OneNand you would simply call the
onenand_set_async_mode/sync_mode from within the probe as a retime
function.

>>> We can, but would it be feasible practically ?, gpmc timings to update in
>>> DT for a such a peripheral (requiring retime) can be found out only by
>>> manual calculation similar to the way done in retime function (based on
>>> peripheral's timings and boot time gpmc clock period), correct ?, Also
>>> wouldn't this make it necessary to know gpmc clock period at boot time
>>> for properly updating gpmc timing entry in DT ?
>>
>> The gpmc clock period can be returned to the connected peripheral when
>> it's registering. Well basically we can call the retime function upon
>> registering and pass the gpmc clock period.
> 
> Won't this lead to the necessity of particular driver load order problem ?,
> As per the above, to return gpmc clock period to the connected peripheral,
> we need to ensure that gpmc driver is probed before peripheral driver.

I think it is more like when probing the gpmc, the retime function for
the connected peripheral is called passing the gpmc clock freq.

> And in that case how can gpmc driver rely on DT as gpmc timings for the
> peripheral requiring retime would not yet be available as peripheral
> driver is not yet probed, seems like a circular dependency.

The DT node should simply have the information required by the retime
function or gpmc timings themselves if available. In the case of OneNAND
async mode you have a bunch of constants such as ...

const int t_cer  = 15;
const int t_avdp = 12;
const int t_cez  = 20; /* max of t_cez, t_oez */
const int t_ds   = 30;
const int t_wpl  = 40;
const int t_wph  = 30

These can be stored in the DT and then translated to gpmc timings at
runtime. DT should only store static timing or clock information known
at compile time.

>>> And in this case, we are going to register retime function, so instead of
>>> relying on DT to provide gpmc timings for such a peripheral, won't it
>>> be better to make use of retime that is already registered ?
>>
>> No we need to pass the timings from device tree as they may be different
>> for similar boards. For example, different level shifters used on
>> similar boards may affect the timings, although the retime function
>> can be the same.
> 
> Unless I am missing something, could not see this scenario taken care
> in the existing retime functions, did see one comment for smc91x, but
> seems in that case Kernel doesn't do any timing configuration and
> leave timings as configured by bootloader

I think that we just need to adapt the current functions that our
calculating the timings so that ...

1. We can call from them within the gpmc probe to setup the timings
versus having the peripherals program the gpmc priory to probe.
2. Any static timing information needed by the retime function is part
of the platform data passed to the gpmc probe and therefore can also be
read from DT.

>From a high-level I think that the goal should be ...

gpmc_probe
	--> request CS
	--> calls retime function to calculate gpmc timing (optional)
	--> configures CS
	--> registers peripheral device

Cheers
Jon

  reply	other threads:[~2012-07-10 17:15 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-27  6:33 [PATCH v5 0/3] Prepare for GPMC driver conversion Afzal Mohammed
2012-06-27  6:33 ` [PATCH v5 1/3] ARM: OMAP2+: nand: unify init functions Afzal Mohammed
2012-06-27  6:33 ` [PATCH v5 2/3] ARM: OMAP2+: gpmc: handle additional timings Afzal Mohammed
2012-06-27  6:34 ` [PATCH v5 3/3] ARM: OMAP2+: onenand: prepare for gpmc driver migration Afzal Mohammed
2012-06-27 14:58   ` Tony Lindgren
2012-06-28  9:32     ` Mohammed, Afzal
2012-06-28 12:32       ` Tony Lindgren
2012-06-28 12:33         ` Mohammed, Afzal
2012-06-28 12:44         ` Mohammed, Afzal
2012-07-30  7:36           ` Mohammed, Afzal
2012-06-28 16:43         ` Jon Hunter
2012-06-28 19:00           ` Jon Hunter
2012-07-02  6:26             ` Tony Lindgren
2012-06-29  6:15           ` Mohammed, Afzal
2012-06-29  6:38             ` Mohammed, Afzal
2012-06-29 14:15             ` Jon Hunter
2012-07-02 10:04               ` Mohammed, Afzal
2012-07-02  6:36           ` Tony Lindgren
2012-07-02  9:43             ` Mohammed, Afzal
2012-07-02 17:29               ` Jon Hunter
2012-07-03  4:35                 ` Mohammed, Afzal
2012-07-03 15:10                   ` Jon Hunter
2012-07-04  5:36                     ` Mohammed, Afzal
2012-07-02 17:25             ` Jon Hunter
2012-07-03  8:17               ` Tony Lindgren
2012-07-03 15:12                 ` Jon Hunter
2012-07-04  7:00                 ` Mohammed, Afzal
2012-07-04  7:51                   ` Tony Lindgren
2012-07-05 10:24                     ` Mohammed, Afzal
2012-07-05 10:55                       ` Tony Lindgren
2012-07-05 11:58                         ` Mohammed, Afzal
2012-07-05 14:49                           ` Tony Lindgren
2012-07-05 14:51                         ` Mohammed, Afzal
2012-07-06 12:05                           ` Tony Lindgren
2012-07-10  6:20                             ` Mohammed, Afzal
2012-07-10  9:45                               ` Tony Lindgren
2012-07-10 10:04                                 ` Mohammed, Afzal
2012-07-10 13:17                                   ` Tony Lindgren
2012-07-10 13:47                                     ` Mohammed, Afzal
2012-07-10 17:15                                       ` Jon Hunter [this message]
2012-07-11  6:47                                         ` Tony Lindgren
2012-07-13  4:36                                           ` Mohammed, Afzal
2012-08-06 13:38                                           ` gpmc generic retime function (subject was RE: [PATCH v5 3/3] ARM: OMAP2+: onenand: prepare for gpmc driver migration) Mohammed, Afzal
2012-08-17 15:02                                             ` Jon Hunter
2012-08-21 11:14                                               ` Mohammed, Afzal
2012-06-27 10:08 ` [PATCH v5 0/3] Prepare for GPMC driver conversion Mohammed, Afzal

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=4FFC6330.1040409@ti.com \
    --to=jon-hunter@ti.com \
    --cc=linux-arm-kernel@lists.infradead.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).