Skip to contentSkip to conversation

ARM: dts: rmobile: Drop MTD partitioning from DT

PATCH Superseded Marek Vasut 3 participants 9 messages May 30, 2018 – Jul 22, 2018 Device tree bindings

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

Drop the MTD partitioning from DT, since it does not describe HW and to give way to a more flexible kernel command line partition passing.

To retain the original partitioning, assure you have enabled CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the following to your kernel command line:

lager:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
stout:   mtdparts=spi0.0:512k(loader),256k(uboot),256k(uboot-env),-(flash)
koelsch: mtdparts=spi0.0:512k(loader),5632k(user),-(flash)
porter:  mtdparts=spi0.0:256k(loader_prg),4m(user_prg),-(flash_fs)
wheat:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
gose:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
alt:     mtdparts=spi0.0:256k(loader),256k(system),-(user)
silk:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
Cc Geert Uytterhoeven <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc linux-renesas-soc at vger.kernel.org

---
V2: Drop the @0 anchor from the commit message, use 4m
V3: Squash the patches into one as requested by the higher ups

---
 arch/arm/boot/dts/r8a7790-lager.dts   | 21 ---------------------
 arch/arm/boot/dts/r8a7790-stout.dts   | 26 --------------------------
 arch/arm/boot/dts/r8a7791-koelsch.dts | 21 ---------------------
 arch/arm/boot/dts/r8a7791-porter.dts  | 21 ---------------------
 arch/arm/boot/dts/r8a7792-wheat.dts   | 21 ---------------------
 arch/arm/boot/dts/r8a7793-gose.dts    | 21 ---------------------
 arch/arm/boot/dts/r8a7794-alt.dts     | 21 ---------------------
 arch/arm/boot/dts/r8a7794-silk.dts    | 21 ---------------------
 8 files changed, 173 deletions(-)
arch/arm/boot/dts/r8a7790-lager.dts +0 -21
index 092610e3f953..7c95e62efd46 100644
@@ -710,27 +710,6 @@
 		spi-cpha;
 		spi-cpol;
 		m25p,fast-read;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "loader";
-				reg = <0x00000000 0x00040000>;
-				read-only;
-			};
-			partition at 40000 {
-				label = "user";
-				reg = <0x00040000 0x00400000>;
-				read-only;
-			};
-			partition at 440000 {
-				label = "flash";
-				reg = <0x00440000 0x03bc0000>;
-			};
-		};
 	};
 };
 
arch/arm/boot/dts/r8a7790-stout.dts +0 -26
index a13a92c26645..dc65519d53ab 100644
@@ -211,32 +211,6 @@
 		spi-cpha;
 		spi-cpol;
 		m25p,fast-read;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "loader";
-				reg = <0x00000000 0x00080000>;
-				read-only;
-			};
-			partition at 80000 {
-				label = "uboot";
-				reg = <0x00080000 0x00040000>;
-				read-only;
-			};
-			partition at c0000 {
-				label = "uboot-env";
-				reg = <0x000c0000 0x00040000>;
-				read-only;
-			};
-			partition at 100000 {
-				label = "flash";
-				reg = <0x00100000 0x03f00000>;
-			};
-		};
 	};
 };
 
arch/arm/boot/dts/r8a7791-koelsch.dts +0 -21
index 8ab793d8b2fd..406d5d29e29c 100644
@@ -724,27 +724,6 @@
 		spi-cpha;
 		spi-cpol;
 		m25p,fast-read;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "loader";
-				reg = <0x00000000 0x00080000>;
-				read-only;
-			};
-			partition at 80000 {
-				label = "user";
-				reg = <0x00080000 0x00580000>;
-				read-only;
-			};
-			partition at 600000 {
-				label = "flash";
-				reg = <0x00600000 0x03a00000>;
-			};
-		};
 	};
 };
 
arch/arm/boot/dts/r8a7791-porter.dts +0 -21
index a01101b49d99..45d89e064407 100644
@@ -344,27 +344,6 @@
 		spi-tx-bus-width = <4>;
 		spi-rx-bus-width = <4>;
 		m25p,fast-read;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "loader_prg";
-				reg = <0x00000000 0x00040000>;
-				read-only;
-			};
-			partition at 40000 {
-				label = "user_prg";
-				reg = <0x00040000 0x00400000>;
-				read-only;
-			};
-			partition at 440000 {
-				label = "flash_fs";
-				reg = <0x00440000 0x03bc0000>;
-			};
-		};
 	};
 };
 
arch/arm/boot/dts/r8a7792-wheat.dts +0 -21
index db01de7a3811..93f78716225a 100644
@@ -217,27 +217,6 @@
 		spi-cpol;
 		spi-cpha;
 		m25p,fast-read;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "loader";
-				reg = <0x00000000 0x00040000>;
-				read-only;
-			};
-			partition at 40000 {
-				label = "user";
-				reg = <0x00040000 0x00400000>;
-				read-only;
-			};
-			partition at 440000 {
-				label = "flash";
-				reg = <0x00440000 0x03bc0000>;
-			};
-		};
 	};
 };
 
arch/arm/boot/dts/r8a7793-gose.dts +0 -21
index aa209f6e5d71..b2dd54fbe40c 100644
@@ -676,27 +676,6 @@
 		spi-cpol;
 		spi-cpha;
 		m25p,fast-read;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "loader";
-				reg = <0x00000000 0x00040000>;
-				read-only;
-			};
-			partition at 40000 {
-				label = "user";
-				reg = <0x00040000 0x00400000>;
-				read-only;
-			};
-			partition at 440000 {
-				label = "flash";
-				reg = <0x00440000 0x03bc0000>;
-			};
-		};
 	};
 };
 
arch/arm/boot/dts/r8a7794-alt.dts +0 -21
index e17027532941..1d044ed598f3 100644
@@ -419,26 +419,5 @@
 		spi-cpol;
 		spi-cpha;
 		m25p,fast-read;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "loader";
-				reg = <0x00000000 0x00040000>;
-				read-only;
-			};
-			partition at 40000 {
-				label = "system";
-				reg = <0x00040000 0x00040000>;
-				read-only;
-			};
-			partition at 80000 {
-				label = "user";
-				reg = <0x00080000 0x03f80000>;
-			};
-		};
 	};
 };
arch/arm/boot/dts/r8a7794-silk.dts +0 -21
index 7808aaee6644..b8163a0e2190 100644
@@ -444,27 +444,6 @@
 		spi-cpol;
 		spi-cpha;
 		m25p,fast-read;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "loader";
-				reg = <0x00000000 0x00040000>;
-				read-only;
-			};
-			partition at 40000 {
-				label = "user";
-				reg = <0x00040000 0x00400000>;
-				read-only;
-			};
-			partition at 440000 {
-				label = "flash";
-				reg = <0x00440000 0x03bc0000>;
-			};
-		};
 	};
 };
 
Signature · 1 line
2.17.0
Applied
#1 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

Quoted 26 lines · Marek Vasut

Drop the MTD partitioning from DT, since it does not describe HW and to give way to a more flexible kernel command line partition passing.

To retain the original partitioning, assure you have enabled CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the following to your kernel command line:

lager:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
stout:   mtdparts=spi0.0:512k(loader),256k(uboot),256k(uboot-env),-(flash)
koelsch: mtdparts=spi0.0:512k(loader),5632k(user),-(flash)
porter:  mtdparts=spi0.0:256k(loader_prg),4m(user_prg),-(flash_fs)
wheat:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
gose:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
alt:     mtdparts=spi0.0:256k(loader),256k(system),-(user)
silk:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
Cc Geert Uytterhoeven <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc linux-renesas-soc at vger.kernel.org
Quoted 3 lines

---
V2: Drop the @0 anchor from the commit message, use 4m
V3: Squash the patches into one as requested by the higher ups

Thanks, applied.

#2 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

In reply to Marek Vasut

Hi,

Quoted 8 lines · Marek Vasut

Drop the MTD partitioning from DT, since it does not describe HW and to give way to a more flexible kernel command line partition passing.

To retain the original partitioning, assure you have enabled CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the following to your kernel command line:

Quoted 8 lines
lager:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
stout:   mtdparts=spi0.0:512k(loader),256k(uboot),256k(uboot-env),-(flash)
koelsch: mtdparts=spi0.0:512k(loader),5632k(user),-(flash)
porter:  mtdparts=spi0.0:256k(loader_prg),4m(user_prg),-(flash_fs)
wheat:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
gose:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
alt:     mtdparts=spi0.0:256k(loader),256k(system),-(user)
silk:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)

Having to specify on command line is such a nasty hack. I wish we could remove that, and at the very least not add it for anything new.

You end up with user space tools trying to parse the kernel command line to figure out what's on the flash, and other really bad habits. :(

I'd strongly advice you to keep this in the board files, unless you have an actual real motivation for changing it. This patch does not provide one.

-Olof

