1 // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
3 * Copyright (C) 2018, STMicroelectronics - All Rights Reserved
11 u32 spl_boot_device(void)
15 boot_mode = (readl(TAMP_BOOT_CONTEXT) & TAMP_BOOT_MODE_MASK) >>
20 case BOOT_FLASH_EMMC_1:
21 return BOOT_DEVICE_MMC1;
23 case BOOT_FLASH_EMMC_2:
24 return BOOT_DEVICE_MMC2;
27 return BOOT_DEVICE_MMC1;
30 u32 spl_boot_mode(const u32 boot_device)
32 return MMCSD_MODE_RAW;
35 int spl_boot_partition(const u32 boot_device)
37 switch (boot_device) {
38 case BOOT_DEVICE_MMC1:
39 return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION;
40 case BOOT_DEVICE_MMC2:
41 return CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_MMC2;
47 void board_init_f(ulong dummy)
54 ret = spl_early_init();
56 debug("spl_early_init() failed: %d\n", ret);
60 ret = uclass_get_device(UCLASS_CLK, 0, &dev);
62 debug("Clock init failed: %d\n", ret);
66 ret = uclass_get_device(UCLASS_RESET, 0, &dev);
68 debug("Reset init failed: %d\n", ret);
72 ret = uclass_get_device(UCLASS_PINCTRL, 0, &dev);
74 debug("%s: Cannot find pinctrl device\n", __func__);
78 /* enable console uart printing */
79 preloader_console_init();
81 ret = uclass_get_device(UCLASS_RAM, 0, &dev);
83 debug("DRAM init failed: %d\n", ret);