Nishanth Menon | ac205d8 | 2023-11-04 03:11:01 -0500 | [diff] [blame] | 1 | // 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 Humphreys | c4b5f82 | 2024-06-14 11:35:46 -0500 | [diff] [blame] | 10 | #include <efi_loader.h> |
Nishanth Menon | ac205d8 | 2023-11-04 03:11:01 -0500 | [diff] [blame] | 11 | #include <cpu_func.h> |
| 12 | #include <env.h> |
| 13 | #include <fdt_support.h> |
| 14 | #include <spl.h> |
| 15 | |
| 16 | DECLARE_GLOBAL_DATA_PTR; |
| 17 | |
Jonathan Humphreys | c4b5f82 | 2024-06-14 11:35:46 -0500 | [diff] [blame] | 18 | struct 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 | |
| 41 | struct 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 Menon | ac205d8 | 2023-11-04 03:11:01 -0500 | [diff] [blame] | 48 | int board_init(void) |
| 49 | { |
| 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | int dram_init(void) |
| 54 | { |
| 55 | return fdtdec_setup_mem_size_base(); |
| 56 | } |
| 57 | |
| 58 | int dram_init_banksize(void) |
| 59 | { |
| 60 | return fdtdec_setup_memory_banksize(); |
| 61 | } |
Nishanth Menon | 9a94f2c | 2024-02-12 13:47:24 -0600 | [diff] [blame] | 62 | |
| 63 | #ifdef CONFIG_BOARD_LATE_INIT |
| 64 | int board_late_init(void) |
| 65 | { |
| 66 | char fdtfile[50]; |
| 67 | |
Aashvij Shenai | 73e4cbe | 2025-01-20 14:20:42 +0530 | [diff] [blame] | 68 | snprintf(fdtfile, sizeof(fdtfile), "%s.dtb", CONFIG_DEFAULT_DEVICE_TREE); |
Nishanth Menon | 9a94f2c | 2024-02-12 13:47:24 -0600 | [diff] [blame] | 69 | |
| 70 | env_set("fdtfile", fdtfile); |
| 71 | |
| 72 | return 0; |
| 73 | } |
| 74 | #endif |