[U-Boot] [PATCH V2 05/13] spl: mmc: get rid of #ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION check

Nikita Kiryanov nikita at compulab.co.il
Wed Oct 28 10:23:22 CET 2015


Implement defaults for the raw partition image loading so that the #ifdef
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION in spl_mmc_load_image() will no
longer be necessary.

This change makes it possible for mmc_load_image_raw_partition() and
mmc_load_image_raw_sector() to coexist.

Signed-off-by: Nikita Kiryanov <nikita at compulab.co.il>
Cc: Igor Grinberg <grinberg at compulab.co.il>
Cc: Paul Kocialkowski <contact at paulk.fr>
Cc: Pantelis Antoniou <panto at antoniou-consulting.com>
Cc: Tom Rini <trini at konsulko.com>
Cc: Simon Glass <sjg at chromium.org>
---
Changes in V2:
	- No changes.

 common/spl/spl_mmc.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 9fec2c4..5d67952 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -133,6 +133,12 @@ static int mmc_load_image_raw_partition(struct mmc *mmc, int partition)
 	return mmc_load_image_raw_sector(mmc, info.start);
 #endif
 }
+#else
+#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION -1
+static int mmc_load_image_raw_partition(struct mmc *mmc, int partition)
+{
+	return -ENOSYS;
+}
 #endif
 
 #ifdef CONFIG_SPL_OS_BOOT
@@ -193,12 +199,12 @@ void spl_mmc_load_image(void)
 			if (!err)
 				return;
 		}
-#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION)
+
 		err = mmc_load_image_raw_partition(mmc,
 			CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);
 		if (!err)
 			return;
-#elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR)
+#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR)
 		err = mmc_load_image_raw_sector(mmc,
 			CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
 		if (!err)
@@ -265,12 +271,11 @@ void spl_mmc_load_image(void)
 			if (!err)
 				return;
 		}
-#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION)
 		err = mmc_load_image_raw_partition(mmc,
 			CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION);
 		if (!err)
 			return;
-#elif defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR)
+#if defined(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR)
 		err = mmc_load_image_raw_sector(mmc,
 			CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
 		if (!err)
-- 
1.9.1



More information about the U-Boot mailing list