public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon Baatz <gmbnomis@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] kirkwood: ib62x0: Support flattened devicetree
Date: Sat, 21 Jul 2012 11:40:15 +0200	[thread overview]
Message-ID: <20120721094014.GA19010@schnuecks.de> (raw)
In-Reply-To: <500A68B8.9060501@doukki.net>

Hi Gerald and Luka,

On Sat, Jul 21, 2012 at 10:30:48AM +0200, DrEagle wrote:
> Hi Simon and Luka,
> 
> Le 21/07/2012 10:03, Luka Perkov a ?crit :
> > On Fri, Jul 20, 2012 at 09:59:15PM +0200, Simon Baatz wrote:
> >> -#define CONFIG_MACH_TYPE	MACH_TYPE_NAS6210
> >> +#define CONFIG_OF_LIBFDT
> > 
> > Do we need to change environment variables too? This is how I'm booting OpenWrt
> > with linux 3.3 now:
> 
> Is it not better to have the same mtdparts as in the original stock
> firmware and in the next linux kernel ?


You both raise good points here. The mtd partitions can be and also
currently are defined in the default FDT.  That's probably where the
kernel should get the partitions from.  However, this means that we
have the problem that the partitions may be defined differently in
U-Boot and the kernel, which is a source of errors.

In my opinion, U-Boot should be able to get the mtd partitions from
the FDT.  I just had a short look, but could not find such a
functionality in U-Boot nor any discussions about it.


> Then we will just need small specifics distribution patch to customize
> the upstream uboot for the specifics boot params:
> In Debian, we need the initrd for raid support system bootup.

Any of these settings here can be overriden by the U-Boot
configuration. Thus, there is no need to modify U-Boot itself.


> It is better to have the same partition scheme in next linux kernel and
> in uboot, whatever it will be.
> And better to be more closer from the original one, to make end-user
> upgrade process simpler.

As said, it would be even better to ensure this by letting U-Boot
learn the partitions from the FDT.

> 
> An alternative will be to have parameters, if possible, to put uboot
> distribution wide compatible.
> May be a bootstrap call (bootscript call from uboot) or another tweak ?
> 
> > diff --git a/include/configs/ib62x0.h b/include/configs/ib62x0.h
> > index 85856f2..b1c11fd 100644
> > --- a/include/configs/ib62x0.h
> > +++ b/include/configs/ib62x0.h
> > @@ -87,25 +87,23 @@
> >   */
> >  #define CONFIG_BOOTCOMMAND \
> >         "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; "     \
> > -       "ubi part root; "                                               \
> > -       "ubifsmount root; "                                             \
> > +       "ubi part rootfs; "                                             \
> > +       "ubifsmount rootfs; "                                           \
> >         "ubifsload 0x800000 ${kernel}; "                                \
> > -       "ubifsload 0x1100000 ${initrd}; "                               \
> > -       "bootm 0x800000 0x1100000"
> > +       "bootm 0x800000"
> >  
> >  #define CONFIG_MTDPARTS                                \
> >         "mtdparts=orion_nand:"                  \
> >         "0x80000 at 0x0(uboot),"                   \
> >         "0x20000 at 0x80000(uboot_env),"           \
> > -       "- at 0xa0000(root)\0"
> > +       "- at 0xa0000(rootfs)\0"
> >  
> >  #define CONFIG_EXTRA_ENV_SETTINGS                                      \
> >         "console=console=ttyS0,115200\0"                                \
> >         "mtdids=nand0=orion_nand\0"                                     \
> >         "mtdparts="CONFIG_MTDPARTS                                      \
> >         "kernel=/boot/uImage\0"                                         \
> > -       "initrd=/boot/uInitrd\0"                                        \
> > -       "bootargs_root=ubi.mtd=2 root=ubi0:root rootfstype=ubifs\0"
> > +       "bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0"
> >  
> >  /*
> >   * Ethernet driver configuration
> > 

Currently I use the following to boot usind a dtb from the first hard
drive:

bootcmd=setenv bootargs $(bootargs_console) $(bootargs_root); \
	run bootcmd_ide; \
	run fdt_ide; \
	bootm 0x00800000 0x01100000 0x01000000;                             
bootcmd_ide=ide reset; \
	ext2load ide 0:1 0x00800000 /boot/uImage; \
	ext2load ide 0:1 0x01100000 /boot/uInitrd \                                                      
fdt_ide=ext2load ide 0:1 0x01000000 /boot/kirkwood-ib62x0.dtb; \
	fdt addr 0x1000000; fdt resize; fdt chosen                                                       

This leaves 8MB for the kernel which is enough for me. But this is in
"works for me" state, I haven't really invested time to find out how
other boards do that.  I also like to set the kernel bootargs from
U-Boot and not from the dtb (using fdt chosen).  The mtd partitions
are not passed via cmdline, but the values from the dtb are taken.


Regards,
   Simon

  reply	other threads:[~2012-07-21  9:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-20 19:59 [U-Boot] [PATCH 1/2] kirkwood: ib62x0: Invert SATA activity LEDs Simon Baatz
2012-07-20 19:59 ` [U-Boot] [PATCH 2/2] kirkwood: ib62x0: Support flattened devicetree Simon Baatz
2012-07-21  8:03   ` Luka Perkov
2012-07-21  8:30     ` DrEagle
2012-07-21  9:40       ` Simon Baatz [this message]
2012-07-21 12:54         ` Luka Perkov
2012-07-21  8:00 ` [U-Boot] [PATCH 1/2] kirkwood: ib62x0: Invert SATA activity LEDs Luka Perkov

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=20120721094014.GA19010@schnuecks.de \
    --to=gmbnomis@gmail.com \
    --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