summaryrefslogtreecommitdiffstats
path: root/board/freescale/p1022ds/spl.c
diff options
context:
space:
mode:
authorYing Zhang <b40530@freescale.com>2013-08-16 15:16:16 +0800
committerYork Sun <yorksun@freescale.com>2013-08-20 09:57:51 -0700
commit5d97fe2a0421247f6b89591c666d7aa94d40beb0 (patch)
treef7dd51801a172e22e17b25adfc09af3bbc7b5d9a /board/freescale/p1022ds/spl.c
parent3aa29de0b04be9d56251474d1036b23da249f607 (diff)
downloadu-boot-5d97fe2a0421247f6b89591c666d7aa94d40beb0.tar.gz
u-boot-5d97fe2a0421247f6b89591c666d7aa94d40beb0.tar.xz
u-boot-5d97fe2a0421247f6b89591c666d7aa94d40beb0.zip
powerpc: p1022ds: add TPL for p1022ds nand boot
TPL is introduced in the patch "NAND: TPL : introduce the TPL based on the SPL", here enable TPL for p1022ds nand boot. Signed-off-by: Ying Zhang <b40530@freescale.com> Acked-by: York Sun <yorksun@freescale.com>
Diffstat (limited to 'board/freescale/p1022ds/spl.c')
-rw-r--r--board/freescale/p1022ds/spl.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c
index 7e89de2b11..358b2e330e 100644
--- a/board/freescale/p1022ds/spl.c
+++ b/board/freescale/p1022ds/spl.c
@@ -100,21 +100,37 @@ void board_init_r(gd_t *gd, ulong dest_addr)
get_clocks();
mem_malloc_init(CONFIG_SPL_RELOC_MALLOC_ADDR,
CONFIG_SPL_RELOC_MALLOC_SIZE);
+#ifndef CONFIG_SPL_NAND_BOOT
env_init();
+#endif
#ifdef CONFIG_SPL_MMC_BOOT
mmc_initialize(bd);
#endif
/* relocate environment function pointers etc. */
+#ifdef CONFIG_SPL_NAND_BOOT
+ nand_spl_load_image(CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE,
+ (uchar *)CONFIG_ENV_ADDR);
+
+ gd->env_addr = (ulong)(CONFIG_ENV_ADDR);
+ gd->env_valid = 1;
+#else
env_relocate();
+#endif
i2c_init(CONFIG_SYS_FSL_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
gd->ram_size = initdram(0);
+#ifdef CONFIG_SPL_NAND_BOOT
+ puts("Tertiary program loader running in sram...");
+#else
puts("Second program loader running in sram...\n");
+#endif
#ifdef CONFIG_SPL_MMC_BOOT
mmc_boot();
#elif defined(CONFIG_SPL_SPI_BOOT)
spi_boot();
+#elif defined(CONFIG_SPL_NAND_BOOT)
+ nand_boot();
#endif
}