2 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
4 * SPDX-License-Identifier: GPL-2.0+ BSD-3-Clause
12 u32 spl_boot_device(void)
16 boot_mode = (readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_MODE_MASK) >>
18 clrsetbits_le32(TAMP_BOOT_CONTEXT,
20 boot_mode << TAMP_BOOT_MODE_SHIFT);
24 case BOOT_FLASH_EMMC_1:
25 return BOOT_DEVICE_MMC1;
27 case BOOT_FLASH_EMMC_2:
28 return BOOT_DEVICE_MMC2;
31 return BOOT_DEVICE_MMC1;
34 u32 spl_boot_mode(const u32 boot_device)
36 return MMCSD_MODE_RAW;
39 int spl_boot_partition(const u32 boot_device)
41 switch (boot_device) {
42 case BOOT_DEVICE_MMC1:
43 return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION;
44 case BOOT_DEVICE_MMC2:
45 return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2;
51 void board_init_f(ulong dummy)
58 ret = spl_early_init();
60 debug("spl_early_init() failed: %d\n", ret);
64 ret = uclass_get_device(UCLASS_CLK, 0, &dev);
66 debug("Clock init failed: %d\n", ret);
70 ret = uclass_get_device(UCLASS_RESET, 0, &dev);
72 debug("Reset init failed: %d\n", ret);
76 ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
78 debug("%s: Cannot find pinctrl device\n", __func__);
82 /* enable console uart printing */
83 preloader_console_init();
85 ret = uclass_get_device(UCLASS_RAM, 0, &dev);
87 debug("DRAM init failed: %d\n", ret);