linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: ls1028a: make the eMMC and SD card controllers use fixed indices
@ 2020-11-19 16:38 Vladimir Oltean
  2020-11-19 18:12 ` Michael Walle
  2020-11-30 14:39 ` Shawn Guo
  0 siblings, 2 replies; 3+ messages in thread
From: Vladimir Oltean @ 2020-11-19 16:38 UTC (permalink / raw)
  To: Shawn Guo, Li Yang, Rob Herring, linux-arm-kernel, devicetree
  Cc: Adrian Hunter, Ulf Hansson, linux-mmc, linux-kernel,
	Ashish Kumar, Yangbo Lu, Michael Walle

As the boot order in the kernel continues to change, sometimes it may
happen that the eSDHC controller mmc@2150000 (the one for eMMC) gets
probed before the one at mmc@2140000 (for external SD cards). The effect
is that the eMMC controller gets the /dev/mmcblk0 name, and the SD card
gets /dev/mmcblk1.

Since the introduction of this SoC, that has never happened in practice,
even though it was never guaranteed in theory. Setting
"root=/dev/mmcblk0p2" in /proc/cmdline has always caused the kernel to
use the second partition from the SD card as the rootfs.

The NXP development boards are typically shipped with either
- LSDK, which uses "root=UUID=", or
- OpenIL, which uses "root=/dev/mmcblkNp2"

