summaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
authorPavel Machek <pavel@denx.de>2012-08-30 22:42:11 +0200
committerTom Rini <trini@ti.com>2012-09-27 11:20:28 -0700
commitc57b953da923c6402afc1c890c21fdc7d5a2cc4a (patch)
tree1d4ecfd2fed252ebec11770488ade3c57217a797 /common/spl
parent4212098181ac91e14374c1207b1e98595f1cc717 (diff)
downloadu-boot-imx-c57b953da923c6402afc1c890c21fdc7d5a2cc4a.zip
u-boot-imx-c57b953da923c6402afc1c890c21fdc7d5a2cc4a.tar.gz
u-boot-imx-c57b953da923c6402afc1c890c21fdc7d5a2cc4a.tar.bz2
SPL: Add support for loading image from ram in SPL.
Signed-off-by: Pavel Machek <pavel@denx.de> Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/spl.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index f2f6de7..c640f87 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -128,6 +128,23 @@ static void __noreturn jump_to_image_no_args(void)
image_entry((u32 *)boot_params_ptr_addr);
}
+#ifdef CONFIG_SPL_RAM_DEVICE
+static void spl_ram_load_image(void)
+{
+ const struct image_header *header;
+
+ /*
+ * Get the header. It will point to an address defined by handoff
+ * which will tell where the image located inside the flash. For
+ * now, it will temporary fixed to address pointed by U-Boot.
+ */
+ header = (struct image_header *)
+ (CONFIG_SYS_TEXT_BASE - sizeof(struct image_header));
+
+ spl_parse_image_header(header);
+}
+#endif
+
void board_init_r(gd_t *dummy1, ulong dummy2)
{
u32 boot_device;
@@ -145,6 +162,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
boot_device = spl_boot_device();
debug("boot device - %d\n", boot_device);
switch (boot_device) {
+#ifdef CONFIG_SPL_RAM_DEVICE
+ case BOOT_DEVICE_RAM:
+ spl_ram_load_image();
+ break;
+#endif
#ifdef CONFIG_SPL_MMC_SUPPORT
case BOOT_DEVICE_MMC1:
case BOOT_DEVICE_MMC2: