From: Stefan Roese Date: Mon, 20 Jul 2015 11:20:39 +0200 Subject: [U-Boot] [PATCH 4/5] spl: spl_mmc: Add option to boot from a MMC partition with offset In-Reply-To: <1437384040-16244-1-git-send-email-sr@denx.de> References: <1437384040-16244-1-git-send-email-sr@denx.de> Message-ID: <1437384040-16244-4-git-send-email-sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This patch introduces the option to boot from a MMC card parition with an offset. This can be done by using both defines together: define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION 1 define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR ((160 << 10) / 512) The example above loads the main U-Boot at offset 160KiB from the MMC partition 1. Signed-off-by: Stefan Roese Cc: Luka Perkov Cc: Dirk Eibach Cc: Tom Rini --- common/spl/spl_mmc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 552f80d..d308679 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -67,7 +67,12 @@ static int mmc_load_image_raw_partition(struct mmc *mmc, int partition) return -1; } +#ifdef CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR + return mmc_load_image_raw_sector(mmc, info.start + + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR); +#else return mmc_load_image_raw_sector(mmc, info.start); +#endif } #endif -- 2.4.6