linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* regression: nand/spi flashes listed in reversed order after "ARM: dts: at91: Switch to the new NAND bindings"
@ 2019-06-26  9:36 Andreas Fenkart
  2019-06-27 10:44 ` Andreas Fenkart
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Fenkart @ 2019-06-26  9:36 UTC (permalink / raw)
  To: devicetree, linux-mtd; +Cc: alexandre.belloni, Michonski, Krzysztof

After this patch, which is of course much appreciated:

1004a2977bdc7566bca87c565541c3232ed467c4
Refs: v4.12-rc1-7-g1004a2977bdc
Author:     Boris Brezillon <boris.brezillon@free-electrons.com>
AuthorDate: Tue May 30 11:20:53 2017 +0200
Commit:     Alexandre Belloni <alexandre.belloni@free-electrons.com>
CommitDate: Wed May 31 11:55:41 2017 +0200

    ARM: dts: at91: Switch to the new NAND bindings

    Use the new EBI/NAND bindings to declare NAND chips and remove old NAND
    nodes along the way.

    Note that we keep using old bindings in at91rm9200.dtsi because this
    SoC is not supported by the EBI driver.

The listing and indexing of my mtd devices changed:

root@after:~# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00010000 "spi32766.0"
...
mtd4: 32000000 00080000 "rootfs"
mtd5: 0bc00000 00080000 "config"

root@before:~# cat /proc/mtd
dev:    size   erasesize  name
...
mtd3: 32000000 00080000 "rootfs"
mtd4: 0bc00000 00080000 "config"
mtd5: 00080000 00010000 "spi32766.0"


I assume sorting the mtd listing in a specific order is not supported
nor desired by the mtd maintainers. So I'm not argueing about that.

But since the index of rootfs device is hard-coded in the cmdline, the
fw-utils config file and a custom script to backup/retrieve
configuration, this is causing me some problems.

The nand is partitioned, the spi is not:
mtdparts=mtdparts=atmel_nand:2M(foo),2M(bar),32M(baz),800M(rootfs),-(config)

While the bootargs can be fixed easily by using the human readable
name (ubi.mtd=rootfs). I can't retrieve that human readable name from
udev alone, nor can I build something from major/minor alone, since
the major is the same for nand/spi flash.

root@before:/etc/udev/rules.d# udevadm info /dev/mtd3
P: /devices/platform/ahb/40000000.nand/mtd/mtd3
N: mtd3
E: DEVNAME=/dev/mtd3
E: DEVPATH=/devices/platform/ahb/40000000.nand/mtd/mtd3
E: DEVTYPE=mtd
E: MAJOR=90
E: MINOR=6

root@dSS:/etc/udev/rules.d# udevadm info /dev/mtd5
P: /devices/platform/ahb/ahb:apb/fffc8000.spi/spi_master/spi32766/spi32766.0/mtd/mtd5
N: mtd5
E: DEVNAME=/dev/mtd5
E: DEVPATH=/devices/platform/ahb/ahb:apb/fffc8000.spi/spi_master/spi32766/spi32766.0/mtd/mtd5
E: DEVTYPE=mtd
E: MAJOR=90
E: MINOR=10
E: OF_COMPATIBLE_0=st,m25p40
E: OF_COMPATIBLE_N=1
E: OF_FULLNAME=/ahb/apb/spi@fffc8000/m25p40@0
E: OF_NAME=m25p40
E: SUBSYSTEM=mtd

What is the preferred to make the rootfs agnostic of a particular mtd
listing order

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: regression: nand/spi flashes listed in reversed order after "ARM: dts: at91: Switch to the new NAND bindings"
  2019-06-26  9:36 regression: nand/spi flashes listed in reversed order after "ARM: dts: at91: Switch to the new NAND bindings" Andreas Fenkart
@ 2019-06-27 10:44 ` Andreas Fenkart
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Fenkart @ 2019-06-27 10:44 UTC (permalink / raw)
  To: devicetree, linux-mtd; +Cc: alexandre.belloni, Michonski, Krzysztof

fyi,

