Dave Gerlach | 3dc33f1 | 2021-04-23 11:27:42 -0500 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Configuration header file for K3 AM642 SoC family |
| 4 | * |
| 5 | * Copyright (C) 2020-2021 Texas Instruments Incorporated - https://www.ti.com/ |
| 6 | * Keerthy <j-keerthy@ti.com> |
| 7 | */ |
| 8 | |
| 9 | #ifndef __CONFIG_AM642_EVM_H |
| 10 | #define __CONFIG_AM642_EVM_H |
| 11 | |
| 12 | #include <linux/sizes.h> |
| 13 | #include <config_distro_bootcmd.h> |
| 14 | #include <environment/ti/mmc.h> |
| 15 | |
| 16 | /* DDR Configuration */ |
| 17 | #define CONFIG_SYS_SDRAM_BASE1 0x880000000 |
| 18 | |
| 19 | #ifdef CONFIG_SYS_K3_SPL_ATF |
| 20 | #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "tispl.bin" |
| 21 | #endif |
| 22 | |
| 23 | #ifndef CONFIG_CPU_V7R |
| 24 | #define CONFIG_SKIP_LOWLEVEL_INIT |
| 25 | #endif |
| 26 | |
| 27 | #define CONFIG_SPL_MAX_SIZE CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE |
| 28 | #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \ |
| 29 | CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4) |
| 30 | /* |
| 31 | * Maximum size in memory allocated to the SPL BSS. Keep it as tight as |
| 32 | * possible (to allow the build to go through), as this directly affects |
| 33 | * our memory footprint. The less we use for BSS the more we have available |
| 34 | * for everything else. |
| 35 | */ |
| 36 | #define CONFIG_SPL_BSS_MAX_SIZE 0x5000 |
| 37 | /* |
| 38 | * Link BSS to be within SPL in a dedicated region located near the top of |
| 39 | * the MCU SRAM, this way making it available also before relocation. Note |
| 40 | * that we are not using the actual top of the MCU SRAM as there is a memory |
| 41 | * location filled in by the boot ROM that we want to read out without any |
| 42 | * interference from the C context. |
| 43 | */ |
| 44 | #define CONFIG_SPL_BSS_START_ADDR (CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX -\ |
| 45 | CONFIG_SPL_BSS_MAX_SIZE) |
| 46 | /* Configure R5 SPL post-relocation malloc pool in DDR */ |
| 47 | #define CONFIG_SYS_SPL_MALLOC_START 0x84000000 |
| 48 | #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_16M |
| 49 | |
| 50 | #define PARTS_DEFAULT \ |
| 51 | /* Linux partitions */ \ |
| 52 | "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" |
| 53 | |
| 54 | /* U-Boot general configuration */ |
| 55 | #define EXTRA_ENV_AM642_BOARD_SETTINGS \ |
| 56 | "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \ |
| 57 | "findfdt=" \ |
| 58 | "setenv name_fdt ${default_device_tree};" \ |
| 59 | "setenv fdtfile ${name_fdt}\0" \ |
| 60 | "name_kern=Image\0" \ |
| 61 | "console=ttyS2,115200n8\0" \ |
| 62 | "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \ |
| 63 | "${mtdparts}\0" \ |
| 64 | "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" |
| 65 | |
| 66 | /* U-Boot MMC-specific configuration */ |
| 67 | #define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \ |
| 68 | "boot=mmc\0" \ |
| 69 | "mmcdev=1\0" \ |
| 70 | "bootpart=1:2\0" \ |
| 71 | "bootdir=/boot\0" \ |
| 72 | "rd_spec=-\0" \ |
| 73 | "init_mmc=run args_all args_mmc\0" \ |
| 74 | "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \ |
| 75 | "get_overlay_mmc=" \ |
| 76 | "fdt address ${fdtaddr};" \ |
| 77 | "fdt resize 0x100000;" \ |
| 78 | "for overlay in $name_overlays;" \ |
| 79 | "do;" \ |
| 80 | "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ |
| 81 | "fdt apply ${dtboaddr};" \ |
| 82 | "done;\0" \ |
| 83 | "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ |
| 84 | "${bootdir}/${name_kern}\0" \ |
| 85 | "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ |
| 86 | "${bootdir}/${name_fit}\0" \ |
| 87 | "partitions=" PARTS_DEFAULT |
| 88 | |
| 89 | /* Incorporate settings into the U-Boot environment */ |
| 90 | #define CONFIG_EXTRA_ENV_SETTINGS \ |
| 91 | DEFAULT_LINUX_BOOT_ENV \ |
| 92 | DEFAULT_MMC_TI_ARGS \ |
| 93 | EXTRA_ENV_AM642_BOARD_SETTINGS \ |
| 94 | EXTRA_ENV_AM642_BOARD_SETTINGS_MMC |
| 95 | |
| 96 | /* Now for the remaining common defines */ |
| 97 | #include <configs/ti_armv7_common.h> |
| 98 | |
| 99 | /* MMC ENV related defines */ |
| 100 | #ifdef CONFIG_ENV_IS_IN_MMC |
| 101 | #define CONFIG_SYS_MMC_ENV_DEV 0 |
| 102 | #define CONFIG_SYS_MMC_ENV_PART 1 |
| 103 | #endif |
| 104 | |
| 105 | #endif /* __CONFIG_AM642_EVM_H */ |