Robert Nelson | 8b415f75 | 2025-03-03 13:15:15 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * https://www.beagleboard.org/boards/beagley-ai |
| 4 | * |
| 5 | * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/ |
| 6 | */ |
| 7 | |
| 8 | #include <asm/arch/hardware.h> |
| 9 | #include <asm/io.h> |
| 10 | #include <dm/uclass.h> |
| 11 | #include <env.h> |
| 12 | #include <fdt_support.h> |
| 13 | #include <spl.h> |
| 14 | #include <asm/arch/k3-ddr.h> |
| 15 | |
| 16 | #if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) |
| 17 | void set_dfu_alt_info(char *interface, char *devstr) |
| 18 | { |
| 19 | if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) |
| 20 | env_set("dfu_alt_info", update_info.dfu_string); |
| 21 | } |
| 22 | #endif |
| 23 | |
| 24 | int board_init(void) |
| 25 | { |
| 26 | return 0; |
| 27 | } |
| 28 | |
| 29 | int dram_init(void) |
| 30 | { |
| 31 | return fdtdec_setup_mem_size_base(); |
| 32 | } |
| 33 | |
| 34 | int dram_init_banksize(void) |
| 35 | { |
| 36 | return fdtdec_setup_memory_banksize(); |
| 37 | } |
| 38 | |
| 39 | #if defined(CONFIG_XPL_BUILD) |
| 40 | void spl_perform_fixups(struct spl_image_info *spl_image) |
| 41 | { |
| 42 | if (IS_ENABLED(CONFIG_K3_DDRSS)) { |
| 43 | if (IS_ENABLED(CONFIG_K3_INLINE_ECC)) |
| 44 | fixup_ddr_driver_for_ecc(spl_image); |
| 45 | } else { |
| 46 | fixup_memory_node(spl_image); |
| 47 | } |
| 48 | } |
| 49 | #endif |
| 50 | |
| 51 | #if IS_ENABLED(CONFIG_BOARD_LATE_INIT) |
| 52 | int board_late_init(void) |
| 53 | { |
| 54 | char fdtfile[50]; |
| 55 | |
| 56 | snprintf(fdtfile, sizeof(fdtfile), "%s.dtb", CONFIG_DEFAULT_DEVICE_TREE); |
| 57 | |
| 58 | env_set("fdtfile", fdtfile); |
| 59 | |
| 60 | return 0; |
| 61 | } |
| 62 | #endif |