2 * Copyright 2014-2015 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
13 DECLARE_GLOBAL_DATA_PTR;
15 u32 spl_boot_device(void)
17 #ifdef CONFIG_SPL_MMC_SUPPORT
18 return BOOT_DEVICE_MMC1;
20 #ifdef CONFIG_SPL_NAND_SUPPORT
21 return BOOT_DEVICE_NAND;
26 u32 spl_boot_mode(const u32 boot_device)
28 switch (spl_boot_device()) {
29 case BOOT_DEVICE_MMC1:
30 #ifdef CONFIG_SPL_FAT_SUPPORT
33 return MMCSD_MODE_RAW;
35 case BOOT_DEVICE_NAND:
38 puts("spl: error: unsupported device\n");
43 #ifdef CONFIG_SPL_BUILD
45 void spl_board_init(void)
47 #if defined(CONFIG_SECURE_BOOT) && defined(CONFIG_FSL_LSCH2)
49 * In case of Secure Boot, the IBR configures the SMMU
50 * to allow only Secure transactions.
51 * SMMU must be reset in bypass mode.
52 * Set the ClientPD bit and Clear the USFCFG Bit
55 val = (in_le32(SMMU_SCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK);
56 out_le32(SMMU_SCR0, val);
57 val = (in_le32(SMMU_NSCR0) | SCR0_CLIENTPD_MASK) & ~(SCR0_USFCFG_MASK);
58 out_le32(SMMU_NSCR0, val);
62 void board_init_f(ulong dummy)
64 /* Clear global data */
65 memset((void *)gd, 0, sizeof(gd_t));
68 #ifdef CONFIG_ARCH_LS2080A
73 preloader_console_init();
75 #ifdef CONFIG_SPL_I2C_SUPPORT