mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 5/5] at91sam9261ek: add first stage support
Date: Sun, 27 Jan 2013 00:14:54 +0100	[thread overview]
Message-ID: <20130126231454.GI26329@game.jcrosoft.org> (raw)
In-Reply-To: <20130126215949.GR1906@pengutronix.de>

On 22:59 Sat 26 Jan     , Sascha Hauer wrote:
> On Sat, Jan 26, 2013 at 07:19:59PM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> >  arch/arm/boards/at91sam9261ek/env/config           |   10 ++-
> >  arch/arm/boards/at91sam9261ek/init.c               |   15 ++++-
> >  .../configs/at91sam9261ek_first_stage_defconfig    |   71 ++++++++++++++++++++
> >  3 files changed, 92 insertions(+), 4 deletions(-)
> >  create mode 100644 arch/arm/configs/at91sam9261ek_first_stage_defconfig
> > 
> > diff --git a/arch/arm/boards/at91sam9261ek/env/config b/arch/arm/boards/at91sam9261ek/env/config
> > index 7d85577..cb3e847 100644
> > --- a/arch/arm/boards/at91sam9261ek/env/config
> > +++ b/arch/arm/boards/at91sam9261ek/env/config
> > @@ -34,8 +34,14 @@ kernelimage=zImage
> >  #kernelimage=Image.lzo
> >  
> >  nand_device=atmel_nand
> > -nand_parts="128k(at91bootstrap),256k(barebox)ro,128k(bareboxenv),128k(bareboxenv2),128k(oftree),4M(kernel),120M(rootfs),-(data)"
> > -rootfs_mtdblock_nand=6
> > +if [ x$borebox_first_stage = x1 ]
> 
> LOL ;) Found a new name for the project?
typo
> 
> > +then
> > +	nand_parts="384k(barebox)ro,128k(bareboxenv),128k(bareboxenv2),128k(oftree),4M(kernel),120M(rootfs),-(data)"
> > +	rootfs_mtdblock_nand=5
> > +else
> > +	nand_parts="128k(at91bootstrap),256k(barebox)ro,128k(bareboxenv),128k(bareboxenv2),128k(oftree),4M(kernel),120M(rootfs),-(data)"
> > +	rootfs_mtdblock_nand=6
> > +fi
> 
> I find this rather confusing. Now we have a bootstrap config, a first
> stage config and a regular config, two different partition layouts and
> no indication how these play together.
> 
> I think it's dangerous to have two different partition layouts. What's
> the reason to concatenate the at91bootstrap and barebox partition
> together for the first stage case?
yes because the 9261 can only load 156K into sram

so it's more than the first block
> 
> What I would understand is:
> 
> - have a 128k first stage barebox which either
>   - loads the kernel directly
>   - or loads the second stage (bigger) barebox
> 
>   The decision could be made by the environment or maybe a button/key
> 
> However, this makes for two defconfigs, not three.
> 
> BTW your at91 bootstrap code has:
> 
> 	bootstrap_read_devfs("nand0", true, SZ_128K, SZ_256K, SZ_1M);
> 
> Which means that you will use up to 1MB of Nand if you have bad blocks.
> This conflicts with your partition layout above.
> 
> I suggest that you combine the first stage and bootstrap config into one
> by adding some switch in the environment to optionally start the second
> stage loader or directly boot through to the kernel.

if you do this the first stage will be limited artificially at 128KiB where we
can go to 156KiB

and later
when we can have the support of the mini nand laod we will use the 384KiB for
barebox first stage

so I prefer to have 2 layout onthe ref board
as it's here for dev not production

Best Regards,
J.
> 
> Sascha
> 
> -- 
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-01-26 23:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-26 18:18 [PATCH 0/5] at91sam9261: add bootstrap and firstage support Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19 ` [PATCH 1/5] at91sam9260/9g20/9261/9g10/9263: split soc lowlevel_init from generic Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19   ` [PATCH 2/5] at91: introduce AT91_LOAD_BAREBOX_SRAM to specifcy which size load for external boot Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19   ` [PATCH 3/5] at91sam9261ek: add spi support Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19   ` [PATCH 4/5] at91sam9261ek: add boostrap support Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19   ` [PATCH 5/5] at91sam9261ek: add first stage support Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 21:59     ` Sascha Hauer
2013-01-26 23:14       ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-01-31 13:22         ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-31 13:23 ` [PATCH 0/5] at91sam9261: add bootstrap and firstage support Jean-Christophe PLAGNIOL-VILLARD

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=20130126231454.GI26329@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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