public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb•de>
To: Sean MacLennan <smaclennan@pikatech•com>
Cc: linuxppc-dev@ozlabs•org, dwmw2@infradead•org
Subject: Re: [PATCH 1/2] port ndfc driver to of platform
Date: Thu, 14 Aug 2008 22:16:45 +0200	[thread overview]
Message-ID: <200808142216.45763.arnd@arndb.de> (raw)
In-Reply-To: <20080814120829.1ad4ed74@lappy.seanm.ca>

On Thursday 14 August 2008, Sean MacLennan wrote:
> On Thu, 14 Aug 2008 11:53:07 +0200
> "Arnd Bergmann" <arnd@arndb•de> wrote:
> 
> > > +	ndfc->ndfcbase = ioremap(reg[1], reg[2]);
> > 
> > This could be better expressed as of_iomap().
> 
> I tried of_iomap(), but it doesn't seem to like the 3 value reg. i.e.
> It doesn't skip the chip select. And since I need to read the reg
> property to get the chip select any way, I just used the value directly.

If of_iomap and of_address_to_resource don't work properly, there
is probably something wrong in your device tree, maybe an incorrect
#size-cells or #address-cells or ranges property in one of
the parents. You need to fix this anyway.

> > > -	platform_set_drvdata(pdev, ndfc);
> > > +	__raw_writel(ccr, ndfc->ndfcbase + NDFC_CCR);
> > >  
> > > -	printk("NDFC NAND Driver initialized. Chip-Rev: 0x%08x\n",
> > > -	       __raw_readl(ndfc->ndfcbase + NDFC_REVID));
> > > +	/* Set the bank settings */
> > > +	reg = of_get_property(ofdev->node, "bank_settings", NULL);
> > > +	bank_settings = reg ? *reg : 0x80002222;
> > 
> > Your device tree does have a bank_setting, so why not assume that
> > all others will have it as well? I would remove the default.
> 
> I am thinking of making the bank settings an optional value. I assume
> most people with 44x chips with NAND will be using u-boot. If you
> enable NAND in u-boot, it should configure the bank settings for you.
> 
> I put the bank setting in my dts just to show a "complete"
> configuration.

Ok, I guess that in the absence of the property, you should not do anything
with this value then, rather than assuming a default.

	Arnd <><

  parent reply	other threads:[~2008-08-14 20:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-02  3:30 [PATCH] port ndfc driver to arch/powerpc Sean MacLennan
2008-08-04 16:25 ` Arnd Bergmann
2008-08-04 17:24   ` Sean MacLennan
2008-08-13 21:36     ` [PATCH 1/2] port ndfc driver to of platform Sean MacLennan
2008-08-14  9:53       ` Arnd Bergmann
2008-08-14 16:08         ` Sean MacLennan
2008-08-14 17:21           ` Sean MacLennan
2008-08-14 20:16           ` Arnd Bergmann [this message]
2008-08-14 20:54             ` Sean MacLennan
2008-08-14 23:10               ` Sean MacLennan
2008-08-15  7:27                 ` Arnd Bergmann
2008-08-15 17:29                   ` Sean MacLennan
2008-08-13 21:45     ` [PATCH 2/2] " Sean MacLennan
2008-08-14 10:08       ` Arnd Bergmann
2008-08-14 16:32         ` Jon Loeliger
2008-08-14 23:20         ` Sean MacLennan
2008-08-15  5:24           ` Sean MacLennan
2008-08-15  7:28             ` Arnd Bergmann

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=200808142216.45763.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=dwmw2@infradead$(echo .)org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=smaclennan@pikatech$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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