diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2017-07-31 17:23:07 +0100 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2017-07-31 17:23:07 +0100 |
commit | e5b9b8c8b78096e961f4a45b9d1418e4641f24f9 (patch) | |
tree | a88f532f386376fca6a376e2c362173f971dc144 /arch/arm/cpu/arm926ejs/rda/spl.c | |
parent | 415d386877df49eb051b85ef74fa59a16dc17c7d (diff) |
Orangepi i96 support (mega patch)rda/v2012.04.01-r0
This is https://github.com/orangepi-xunlong/OrangePiRDA_u-boot
5ee06c1afb7c ("add new patch a patch") as a single patch against
a guestimated upstream version.
This is merely a reference tree for later comparisons.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
NOT-Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Diffstat (limited to 'arch/arm/cpu/arm926ejs/rda/spl.c')
-rw-r--r-- | arch/arm/cpu/arm926ejs/rda/spl.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/arch/arm/cpu/arm926ejs/rda/spl.c b/arch/arm/cpu/arm926ejs/rda/spl.c new file mode 100644 index 0000000000..5111638288 --- /dev/null +++ b/arch/arm/cpu/arm926ejs/rda/spl.c @@ -0,0 +1,74 @@ +#include <common.h> +#include <asm/u-boot.h> +#include <asm/utils.h> +#include <nand.h> +#include <malloc.h> + +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT + +DECLARE_GLOBAL_DATA_PTR; +/* Define global data structure pointer to it*/ +static gd_t gdata __attribute__ ((section(".data"))); +static bd_t bdata __attribute__ ((section(".data"))); + +#else + +void puts(const char *str) +{ + while (*str) + putc(*str++); +} + +void putc(char c) +{ +} + +#endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */ + +inline void hang(void) +{ + puts("### ERROR ### Please RESET the board ###\n"); + for (;;) + ; +} + +void board_init_f(ulong dummy) +{ + relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE); +} + +void board_init_r(gd_t *id, ulong dummy) +{ +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT + gd = &gdata; + gd->bd = &bdata; + gd->flags |= GD_FLG_RELOC; + gd->baudrate = CONFIG_BAUDRATE; + serial_init(); /* serial communications setup */ + gd->have_console = 1; +#endif + puts("board_init_r\n"); + while(1) + ; +#if 0 +#ifdef CONFIG_SPL_NAND_LOAD + nand_init(); + puts("Nand boot...\n"); + nand_boot(); +#endif +#ifdef CONFIG_SPL_SPI_LOAD + mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN, + CONFIG_SYS_MALLOC_LEN); + + gd = &gdata; + gd->bd = &bdata; + gd->flags |= GD_FLG_RELOC; + gd->baudrate = CONFIG_BAUDRATE; + serial_init(); /* serial communications setup */ + gd->have_console = 1; + + puts("SPI boot...\n"); + spi_boot(); +#endif +#endif +} |