public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Aneesh V <aneesh@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 21/22] omap: spl: add FAT support over MMC
Date: Mon, 28 Feb 2011 17:16:30 +0530	[thread overview]
Message-ID: <1298893591-17636-22-git-send-email-aneesh@ti.com> (raw)
In-Reply-To: <1298893591-17636-1-git-send-email-aneesh@ti.com>

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(-)

diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h
index 0ed474d..dcc9e39 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -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 */
diff --git a/spl/board/ti/sdp4430/Makefile b/spl/board/ti/sdp4430/Makefile
index 18c5b8e..8310db9 100644
--- a/spl/board/ti/sdp4430/Makefile
+++ b/spl/board/ti/sdp4430/Makefile
@@ -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 $@
diff --git a/spl/board/ti/spl-omap.c b/spl/board/ti/spl-omap.c
index b64eac9..3612434 100644
--- a/spl/board/ti/spl-omap.c
+++ b/spl/board/ti/spl-omap.c
@@ -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();
-- 
1.7.0.4

  parent reply	other threads:[~2011-02-28 11:46 UTC|newest]

Thread overview: 244+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-28 11:46 [U-Boot] [PATCH 00/22] U-Boot MMC SPL for OMAP4 Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 01/22] mkimage: Add OMAP boot image support Aneesh V
2011-03-01 14:24   ` Bedia, Vaibhav
2011-03-01 14:45     ` John Rigby
2011-03-01 14:49     ` Aneesh V
2011-03-02  4:51       ` Bedia, Vaibhav
     [not found]       ` <FCCFB4CDC6E5564B9182F639FC356087037077712B@dbde02.ent.ti.com>
2011-03-04  5:27         ` Bedia, Vaibhav
2011-03-04  8:49           ` Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 02/22] omap: add miscellaneous utility macros for bit-field operations Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 03/22] omap4: add OMAP4430 revision check Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 04/22] armv7: start.S: provide a hook for saving boot params Aneesh V
2011-03-01 14:27   ` Bedia, Vaibhav
2011-02-28 11:46 ` [U-Boot] [PATCH 05/22] omap4: save parameters passed by ROM code to SPL Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 06/22] arm: new labels in the linker script file Aneesh V
2011-03-08 10:12   ` Po-Yu Chuang
2011-03-08 11:20     ` Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 07/22] Add generic spl infrastructure Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 08/22] armv7: start.S: add SPL support Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 09/22] omap: add spl support Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 10/22] omap4: add spl support for OMAP4 SDP Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 11/22] omap4: add serial console support to SPL Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 12/22] omap4: utility function to identify the context of hw init Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 13/22] omap4: separate mux settings into essential and non essential parts Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 14/22] omap4: correct mux data for sdp4430 Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 15/22] omap4: add clock support Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 16/22] omap4: add sdram init support Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 17/22] omap4: calculate EMIF register values Aneesh V
2011-03-09  4:46   ` John Rigby
2011-03-09  5:08     ` Aneesh V
2011-03-09  6:02       ` John Rigby
2011-03-09  9:26     ` Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 18/22] omap4: automatic sdram detection Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 19/22] armv7: embed u-boot size within u-boot for use from SPL Aneesh V
2011-02-28 11:46 ` [U-Boot] [PATCH 20/22] omap: add MMC support to SPL Aneesh V
2011-02-28 11:46 ` Aneesh V [this message]
2011-02-28 11:46 ` [U-Boot] [PATCH 22/22] omap4: add spl support for OMAP4 Panda Aneesh V
2011-03-21  8:21 ` [U-Boot] [PATCH 00/22] U-Boot MMC SPL for OMAP4 Aneesh V
2011-03-22  8:50   ` Chander M. Kashyap
2011-03-22  9:20     ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 " Aneesh V
2011-07-03  9:06   ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 01/22] mkimage: Add OMAP boot image support Aneesh V
2011-05-15 19:06   ` Wolfgang Denk
2011-05-16 10:16     ` Aneesh V
2011-05-16 11:48       ` Wolfgang Denk
2011-05-17 10:24         ` Aneesh V
2011-05-17 11:15           ` Wolfgang Denk
2011-05-17 12:09         ` Aneesh V
2011-05-17 12:32           ` Wolfgang Denk
2011-05-16  1:52   ` Mike Frysinger
2011-05-16  2:55     ` Mike Frysinger
2011-05-16 10:28       ` Aneesh V
2011-05-16 18:42         ` Mike Frysinger
2011-05-17  6:30           ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 02/22] omap4: add OMAP4430 revision check Aneesh V
2011-05-15 19:09   ` Wolfgang Denk
2011-05-16 12:14     ` Aneesh V
2011-05-16 15:35       ` Wolfgang Denk
2011-05-17  6:40         ` Aneesh V
2011-05-17  8:10           ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 03/22] armv7: start.S: provide a hook for saving boot params Aneesh V
2011-05-15 19:10   ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 04/22] omap4: save parameters passed by ROM code to SPL Aneesh V
2011-05-15 19:14   ` Wolfgang Denk
2011-05-16 12:29     ` Aneesh V
2011-05-16 15:37       ` Wolfgang Denk
2011-05-17  6:44         ` Aneesh V
2011-05-17  8:11           ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 05/22] arm: new labels in the linker script file Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 06/22] Add generic spl infrastructure Aneesh V
2011-05-15 19:48   ` Wolfgang Denk
2011-05-16 12:48     ` Aneesh V
2011-05-16 15:41       ` Wolfgang Denk
2011-05-16 18:32   ` Scott Wood
2011-05-17  6:54     ` Aneesh V
2011-05-17  8:15       ` Wolfgang Denk
2011-05-17 10:30         ` Aneesh V
2011-05-17 11:17           ` Wolfgang Denk
2011-05-17 12:16             ` Aneesh V
2011-05-17 12:33               ` Wolfgang Denk
2011-05-17 14:01                 ` Aneesh V
2011-05-17 16:50       ` Scott Wood
2011-05-18  3:35         ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 07/22] armv7: start.S: add SPL support Aneesh V
2011-05-15 19:49   ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 08/22] omap: add spl support Aneesh V
2011-05-15 19:52   ` Wolfgang Denk
2011-05-16 14:10     ` Aneesh V
2011-05-16 15:43       ` Wolfgang Denk
2011-05-17  6:59         ` Aneesh V
2011-05-17  8:16           ` Wolfgang Denk
2011-05-26 13:51             ` Aneesh V
2011-06-02 15:54               ` Aneesh V
2011-06-07  9:15               ` Aneesh V
2011-06-15 10:13               ` Wolfgang Denk
2011-06-15 10:53                 ` Aneesh V
2011-06-15 12:04                   ` Wolfgang Denk
2011-06-15 12:08                     ` Aneesh V
2011-06-15 12:44                       ` Wolfgang Denk
2011-05-16 18:39       ` Scott Wood
2011-05-18  5:05         ` Aneesh V
2011-05-18 15:51           ` Scott Wood
2011-05-15 19:53   ` Wolfgang Denk
2011-05-16 14:17     ` Aneesh V
2011-05-16  9:48   ` Simon Schwarz
2011-05-16 14:20     ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 09/22] omap4: add spl support for OMAP4 SDP Aneesh V
2011-05-15 18:33   ` Wolfgang Denk
2011-05-16 14:29     ` Aneesh V
2011-05-16 15:48       ` Wolfgang Denk
2011-05-17  7:11         ` Aneesh V
2011-05-17  8:19           ` Wolfgang Denk
2011-05-17 12:33             ` Aneesh V
2011-05-17 12:53               ` Wolfgang Denk
2011-05-26 13:25                 ` Aneesh V
2011-06-02 15:33                   ` Aneesh V
2011-06-07  9:09                   ` Aneesh V
2011-06-15 10:07                   ` Wolfgang Denk
2011-05-15 19:54   ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 10/22] omap4: utility function to identify the context of hw init Aneesh V
2011-05-15 19:59   ` Wolfgang Denk
     [not found]     ` <4DD135D0.8070805@ti.com>
2011-05-16 15:50       ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 11/22] omap4: separate mux settings into essential and non essential parts Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 12/22] omap4: correct mux data for sdp4430 Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 13/22] omap4: add clock support Aneesh V
2011-05-15 19:00   ` Wolfgang Denk
2011-05-17 13:30     ` Aneesh V
2011-05-17 21:44       ` Wolfgang Denk
2011-06-25 12:05         ` Aneesh V
2011-06-25 13:05           ` Wolfgang Denk
2011-06-21  5:49   ` Aneesh V
2011-06-21  6:25     ` Aneesh V
2011-06-21  7:12       ` Aneesh V
2011-06-21  8:20         ` Wolfgang Denk
2011-06-21  9:08           ` Aneesh V
2011-06-21 10:22             ` Wolfgang Denk
2011-06-21 11:10               ` Aneesh V
2011-06-21 11:22             ` Aneesh V
2011-06-21  7:05     ` Wolfgang Denk
2011-06-21  7:05       ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 14/22] omap4: add serial console support to SPL Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 15/22] omap4: add sdram init support Aneesh V
2011-05-15 20:01   ` Wolfgang Denk
2011-05-17 14:13     ` Aneesh V
2011-05-17 21:46       ` Wolfgang Denk
2011-05-15 20:02   ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 16/22] omap4: calculate EMIF register values Aneesh V
2011-05-15 20:05   ` Wolfgang Denk
2011-05-15 20:42     ` Måns Rullgård
2011-05-17 14:30       ` Aneesh V
2011-05-17 14:26     ` Aneesh V
2011-05-17 21:54       ` Wolfgang Denk
2011-05-18  3:49         ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 17/22] omap4: automatic sdram detection Aneesh V
2011-05-15 20:06   ` Wolfgang Denk
2011-05-17 14:33     ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 18/22] armv7: embed u-boot size within u-boot for use from SPL Aneesh V
2011-05-15 20:09   ` Wolfgang Denk
2011-05-18  5:02     ` Aneesh V
2011-05-18  6:06       ` Wolfgang Denk
2011-05-26 11:08         ` Aneesh V
2011-05-26 17:21           ` Wolfgang Denk
2011-05-16 18:56   ` Scott Wood
2011-05-18  4:49     ` Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 19/22] omap: add MMC support to SPL Aneesh V
2011-05-15 15:21 ` [U-Boot] [PATCH v2 20/22] omap: spl: add FAT support over MMC Aneesh V
2011-05-15 20:12   ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 21/22] omap4: add spl support for OMAP4 Panda Aneesh V
2011-05-15 20:14   ` Wolfgang Denk
2011-05-15 15:21 ` [U-Boot] [PATCH v2 22/22] omap: spl: add more debug traces Aneesh V
2011-05-15 20:21   ` Wolfgang Denk
2011-06-13 13:59     ` Aneesh V
2011-06-14  4:17       ` Aneesh V
2011-06-15 10:18       ` Wolfgang Denk
2011-07-03  9:35         ` Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 00/12] U-Boot MMC SPL for OMAP4 Aneesh V
2011-07-18 13:38   ` Aneesh V
2011-07-18 13:50     ` Wolfgang Denk
2011-07-18 14:05       ` Aneesh V
2011-07-18 14:15         ` Wolfgang Denk
2011-07-16 12:53 ` [U-Boot] [PATCH v3 01/12] omap4: utility function to identify the context of hw init Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 02/12] omap4: cleanup pin mux data Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 03/12] omap4: add OMAP4430 revision check Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 04/12] omap4: add clock support Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 05/12] omap4: add sdram init support Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 06/12] omap4: calculate EMIF register values Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 07/12] omap4: automatic sdram detection Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 08/12] armv7: start.S: fixes and enhancements for SPL Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 09/12] omap: add basic SPL support Aneesh V
2011-07-16 13:36   ` Daniel Schwierzeck
2011-07-16 14:24     ` Aneesh V
2011-07-16 14:30       ` Aneesh V
2011-07-16 15:02     ` Wolfgang Denk
2011-07-18  9:42       ` Daniel Schwierzeck
2011-07-18  9:44         ` Aneesh V
2011-07-18 12:04         ` Wolfgang Denk
2011-07-18 13:21   ` Simon Schwarz
2011-07-18 13:26     ` Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 10/12] Correct ih_os for u-boot.img Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 11/12] omap: add MMC and FAT support to SPL Aneesh V
2011-07-16 12:53 ` [U-Boot] [PATCH v3 12/12] mkimage: Add OMAP boot image support Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 00/12] U-Boot MMC SPL for OMAP4 Aneesh V
2011-07-20 21:31   ` Paulraj, Sandeep
2011-07-21  5:48     ` V, Aneesh
2011-07-21 14:04       ` Paulraj, Sandeep
2011-07-21  7:15     ` V, Aneesh
2011-07-18 15:46 ` [U-Boot] [PATCH v4 01/12] omap4: utility function to identify the context of hw init Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 02/12] omap4: cleanup pin mux data Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 03/12] omap4: add OMAP4430 revision check Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 04/12] omap4: add clock support Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 05/12] omap4: add sdram init support Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 06/12] omap4: calculate EMIF register values Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 07/12] omap4: automatic sdram detection Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 08/12] armv7: start.S: fixes and enhancements for SPL Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 09/12] omap: add basic SPL support Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 10/12] Correct ih_os for u-boot.img Aneesh V
2011-07-28 15:17   ` Wolfgang Denk
2011-07-18 15:46 ` [U-Boot] [PATCH v4 11/12] omap: add MMC and FAT support to SPL Aneesh V
2011-07-19  9:16   ` Simon Schwarz
2011-07-19 11:16     ` Aneesh V
2011-07-18 15:46 ` [U-Boot] [PATCH v4 12/12] mkimage: Add OMAP boot image support Aneesh V
2011-07-28 15:21   ` Wolfgang Denk
2011-08-02  9:08     ` Reinhard Meyer
2011-08-02 11:29       ` Albert ARIBAUD
2011-08-02 11:58         ` Reinhard Meyer
2011-07-21  7:28 ` [U-Boot] [PATCH v4 00/12] U-Boot MMC SPL for OMAP4 Aneesh V
2011-07-21 13:12   ` Paulraj, Sandeep
2011-07-21  7:28 ` [U-Boot] [PATCH v4 01/12] omap4: utility function to identify the context of hw init Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 02/12] omap4: cleanup pin mux data Aneesh V
2011-07-28 19:26   ` Wolfgang Denk
2011-07-29  8:41     ` Aneesh V
2011-07-29  8:56       ` Wolfgang Denk
2011-07-29 10:41         ` Aneesh V
2011-07-29 11:45           ` Wolfgang Denk
2011-07-21  7:28 ` [U-Boot] [PATCH v4 03/12] omap4: add OMAP4430 revision check Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 04/12] omap4: add clock support Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 05/12] omap4: add sdram init support Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 06/12] omap4: calculate EMIF register values Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 07/12] omap4: automatic sdram detection Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 08/12] armv7: start.S: fixes and enhancements for SPL Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 09/12] omap: add basic SPL support Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 10/12] Correct ih_os for u-boot.img Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 11/12] omap: add MMC and FAT support to SPL Aneesh V
2011-07-21  7:28 ` [U-Boot] [PATCH v4 12/12] mkimage: Add OMAP boot image support Aneesh V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298893591-17636-22-git-send-email-aneesh@ti.com \
    --to=aneesh@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox