3 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/u-boot.h>
11 #include <asm/utils.h>
13 #include <asm/arch/dm365_lowlevel.h>
16 #include <spi_flash.h>
19 DECLARE_GLOBAL_DATA_PTR;
21 #ifndef CONFIG_SPL_LIBCOMMON_SUPPORT
22 void puts(const char *str)
31 NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), '\r');
33 NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c);
35 #endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */
37 void spl_board_init(void)
39 #ifdef CONFIG_SOC_DM365
40 dm36x_lowlevel_init(0);
42 #ifdef CONFIG_SOC_DA8XX
45 preloader_console_init();
48 u32 spl_boot_mode(const u32 boot_device)
50 return MMCSD_MODE_RAW;
53 u32 spl_boot_device(void)
55 switch (davinci_syscfg_regs->bootcfg) {
56 #ifdef CONFIG_SPL_NAND_SUPPORT
57 case DAVINCI_NAND8_BOOT:
58 case DAVINCI_NAND16_BOOT:
59 return BOOT_DEVICE_NAND;
62 #ifdef CONFIG_SPL_MMC_SUPPORT
63 case DAVINCI_SD_OR_MMC_BOOT:
64 case DAVINCI_MMC_ONLY_BOOT:
65 return BOOT_DEVICE_MMC1;
68 #ifdef CONFIG_SPL_SPI_FLASH_SUPPORT
69 case DAVINCI_SPI0_FLASH_BOOT:
70 case DAVINCI_SPI1_FLASH_BOOT:
71 return BOOT_DEVICE_SPI;
75 puts("Unknown boot device\n");