public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <computersforpeace@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-mtd@lists.infradead.org,
	"Dmitry Torokhov" <dtor@google.com>,
	"Anatol Pomazao" <anatol@google.com>,
	"Ray Jui" <rjui@broadcom.com>,
	"Corneliu Doban" <cdoban@broadcom.com>,
	"Jonathan Richardson" <jonathar@broadcom.com>,
	"Rafał Miłecki" <zajec5@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Kevin Cernekee" <cernekee@gmail.com>
Subject: Re: [PATCH 3/3] mtd: nand: add NAND driver for Broadcom STB NAND controller
Date: Wed, 18 Mar 2015 18:49:21 -0700	[thread overview]
Message-ID: <20150319014921.GQ32500@ld-irv-0074> (raw)
In-Reply-To: <55072714.9080104@gmail.com>

On Mon, Mar 16, 2015 at 11:55:16AM -0700, Florian Fainelli wrote:
> On 06/03/15 17:18, Brian Norris wrote:
> > +static int brcmnand_revision_init(struct brcmnand_controller *ctrl)
> > +{
> > +	static const unsigned int block_sizes_v6[] = { 8, 16, 128, 256, 512, 1024, 2048, 0 };
> > +	static const unsigned int block_sizes_v4[] = { 16, 128, 8, 512, 256, 1024, 2048, 0 };
> > +	static const unsigned int page_sizes[] = { 512, 2048, 4096, 8192, 0 };
> > +
> > +	ctrl->nand_version = nand_readreg(ctrl, 0) & 0xffff;
> > +
> > +	/* Only support v4.0+? */
> > +	if (ctrl->nand_version < 0x0400)
> > +		return -ENODEV;
> 
> It could be nice to have an informative error message here that this is
> either:
> 
> - an unknown controller revision (> 7.1)
> - an older controller revision
> - a check against the compatible property, just in case?

I'll add a message that the revision is not supported. The DT binding
should catch this too, so this check is just an extra safeguard.

> [snip]
> 
> > +		ctrl->cs_offsets = brcmnand_cs_offsets_v71;
> > +	} else {
> > +		ctrl->cs_offsets = brcmnand_cs_offsets;
> > +
> > +		/* pre-v5.0 has a different CS0 offset layout */
> > +		if (ctrl->nand_version <= 0x0500)
> > +			ctrl->cs0_offsets = brcmnand_cs_offsets_cs0;
> 
> Based on this check, should the comment should be "pre-v5.0 and v5.0
> have a different CS0 offset layout"?

Yes. Fixed.

Brian

  reply	other threads:[~2015-03-19  1:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-07  1:18 [PATCH 0/3] mtd: nand: add Broadcom NAND controller support Brian Norris
2015-03-07  1:18 ` [PATCH 1/3] mtd: nand: add common DT init code Brian Norris
2015-03-07  1:18 ` [PATCH 2/3] Documentation: devicetree: add binding doc for Broadcom NAND controller Brian Norris
2015-03-16 18:49   ` Florian Fainelli
     [not found]   ` <1425691129-1150-3-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-16 23:07     ` Scott Branden
     [not found]       ` <55076247.4070104-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2015-03-16 23:37         ` Brian Norris
2015-03-16 23:40           ` Scott Branden
2015-03-16 23:46             ` Brian Norris
2015-03-16 23:52               ` Scott Branden
2015-03-07  1:18 ` [PATCH 3/3] mtd: nand: add NAND driver for Broadcom STB " Brian Norris
2015-03-07 12:39   ` Paul Bolle
2015-03-09 17:30     ` Brian Norris
2015-03-07 17:39   ` Rafał Miłecki
     [not found]     ` <CACna6rzkEQu+LYchckFpLLxkvyMYK7N84nrGu8p0rjRsRbFzfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-07 21:48       ` Rafał Miłecki
2015-03-08  0:44     ` Rafał Miłecki
2015-03-09 17:49       ` Brian Norris
2015-03-09 17:57         ` Ray Jui
     [not found]   ` <1425691129-1150-4-git-send-email-computersforpeace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-07 13:21     ` Rafał Miłecki
2015-03-09 17:31       ` Brian Norris
2015-03-07 22:15     ` Rafał Miłecki
2015-03-16 18:55     ` Florian Fainelli
2015-03-19  1:49       ` Brian Norris [this message]
2015-03-16 19:58   ` Florian Fainelli
2015-03-08  0:01 ` [PATCH 0/3] mtd: nand: add Broadcom NAND controller support Rafał Miłecki
2015-03-08  0:57   ` Brian Norris
2015-03-08 10:22     ` Rafał Miłecki
2015-03-09 18:04       ` Brian Norris
2015-03-08 11:18     ` Rafał Miłecki
2015-03-09 17:59       ` Brian Norris
     [not found] ` <CALj_zD5rW3Se27Rh0pL6QTMNGOrrmrvAVLvW3BCuF8RujYQE=g@mail.gmail.com>
2015-03-16 23:44   ` Brian Norris

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=20150319014921.GQ32500@ld-irv-0074 \
    --to=computersforpeace@gmail.com \
    --cc=anatol@google.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=cdoban@broadcom.com \
    --cc=cernekee@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dtor@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=jonathar@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rjui@broadcom.com \
    --cc=zajec5@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