@@ -259,6 +259,7 @@
#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
+#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
#define CONFIG_SYS_SPL_BSS_START_ADDR 0x80000000
#define CONFIG_SYS_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
@@ -103,6 +103,14 @@ $(obj)part_dos.h:
@ln -s $(TOPDIR)/disk/part_dos.h $@
COBJS += omap_hsmmc.o omap24xx_i2c.o mmc.o time.o part.o part_dos.o
+
+# fat
+$(obj)fat.c:
+ @rm -f $@
+ @ln -s $(TOPDIR)/fs/fat/fat.c $@
+
+COBJS += fat.o
+
# armv7
$(obj)start.S:
@rm -f $@
@@ -29,6 +29,7 @@
#include <asm/u-boot.h>
#include <asm/arch/sys_proto.h>
#include <mmc.h>
+#include <fat.h>
#include <timestamp_autogenerated.h>
#include <asm/omap_common.h>
#include <asm/arch/mmc_host_def.h>
@@ -101,6 +102,25 @@ end:
}
}
+static void mmc_load_uboot_fat(struct mmc *mmc)
+{
+ s32 err;
+
+ err = fat_register_device(&mmc->block_dev,
+ CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION);
+ if (err) {
+ printf("spl: fat register err - %d\n", err);
+ hang();
+ }
+
+ err = file_fat_read("u-boot.bin", (u8 *)CONFIG_SYS_TEXT_BASE, 0);
+
+ if (err <= 0) {
+ printf("spl: error reading u-boot.bin - %d\n", err);
+ hang();
+ }
+}
+
static void mmc_load_uboot(u32 mmc_dev)
{
struct mmc *mmc;
@@ -124,6 +144,8 @@ static void mmc_load_uboot(u32 mmc_dev)
boot_mode = omap_boot_mode();
if (boot_mode == MMCSD_MODE_RAW)
mmc_load_uboot_raw(mmc, mmc_dev);
+ else if (boot_mode == MMCSD_MODE_FAT)
+ mmc_load_uboot_fat(mmc);
else {
puts("spl: wrong MMC boot mode\n");
hang();
Signed-off-by: Aneesh V <aneesh@ti.com> --- include/configs/omap4_sdp4430.h | 1 + spl/board/ti/sdp4430/Makefile | 8 ++++++++ spl/board/ti/spl-omap.c | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+), 0 deletions(-)