So for OpenIL, let's preserve that old behavior by adding some aliases
which create naming consistency (for LSDK it doesn't matter):
- the SD card controller uses /dev/mmcblk0
- the eMMC controller uses /dev/mmcblk1

For the Kontron SL28 boards, Michael Walle says that they are shipped
with "root=UUID=" already, so the probing order doesn't matter, but it
is more natural to him for /dev/mmcblk0 to be the eMMC, so let's do it
the other way around there.

The aliases are parsed by mmc_alloc_host() in drivers/mmc/core/host.c.

Cc: Ashish Kumar <Ashish.Kumar@nxp.com>
Cc: Yangbo Lu <yangbo.lu@nxp.com>
Cc: Michael Walle <michael@walle.cc>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts | 2 ++
 arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts          | 2 ++
 arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts          | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
index 8161dd237971..99a17c187aa8 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28.dts
@@ -23,6 +23,8 @@ aliases {
 		serial2 = &lpuart1;
 		spi0 = &fspi;
 		spi1 = &dspi2;
+		mmc0 = &esdhc1;
+		mmc1 = &esdhc;
 	};
 
 	buttons0 {
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
index 13cdc958ba3e..c0786b713791 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
@@ -23,6 +23,8 @@ aliases {
 		gpio2 = &gpio3;
 		serial0 = &duart0;
 		serial1 = &duart1;
+		mmc0 = &esdhc;
+		mmc1 = &esdhc1;
 	};
 
 	chosen {
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
index 1efb61cff454..c1d1ba459307 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb.dts
@@ -19,6 +19,8 @@ aliases {
 		crypto = &crypto;
 		serial0 = &duart0;
 		serial1 = &duart1;
+		mmc0 = &esdhc;
+		mmc1 = &esdhc1;
 	};
 
 	chosen {
-- 
2.25.1


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

* Re: [PATCH v2] arm64: dts: ls1028a: make the eMMC and SD card controllers use fixed indices
  2020-11-19 16:38 [PATCH v2] arm64: dts: ls1028a: make the eMMC and SD card controllers use fixed indices Vladimir Oltean
@ 2020-11-19 18:12 ` Michael Walle
  2020-11-30 14:39 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Walle @ 2020-11-19 18:12 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Shawn Guo, Li Yang, Rob Herring, linux-arm-kernel, devicetree,
	Adrian Hunter, Ulf Hansson, linux-mmc, linux-kernel,
	Ashish Kumar, Yangbo Lu

Am 2020-11-19 17:38, schrieb Vladimir Oltean:
> As the boot order in the kernel continues to change, sometimes it may
> happen that the eSDHC controller mmc@2150000 (the one for eMMC) gets
> probed before the one at mmc@2140000 (for external SD cards). The 
> effect
> is that the eMMC controller gets the /dev/mmcblk0 name, and the SD card
> gets /dev/mmcblk1.
> 
> Since the introduction of this SoC, that has never happened in 
> practice,
> even though it was never guaranteed in theory. Setting
> "root=/dev/mmcblk0p2" in /proc/cmdline has always caused the kernel to
> use the second partition from the SD card as the rootfs.
> 
> The NXP development boards are typically shipped with either
> - LSDK, which uses "root=UUID=", or
> - OpenIL, which uses "root=/dev/mmcblkNp2"
> 
> So for OpenIL, let's preserve that old behavior by adding some aliases
> which create naming consistency (for LSDK it doesn't matter):
> - the SD card controller uses /dev/mmcblk0
> - the eMMC controller uses /dev/mmcblk1
> 
> For the Kontron SL28 boards, Michael Walle says that they are shipped
> with "root=UUID=" already, so the probing order doesn't matter, but it
> is more natural to him for /dev/mmcblk0 to be the eMMC, so let's do it
> the other way around there.
> 
> The aliases are parsed by mmc_alloc_host() in drivers/mmc/core/host.c.
> 
> Cc: Ashish Kumar <Ashish.Kumar@nxp.com>
> Cc: Yangbo Lu <yangbo.lu@nxp.com>
> Cc: Michael Walle <michael@walle.cc>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Acked-by: Michael Walle <michael@walle.cc> [for the sl28 boards]

-michael

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

* Re: [PATCH v2] arm64: dts: ls1028a: make the eMMC and SD card controllers use fixed indices
  2020-11-19 16:38 [PATCH v2] arm64: dts: ls1028a: make the eMMC and SD card controllers use fixed indices Vladimir Oltean
  2020-11-19 18:12 ` Michael Walle
@ 2020-11-30 14:39 ` Shawn Guo
  1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2020-11-30 14:39 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Li Yang, Rob Herring, linux-arm-kernel, devicetree,
	Adrian Hunter, Ulf Hansson, linux-mmc, linux-kernel,
	Ashish Kumar, Yangbo Lu, Michael Walle

On Thu, Nov 19, 2020 at 06:38:21PM +0200, Vladimir Oltean wrote:
> As the boot order in the kernel continues to change, sometimes it may
> happen that the eSDHC controller mmc@2150000 (the one for eMMC) gets
> probed before the one at mmc@2140000 (for external SD cards). The effect
> is that the eMMC controller gets the /dev/mmcblk0 name, and the SD card
> gets /dev/mmcblk1.
> 
> Since the introduction of this SoC, that has never happened in practice,
> even though it was never guaranteed in theory. Setting
> "root=/dev/mmcblk0p2" in /proc/cmdline has always caused the kernel to
> use the second partition from the SD card as the rootfs.
> 
> The NXP development boards are typically shipped with either
> - LSDK, which uses "root=UUID=", or
> - OpenIL, which uses "root=/dev/mmcblkNp2"
> 
> So for OpenIL, let's preserve that old behavior by adding some aliases
> which create naming consistency (for LSDK it doesn't matter):
> - the SD card controller uses /dev/mmcblk0
> - the eMMC controller uses /dev/mmcblk1
> 
> For the Kontron SL28 boards, Michael Walle says that they are shipped
> with "root=UUID=" already, so the probing order doesn't matter, but it
> is more natural to him for /dev/mmcblk0 to be the eMMC, so let's do it
> the other way around there.
> 
> The aliases are parsed by mmc_alloc_host() in drivers/mmc/core/host.c.
> 
> Cc: Ashish Kumar <Ashish.Kumar@nxp.com>
> Cc: Yangbo Lu <yangbo.lu@nxp.com>
> Cc: Michael Walle <michael@walle.cc>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Applied, thanks.

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

end of thread, other threads:[~2020-11-30 14:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 16:38 [PATCH v2] arm64: dts: ls1028a: make the eMMC and SD card controllers use fixed indices Vladimir Oltean
2020-11-19 18:12 ` Michael Walle
2020-11-30 14:39 ` Shawn Guo

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