configs: am64x_evm_*_defconfig: Rearrange the components in SRAM to satisfy the limit...
[platform/kernel/u-boot.git] / include / configs / am64x_evm.h
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 #include <asm/arch/am64_hardware.h>
16
17 /* DDR Configuration */
18 #define CONFIG_SYS_SDRAM_BASE1          0x880000000
19
20 #ifdef CONFIG_SYS_K3_SPL_ATF
21 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "tispl.bin"
22 #endif
23
24 #ifndef CONFIG_CPU_V7R
25 #define CONFIG_SKIP_LOWLEVEL_INIT
26 #endif
27
28 #define CONFIG_SPL_MAX_SIZE             CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
29 #if defined(CONFIG_TARGET_AM642_A53_EVM)
30 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE + \
31                                         CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4)
32 #else
33 /*
34  * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
35  * possible (to allow the build to go through), as this directly affects
36  * our memory footprint. The less we use for BSS the more we have available
37  * for everything else.
38  */
39 #define CONFIG_SPL_BSS_MAX_SIZE         0x1000
40 /*
41  * Link BSS to be within SPL in a dedicated region located near the top of
42  * the MCU SRAM, this way making it available also before relocation. Note
43  * that we are not using the actual top of the MCU SRAM as there is a memory
44  * location filled in by the boot ROM that we want to read out without any
45  * interference from the C context.
46  */
47 #define CONFIG_SPL_BSS_START_ADDR       (TI_SRAM_SCRATCH_BOARD_EEPROM_START -\
48                                          CONFIG_SPL_BSS_MAX_SIZE)
49 /* Set the stack right below the SPL BSS section */
50 #define CONFIG_SYS_INIT_SP_ADDR         CONFIG_SPL_BSS_START_ADDR
51 /* Configure R5 SPL post-relocation malloc pool in DDR */
52 #define CONFIG_SYS_SPL_MALLOC_START    0x84000000
53 #define CONFIG_SYS_SPL_MALLOC_SIZE     SZ_16M
54 #endif
55
56 #define PARTS_DEFAULT \
57         /* Linux partitions */ \
58         "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
59
60 /* U-Boot general configuration */
61 #define EXTRA_ENV_AM642_BOARD_SETTINGS                                  \
62         "findfdt="                                                      \
63                 "if test $board_name = am64x_gpevm; then " \
64                         "setenv fdtfile k3-am642-evm.dtb; fi; " \
65                 "if test $board_name = am64x_skevm; then " \
66                         "setenv fdtfile k3-am642-sk.dtb; fi;" \
67                 "if test $fdtfile = undefined; then " \
68                         "echo WARNING: Could not determine device tree to use; fi; \0" \
69         "name_kern=Image\0"                                             \
70         "console=ttyS2,115200n8\0"                                      \
71         "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 "  \
72                 "${mtdparts}\0"                                         \
73         "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
74
75 /* U-Boot MMC-specific configuration */
76 #define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC                              \
77         "boot=mmc\0"                                                    \
78         "mmcdev=1\0"                                                    \
79         "bootpart=1:2\0"                                                \
80         "bootdir=/boot\0"                                               \
81         "rd_spec=-\0"                                                   \
82         "init_mmc=run args_all args_mmc\0"                              \
83         "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
84         "get_overlay_mmc="                                              \
85                 "fdt address ${fdtaddr};"                               \
86                 "fdt resize 0x100000;"                                  \
87                 "for overlay in $name_overlays;"                        \
88                 "do;"                                                   \
89                 "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && "    \
90                 "fdt apply ${dtboaddr};"                                \
91                 "done;\0"                                               \
92         "get_kern_mmc=load mmc ${bootpart} ${loadaddr} "                \
93                 "${bootdir}/${name_kern}\0"                             \
94         "get_fit_mmc=load mmc ${bootpart} ${addr_fit} "                 \
95                 "${bootdir}/${name_fit}\0"                              \
96         "partitions=" PARTS_DEFAULT
97
98 /* Incorporate settings into the U-Boot environment */
99 #define CONFIG_EXTRA_ENV_SETTINGS                                       \
100         DEFAULT_LINUX_BOOT_ENV                                          \
101         DEFAULT_MMC_TI_ARGS                                             \
102         EXTRA_ENV_AM642_BOARD_SETTINGS                                  \
103         EXTRA_ENV_AM642_BOARD_SETTINGS_MMC
104
105 /* Now for the remaining common defines */
106 #include <configs/ti_armv7_common.h>
107
108 /* MMC ENV related defines */
109 #ifdef CONFIG_ENV_IS_IN_MMC
110 #define CONFIG_SYS_MMC_ENV_DEV          0
111 #define CONFIG_SYS_MMC_ENV_PART 1
112 #endif
113
114 #endif /* __CONFIG_AM642_EVM_H */