blob: 1e43d1c1bd23b5ca4634c481d52de98ce113bf61 [file] [log] [blame]
Nishanth Menonac205d82023-11-04 03:11:01 -05001// SPDX-License-Identifier: GPL-2.0
2/*
3 * https://beagleboard.org/ai-64
4 *
5 * Copyright (C) 2022-2023 Texas Instruments Incorporated - https://www.ti.com/
6 * Copyright (C) 2022-2023 Jason Kridner, BeagleBoard.org Foundation
7 * Copyright (C) 2022-2023 Robert Nelson, BeagleBoard.org Foundation
8 */
9
Jonathan Humphreysc4b5f822024-06-14 11:35:46 -050010#include <efi_loader.h>
Nishanth Menonac205d82023-11-04 03:11:01 -050011#include <cpu_func.h>
12#include <env.h>
13#include <fdt_support.h>
14#include <spl.h>
15
16DECLARE_GLOBAL_DATA_PTR;
17
Jonathan Humphreysc4b5f822024-06-14 11:35:46 -050018struct efi_fw_image fw_images[] = {
19 {
20 .image_type_id = BEAGLEBONEAI64_TIBOOT3_IMAGE_GUID,
21 .fw_name = u"BEAGLEBONEAI64_TIBOOT3",
22 .image_index = 1,
23 },
24 {
25 .image_type_id = BEAGLEBONEAI64_SPL_IMAGE_GUID,
26 .fw_name = u"BEAGLEBONEAI64_SPL",
27 .image_index = 2,
28 },
29 {
30 .image_type_id = BEAGLEBONEAI64_UBOOT_IMAGE_GUID,
31 .fw_name = u"BEAGLEBONEAI64_UBOOT",
32 .image_index = 3,
33 },
34 {
35 .image_type_id = BEAGLEBONEAI64_SYSFW_IMAGE_GUID,
36 .fw_name = u"BEAGLEBONEAI64_SYSFW",
37 .image_index = 4,
38 }
39};
40
41struct efi_capsule_update_info update_info = {
42 .dfu_string = "mmc 0=tiboot3.bin raw 0 2000 mmcpart 1;"
43 "tispl.bin fat 0 1;u-boot.img fat 0 1; sysfw.itb fat 0 1",
44 .num_images = ARRAY_SIZE(fw_images),
45 .images = fw_images,
46};
47
48#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
49void set_dfu_alt_info(char *interface, char *devstr)
50{
51 if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
52 env_set("dfu_alt_info", update_info.dfu_string);
53}
54#endif
55
Nishanth Menonac205d82023-11-04 03:11:01 -050056int board_init(void)
57{
58 return 0;
59}
60
61int dram_init(void)
62{
63 return fdtdec_setup_mem_size_base();
64}
65
66int dram_init_banksize(void)
67{
68 return fdtdec_setup_memory_banksize();
69}
Nishanth Menon9a94f2c2024-02-12 13:47:24 -060070
71#ifdef CONFIG_BOARD_LATE_INIT
72int board_late_init(void)
73{
74 char fdtfile[50];
75
76 snprintf(fdtfile, sizeof(fdtfile), "%s/%s.dtb",
77 CONFIG_TI_FDT_FOLDER_PATH, CONFIG_DEFAULT_DEVICE_TREE);
78
79 env_set("fdtfile", fdtfile);
80
81 return 0;
82}
83#endif