[U-Boot] [PATCH] spl: if MMCSD_MODE_RAW fails, try MMCSD_MODE_FS, if available

In SPL MMC, boot modes are exclusive. So, if MMCSD_MODE_RAW fails, the board hangs. This patch allows to try MMCSD_MODE_FS then, if available.
It has been tested on a pandaboard (rev. A3).
Signed-off-by: Guillaume GARDET guillaume.gardet@free.fr Cc: Tom Rini trini@ti.com --- common/spl/spl_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index ee71f79..2c34b75 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -101,7 +101,8 @@ void spl_mmc_load_image(void) err = mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT) - } else if (boot_mode == MMCSD_MODE_FS) { + } + if (err || boot_mode == MMCSD_MODE_FS) { debug("boot mode - FS\n"); #ifdef CONFIG_SPL_FAT_SUPPORT #ifdef CONFIG_SPL_OS_BOOT

Ping. Just a friendly reminder.
Guillaume
Le 18/11/2014 10:44, Guillaume GARDET a écrit :
In SPL MMC, boot modes are exclusive. So, if MMCSD_MODE_RAW fails, the board hangs. This patch allows to try MMCSD_MODE_FS then, if available.
It has been tested on a pandaboard (rev. A3).
Signed-off-by: Guillaume GARDET guillaume.gardet@free.fr Cc: Tom Rini trini@ti.com
common/spl/spl_mmc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index ee71f79..2c34b75 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -101,7 +101,8 @@ void spl_mmc_load_image(void) err = mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); #if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
- } else if (boot_mode == MMCSD_MODE_FS) {
- }
- if (err || boot_mode == MMCSD_MODE_FS) { debug("boot mode - FS\n"); #ifdef CONFIG_SPL_FAT_SUPPORT #ifdef CONFIG_SPL_OS_BOOT

On Tue, Nov 18, 2014 at 10:44:46AM +0100, Guillaume GARDET wrote:
In SPL MMC, boot modes are exclusive. So, if MMCSD_MODE_RAW fails, the board hangs. This patch allows to try MMCSD_MODE_FS then, if available.
It has been tested on a pandaboard (rev. A3).
Signed-off-by: Guillaume GARDET guillaume.gardet@free.fr Cc: Tom Rini trini@ti.com
Applied to u-boot/master, thanks!

On Tue, Nov 18, 2014 at 3:44 AM, Guillaume GARDET guillaume.gardet@free.fr wrote:
In SPL MMC, boot modes are exclusive. So, if MMCSD_MODE_RAW fails, the board hangs. This patch allows to try MMCSD_MODE_FS then, if available.
It has been tested on a pandaboard (rev. A3).
HI Guillaume,
What mode did you test this is? (RAW or FS)
In Raw Mode with the omap5_uevm & beaglebone black, i've had to revert this. (I'm using RAW mode by default)
U-Boot SPL 2015.01-rc3-dirty (Dec 08 2014 - 20:04:01) OMAP5432 ES2.0 SPL: Please implement spl_start_uboot() for your board SPL: Direct Linux boot not active! spl: wrong MMC boot mode ### ERROR ### Please RESET the board ###
Disk setup, I'm using
sudo dd if=/dev/zero of=${DISK} bs=1M count=10
sudo dd if=./u-boot/MLO of=${DISK} count=1 seek=1 conv=notrunc bs=128k sudo dd if=./u-boot/u-boot.img of=${DISK} count=2 seek=1 conv=notrunc bs=384k
sudo sfdisk --in-order --Linux --unit M ${DISK} <<-__EOF__ 1,,0x83,* __EOF__
Regards,

