devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier@dowhile0.org>
To: florian.vaussard@epfl.ch
Cc: Benoit Cousson <b-cousson@ti.com>,
	Tony Lindgren <tony@atomide.com>,
	devicetree-discuss@lists.ozlabs.org,
	Daniel Mack <zonque@gmail.com>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] ARM: dts: OMAP3: Add GPMC controller
Date: Tue, 5 Feb 2013 20:40:58 +0100	[thread overview]
Message-ID: <CABxcv=ms0DOHL8ooktLi+_gQGvGOiKpNgx7gKnU5BUX1pWkAJQ@mail.gmail.com> (raw)
In-Reply-To: <51114003.9070405@epfl.ch>

On Tue, Feb 5, 2013 at 6:23 PM, Florian Vaussard
<florian.vaussard@epfl.ch> wrote:
> Hi Javier,
>

Hi Florian,

> On 02/04/2013 12:57 PM, Javier Martinez Canillas wrote:
>
> [...]
>
>
>>
>> Yes, I saw on the list that Tony asked you too extend the GPMC DT
>> support. Flash support is on my TODO list too but I don't know if I'm
>> going to have time to work on this in the next few weeks.
>>
>> Since you are thinking to change the binding, there is something I
>> want to discuss with you.
>>
>> We have two different version for each IGEP board, one that uses NAND
>> memory and another that has OneNAND.
>>
>> With board files this is easy because the flash memory type is
>> hardcoded (in hardware) using sysboot pins [3]. So we check the
>> sysboot value and call board_nand_init() or board_onenand_init()
>> accordingly and pass the same static struct mtd_partition
>> igep_flash_partitions[] in both cases.
>>
>> But with DT this is a little bit trickier since you have to define
>> either a nand@0 or onenand@0 child node for the gpmc device node. So,
>> we will have to create lots of dts and dtsi to handle each combination
>> (IGEPv2 + NAND, IGEPv2 + OneNAND, IGEP COM + NAND, etc).
>>
>> I wonder if we could just have a generic gpmc-flash binding and maybe
>> use a "gpmc, flash_type" property or something like that to decide if
>> gpmc_onenand_init() or gpmc_nand_init() has to be called.
>>
>
> This boils down to the problem where you have an "if" statement in
> your board file, and I think no general solution exists.
>

Yes, this is a general issue since DT uses a declarative paradigm.

I was just pointing out that I found that particular issue with the flash
memory type on IGEP boards.

> In your suggestion, having a property will force you anyway to write
> distinct DT files to account for the two versions, so it won't really
> help if I understand correctly. We would need conditional
> section inside device trees, at least to test for simple parameters.
> Or a way to generate several DT blobs based on a single DT source file.
>

Well you will still need a different dtb for each <board,flash type> combination
but it could make your device trees smaller and simpler since you can define
your GPMC flash child node on a dtsi where you set all the partition and sizes
and export that device node to your boards dts that only set the
"gpmc, flash_type"
property to nand or onenand (assuming both your NAND and OneNAND version
have the same partition layout and sizes).

Otherwise you would have to define the complete onenand or nand child node
on your board dts having duplicated definition for your flash partition layouts.

> Another hackish solution would be to write a meta component, whose
> probe section would do your test. But this is just a stripped down version
> of the board file, far from being generic...
>

Yes, and that doesn't fit on the DT model too well. I still don't know what's
the best way to do it.

> I will think on it during my holidays :)
>

great, I hope you enjoy your holidays :-)

> Regards,
>
> Florian
>

Thanks a lot and best regards,
Javier

  reply	other threads:[~2013-02-05 19:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28 17:54 [PATCH 0/2] ARM: dts: OMAP3: Add GPMC controller and NAND memory to Overo Florian Vaussard
2013-01-28 17:54 ` [PATCH 1/2] ARM: dts: OMAP3: Add GPMC controller Florian Vaussard
2013-02-04  9:27   ` Javier Martinez Canillas
2013-02-04 10:36     ` Florian Vaussard
     [not found]       ` <510F8F49.9020800-p8DiymsW2f8@public.gmane.org>
2013-02-04 11:57         ` Javier Martinez Canillas
2013-02-04 17:32           ` Tony Lindgren
2013-02-04 18:15             ` Javier Martinez Canillas
2013-02-05 17:23           ` Florian Vaussard
2013-02-05 19:40             ` Javier Martinez Canillas [this message]
2013-02-16 13:09   ` Anil Kumar
2013-02-16 16:44     ` Javier Martinez Canillas
2013-02-18 12:26       ` Cousson, Benoit
2013-02-19  1:00   ` Jon Hunter
2013-03-14 16:01   ` Benoit Cousson
2013-01-28 17:54 ` [PATCH 2/2] ARM: dts: OMAP3: Add NAND memory for Overo products Florian Vaussard
2013-02-01 22:16 ` [PATCH 0/2] ARM: dts: OMAP3: Add GPMC controller and NAND memory to Overo Tony Lindgren
2013-02-04  8:58   ` Florian Vaussard

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='CABxcv=ms0DOHL8ooktLi+_gQGvGOiKpNgx7gKnU5BUX1pWkAJQ@mail.gmail.com' \
    --to=javier@dowhile0.org \
    --cc=b-cousson@ti.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=florian.vaussard@epfl.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    --cc=zonque@gmail.com \
    /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).