1 // SPDX-License-Identifier: GPL-2.0+
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
9 #include <asm/u-boot.h>
10 #include <asm/utils.h>
12 #include <asm/arch/dm365_lowlevel.h>
15 #include <spi_flash.h>
18 #ifndef CONFIG_SPL_LIBCOMMON_SUPPORT
19 void puts(const char *str)
28 NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), '\r');
30 NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c);
32 #endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */
34 void spl_board_init(void)
36 #ifdef CONFIG_SOC_DM365
37 dm36x_lowlevel_init(0);
39 #ifdef CONFIG_SOC_DA8XX
42 preloader_console_init();
45 u32 spl_boot_device(void)
47 switch (davinci_syscfg_regs->bootcfg) {
48 #ifdef CONFIG_SPL_NAND_SUPPORT
49 case DAVINCI_NAND8_BOOT:
50 case DAVINCI_NAND16_BOOT:
51 return BOOT_DEVICE_NAND;
54 #ifdef CONFIG_SPL_MMC_SUPPORT
55 case DAVINCI_SD_OR_MMC_BOOT:
56 case DAVINCI_MMC_ONLY_BOOT:
57 return BOOT_DEVICE_MMC1;
60 #ifdef CONFIG_SPL_SPI_FLASH_SUPPORT
61 case DAVINCI_SPI0_FLASH_BOOT:
62 case DAVINCI_SPI1_FLASH_BOOT:
63 return BOOT_DEVICE_SPI;
67 puts("Unknown boot device\n");