diff mbox series

[U-Boot,v3] imx: spl: Partially revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"

Message ID 1518705700-9402-1-git-send-email-fabio.estevam@nxp.com
State Accepted
Commit 0339086bd9b99ae354c26e8758d5bab51ef84a3a
Delegated to: Stefano Babic
Headers show
Series [U-Boot,v3] imx: spl: Partially revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function" | expand

Commit Message

Fabio Estevam Feb. 15, 2018, 2:41 p.m. UTC
Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
function") breaks the boot on several i.MX6 boards,
such as cuboxi and wandboard:

U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
Trying to boot from MMC1
Failed to mount ext2 filesystem...
spl_load_image_ext: ext4fs mount err - 0

Partially revert it so that we can boot U-Boot again on these
i.MX6 platforms.

Reported-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v2:
- Do a partiall revert instead of full revert (Lukasz)

 arch/arm/mach-imx/spl.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Breno Matheus Lima Feb. 24, 2018, 5:46 p.m. UTC | #1
2018-02-15 12:41 GMT-02:00 Fabio Estevam <fabio.estevam@nxp.com>:
> Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
> function") breaks the boot on several i.MX6 boards,
> such as cuboxi and wandboard:
>
> U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
> Trying to boot from MMC1
> Failed to mount ext2 filesystem...
> spl_load_image_ext: ext4fs mount err - 0
>
> Partially revert it so that we can boot U-Boot again on these
> i.MX6 platforms.
>
> Reported-by: Jonathan Gray <jsg@jsg.id.au>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Tested-by: Breno Lima <breno.lima@nxp.com>
Tom Rini Feb. 24, 2018, 6:22 p.m. UTC | #2
On Sat, Feb 24, 2018 at 02:46:23PM -0300, Breno Matheus Lima wrote:
> 2018-02-15 12:41 GMT-02:00 Fabio Estevam <fabio.estevam@nxp.com>:
> > Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
> > function") breaks the boot on several i.MX6 boards,
> > such as cuboxi and wandboard:
> >
> > U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
> > Trying to boot from MMC1
> > Failed to mount ext2 filesystem...
> > spl_load_image_ext: ext4fs mount err - 0
> >
> > Partially revert it so that we can boot U-Boot again on these
> > i.MX6 platforms.
> >
> > Reported-by: Jonathan Gray <jsg@jsg.id.au>
> > Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> 
> Tested-by: Breno Lima <breno.lima@nxp.com>

Was this intentionally not in your PR, Stefano?  Thanks!
Stefano Babic Feb. 24, 2018, 6:32 p.m. UTC | #3
On 24/02/2018 19:22, Tom Rini wrote:
> On Sat, Feb 24, 2018 at 02:46:23PM -0300, Breno Matheus Lima wrote:
>> 2018-02-15 12:41 GMT-02:00 Fabio Estevam <fabio.estevam@nxp.com>:
>>> Commit d695d6627803 ("spl: eMMC/SD: Provide one __weak spl_boot_mode()
>>> function") breaks the boot on several i.MX6 boards,
>>> such as cuboxi and wandboard:
>>>
>>> U-Boot SPL 2018.03-rc1-00212-g48914fc119 (Feb 10 2018 - 11:04:33 +1300)
>>> Trying to boot from MMC1
>>> Failed to mount ext2 filesystem...
>>> spl_load_image_ext: ext4fs mount err - 0
>>>
>>> Partially revert it so that we can boot U-Boot again on these
>>> i.MX6 platforms.
>>>
>>> Reported-by: Jonathan Gray <jsg@jsg.id.au>
>>> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
>>
>> Tested-by: Breno Lima <breno.lima@nxp.com>
> 
> Was this intentionally not in your PR, Stefano?  Thanks!
> 

No, it was not intentionally :-(. I pick it up.

Regards,
Stefano
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
index a9079fc..b2521b2 100644
--- a/arch/arm/mach-imx/spl.c
+++ b/arch/arm/mach-imx/spl.c
@@ -132,6 +132,29 @@  int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 }
 #endif
 
+#if defined(CONFIG_SPL_MMC_SUPPORT)
+/* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */
+u32 spl_boot_mode(const u32 boot_device)
+{
+	switch (spl_boot_device()) {
+	/* for MMC return either RAW or FAT mode */
+	case BOOT_DEVICE_MMC1:
+	case BOOT_DEVICE_MMC2:
+#if defined(CONFIG_SPL_FAT_SUPPORT)
+		return MMCSD_MODE_FS;
+#elif defined(CONFIG_SUPPORT_EMMC_BOOT)
+		return MMCSD_MODE_EMMCBOOT;
+#else
+		return MMCSD_MODE_RAW;
+#endif
+		break;
+	default:
+		puts("spl: ERROR:  unsupported device\n");
+		hang();
+	}
+}
+#endif
+
 #if defined(CONFIG_SECURE_BOOT)
 
 /*