aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInderpal Singh <inderpal.singh@linaro.org>2012-12-18 14:39:38 +0530
committerTushar Behera <tushar.behera@linaro.org>2013-02-05 10:39:12 +0530
commitb8c475ce0be7ea15ce6eef930d01dad7c57da03f (patch)
tree35088c287510ab1a667d8e03db93b3e580d59043
parent443065525e6ee22ac0f3b35e82ceb04e6ff84f86 (diff)
downloadu-boot-linaro-stable-b8c475ce0be7ea15ce6eef930d01dad7c57da03f.tar.gz
EXYNOS5250: ARNDALE: Read operating mode and invoke copy functions accordingly
Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
-rw-r--r--board/samsung/smdk5250/lowlevel_init.S23
-rw-r--r--board/samsung/smdk5250/mmc_boot.c13
2 files changed, 34 insertions, 2 deletions
diff --git a/board/samsung/smdk5250/lowlevel_init.S b/board/samsung/smdk5250/lowlevel_init.S
index 2ef520f..25e2e68 100644
--- a/board/samsung/smdk5250/lowlevel_init.S
+++ b/board/samsung/smdk5250/lowlevel_init.S
@@ -102,6 +102,8 @@ first_cpu:
cmp r1, r2 /* compare r1, r2 */
beq 1f /* r0 == r1 then skip sdram init */
+ bl read_om
+
/* init system clock */
bl system_clock_init
@@ -133,3 +135,24 @@ exit_wakeup:
mov pc, r1
nop
nop
+
+read_om:
+ /* Read booting information */
+ ldr r0, =EXYNOS5_POWER_BASE
+ ldr r1, [r0,#0x0] /*OMR_OFFSET*/
+ bic r2, r1, #0xffffffc1
+
+ /* SD/MMC BOOT */
+ cmp r2, #0x4
+ moveq r3, #BOOT_MMCSD
+
+ /* eMMC 4.4 BOOT */
+ cmp r2, #0x8
+ moveq r3, #BOOT_EMMC_4_4
+ cmp r2, #0x28
+ moveq r3, #BOOT_EMMC_4_4
+
+ ldr r0, =(EXYNOS5_POWER_BASE + INFORM3_OFFSET)
+ str r3, [r0]
+
+ mov pc, lr
diff --git a/board/samsung/smdk5250/mmc_boot.c b/board/samsung/smdk5250/mmc_boot.c
index 449a919..c0b79eb 100644
--- a/board/samsung/smdk5250/mmc_boot.c
+++ b/board/samsung/smdk5250/mmc_boot.c
@@ -30,9 +30,18 @@
*/
void copy_uboot_to_ram(void)
{
- u32 (*copy_bl2)(u32, u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR;
+ u32 (*copy_bl2_from_mmc)(u32, u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR;
+ u32 (*copy_bl2_from_emmc)(u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR_EMMC;
+ u32 (*copy_bl2_from_emmc_done)() = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR_EMMC_DONE;
- copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT, CONFIG_SYS_TEXT_BASE);
+ u32 inform3 = readl(EXYNOS5_POWER_BASE + INFORM3_OFFSET);
+
+ if (inform3 == BOOT_MMCSD)
+ copy_bl2_from_mmc(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT, CONFIG_SYS_TEXT_BASE);
+ else if (inform3 == BOOT_EMMC_4_4) {
+ copy_bl2_from_emmc(BL2_SIZE_BLOC_COUNT, CONFIG_SYS_TEXT_BASE);
+ copy_bl2_from_emmc_done();
+ }
}
void board_init_f(unsigned long bootflag)