public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ladislav Michl <ladis@linux-mips.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/6] cmd: mtdparts: support runtime generated mtdparts
Date: Mon, 6 Jun 2016 09:48:32 +0200	[thread overview]
Message-ID: <20160606074832.GA1079@localhost.localdomain> (raw)
In-Reply-To: <CAOMqctTJL+JHFxoH9ktHenmZAwQi7bQVYybsBnbXb+7f8aUNJw@mail.gmail.com>

On Mon, Jun 06, 2016 at 09:08:47AM +0200, Michal Suchanek wrote:
> On 5 June 2016 at 20:23, Ladislav Michl <ladis@linux-mips.org> wrote:
> > On Sun, Jun 05, 2016 at 07:58:46PM +0200, Michal Suchanek wrote:
> >> There is similar problem on sunxi.
> >>
> >> Given this flash is non-removable and has many pins you are unlikely
> >> going to encounter its content on any system that was not loaded with
> >> u-boot.
> >>
> >> Still Linux can only produce fixed size mtdparts. You can prepend
> >> perfectly sized mtdparts for u-boot but until Linux is taught to
> >> follow that with its own partitions without gap you still need to use
> >> the worst case scenario for the start of the Linux partitions.
> >
> > I didn't get 'fixed size mtdparts' part. Linux supports cmdline
> > partition layout passing since the dawn of mtd subsystem (I used it more
> 
> Sure.
> 
> It does not, however, support size in anything but some kind of fixed
> size blocks.
> 
> It cannot adjust the layout for different media page size or erase
> block size. It cannot specify that a partition follows after another
> or extends to the end of medium.

That's not actually needed, as we know both page size and erase block size.
Therefore it is easy to make layout respect those values, which was actual
motivation for this patch. The later is simply not true, as you can
certainly create a partition that extends to the end of medium:
mtdparts=omap2-nand.0:512k(xloader),1920k(uboot),128k(uboot-env),10m(boot),-(rootfs)
Above is something that I want to avoid and replace with:
mtdparts=omap2-nand.0:<4*size_of_block>(SPL),-(UBI)
(actually this is going to be translated to DTB before booting kernel)
More free eraseblock for UBI, the better... Boot ROM reads from first
(4) bare sector(s) and everything else is stored in UBI volumes. This
is currently the only reliable way to make a use of MLC NAND.

> What you specify on the commandline is in no way related to the actual
> medium you are partitioning.

What I'm specifying on cmdline (DTB) is what I'm going to get. I has always
worked this way. Well, some drivers of even board support files had
partitioning hardcoded, but we are trying to get rid of that.

[snip]
> > Unless I'm missing something, partition layout is passed to the kernel
> > from the bootloader. So if kernel ends up with a different layout than
> > a bootloader, there's a bug somewhere and that should be fixed.
> 
> That's not it. The problem is that if this patch changes the layout
> then building u-boot before this patch gives one layout and after this
> patch it gives another layout effectively changing the partitioning.
> All to save a few megabytes of a several gigiabyte medium. And if you
> say that people can always set the partitioning by hand then it
> completely defeats the purpose of fine-tuning the default in the first
> place.

U-Boot never prevented people from shooting their own leg, therefore
there's no 'feature' preventing them to change default layout. They
are still free to do whatever they want it they find it useful.
Also I'm not proposing to change layout for exiting boards, just
proving way to do it. igep00x0 boards had buggy NAND support since
begining, so while fixing that, let's do it right way. Note that
this feature is completely optional.

> If on the other hand Linux got support for sizing partitions in nand
> pages or eraseblocks and a patch changed the mtdparts layout to use
> the new units then either both u-boot and Linux support the units or
> parsing the partition fails. So it's safe and flexible and more
> general and probably even less work on u-boot's part.

Okay, specifing size in therms of eraseblock would solve my problem
and I have to admit I'm not aware such a thing exists. Any pointer to
the patch introducing that change?

Thank you,
	ladis

  reply	other threads:[~2016-06-06  7:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-05 17:34 [U-Boot] [PATCH 0/6] cmd: mtdparts: Add support for runtime generated defaults Ladislav Michl
2016-06-05 17:38 ` [U-Boot] [PATCH 1/6] cmd: mtdparts: fix mtdparts variable presence confusion in mtdparts_init Ladislav Michl
2016-06-05 17:40 ` [U-Boot] [PATCH 2/6] cmd: mtdparts: fix null pointer dereference in parse_mtdparts Ladislav Michl
2016-06-05 17:41 ` [U-Boot] [PATCH 3/6] cmd: mtdparts: consolidate mtdparts reading from env Ladislav Michl
2016-06-05 17:42 ` [U-Boot] [PATCH 4/6] cmd: mtdparts: use defaults by default Ladislav Michl
2016-06-05 17:43 ` [U-Boot] [PATCH 5/6] cmd: mtdparts: support runtime generated mtdparts Ladislav Michl
2016-06-05 17:58   ` Michal Suchanek
2016-06-05 18:23     ` Ladislav Michl
2016-06-06  7:08       ` Michal Suchanek
2016-06-06  7:48         ` Ladislav Michl [this message]
2016-06-06 18:50           ` Michal Suchanek
2016-06-06 21:21             ` Ladislav Michl
2016-06-07  7:43               ` Michal Suchanek
2016-06-07 13:08                 ` Ladislav Michl
2016-06-05 17:43 ` [U-Boot] [PATCH 6/6] igep00x0: generate default mtdparts according NAND chip used Ladislav Michl

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=20160606074832.GA1079@localhost.localdomain \
    --to=ladis@linux-mips.org \
    --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