blob: 99eb8972cf3dab3e143bce366a00007712012cb0 [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
Nishanth Menonac205d82023-11-04 03:11:01 -050048int board_init(void)
49{
50 return 0;
51}
52
53int dram_init(void)
54{
55 return fdtdec_setup_mem_size_base();
56}
57
58int dram_init_banksize(void)
59{
60 return fdtdec_setup_memory_banksize();
61}
Nishanth Menon9a94f2c2024-02-12 13:47:24 -060062
63#ifdef CONFIG_BOARD_LATE_INIT
64int board_late_init(void)
65{
66 char fdtfile[50];
67
Aashvij Shenai73e4cbe2025-01-20 14:20:42 +053068 snprintf(fdtfile, sizeof(fdtfile), "%s.dtb", CONFIG_DEFAULT_DEVICE_TREE);
Nishanth Menon9a94f2c2024-02-12 13:47:24 -060069
70 env_set("fdtfile", fdtfile);
71
72 return 0;
73}
74#endif