actually straight forward when also dumping the attributes:
udevadm info -a /dev/mtd0

here my rules
SUBSYSTEM=="mtd", ATTR{type}=="nand", ACTION=="add", SYMLINK+="mtd/%s{name}"
SUBSYSTEM=="mtd", ATTR{type}=="nor", ACTION=="add" SYMLINK+="mtd/spi"

/andi

Am Mi., 26. Juni 2019 um 11:36 Uhr schrieb Andreas Fenkart <afenkart@gmail.com>:
>
> After this patch, which is of course much appreciated:
>
> 1004a2977bdc7566bca87c565541c3232ed467c4
> Refs: v4.12-rc1-7-g1004a2977bdc
> Author:     Boris Brezillon <boris.brezillon@free-electrons.com>
> AuthorDate: Tue May 30 11:20:53 2017 +0200
> Commit:     Alexandre Belloni <alexandre.belloni@free-electrons.com>
> CommitDate: Wed May 31 11:55:41 2017 +0200
>
>     ARM: dts: at91: Switch to the new NAND bindings
>
>     Use the new EBI/NAND bindings to declare NAND chips and remove old NAND
>     nodes along the way.
>
>     Note that we keep using old bindings in at91rm9200.dtsi because this
>     SoC is not supported by the EBI driver.
>
> The listing and indexing of my mtd devices changed:
>
> root@after:~# cat /proc/mtd
> dev:    size   erasesize  name
> mtd0: 00080000 00010000 "spi32766.0"
> ...
> mtd4: 32000000 00080000 "rootfs"
> mtd5: 0bc00000 00080000 "config"
>
> root@before:~# cat /proc/mtd
> dev:    size   erasesize  name
> ...
> mtd3: 32000000 00080000 "rootfs"
> mtd4: 0bc00000 00080000 "config"
> mtd5: 00080000 00010000 "spi32766.0"
>
>
> I assume sorting the mtd listing in a specific order is not supported
> nor desired by the mtd maintainers. So I'm not argueing about that.
>
> But since the index of rootfs device is hard-coded in the cmdline, the
> fw-utils config file and a custom script to backup/retrieve
> configuration, this is causing me some problems.
>
> The nand is partitioned, the spi is not:
> mtdparts=mtdparts=atmel_nand:2M(foo),2M(bar),32M(baz),800M(rootfs),-(config)
>
> While the bootargs can be fixed easily by using the human readable
> name (ubi.mtd=rootfs). I can't retrieve that human readable name from
> udev alone, nor can I build something from major/minor alone, since
> the major is the same for nand/spi flash.
>
> root@before:/etc/udev/rules.d# udevadm info /dev/mtd3
> P: /devices/platform/ahb/40000000.nand/mtd/mtd3
> N: mtd3
> E: DEVNAME=/dev/mtd3
> E: DEVPATH=/devices/platform/ahb/40000000.nand/mtd/mtd3
> E: DEVTYPE=mtd
> E: MAJOR=90
> E: MINOR=6
>
> root@dSS:/etc/udev/rules.d# udevadm info /dev/mtd5
> P: /devices/platform/ahb/ahb:apb/fffc8000.spi/spi_master/spi32766/spi32766.0/mtd/mtd5
> N: mtd5
> E: DEVNAME=/dev/mtd5
> E: DEVPATH=/devices/platform/ahb/ahb:apb/fffc8000.spi/spi_master/spi32766/spi32766.0/mtd/mtd5
> E: DEVTYPE=mtd
> E: MAJOR=90
> E: MINOR=10
> E: OF_COMPATIBLE_0=st,m25p40
> E: OF_COMPATIBLE_N=1
> E: OF_FULLNAME=/ahb/apb/spi@fffc8000/m25p40@0
> E: OF_NAME=m25p40
> E: SUBSYSTEM=mtd
>
> What is the preferred to make the rootfs agnostic of a particular mtd
> listing order

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-27 10:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26  9:36 regression: nand/spi flashes listed in reversed order after "ARM: dts: at91: Switch to the new NAND bindings" Andreas Fenkart
2019-06-27 10:44 ` Andreas Fenkart

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).