Hi Robert,
Le 12/12/2014 22:49, Robert Nelson a écrit :
On Tue, Nov 18, 2014 at 3:44 AM, Guillaume GARDET guillaume.gardet@free.fr wrote:
In SPL MMC, boot modes are exclusive. So, if MMCSD_MODE_RAW fails, the board hangs. This patch allows to try MMCSD_MODE_FS then, if available.
It has been tested on a pandaboard (rev. A3).
HI Guillaume,
What mode did you test this is? (RAW or FS)
I did test for FS for sure, but not sure about raw mode.
In Raw Mode with the omap5_uevm & beaglebone black, i've had to revert this. (I'm using RAW mode by default)
U-Boot SPL 2015.01-rc3-dirty (Dec 08 2014 - 20:04:01) OMAP5432 ES2.0 SPL: Please implement spl_start_uboot() for your board SPL: Direct Linux boot not active! spl: wrong MMC boot mode ### ERROR ### Please RESET the board ###
Ok, I think I found the problem. Could you test the following patch, please? http://guillaume.gardet.free.fr/u-boot/0001-spl-mmc-Fix-raw-boot-mode-relate...
If this patch fix your boot problem, I will send it ASAP.
Guillaume

Le 15/12/2014 09:43, Guillaume Gardet a écrit :
Hi Robert,
Le 12/12/2014 22:49, Robert Nelson a écrit :
On Tue, Nov 18, 2014 at 3:44 AM, Guillaume GARDET guillaume.gardet@free.fr wrote:
In SPL MMC, boot modes are exclusive. So, if MMCSD_MODE_RAW fails, the board hangs. This patch allows to try MMCSD_MODE_FS then, if available.
It has been tested on a pandaboard (rev. A3).
HI Guillaume,
What mode did you test this is? (RAW or FS)
I did test for FS for sure, but not sure about raw mode.
In Raw Mode with the omap5_uevm & beaglebone black, i've had to revert this. (I'm using RAW mode by default)
U-Boot SPL 2015.01-rc3-dirty (Dec 08 2014 - 20:04:01) OMAP5432 ES2.0 SPL: Please implement spl_start_uboot() for your board SPL: Direct Linux boot not active! spl: wrong MMC boot mode ### ERROR ### Please RESET the board ###
Ok, I think I found the problem. Could you test the following patch, please? http://guillaume.gardet.free.fr/u-boot/0001-spl-mmc-Fix-raw-boot-mode-relate...
If this patch fix your boot problem, I will send it ASAP.
Just updated the patch with a better fix: http://guillaume.gardet.free.fr/u-boot/0001-spl-mmc-Fix-raw-boot-mode-relate...
Guillaume

Le 15/12/2014 10:01, Guillaume Gardet a écrit :
Le 15/12/2014 09:43, Guillaume Gardet a écrit :
Hi Robert,
Le 12/12/2014 22:49, Robert Nelson a écrit :
On Tue, Nov 18, 2014 at 3:44 AM, Guillaume GARDET guillaume.gardet@free.fr wrote:
In SPL MMC, boot modes are exclusive. So, if MMCSD_MODE_RAW fails, the board hangs. This patch allows to try MMCSD_MODE_FS then, if available.
It has been tested on a pandaboard (rev. A3).
HI Guillaume,
What mode did you test this is? (RAW or FS)
I did test for FS for sure, but not sure about raw mode.
In Raw Mode with the omap5_uevm & beaglebone black, i've had to revert this. (I'm using RAW mode by default)
U-Boot SPL 2015.01-rc3-dirty (Dec 08 2014 - 20:04:01) OMAP5432 ES2.0 SPL: Please implement spl_start_uboot() for your board SPL: Direct Linux boot not active! spl: wrong MMC boot mode ### ERROR ### Please RESET the board ###
Ok, I think I found the problem. Could you test the following patch, please? http://guillaume.gardet.free.fr/u-boot/0001-spl-mmc-Fix-raw-boot-mode-relate...
If this patch fix your boot problem, I will send it ASAP.
Just updated the patch with a better fix: http://guillaume.gardet.free.fr/u-boot/0001-spl-mmc-Fix-raw-boot-mode-relate...
As I was able to test this patch, I just sent it: https://patchwork.ozlabs.org/patch/421858/
Guillaume
participants (4)
-
Guillaume GARDET
-
Guillaume Gardet
-
Robert Nelson
-
Tom Rini