#3 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

Quoted 1 line · Olof Johansson

Hi,

Hi,

Quoted 18 lines · Marek Vasut
Quoted 8 lines

Drop the MTD partitioning from DT, since it does not describe HW and to give way to a more flexible kernel command line partition passing.

To retain the original partitioning, assure you have enabled CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the following to your kernel command line:

Quoted 8 lines
lager:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
stout:   mtdparts=spi0.0:512k(loader),256k(uboot),256k(uboot-env),-(flash)
koelsch: mtdparts=spi0.0:512k(loader),5632k(user),-(flash)
porter:  mtdparts=spi0.0:256k(loader_prg),4m(user_prg),-(flash_fs)
wheat:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
gose:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
alt:     mtdparts=spi0.0:256k(loader),256k(system),-(user)
silk:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
Quoted 2 lines

Having to specify on command line is such a nasty hack. I wish we could remove that, and at the very least not add it for anything new.

Do you have a better suggestion ?

Quoted 3 lines

You end up with user space tools trying to parse the kernel command line to figure out what's on the flash, and other really bad habits. :(

You should just read /proc/mtd , see
http://www.linux-mtd.infradead.org/doc/general.html

Quoted 3 lines

I'd strongly advice you to keep this in the board files, unless you have an actual real motivation for changing it. This patch does not provide one.

Partitioning is not hardware description, it should not be in DT.

Signature · 2 lines
Best regards,
Marek Vasut
#4 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

Quoted 23 lines · Marek Vasut
Quoted 1 line · Olof Johansson

Hi,

Hi,

Quoted 18 lines · Marek Vasut
Quoted 16 lines

Drop the MTD partitioning from DT, since it does not describe HW and to give way to a more flexible kernel command line partition passing.

To retain the original partitioning, assure you have enabled CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the following to your kernel command line:

lager:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
stout:   mtdparts=spi0.0:512k(loader),256k(uboot),256k(uboot-env),-(flash)
koelsch: mtdparts=spi0.0:512k(loader),5632k(user),-(flash)
porter:  mtdparts=spi0.0:256k(loader_prg),4m(user_prg),-(flash_fs)
wheat:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
gose:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
alt:     mtdparts=spi0.0:256k(loader),256k(system),-(user)
silk:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
Quoted 4 lines
Quoted 2 lines

Having to specify on command line is such a nasty hack. I wish we could remove that, and at the very least not add it for anything new.

Do you have a better suggestion ?

Yes, keep it in DT.

Quoted 6 lines
Quoted 3 lines

You end up with user space tools trying to parse the kernel command line to figure out what's on the flash, and other really bad habits. :(

You should just read /proc/mtd , see
http://www.linux-mtd.infradead.org/doc/general.html

Sure, I know that but not everybody does, and they do it in bad ways if given the opportunity.

Quoted 5 lines
Quoted 3 lines

I'd strongly advice you to keep this in the board files, unless you have an actual real motivation for changing it. This patch does not provide one.

Partitioning is not hardware description, it should not be in DT.

Read my reply again. It's part of _platform_ description, and belongs in DT.

-Olof

#5 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

Quoted 24 lines · Olof Johansson
Quoted 23 lines · Marek Vasut
Quoted 1 line · Olof Johansson

Hi,

Hi,

Quoted 18 lines · Marek Vasut
Quoted 16 lines

Drop the MTD partitioning from DT, since it does not describe HW and to give way to a more flexible kernel command line partition passing.

To retain the original partitioning, assure you have enabled CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the following to your kernel command line:

lager:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
stout:   mtdparts=spi0.0:512k(loader),256k(uboot),256k(uboot-env),-(flash)
koelsch: mtdparts=spi0.0:512k(loader),5632k(user),-(flash)
porter:  mtdparts=spi0.0:256k(loader_prg),4m(user_prg),-(flash_fs)
wheat:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
gose:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
alt:     mtdparts=spi0.0:256k(loader),256k(system),-(user)
silk:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Having to specify on command line is such a nasty hack. I wish we could remove that, and at the very least not add it for anything new.

Do you have a better suggestion ?

Yes, keep it in DT.

See below

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

You end up with user space tools trying to parse the kernel command line to figure out what's on the flash, and other really bad habits. :(

You should just read /proc/mtd , see
http://www.linux-mtd.infradead.org/doc/general.html

Sure, I know that but not everybody does, and they do it in bad ways if given the opportunity.

That's what the documentation is for. I assume whoever is using MTD is also capable of reading the documentation and thus avoiding such basic mistakes.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I'd strongly advice you to keep this in the board files, unless you have an actual real motivation for changing it. This patch does not provide one.

Partitioning is not hardware description, it should not be in DT.

Read my reply again. It's part of _platform_ description, and belongs in DT.

I can repartition the flash whichever way I want for my purposes, just like I can repartition a harddrive. We don't have harddrive partitioning in the DT, why should we have flash partitioning there ? How do those differ ?

Signature · 2 lines
Best regards,
Marek Vasut
#6 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

Quoted 41 lines · Marek Vasut
Quoted 24 lines · Olof Johansson
Quoted 23 lines · Marek Vasut
Quoted 1 line · Olof Johansson

Hi,

Hi,

Quoted 18 lines · Marek Vasut
Quoted 16 lines

Drop the MTD partitioning from DT, since it does not describe HW and to give way to a more flexible kernel command line partition passing.

To retain the original partitioning, assure you have enabled CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the following to your kernel command line:

lager:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
stout:   mtdparts=spi0.0:512k(loader),256k(uboot),256k(uboot-env),-(flash)
koelsch: mtdparts=spi0.0:512k(loader),5632k(user),-(flash)
porter:  mtdparts=spi0.0:256k(loader_prg),4m(user_prg),-(flash_fs)
wheat:   mtdparts=spi0.0:256k(loader),4m(user),-(flash)
gose:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
alt:     mtdparts=spi0.0:256k(loader),256k(system),-(user)
silk:    mtdparts=spi0.0:256k(loader),4m(user),-(flash)
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Having to specify on command line is such a nasty hack. I wish we could remove that, and at the very least not add it for anything new.

Do you have a better suggestion ?

Yes, keep it in DT.

See below

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

You end up with user space tools trying to parse the kernel command line to figure out what's on the flash, and other really bad habits. :(

You should just read /proc/mtd , see
http://www.linux-mtd.infradead.org/doc/general.html

Quoted 6 lines
Quoted 2 lines

Sure, I know that but not everybody does, and they do it in bad ways if given the opportunity.

That's what the documentation is for. I assume whoever is using MTD is also capable of reading the documentation and thus avoiding such basic mistakes.

Why read the docs when the information obviously is there when you grep it?

I'm agreeing with you -- I've just seen it done wrong so many times. Making it harder to make mistakes is always a good thing.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

I'd strongly advice you to keep this in the board files, unless you have an actual real motivation for changing it. This patch does not provide one.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Partitioning is not hardware description, it should not be in DT.

Read my reply again. It's part of _platform_ description, and belongs in DT.

I can repartition the flash whichever way I want for my purposes, just like I can repartition a harddrive. We don't have harddrive partitioning in the DT, why should we have flash partitioning there ? How do those differ ?

A drive can be auto-probed. We have partition tables on the disk that self-describes the contents.

That doesn't exist on flashes, at least not usually. This is really unfortunate, I wish we could change _that_ instead of argue here.

If you repartition your disk, you need to change the command line arguments to the kernel too. It's definitely not an argument to keeping it on the command line instead.

Also, you now have a dependencies between hardware description, probe order and stable naming in the kernel, and the command line. With DT, you have it all in one place, right next to the flash part. It doesn't matter what name it gets probed at, and nobody needs to know the mapping to get it right.

-Olof

#7 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

On 07/22/2018 12:23 AM, Olof Johansson wrote:
[...]

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

You end up with user space tools trying to parse the kernel command line to figure out what's on the flash, and other really bad habits. :(

You should just read /proc/mtd , see
http://www.linux-mtd.infradead.org/doc/general.html

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Sure, I know that but not everybody does, and they do it in bad ways if given the opportunity.

That's what the documentation is for. I assume whoever is using MTD is also capable of reading the documentation and thus avoiding such basic mistakes.

Why read the docs when the information obviously is there when you grep it?

To do things correctly of course.

Quoted 2 lines

I'm agreeing with you -- I've just seen it done wrong so many times. Making it harder to make mistakes is always a good thing.

If you follow this argument through, you could say we should start plucking out random files from /proc because someone might cluelessly misuse them. This might lead to a system that's hard to misuse indeed, but likely also quite useless.

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

I'd strongly advice you to keep this in the board files, unless you have an actual real motivation for changing it. This patch does not provide one.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Partitioning is not hardware description, it should not be in DT.

Read my reply again. It's part of _platform_ description, and belongs in DT.

