blob: 7c30e50c5f1e33aeb297773379fc711dd143237b [file] [log] [blame]
Dave Gerlach3dc33f12021-04-23 11:27:42 -05001/* 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
Lokesh Vutla31c47172021-05-06 16:44:53 +053028#if defined(CONFIG_TARGET_AM642_A53_EVM)
Dave Gerlach3dc33f12021-04-23 11:27:42 -050029#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \
30 CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4)
Lokesh Vutla31c47172021-05-06 16:44:53 +053031#else
Dave Gerlach3dc33f12021-04-23 11:27:42 -050032/*
33 * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
34 * possible (to allow the build to go through), as this directly affects
35 * our memory footprint. The less we use for BSS the more we have available
36 * for everything else.
37 */
Lokesh Vutla9faad9b2021-05-06 16:44:54 +053038#define CONFIG_SPL_BSS_MAX_SIZE 0x1000
Dave Gerlach3dc33f12021-04-23 11:27:42 -050039/*
40 * Link BSS to be within SPL in a dedicated region located near the top of
41 * the MCU SRAM, this way making it available also before relocation. Note
42 * that we are not using the actual top of the MCU SRAM as there is a memory
43 * location filled in by the boot ROM that we want to read out without any
44 * interference from the C context.
45 */
46#define CONFIG_SPL_BSS_START_ADDR (CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX -\
47 CONFIG_SPL_BSS_MAX_SIZE)
Lokesh Vutla31c47172021-05-06 16:44:53 +053048/* Set the stack right below the SPL BSS section */
49#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_BSS_START_ADDR
Dave Gerlach3dc33f12021-04-23 11:27:42 -050050/* Configure R5 SPL post-relocation malloc pool in DDR */
51#define CONFIG_SYS_SPL_MALLOC_START 0x84000000
52#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_16M
Lokesh Vutla31c47172021-05-06 16:44:53 +053053#endif
Dave Gerlach3dc33f12021-04-23 11:27:42 -050054
55#define PARTS_DEFAULT \
56 /* Linux partitions */ \
57 "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
58
59/* U-Boot general configuration */
60#define EXTRA_ENV_AM642_BOARD_SETTINGS \
Dave Gerlach3dc33f12021-04-23 11:27:42 -050061 "findfdt=" \
Lokesh Vutlab6587352021-05-06 16:44:55 +053062 "if test $board_name = am64x_gpevm; then " \
63 "setenv fdtfile k3-am642-evm.dtb; fi; " \
64 "if test $board_name = am64x_skevm; then " \
65 "setenv fdtfile k3-am642-sk.dtb; fi;" \
66 "if test $fdtfile = undefined; then " \
67 "echo WARNING: Could not determine device tree to use; fi; \0" \
Dave Gerlach3dc33f12021-04-23 11:27:42 -050068 "name_kern=Image\0" \
69 "console=ttyS2,115200n8\0" \
70 "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \
71 "${mtdparts}\0" \
72 "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
73
74/* U-Boot MMC-specific configuration */
75#define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \
76 "boot=mmc\0" \
77 "mmcdev=1\0" \
78 "bootpart=1:2\0" \
79 "bootdir=/boot\0" \
80 "rd_spec=-\0" \
81 "init_mmc=run args_all args_mmc\0" \
Lokesh Vutlab6587352021-05-06 16:44:55 +053082 "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Dave Gerlach3dc33f12021-04-23 11:27:42 -050083 "get_overlay_mmc=" \
84 "fdt address ${fdtaddr};" \
85 "fdt resize 0x100000;" \
86 "for overlay in $name_overlays;" \
87 "do;" \
88 "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
89 "fdt apply ${dtboaddr};" \
90 "done;\0" \
91 "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
92 "${bootdir}/${name_kern}\0" \
93 "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \
94 "${bootdir}/${name_fit}\0" \
95 "partitions=" PARTS_DEFAULT
96
97/* Incorporate settings into the U-Boot environment */
98#define CONFIG_EXTRA_ENV_SETTINGS \
99 DEFAULT_LINUX_BOOT_ENV \
100 DEFAULT_MMC_TI_ARGS \
101 EXTRA_ENV_AM642_BOARD_SETTINGS \
102 EXTRA_ENV_AM642_BOARD_SETTINGS_MMC
103
104/* Now for the remaining common defines */
105#include <configs/ti_armv7_common.h>
106
107/* MMC ENV related defines */
108#ifdef CONFIG_ENV_IS_IN_MMC
109#define CONFIG_SYS_MMC_ENV_DEV 0
110#define CONFIG_SYS_MMC_ENV_PART 1
111#endif
112
113#endif /* __CONFIG_AM642_EVM_H */