]> Git Repo - u-boot.git/blame - arch/arm/mach-davinci/spl.c
common: Move hang() to the same header as panic()
[u-boot.git] / arch / arm / mach-davinci / spl.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
435199f3
HS
2/*
3 * Copyright (C) 2011
4 * Heiko Schocher, DENX Software Engineering, [email protected].
435199f3
HS
5 */
6#include <common.h>
3f7f2414 7#include <config.h>
29a4a9f1 8#include <hang.h>
3f7f2414 9#include <spl.h>
435199f3
HS
10#include <asm/u-boot.h>
11#include <asm/utils.h>
12#include <nand.h>
13#include <asm/arch/dm365_lowlevel.h>
14#include <ns16550.h>
620fd27c
CR
15#include <malloc.h>
16#include <spi_flash.h>
0d986e61 17#include <mmc.h>
620fd27c 18
3f7f2414 19#ifndef CONFIG_SPL_LIBCOMMON_SUPPORT
435199f3
HS
20void puts(const char *str)
21{
22 while (*str)
23 putc(*str++);
24}
25
26void putc(char c)
27{
28 if (c == '\n')
29 NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), '\r');
30
31 NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c);
32}
620fd27c
CR
33#endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */
34
2a766db9 35void board_init_f(ulong dummy)
435199f3 36{
620fd27c 37 arch_cpu_init();
2a766db9
SN
38
39 spl_early_init();
40
3f7f2414
TR
41 preloader_console_init();
42}
560e69bf 43
3f7f2414
TR
44u32 spl_boot_device(void)
45{
c0fa385c
FP
46 switch (davinci_syscfg_regs->bootcfg) {
47#ifdef CONFIG_SPL_NAND_SUPPORT
48 case DAVINCI_NAND8_BOOT:
49 case DAVINCI_NAND16_BOOT:
50 return BOOT_DEVICE_NAND;
0d986e61 51#endif
c0fa385c
FP
52
53#ifdef CONFIG_SPL_MMC_SUPPORT
54 case DAVINCI_SD_OR_MMC_BOOT:
55 case DAVINCI_MMC_ONLY_BOOT:
56 return BOOT_DEVICE_MMC1;
57#endif
58
59#ifdef CONFIG_SPL_SPI_FLASH_SUPPORT
60 case DAVINCI_SPI0_FLASH_BOOT:
61 case DAVINCI_SPI1_FLASH_BOOT:
62 return BOOT_DEVICE_SPI;
63#endif
64
65 default:
66 puts("Unknown boot device\n");
67 hang();
68 }
435199f3 69}
This page took 0.302337 seconds and 4 git commands to generate.