Skip to contentSkip to conversation

ARM: dts: bcm2711-rpi: Use aliases to set custom MMC device index

PATCH In review Ariel D'Alessandro 2 participants 3 messages Jun 14, 2022 – Jun 29, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: bcm2711-rpi: Use aliases to set custom MMC device index

Add MMC aliases to ensure that the /dev/mmcblk ID for the first eMMC/SD card won't change depending on the probe order of the MMC drivers.

---

Changes in v2:
* Moved alias from bcm2711-rpi-4-b.dts to bcm2711-rpi.dtsi

 arch/arm/boot/dts/bcm2711-rpi.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/bcm2711-rpi.dtsi +1 -0
index ca266c5d9f9b..a39b2f68e4cc 100644
@@ -13,6 +13,7 @@ memory@0 {
 	aliases {
 		emmc2bus = &emmc2bus;
 		ethernet0 = &genet;
+		mmc0 = &emmc2;	/* mmcblk0 for eMMC/SD */
 		pcie0 = &pcie0;
 		blconfig = &blconfig;
 	};
Signature · 1 line
2.34.1
#1 lore raw

Hi Ariel,

Am 14.06.22 um 16:12 schrieb Ariel D'Alessandro:

Quoted 3 lines

Add MMC aliases to ensure that the /dev/mmcblk ID for the first eMMC/SD card won't change depending on the probe order of the MMC drivers.

this changes the emmc2 from mmc1 to mmc0 in my case (RPi 4, multi_v7_defconfig), which i consider as a regression / unexpected change in userspace.

Could you please explain your actual motivation of your patch?

Quoted 22 lines

---

Changes in v2:
* Moved alias from bcm2711-rpi-4-b.dts to bcm2711-rpi.dtsi

  arch/arm/boot/dts/bcm2711-rpi.dtsi | 1 +
  1 file changed, 1 insertion(+)
arch/arm/boot/dts/bcm2711-rpi.dtsi +1 -0
index ca266c5d9f9b..a39b2f68e4cc 100644
@@ -13,6 +13,7 @@ memory@0 {
  	aliases {
  		emmc2bus = &emmc2bus;
  		ethernet0 = &genet;
+		mmc0 = &emmc2;	/* mmcblk0 for eMMC/SD */
  		pcie0 = &pcie0;
  		blconfig = &blconfig;
  	};
#2 lore raw

Hi Stefan,

Sorry for the delay.

Quoted 7 lines · Stefan Wahren

Hi Ariel,

Am 14.06.22 um 16:12 schrieb Ariel D'Alessandro:

Quoted 3 lines

Add MMC aliases to ensure that the /dev/mmcblk ID for the first eMMC/SD card won't change depending on the probe order of the MMC drivers.

Quoted 5 lines

this changes the emmc2 from mmc1 to mmc0 in my case (RPi 4, multi_v7_defconfig), which i consider as a regression / unexpected change in userspace.

Could you please explain your actual motivation of your patch?

That's a good point. The original reason comes from u-boot in fact, I just sent the patch here as u-boot is syncing the dts files from the kernel.

U-boot uses the same defconfig configs/rpi_arm64_defconfig for different RPi versions, which have different mmcblk ids numbering.

In order to use bootcount support in u-boot, the config option CONFIG_SYS_BOOTCOUNT_EXT_DEVPART needs to be filled with the fixed dev/part ids. In general I'd expect mmcblk0 to be eMMC/SD, which is not in this case, at least for RPi4.

Anyway, this is probably something to be discussed on the u-boot mailing list, not here.

Thanks,
Ariel

Quoted 24 lines
Quoted 24 lines

---

Changes in v2:
* Moved alias from bcm2711-rpi-4-b.dts to bcm2711-rpi.dtsi

  arch/arm/boot/dts/bcm2711-rpi.dtsi | 1 +

  1 file changed, 1 insertion(+)
arch/arm/boot/dts/bcm2711-rpi.dtsi +1 -0
index ca266c5d9f9b..a39b2f68e4cc 100644
@@ -13,6 +13,7 @@ memory@0 {
       aliases {
           emmc2bus = &emmc2bus;
           ethernet0 = &genet;
+        mmc0 = &emmc2;    /* mmcblk0 for eMMC/SD */
           pcie0 = &pcie0;
           blconfig = &blconfig;
       };