barebox_default_env: fix out of tree build
[barebox-mini2440.git] / board / a9m2410 / lowlevel_init.S
blob461b93c3f12438196e7a950ce96f2ae442a85cfa
1 /*
2  *
3  */
5 #include <config.h>
6 #include <mach/s3c24x0-iomap.h>
8         .section ".text_bare_init.board_init_lowlevel","ax"
10 .globl board_init_lowlevel
11 board_init_lowlevel:
13         mov r10, lr             /* save the link register */
15         bl s3c24x0_disable_wd
17         /* skip everything here if we are already running from SDRAM */
18         cmp pc, #S3C24X0_SDRAM_BASE
19         blo 1f
20         cmp pc, #S3C24X0_SDRAM_END
21         bhs 1f
23         mov pc, r10
25 /* we are running from NOR or NAND/SRAM memory. Do further initialisation */
27         bl s3c24x0_pll_init
29         bl s3c24x0_sdram_init
31 #ifdef CONFIG_S3C24XX_NAND_BOOT
32         mov lr, r10             /* restore the link register */
33 /* up to here we are running from the internal SRAM area */
34         b s3c24x0_nand_boot     /* does return directly to our caller into SDRAM */
35 #else
36         mov pc, r10
37 #endif