linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jon Hunter <jon-hunter@ti.com>
To: Ezequiel Garcia <elezegarcia@gmail.com>
Cc: Mark Jackson <mpfj-list@mimc.co.uk>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	Afzal Mohammed <afzal@ti.com>
Subject: Re: DT GPMC SRAM and NOR flash support ?
Date: Mon, 11 Feb 2013 16:21:59 -0600	[thread overview]
Message-ID: <51196F07.1020600@ti.com> (raw)
In-Reply-To: <CALF0-+VQ3CJ+GU+Gp7TFDpzND8K48Q_d2yoEy=Y1TdyD1Nb9kA@mail.gmail.com>


On 02/09/2013 07:27 AM, Ezequiel Garcia wrote:
> Hi Mark,
> 
> On Thu, Feb 7, 2013 at 6:51 AM, Mark Jackson <mpfj-list@mimc.co.uk> wrote:
>> Okay ... I have made some progress, but it's not ideal.
>>
>> Currently I've hacked the GPMC DT driver (gpmc_probe_dt(), etc) so it now handles setting up the
>> chip selects and timings for NOR devices, e.g.
>>
>>                 gpmc: gpmc@50000000 {
>>                         status = "okay";
>>                         ranges = <0 0 0x08000000 0x08000000>;   /* CS0: NOR 16M */
>>
>>                         nor@0,0 {
>>                                 compatible = "spansion,s29gl064n90t", "cfi-flash";
>>                                 reg = <0 0 0>;
>>                                 bank-width = <2>;
>>
>>                                 gpmc,sync-clk = <0>;
>>                                 gpmc,cs-on = <10>;
>>                                 gpmc,cs-rd-off = <150>;
>>                                 gpmc,cs-wr-off = <150>;
>>                                 gpmc,adv-on = <10>;
>>                                 gpmc,adv-rd-off = <10>;
>>                                 gpmc,adv-wr-off = <10>;
>>                                 gpmc,oe-on = <30>;
>>                                 gpmc,oe-off = <150>;
>>                                 gpmc,we-on = <30>;
>>                                 gpmc,we-off = <150>;
>>                                 gpmc,rd-cycle = <150>;
>>                                 gpmc,wr-cycle = <150>;
>>                                 gpmc,access = <130>;
>>                                 gpmc,page-burst-access = <10>;
>>                                 gpmc,cycle2cycle-diff = <1>;
>>                                 gpmc,cycle2cycle-same = <1>;
>>                                 gpmc,cycle2cycle-delay = <10>;
>>                                 gpmc,wr-data-mux-bus = <60>;
>>                         };
>>                 };
>>
>> But the physmap driver (of_flash_probe()) is unable to use this information.  It seems that although
>> I can call of_flash_probe() from my NOR setup code, the platform_device being reference is wrong.

By the way, you shouldn't be calling of_flash_probe directly. If we
register the device correctly this should be called for us. See below on
how to fix the registering of the device.

>> The platform_device passed to my gpmc_probe_nor_child() routine from gpmc_probe_dt() points to my
>> gpmc entry (above), but the physmap probe requires its own DT entry (rather than a node child such
>> as my NOR entry with the GPMC device entry).
>>
> 
> I think you can call something like:
> 
> of_platform_populate();

This is being call from the mach-omap2/board-generic.c file on boot.
Where are you suggesting this is called from?

> On your GPMC node and have the child initialize.
> This way you don't need to have separate cfi-flash compatible nodes,
> you can have them as childs.
> 
> Although I'm not sure this is a sane approach, I'm almost sure this should work.

>From looking at the DT code and playing around with my omap2 board, if
we add "simple-bus" to the compatible string for the gpmc controller,
then DT will register the cfi-flash device as implemented above and you
don't need the extra node. For example ...

                gpmc: gpmc@6800a000 {
-                       compatible = "ti,omap2420-gpmc";
+                       compatible = "ti,omap2420-gpmc", "simple-bus";
                        ti,hwmods = "gpmc";
                        reg = <0x6800a000 0x1000>;
                        interrupts = <20>;

I am also concerned about how gpmc_cs_request() is implemented when we
are booting with device-tree. This function is mapping the CS where ever
it has space available and is not looking at the DTS to see where you
want the flash to be. So this needs to be addressed too.

Cheers
Jon

  reply	other threads:[~2013-02-11 22:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01 16:56 DT GPMC SRAM and NOR flash support ? Mark Jackson
2013-02-01 17:12 ` Jon Hunter
2013-02-01 19:39   ` Mark Jackson
2013-02-05 16:16     ` Mark Jackson
2013-02-05 16:35       ` Jon Hunter
2013-02-05 16:48         ` Mark Jackson
2013-02-05 17:08           ` Jon Hunter
2013-02-07  9:51             ` Mark Jackson
2013-02-07 10:34               ` Mark Jackson
2013-02-09  0:43               ` Jon Hunter
2013-02-09 13:27               ` Ezequiel Garcia
2013-02-11 22:21                 ` Jon Hunter [this message]
2013-02-12 14:36                   ` Ezequiel Garcia
2013-02-13 21:07               ` Jon Hunter
2013-02-14 10:18                 ` Ezequiel Garcia
2013-02-15  7:42                   ` Jon Hunter
2013-03-01 21:08                 ` Ezequiel Garcia
2013-03-01 21:42                   ` Ezequiel Garcia
2013-03-01 22:23                     ` Jon Hunter
2013-02-06  5:07         ` 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=51196F07.1020600@ti.com \
    --to=jon-hunter@ti.com \
    --cc=afzal@ti.com \
    --cc=elezegarcia@gmail.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=mpfj-list@mimc.co.uk \
    /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).