I can repartition the flash whichever way I want for my purposes, just like I can repartition a harddrive. We don't have harddrive partitioning in the DT, why should we have flash partitioning there ? How do those differ ?

Quoted 5 lines

A drive can be auto-probed. We have partition tables on the disk that self-describes the contents.

That doesn't exist on flashes, at least not usually. This is really unfortunate, I wish we could change _that_ instead of argue here.

Technically it does. Consider the fact that those flashes have between 4-64 MiB in size and sector size of 256 kiB . If you waste one sector on the 4 MiB flash for some sort of partition table, you waste 1/16th of the flash, which is a lot.

The bootloader needs to know the flash layout and it must be in sync with the kernel, so there has to be some sort of communication channel between those two. I don't want to add handler for every possible bootloader that can be used on those platforms into the kernel though.

Quoted 3 lines

If you repartition your disk, you need to change the command line arguments to the kernel too. It's definitely not an argument to keeping it on the command line instead.

How so ? /dev/sdxy remains /dev/sdxy . Sure, you can use UUID and change it, but that's a specific case.

Quoted 5 lines

Also, you now have a dependencies between hardware description, probe order and stable naming in the kernel, and the command line. With DT, you have it all in one place, right next to the flash part. It doesn't matter what name it gets probed at, and nobody needs to know the mapping to get it right.

In this case it doesn't matter either, since you have only one flash device.

Signature · 2 lines
Best regards,
Marek Vasut
#8 lore raw

PATCH 1/1 ARM: dts: rmobile: Drop MTD partitioning from DT

Quoted 52 lines · Marek Vasut

On 07/22/2018 12:23 AM, Olof Johansson wrote:
[...]

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

You end up with user space tools trying to parse the kernel command line to figure out what's on the flash, and other really bad habits. :(

You should just read /proc/mtd , see
http://www.linux-mtd.infradead.org/doc/general.html

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Sure, I know that but not everybody does, and they do it in bad ways if given the opportunity.

That's what the documentation is for. I assume whoever is using MTD is also capable of reading the documentation and thus avoiding such basic mistakes.

Why read the docs when the information obviously is there when you grep it?

To do things correctly of course.

Quoted 2 lines

I'm agreeing with you -- I've just seen it done wrong so many times. Making it harder to make mistakes is always a good thing.

If you follow this argument through, you could say we should start plucking out random files from /proc because someone might cluelessly misuse them. This might lead to a system that's hard to misuse indeed, but likely also quite useless.

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines

I'd strongly advice you to keep this in the board files, unless you have an actual real motivation for changing it. This patch does not provide one.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Partitioning is not hardware description, it should not be in DT.

Read my reply again. It's part of _platform_ description, and belongs in DT.

I can repartition the flash whichever way I want for my purposes, just like I can repartition a harddrive. We don't have harddrive partitioning in the DT, why should we have flash partitioning there ? How do those differ ?

Quoted 5 lines

A drive can be auto-probed. We have partition tables on the disk that self-describes the contents.

That doesn't exist on flashes, at least not usually. This is really unfortunate, I wish we could change _that_ instead of argue here.

Technically it does. Consider the fact that those flashes have between 4-64 MiB in size and sector size of 256 kiB . If you waste one sector on the 4 MiB flash for some sort of partition table, you waste 1/16th of the flash, which is a lot.

Quoted 4 lines

The bootloader needs to know the flash layout and it must be in sync with the kernel, so there has to be some sort of communication channel between those two. I don't want to add handler for every possible bootloader that can be used on those platforms into the kernel though.

The standard argument here, is always to have the bootloader patch up the device tree to make it represent the actual device. We do this all the time for things such as command line, memory sizes, ethernet addresses, etc. This is no different.

Quoted 7 lines
Quoted 3 lines

If you repartition your disk, you need to change the command line arguments to the kernel too. It's definitely not an argument to keeping it on the command line instead.

How so ? /dev/sdxy remains /dev/sdxy . Sure, you can use UUID and change it, but that's a specific case.

Quoted 7 lines
Quoted 5 lines

Also, you now have a dependencies between hardware description, probe order and stable naming in the kernel, and the command line. With DT, you have it all in one place, right next to the flash part. It doesn't matter what name it gets probed at, and nobody needs to know the mapping to get it right.

In this case it doesn't matter either, since you have only one flash device.

In this very narrow case maybe, but in general it's a horrible idea to encourage people to use the command line instead of device tree for this.

I'm still waiting on a compelling argument to motivate why this patch should be applied. I don't think there is one, so let's not apply it.

-Olof