[PATCH 3/3] ARM: rpi: look for env in mmc0 as well

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Raspberry Pi Compute Module 4S device tree has a DT alias for the eMMC,
which makes it mmc0. Use that as a fallback, so environment and /boot
mount is correct there as well.

There is no upstream device tree for this S-variant yet, but it's already
bootable when barebox is passed the device tree by the VideoCore.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 arch/arm/boards/raspberry-pi/rpi-common.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/raspberry-pi/rpi-common.c b/arch/arm/boards/raspberry-pi/rpi-common.c
index f3a28e87c6f0..abee5ffcdbee 100644
--- a/arch/arm/boards/raspberry-pi/rpi-common.c
+++ b/arch/arm/boards/raspberry-pi/rpi-common.c
@@ -188,14 +188,20 @@ mem_initcall(rpi_mem_init);
 static int rpi_env_init(void)
 {
 	struct stat s;
-	const char *diskdev = "/dev/disk0.0";
+	const char *diskdev;
 	int ret;
 
 	device_detect_by_name("mci0");
 
+	diskdev = "/dev/disk0.0";
 	ret = stat(diskdev, &s);
 	if (ret) {
-		printf("no %s. using default env\n", diskdev);
+		device_detect_by_name("mmc0");
+		diskdev = "/dev/mmc0.0";
+		ret = stat(diskdev, &s);
+	}
+	if (ret) {
+		printf("no /dev/disk0.0 or /dev/mmc0.0. using default env\n");
 		return 0;
 	}
 
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux