u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: "Marek Behún" <marek.behun@nic.cz>
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de,
	"Masami Hiramatsu" <masami.hiramatsu@linaro.org>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Patrice CHOTARD" <patrice.chotard@foss.st.com>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Pali Rohár" <pali@kernel.org>, "Simon Glass" <sjg@chromium.org>
Subject: u-boot and mtdparts
Date: Thu, 15 Jul 2021 20:13:55 +0200	[thread overview]
Message-ID: <20210715201355.5f571f27@dellmb> (raw)

Hello Tom and others,

many boards still use the obsolete mtdparts command.
What is the plan with this command? Do we still want to support it?

Recently as discovered by Masami, my patch
  mtd: spi-nor: allow  registering multiple MTDs when DM is enabled
caused that mtds may have different name than that defined in
CONFIG_MTDPARTS_DEFAULT.
Masami fixed his board by putting the partition definitions into
devicetree, but there are still many boards that may be broken.

The easy fix here is to make mtd_device_matches_name() in
drivers/mtd/mtdcore.c to support the old names. Most of them are in
format "type.id", for example "nor.1", "nand.1", but some are different.

The problem is that I do not know how exactly to match these names with
the devices. Does the number represent the bus, or chip select or
something else?

There are also multiple parsers of the mtdparts string (at least two,
one in cmd/mtdparts.c and the other in drivers/mtd/mtd_uboot.c).

IMO the proper solution would be to get rid of the mtdparts entirely,
move it to devicetree, and add code that generates the mtdparts string
for Linux' command line from devicetree.

What do you think?

Marek

             reply	other threads:[~2021-07-15 18:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15 18:13 Marek Behún [this message]
2021-07-15 18:26 ` u-boot and mtdparts Simon Glass
2021-07-15 20:50 ` Tom Rini

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=20210715201355.5f571f27@dellmb \
    --to=marek.behun@nic.cz \
    --cc=jagan@amarulasolutions.com \
    --cc=masami.hiramatsu@linaro.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=pali@kernel.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.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;
as well as URLs for NNTP newsgroup(s).