Skip to contentSkip to conversation

ARM: zii-vf610-dev: fix boot sd

PATCH In review Vivien Didelot 2 participants 3 messages Jan 19, 2019 – Jan 21, 2019 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: zii-vf610-dev: fix boot sd

The 'sd' boot is currently broken on zii-vf610-dev because there are no mci devices (anymore?), only mmc. There are also no need to check for the device number since both Rev B and Rev C report their SD card slot on mmc1.

Note that mmc1.0 is already mounted on /mnt/mmc1.0 once mmc1.probe=1 is typed. It would've been more appropriate to use "ln /mnt/mmc1.0 /mnt/sd", but ln isn't useable with automount since the mountpoint needs to be already created and ln has no force option. There are no complains with having two mountpoints for a device, so just blindly mount the device again.

---
 .../defaultenv-zii-vf610-dev/init/automount-sd       | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)
arch/arm/boards/zii-vf610-dev/defaultenv-zii-vf610-dev/init/automount-sd +1 -11
index f44dab34e..442c8a61c 100644
@@ -1,13 +1,3 @@
 #!/bin/sh
 
-if [ x${global.hostname} = xdev-rev-b -o x${global.hostname} = xdev-rev-c ];
-then
-    global sd=0
-else
-    global sd=1
-fi
-
-mkdir -p /mnt/sd
-automount /mnt/sd 'mci${global.sd}.probe=1 && mount /dev/disk${global.sd}.0 /mnt/sd'
-
-exit 0
+automount -d /mnt/sd 'mmc1.probe=1 && mount /dev/mmc1.0 /mnt/sd'
Signature · 7 lines
2.20.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw
Quoted 3 lines · Vivien Didelot

The 'sd' boot is currently broken on zii-vf610-dev because there are no mci devices (anymore?), only mmc.

Yeah, I forgot to update this part in 5f99a8d403 "dts: VFxxx: Add aliases for ESDHC controllers", sorry about that!

Quoted 4 lines

There are also no need to check
for the device number since both Rev B and Rev C report their SD card slot on mmc1.

I think you might be misreading the if condition in that check. What it is meant to test is:

if ((board == VF610 Dev Rev C) || (board == VF610 Dev Rev B)) {
SDHCI = SDHCI1
} else {
SDHCI = SDHCI2
}

IOW, it is meant to configure development boards to boot from SD card (attached to SDHCI1 on both revisions) and from eMMC on other boards supported by that build (CFU1, SPU3, SCU4).

Quoted 7 lines

Note that mmc1.0 is already mounted on /mnt/mmc1.0 once mmc1.probe=1 is typed. It would've been more appropriate to use "ln /mnt/mmc1.0 /mnt/sd", but ln isn't useable with automount since the mountpoint needs to be already created and ln has no force option. There are no complains with having two mountpoints for a device, so just blindly mount the device again.

I think we can still take advantage of default automount path (/mnt/mmc1.0), by moving the if check to "boot/sd" and using "/mnt/mmc${global.sd}.0/" as a prefix for Linux image and DTB blob. This way there would be no need to create a symlink or a second mount point and "init/automount-sd" could be dropped completely.

Thanks,
Andrey Smirnov

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

#2 lore raw

Hi Andrey,

Quoted 7 lines · Andrey Smirnov
Quoted 3 lines · Vivien Didelot

The 'sd' boot is currently broken on zii-vf610-dev because there are no mci devices (anymore?), only mmc.

Yeah, I forgot to update this part in 5f99a8d403 "dts: VFxxx: Add aliases for ESDHC controllers", sorry about that!

No worries, I'll add a Fixes tag in v2, if Barebox likes that ;-)

Quoted 14 lines
Quoted 4 lines

There are also no need to check
for the device number since both Rev B and Rev C report their SD card slot on mmc1.

I think you might be misreading the if condition in that check. What it is meant to test is:

if ((board == VF610 Dev Rev C) || (board == VF610 Dev Rev B)) {
SDHCI = SDHCI1
} else {
SDHCI = SDHCI2
}

Quoted 3 lines

IOW, it is meant to configure development boards to boot from SD card (attached to SDHCI1 on both revisions) and from eMMC on other boards supported by that build (CFU1, SPU3, SCU4).

OK I got confused because I didn't know that zii-vf610-dev was used by other platforms, I'll keep the check.

Quoted 8 lines
Quoted 7 lines

Note that mmc1.0 is already mounted on /mnt/mmc1.0 once mmc1.probe=1 is typed. It would've been more appropriate to use "ln /mnt/mmc1.0 /mnt/sd", but ln isn't useable with automount since the mountpoint needs to be already created and ln has no force option. There are no complains with having two mountpoints for a device, so just blindly mount the device again.

Quoted 5 lines

I think we can still take advantage of default automount path (/mnt/mmc1.0), by moving the if check to "boot/sd" and using "/mnt/mmc${global.sd}.0/" as a prefix for Linux image and DTB blob. This way there would be no need to create a symlink or a second mount point and "init/automount-sd" could be dropped completely.

Will do, thank you.

Vivien

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox