blob: df89125cb294b1af8b474c10f6729c9ee312df77 [file] [log] [blame]
Siew Chin Lim612ee822021-03-15 15:59:16 +08001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2020 Intel Corporation. All rights reserved
Tien Fong Chee43975a12025-02-18 16:34:59 +08004 * Copyright (C) 2025 Altera Corporation <www.altera.com>
Siew Chin Lim612ee822021-03-15 15:59:16 +08005 *
6 */
7
Tien Fong Chee43975a12025-02-18 16:34:59 +08008#include <hang.h>
Siew Chin Lim612ee822021-03-15 15:59:16 +08009#include <spl.h>
Tien Fong Chee43975a12025-02-18 16:34:59 +080010#include <dm/uclass.h>
Siew Chin Lim612ee822021-03-15 15:59:16 +080011
12DECLARE_GLOBAL_DATA_PTR;
13
14u32 spl_boot_device(void)
15{
16 return BOOT_DEVICE_MMC1;
17}
18
Simon Glassb58bfe02021-08-08 12:20:09 -060019#if IS_ENABLED(CONFIG_SPL_MMC)
Siew Chin Lim612ee822021-03-15 15:59:16 +080020u32 spl_boot_mode(const u32 boot_device)
21{
22 if (IS_ENABLED(CONFIG_SPL_FS_FAT) || IS_ENABLED(CONFIG_SPL_FS_EXT4))
23 return MMCSD_MODE_FS;
24 else
25 return MMCSD_MODE_RAW;
26}
27#endif
Tien Fong Chee43975a12025-02-18 16:34:59 +080028
29/* board specific function prior loading SSBL / U-Boot */
30void spl_perform_fixups(struct spl_image_info *spl_image)
31{
32 int ret;
33 struct udevice *dev;
34
35 ret = uclass_get_device_by_name(UCLASS_NOP, "socfpga-smmu-secure-config", &dev);
36 if (ret) {
37 printf("HPS SMMU secure settings init failed: %d\n", ret);
38 hang();
39 }
40}