[U-Boot] [PATCH V2 1/9] spl: mmc: introduce spl_mmc_get_uboot_raw_sector

peng.fan at nxp.com peng.fan at nxp.com
Mon Sep 23 02:18:40 UTC 2019


From: Peng Fan <peng.fan at nxp.com>

Introduce a weak function spl_mmc_get_uboot_raw_sector, then platform
could have their own implementation.

Signed-off-by: Peng Fan <peng.fan at nxp.com>
Cc: Simon Goldschmidt <simon.k.r.goldschmidt at gmail.com>
Cc: Tien Fong Chee <tien.fong.chee at intel.com>
Cc: Marek Vasut <marex at denx.de>
Cc: Andreas Dannenberg <dannenberg at ti.com>
Cc: Alex Kiernan <alex.kiernan at gmail.com>
Cc: Stefan Roese <sr at denx.de>
Cc: Patrick Delaunay <patrick.delaunay at st.com>
Cc: Miquel Raynal <miquel.raynal at bootlin.com>
Cc: Michal Simek <michal.simek at xilinx.com>
---

V2:
 None

 common/spl/spl_mmc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 6c6eaf4ec8..ebc566081a 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -313,6 +313,15 @@ int spl_boot_partition(const u32 boot_device)
 }
 #endif
 
+unsigned long __weak spl_mmc_get_uboot_raw_sector(struct mmc *mmc)
+{
+#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR
+	return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR;
+#else
+	return 0;
+#endif
+}
+
 int spl_mmc_load(struct spl_image_info *spl_image,
 		 struct spl_boot_device *bootdev,
 		 const char *filename,
@@ -340,6 +349,8 @@ int spl_mmc_load(struct spl_image_info *spl_image,
 		}
 	}
 
+	raw_sect = spl_mmc_get_uboot_raw_sector(mmc);
+
 	boot_mode = spl_boot_mode(bootdev->boot_device);
 	err = -EINVAL;
 	switch (boot_mode) {
-- 
2.16.4



More information about the U-Boot mailing list