configs: am64x_evm_*_defconfig: Rearrange the components in SRAM to satisfy the limit...
[platform/kernel/u-boot.git] / include / configs / am64x_evm.h
index 99c779b..7c9bdc2 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/sizes.h>
 #include <config_distro_bootcmd.h>
 #include <environment/ti/mmc.h>
+#include <asm/arch/am64_hardware.h>
 
 /* DDR Configuration */
 #define CONFIG_SYS_SDRAM_BASE1         0x880000000
 #endif
 
 #define CONFIG_SPL_MAX_SIZE            CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
+#if defined(CONFIG_TARGET_AM642_A53_EVM)
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE +        \
                                        CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4)
+#else
 /*
  * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
  * possible (to allow the build to go through), as this directly affects
  * our memory footprint. The less we use for BSS the more we have available
  * for everything else.
  */
-#define CONFIG_SPL_BSS_MAX_SIZE                0x5000
+#define CONFIG_SPL_BSS_MAX_SIZE                0x1000
 /*
  * Link BSS to be within SPL in a dedicated region located near the top of
  * the MCU SRAM, this way making it available also before relocation. Note
  * location filled in by the boot ROM that we want to read out without any
  * interference from the C context.
  */
-#define CONFIG_SPL_BSS_START_ADDR      (CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX -\
+#define CONFIG_SPL_BSS_START_ADDR      (TI_SRAM_SCRATCH_BOARD_EEPROM_START -\
                                         CONFIG_SPL_BSS_MAX_SIZE)
+/* Set the stack right below the SPL BSS section */
+#define CONFIG_SYS_INIT_SP_ADDR         CONFIG_SPL_BSS_START_ADDR
 /* Configure R5 SPL post-relocation malloc pool in DDR */
 #define CONFIG_SYS_SPL_MALLOC_START    0x84000000
 #define CONFIG_SYS_SPL_MALLOC_SIZE     SZ_16M
+#endif
 
 #define PARTS_DEFAULT \
        /* Linux partitions */ \
 
 /* U-Boot general configuration */
 #define EXTRA_ENV_AM642_BOARD_SETTINGS                                 \
-       "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0"      \
        "findfdt="                                                      \
-               "setenv name_fdt ${default_device_tree};"               \
-               "setenv fdtfile ${name_fdt}\0"                          \
+               "if test $board_name = am64x_gpevm; then " \
+                       "setenv fdtfile k3-am642-evm.dtb; fi; " \
+               "if test $board_name = am64x_skevm; then " \
+                       "setenv fdtfile k3-am642-sk.dtb; fi;" \
+               "if test $fdtfile = undefined; then " \
+                       "echo WARNING: Could not determine device tree to use; fi; \0" \
        "name_kern=Image\0"                                             \
        "console=ttyS2,115200n8\0"                                      \
        "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 "  \
@@ -71,7 +80,7 @@
        "bootdir=/boot\0"                                               \
        "rd_spec=-\0"                                                   \
        "init_mmc=run args_all args_mmc\0"                              \
-       "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \
+       "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
        "get_overlay_mmc="                                              \
                "fdt address ${fdtaddr};"                               \
                "fdt resize 0x100000;"                                  \