[U-Boot] [PATCH v2] spl: eMMC/SD: Provide one __weak spl_boot_mode() function
Lukasz Majewski
lukma at denx.de
Sat Feb 10 10:45:31 UTC 2018
Hi Jonathan,
> On Sat, Feb 10, 2018 at 10:57:26AM +0100, Lukasz Majewski wrote:
> > Hi Jonathan,
> >
> > > On Sat, Feb 10, 2018 at 01:45:16AM +0100, Lukasz Majewski wrote:
> > > > Hi Jonathan,
> > > >
> > > > > On Sat, Feb 03, 2018 at 11:00:35AM -0200, Fabio Estevam
> > > > > wrote:
> > > > > > On Sat, Feb 3, 2018 at 5:29 AM, Lukasz Majewski
> > > > > > <lukma at denx.de> wrote:
> > > > > > > The goal of this patch is to clean up the code related to
> > > > > > > choosing SPL MMC boot mode.
> > > > > > >
> > > > > > > The spl_boot_mode() now is called only in
> > > > > > > spl_mmc_load_image() function, which is only compiled in
> > > > > > > if CONFIG_SPL_MMC_SUPPORT is enabled.
> > > > > > >
> > > > > > > To achieve the goal, all per mach/arch implementations
> > > > > > > eligible for unification has been replaced with one __weak
> > > > > > > implementation.
> > > > > > >
> > > > > > > Signed-off-by: Lukasz Majewski <lukma at denx.de>
> > > > > > > Reviewed-by: Marek Vasut <marex at denx.de>
> > > > > > > Reviewed-by: Stefano Babic <sbabic at denx.de>
> > > > > > > Acked-by: Michal Simek <michal.simek at xilinx.com> (For
> > > > > > > ZynqMP)
> > > > > >
> > > > > > Nice cleanup:
> > > > > >
> > > > > > Reviewed-by: Fabio Estevam <fabio.estevam at nxp.com>
> > > > >
> > > > > This has broken booting via mmc with mx6cuboxi for me.
> > > > >
> > > > > SPL loops on
> > > > >
> > > > > 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
> > > >
> > > > Could you check what is the status of following defines in
> > > > your .config file:
> > > >
> > > > CONFIG_SPL_FAT_SUPPORT
> > > > CONFIG_SUPPORT_EMMC_BOOT
> > >
> > > "# CONFIG_SPL_FAT_SUPPORT is not set"
> > >
> > > CONFIG_SUPPORT_EMMC_BOOT is not in the .config at all
> > >
> > > CONFIG_SPL_EXT_SUPPORT previously for imx6 would result in
> > > MMCSD_MODE_RAW but now it results in MMCSD_MODE_FS.
> > >
> > > >
> > > > And if by any chance your don't have:
> > > > CONFIG_SPL_EXT_SUPPORT defined?
> > >
> > > CONFIG_SPL_EXT_SUPPORT=y
> >
> > Could you for test comment out the above define?
>
> Removing CONFIG_SPL_EXT_SUPPORT=y from the defconfig or using the
> following diff makes the system boot.
>
> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
> index 351f4edd41..1541a4837d 100644
> --- a/common/spl/spl_mmc.c
> +++ b/common/spl/spl_mmc.c
> @@ -283,7 +283,7 @@ static int spl_mmc_do_fs_boot(struct
> spl_image_info *spl_image, struct mmc *mmc)
> u32 __weak spl_boot_mode(const u32 boot_device)
> {
> -#if defined(CONFIG_SPL_FAT_SUPPORT) ||
> defined(CONFIG_SPL_EXT_SUPPORT) +#if defined(CONFIG_SPL_FAT_SUPPORT)
> return MMCSD_MODE_FS;
> #elif defined(CONFIG_SUPPORT_EMMC_BOOT)
> return MMCSD_MODE_EMMCBOOT;
Original iMX code (CONFIG_SPL_EXT_SUPPORT is not taken into account at
all):
----------------------------------------------------------------------------
-#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
Current code (socfpga):
+u32 __weak spl_boot_mode(const u32 boot_device)
+{
+#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
+ return MMCSD_MODE_FS;
+#elif defined(CONFIG_SUPPORT_EMMC_BOOT)
+ return MMCSD_MODE_EMMCBOOT;
+#else
+ return MMCSD_MODE_RAW;
+#endif
+}
So with the original iMX code the MMCSD_MODE_RAW is returned even when
you do have CONFIG_SPL_EXT_SUPPORT enabled.
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180210/c664eaee/attachment.sig>
More information about the U-Boot
mailing list