* Can U-Boot create mtdparts from device tree partition info?
@ 2024-03-06 16:48 Chuck Meade
2024-03-07 9:17 ` Alexander Dahl
0 siblings, 1 reply; 3+ messages in thread
From: Chuck Meade @ 2024-03-06 16:48 UTC (permalink / raw)
To: u-boot
Hello,
In looking through the source, I'm not yet seeing logic that allows U-Boot to actually use MTD partition information found in the device tree. Does this logic exist and I'm just missing it? Or do I
need to parse the device tree partitions manually and create the mtdparts env variable?
Sorry if this is obvious, I'm just not seeing it yet. Also, if the answer is just to manually enter the mtdparts env variable, and keep it in line with the partition information in the device tree as
a manual operation, please let me know that too. I'm just hoping there is a way to have U-Boot get the info from the device tree automatically.
Thanks very much,
Chuck
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Can U-Boot create mtdparts from device tree partition info?
2024-03-06 16:48 Can U-Boot create mtdparts from device tree partition info? Chuck Meade
@ 2024-03-07 9:17 ` Alexander Dahl
2024-03-07 22:10 ` Chuck Meade
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Dahl @ 2024-03-07 9:17 UTC (permalink / raw)
To: Chuck Meade; +Cc: u-boot
Hello Chuck,
Am Wed, Mar 06, 2024 at 11:48:39AM -0500 schrieb Chuck Meade:
> Hello,
>
> In looking through the source, I'm not yet seeing logic that allows U-Boot
> to actually use MTD partition information found in the device tree. Does
> this logic exist and I'm just missing it? Or do I need to parse the device
> tree partitions manually and create the mtdparts env variable?
U-Boot can use the partition information from device tree, but not
with mtdparts. Try enabling CMD_MTD and run `mtd list` and you will
see those partitions.
> Sorry if this is obvious, I'm just not seeing it yet. Also, if the answer
> is just to manually enter the mtdparts env variable, and keep it in line
> with the partition information in the device tree as a manual operation,
> please let me know that too. I'm just hoping there is a way to have U-Boot
> get the info from the device tree automatically.
You could do that, but it is probably not necessary. The 'nand'
command has some nice ways to enter commands using those mtdparts
labels, but the 'mtd' covers the basic features like read, write,
erase too, also with names, but with a different calling syntax for
the commands.
Unfortunately the 'nand' command uses mtdparts only and does not work
with partitions defined in DT. The 'mtd' command is organized
differently and you might not find all features the 'nand' command
has.
Greets
Alex
>
> Thanks very much,
> Chuck
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Can U-Boot create mtdparts from device tree partition info?
2024-03-07 9:17 ` Alexander Dahl
@ 2024-03-07 22:10 ` Chuck Meade
0 siblings, 0 replies; 3+ messages in thread
From: Chuck Meade @ 2024-03-07 22:10 UTC (permalink / raw)
To: u-boot
Hi Alex,
On Thu, Mar 7, 2024 at 4:17 AM Alexander Dahl <ada@thorsis.com> wrote:
> Hello Chuck,
>
> Am Wed, Mar 06, 2024 at 11:48:39AM -0500 schrieb Chuck Meade:
> > Hello,
> >
> > In looking through the source, I'm not yet seeing logic that allows
> U-Boot
> > to actually use MTD partition information found in the device tree. Does
> > this logic exist and I'm just missing it? Or do I need to parse the
> device
> > tree partitions manually and create the mtdparts env variable?
>
> U-Boot can use the partition information from device tree, but not
> with mtdparts. Try enabling CMD_MTD and run `mtd list` and you will
> see those partitions.
>
Thanks very much for the info. I am using a U-Boot source tree from a
Petalinux distro, and it turns out that there has been a patch to U-Boot
since this distro was created, involving flash_node in mtdparts.c. I was
able to incorporate this patch into the U-Boot source tree here and the
"mtd list" version now works as you described. I can see all of the MTD
partitions from my device tree.
I appreciate your help! Thanks,
Chuck
>
> > Sorry if this is obvious, I'm just not seeing it yet. Also, if the
> answer
> > is just to manually enter the mtdparts env variable, and keep it in line
> > with the partition information in the device tree as a manual operation,
> > please let me know that too. I'm just hoping there is a way to have
> U-Boot
> > get the info from the device tree automatically.
>
> You could do that, but it is probably not necessary. The 'nand'
> command has some nice ways to enter commands using those mtdparts
> labels, but the 'mtd' covers the basic features like read, write,
> erase too, also with names, but with a different calling syntax for
> the commands.
>
> Unfortunately the 'nand' command uses mtdparts only and does not work
> with partitions defined in DT. The 'mtd' command is organized
> differently and you might not find all features the 'nand' command
> has.
>
> Greets
> Alex
>
> >
> > Thanks very much,
> > Chuck
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-03-07 22:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06 16:48 Can U-Boot create mtdparts from device tree partition info? Chuck Meade
2024-03-07 9:17 ` Alexander Dahl
2024-03-07 22:10 ` Chuck Meade
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox