From: E Shattow <e@freeshell.de>
To: Yixun Lan <dlan@kernel.org>
Cc: u-boot@lists.u-boot-project.org, Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH 2/2] configs: spacemit: k3: enable mtdparts on Pico-ITX in main app
Date: Thu, 22 Oct 2026 00:41:22 -0700 [thread overview]
Message-ID: <ed97f914-cdd0-4dcd-bf4c-7b8a10f8bb5e@freeshell.de> (raw)
In-Reply-To: <20261022005754-GKO26088@kernel.org>
Hi Yixun,
On 10/21/26 17:57, Yixun Lan wrote:
> Hi E
>
> On 07:35 Wed 21 Oct , E Shattow wrote:
>> Hi Yixun,
>> ...
>> Let me know if you do yet prefer the bus address repeated for the name
>> of partition layout. I'd like to see this as part of a runtime-generated
>> mtdparts configuration, so anything is okay with me for the initial
>> manual layout here.
>>
> I've done a further check.. so quote from <uboot>/cmd/mtdparts.c
>
> * mtdparts=[mtdparts=]<mtd-def>[;<mtd-def>...]
> *
> * <mtd-def> := <mtd-id>:<part-def>[,<part-def>...]
> * <mtd-id> := unique device tag used by linux kernel to find mtd device (mtd->name)
>
> from kernel side, check file drivers/mtd/parsers/cmdlinepart.c which
> has the same format, on the linux console (if no mtdparts enabled)
Have a look also at comments in Linux function atmel_nand_attach_chip():
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mtd/nand/raw/atmel/nand-controller.c#n2008
"We keep the MTD name unchanged to avoid breaking platforms where the
MTD cmdline parser is used and the bootloader has not been updated to
use the new naming scheme."
"If the new bindings are used and the bootloader has not been updated to
pass a new mtdparts parameter on the cmdline, you should define the
following property in your nand node:"
label = "atmel_nand";
"This way, mtd->name will be set by the core when nand_set_flash_node()
is called."
The examples I can find of CONFIG_BOOTARGS in U-Boot source tree are:
1 mtdparts=mtdparts=atmel_nand
1 mtdparts=s3c-onenand
2 mtdparts=1550000.spi
2 mtdparts=1550000.spi-0
6 mtdparts=60000000.nor
45 mtdparts=atmel_nand
>
> # cat /sys/class/mtd/mtd0/name
> d420c000.spi
>
> so with bus address it's able to support cmdlinepart, although we
> currently use ofpart, but IMO, it's correct and in case people need it
Yes, although I will be clear to say this is some form of Linux
dev_name() and not the bus address, if that is yet a correct thing to
say. I'm only sure to confirm what you describe by running a build of
mainline Linux kernel with this configuration. For example:
# With StarFive JH-7110 SoC and mtdparts test Linux kernel
$ cat /sys/class/mtd/mtd0/name
13010000.spi.0
# With SpacemiT K3 SoC and mtdparts test Linux kernel
$ cat /sys/class/mtd/mtd0/name
d420c000.spi
If mtdparts=spi0.0... is on the commandline then it is not matched. Else
I use instead of spi0.0 the form of dev_name() as alluded to in the
mdtparts.c code then I do see the partitions appear in /proc/mtd
I would like to make a more exact description of where in mainline Linux
code that causes "d420c000.spi" (is this exactly the dev_name? and from
what code?) but it is at least enough for me now to confirm the effect
it has in testing and how to get this outcome without guessing.
Thanks again, and I'll send the requested changes shortly,
-E
prev parent reply other threads:[~2026-10-22 7:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 19:51 [PATCH 0/2] Enable SPI NOR flash for SpacemiT K3 in main app E Shattow
2026-10-20 19:51 ` [PATCH 1/2] configs: spacemit: k3: enable spi nor flash " E Shattow
2026-10-21 7:13 ` Yixun Lan
2026-10-21 7:37 ` E Shattow
2026-10-21 8:01 ` Yixun Lan
2026-10-21 15:47 ` E Shattow
2026-10-20 19:51 ` [PATCH 2/2] configs: spacemit: k3: enable mtdparts on Pico-ITX " E Shattow
2026-10-21 7:56 ` Yixun Lan
2026-10-21 14:35 ` E Shattow
2026-10-22 0:57 ` Yixun Lan
2026-10-22 7:41 ` E Shattow [this message]
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=ed97f914-cdd0-4dcd-bf4c-7b8a10f8bb5e@freeshell.de \
--to=e@freeshell.de \
--cc=dlan@kernel.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.