public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Scott Wood <oss@buserror.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCHv2 1/3] nand_spl_simple: Add a simple flash read function
Date: Mon, 04 Jan 2016 15:45:08 -0600	[thread overview]
Message-ID: <1451943908.19133.6.camel@buserror.net> (raw)
In-Reply-To: <20160104211750.GA10207@localhost.localdomain>

On Mon, 2016-01-04 at 22:17 +0100, Ladislav Michl wrote:
> On Mon, Jan 04, 2016 at 07:38:23PM +0100, Ladislav Michl wrote:
> > On Mon, Jan 04, 2016 at 12:23:36PM -0600, Scott Wood wrote:
> > > On Mon, 2016-01-04 at 16:54 +0100, Ladislav Michl wrote:
> > > > From: Thomas Gleixner <tglx@linutronix.de>
> > > > 
> > > > To support UBI in SPL we need a simple flash read function. Add one to
> > > > nand_spl_simple and keep it as simple as it goes.
> > > > 
> > > > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > > 
> > > Where is your signoff?
> > 
> > I'm only messenger and have nothing to do with this part of patch. The
> > other
> > part which I touched has my signoff.
> > 
> > > Did Thomas really write this patch for U-Boot (if so, why isn't he on
> > > CC?) or
> > > is it taken from some other project?
> > 
> > Ha! It is my mailer which broke Cc. Thomas was on Cc list and still is in
> > my
> > sent-mail folder. Also apologize to Marek, let's see how Cc will end this
> > time.
> > And yes, patch was written for U-Boot: 
> > https://patchwork.ozlabs.org/patch/367305/
> 
> Well, seems to be mailman configuration:
> https://mail.python.org/pipermail/mailman-users/2006-May/051194.html
> so those who received post via mailman are seeing striped Cc line. Thanks to
> Nathan Lynch for pointing it out.
> Full Cc list:
> Cc: Scott Wood <oss@buserror.net>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Richard Weinberger <richard@nod.at>
> Cc: Marek Vasut <marex@denx.de>

Oh right, I forgot about that mailman bug.

> > > +int nand_spl_read_flash(u32 pnum, u32 offset, u32 len, void *dest)
> > > 
> > > This name is too generic and doesn't suggest what's different compared
> > > to
> > > nand_spl_load_image (they both read data from flash into a buffer).
> > > 
> > > How about nand_spl_read_block()?
> > 
> > ok.
> 
> Thinking about it more, I'd rather see nand_spl_read_peb(int peb, ...
> but that is not consistent with other nand reading functions.

"peb" is cryptic, and what sort of non-physical erase block does the core NAND
code deal with that warrants distinction?

> 
> > > > +{
> > > > +	u32 offs, page, read, toread = len;
> > > > +
> > > > +	/* Calculate the page number */
> > > > +	page = offset / CONFIG_SYS_NAND_PAGE_SIZE;
> > > > +
> > > > +	/* Offset to the start of a flash page */
> > > > +	offs = offset % CONFIG_SYS_NAND_PAGE_SIZE;
> > > > +
> > > > +	while (toread) {
> > > > +		/*
> > > > +		 * Non page aligned reads go to the scratch buffer.
> > > > +		 * Page aligned reads go directly to the destination.
> > > > +		 */
> > > > +		if (offs || toread < CONFIG_SYS_NAND_PAGE_SIZE) {
> > > > +			nand_read_page(pnum, page, scratch_buf);
> > > > +			read = min(len, toread);
> > > 
> > > toread is always <= len, so this is pointless.  As this is the only use
> > > of len
> > > after the toread init, once this is gone you could also eliminate toread
> > > and
> > > just use len.
> > 
> > ok, will change that.
> 
> What about something like this? Changelog will be appended to v3.
> Btw, any comments to other patches in this serie?
> 
> -- >8 --
> 
> From: Thomas Gleixner <tglx@linutronix.de>
> Subject: nand_spl_simple: Add a simple NAND read function
>     
> To support UBI in SPL we need a simple NAND read function. Add one to
> nand_spl_simple and keep it as simple as it goes.
>     
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>

Acked-by: Scott Wood <oss@buserror.net>

-Scott

  reply	other threads:[~2016-01-04 21:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 15:52 [U-Boot] [PATCHv2 0/3] spl: Lightweight UBI and UBI fastmap support Ladislav Michl
2016-01-04 15:54 ` [U-Boot] [PATCHv2 1/3] nand_spl_simple: Add a simple flash read function Ladislav Michl
2016-01-04 17:19   ` Marek Vasut
2016-01-04 17:58     ` Ladislav Michl
2016-01-04 18:38       ` Marek Vasut
2016-01-04 18:23   ` Scott Wood
2016-01-04 18:38     ` Ladislav Michl
2016-01-04 18:44       ` Scott Wood
2016-01-04 21:17       ` Ladislav Michl
2016-01-04 21:45         ` Scott Wood [this message]
2016-01-04 22:40           ` Marek Vasut
2016-01-04 22:42             ` Scott Wood
2016-01-04 22:52               ` Marek Vasut
2016-01-04 15:56 ` [U-Boot] [PATCHv2 2/3] spl: Lightweight UBI and UBI fastmap support Ladislav Michl
2016-01-06 16:52   ` Ladislav Michl
2016-01-06 17:09     ` Marek Vasut
2016-01-04 15:57 ` [U-Boot] [PATCHv2 3/3] igep00x0: UBIize Ladislav Michl
2016-01-07 10:47 ` [U-Boot] [PATCHv2 0/3] spl: Lightweight UBI and UBI fastmap support Heiko Schocher
2016-01-10 14:00   ` Ladislav Michl
2016-01-11  5:50     ` Heiko Schocher

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=1451943908.19133.6.camel@buserror.net \
    --to=oss@buserror.net \
    --cc=u-boot@lists.denx.de \
    /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