Bryan Brattlof | 77d831f | 2024-03-12 15:20:25 -0500 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Board specific initialization for AM62Px platforms |
| 4 | * |
| 5 | * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/ |
| 6 | * |
| 7 | */ |
| 8 | |
Jonathan Humphreys | 72b75fc | 2024-06-14 11:35:43 -0500 | [diff] [blame] | 9 | #include <efi_loader.h> |
Bryan Brattlof | 77d831f | 2024-03-12 15:20:25 -0500 | [diff] [blame] | 10 | #include <asm/arch/hardware.h> |
| 11 | #include <asm/io.h> |
| 12 | #include <dm/uclass.h> |
| 13 | #include <env.h> |
| 14 | #include <fdt_support.h> |
| 15 | #include <spl.h> |
Manorit Chawdhry | a878719 | 2024-07-02 10:50:01 +0530 | [diff] [blame^] | 16 | #include "../common/fdt_ops.h" |
Bryan Brattlof | 77d831f | 2024-03-12 15:20:25 -0500 | [diff] [blame] | 17 | |
Jonathan Humphreys | 72b75fc | 2024-06-14 11:35:43 -0500 | [diff] [blame] | 18 | struct efi_fw_image fw_images[] = { |
| 19 | { |
| 20 | .image_type_id = AM62PX_SK_TIBOOT3_IMAGE_GUID, |
| 21 | .fw_name = u"AM62PX_SK_TIBOOT3", |
| 22 | .image_index = 1, |
| 23 | }, |
| 24 | { |
| 25 | .image_type_id = AM62PX_SK_SPL_IMAGE_GUID, |
| 26 | .fw_name = u"AM62PX_SK_SPL", |
| 27 | .image_index = 2, |
| 28 | }, |
| 29 | { |
| 30 | .image_type_id = AM62PX_SK_UBOOT_IMAGE_GUID, |
| 31 | .fw_name = u"AM62PX_SK_UBOOT", |
| 32 | .image_index = 3, |
| 33 | } |
| 34 | }; |
| 35 | |
| 36 | struct efi_capsule_update_info update_info = { |
| 37 | .dfu_string = "sf 0:0=tiboot3.bin raw 0 80000;" |
| 38 | "tispl.bin raw 80000 200000;u-boot.img raw 280000 400000", |
| 39 | .num_images = ARRAY_SIZE(fw_images), |
| 40 | .images = fw_images, |
| 41 | }; |
| 42 | |
| 43 | #if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) |
| 44 | void set_dfu_alt_info(char *interface, char *devstr) |
| 45 | { |
| 46 | if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) |
| 47 | env_set("dfu_alt_info", update_info.dfu_string); |
| 48 | } |
| 49 | #endif |
| 50 | |
Bryan Brattlof | 77d831f | 2024-03-12 15:20:25 -0500 | [diff] [blame] | 51 | int board_init(void) |
| 52 | { |
| 53 | return 0; |
| 54 | } |
| 55 | |
| 56 | int dram_init(void) |
| 57 | { |
| 58 | return fdtdec_setup_mem_size_base(); |
| 59 | } |
| 60 | |
| 61 | int dram_init_banksize(void) |
| 62 | { |
| 63 | return fdtdec_setup_memory_banksize(); |
| 64 | } |
Manorit Chawdhry | a878719 | 2024-07-02 10:50:01 +0530 | [diff] [blame^] | 65 | |
| 66 | #if IS_ENABLED(CONFIG_BOARD_LATE_INIT) |
| 67 | int board_late_init(void) |
| 68 | { |
| 69 | ti_set_fdt_env(NULL, NULL); |
| 70 | return 0; |
| 71 | } |
| 72 | #endif |