2 * Copyright 2014-2015 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
14 DECLARE_GLOBAL_DATA_PTR;
16 u32 spl_boot_device(void)
18 #ifdef CONFIG_SPL_MMC_SUPPORT
19 return BOOT_DEVICE_MMC1;
21 #ifdef CONFIG_SPL_NAND_SUPPORT
22 return BOOT_DEVICE_NAND;
27 u32 spl_boot_mode(void)
29 switch (spl_boot_device()) {
30 case BOOT_DEVICE_MMC1:
31 #ifdef CONFIG_SPL_FAT_SUPPORT
32 return MMCSD_MODE_FAT;
34 return MMCSD_MODE_RAW;
36 case BOOT_DEVICE_NAND:
39 puts("spl: error: unsupported device\n");
44 #ifdef CONFIG_SPL_BUILD
45 void board_init_f(ulong dummy)
47 /* Clear global data */
48 memset((void *)gd, 0, sizeof(gd_t));
59 preloader_console_init();
61 #ifdef CONFIG_SPL_I2C_SUPPORT
67 memset(__bss_start, 0, __bss_end - __bss_start);
69 #ifdef CONFIG_LAYERSCAPE_NS_ACCESS
70 enable_layerscape_ns_access();
72 board_init_r(NULL, 0);