1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Configuration header file for K3 AM642 SoC family
5 * Copyright (C) 2020-2021 Texas Instruments Incorporated - https://www.ti.com/
9 #ifndef __CONFIG_AM642_EVM_H
10 #define __CONFIG_AM642_EVM_H
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 #include <environment/ti/k3_dfu.h>
18 /* DDR Configuration */
19 #define CONFIG_SYS_SDRAM_BASE1 0x880000000
21 #if defined(CONFIG_TARGET_AM642_A53_EVM)
24 * Link BSS to be within SPL in a dedicated region located near the top of
25 * the MCU SRAM, this way making it available also before relocation. Note
26 * that we are not using the actual top of the MCU SRAM as there is a memory
27 * location filled in by the boot ROM that we want to read out without any
28 * interference from the C context.
30 #define CONFIG_SPL_BSS_START_ADDR (TI_SRAM_SCRATCH_BOARD_EEPROM_START -\
31 CONFIG_SPL_BSS_MAX_SIZE)
32 /* Set the stack right below the SPL BSS section */
33 /* Configure R5 SPL post-relocation malloc pool in DDR */
34 #define CONFIG_SYS_SPL_MALLOC_START 0x84000000
35 #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_16M
38 #define PARTS_DEFAULT \
39 /* Linux partitions */ \
40 "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
42 /* U-Boot general configuration */
43 #define EXTRA_ENV_AM642_BOARD_SETTINGS \
45 "if test $board_name = am64x_gpevm; then " \
46 "setenv fdtfile k3-am642-evm.dtb; fi; " \
47 "if test $board_name = am64x_skevm; then " \
48 "setenv fdtfile k3-am642-sk.dtb; fi;" \
49 "if test $fdtfile = undefined; then " \
50 "echo WARNING: Could not determine device tree to use; fi; \0" \
52 "console=ttyS2,115200n8\0" \
53 "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \
55 "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
57 /* U-Boot MMC-specific configuration */
58 #define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \
64 "init_mmc=run args_all args_mmc\0" \
65 "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
67 "fdt address ${fdtaddr};" \
68 "fdt resize 0x100000;" \
69 "for overlay in $name_overlays;" \
71 "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
72 "fdt apply ${dtboaddr};" \
74 "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
75 "${bootdir}/${name_kern}\0" \
76 "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \
77 "${bootdir}/${name_fit}\0" \
78 "partitions=" PARTS_DEFAULT
80 #define EXTRA_ENV_AM642_BOARD_SETTING_USBMSC \
81 "args_usb=run finduuid;setenv bootargs console=${console} " \
83 "root=PARTUUID=${uuid} rw " \
84 "rootfstype=${mmcrootfstype}\0" \
85 "init_usb=run args_all args_usb\0" \
86 "get_fdt_usb=load usb ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
88 "fdt address ${fdtaddr};" \
89 "fdt resize 0x100000;" \
90 "for overlay in $name_overlays;" \
92 "load usb ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
93 "fdt apply ${dtboaddr};" \
95 "get_kern_usb=load usb ${bootpart} ${loadaddr} " \
96 "${bootdir}/${name_kern}\0" \
97 "get_fit_usb=load usb ${bootpart} ${addr_fit} " \
98 "${bootdir}/${name_fit}\0" \
99 "usbboot=setenv boot usb;" \
100 "setenv bootpart 0:2;" \
104 "run get_kern_usb;" \
108 #define EXTRA_ENV_DFUARGS \
114 /* Incorporate settings into the U-Boot environment */
115 #define CONFIG_EXTRA_ENV_SETTINGS \
116 DEFAULT_LINUX_BOOT_ENV \
117 DEFAULT_MMC_TI_ARGS \
118 EXTRA_ENV_AM642_BOARD_SETTINGS \
119 EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \
121 EXTRA_ENV_AM642_BOARD_SETTING_USBMSC
123 /* Now for the remaining common defines */
124 #include <configs/ti_armv7_common.h>
126 #define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
128 #endif /* __CONFIG_AM642_EVM_H */