blob: ba67c98693b0ad988853170dd6187568ee5b4480 [file] [log] [blame]
Bryan Brattlof719bd652022-11-03 19:13:58 -05001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Configuration header file for K3 AM62Ax SoC family
4 *
5 * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/
6 */
7
8#ifndef __CONFIG_AM62AX_EVM_H
9#define __CONFIG_AM62AX_EVM_H
10
11#include <linux/sizes.h>
Bryan Brattlof719bd652022-11-03 19:13:58 -050012#include <environment/ti/mmc.h>
13#include <environment/ti/k3_dfu.h>
14
15/* DDR Configuration */
16#define CFG_SYS_SDRAM_BASE1 0x880000000
17
18#define PARTS_DEFAULT \
19 /* Linux partitions */ \
20 "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" \
21
22/* U-Boot general configuration */
23#define EXTRA_ENV_AM62A7_BOARD_SETTINGS \
24 "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
25 "findfdt=" \
26 "setenv name_fdt ${default_device_tree};" \
27 "setenv fdtfile ${name_fdt}\0" \
28 "name_kern=Image\0" \
29 "console=ttyS2,115200n8\0" \
30 "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \
31 "${mtdparts}\0" \
32 "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
33
34/* U-Boot MMC-specific configuration */
35#define EXTRA_ENV_AM62A7_BOARD_SETTINGS_MMC \
36 "boot=mmc\0" \
37 "mmcdev=1\0" \
38 "bootpart=1:2\0" \
39 "bootdir=/boot\0" \
40 "rd_spec=-\0" \
41 "init_mmc=run args_all args_mmc\0" \
42 "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \
43 "get_overlay_mmc=" \
44 "fdt address ${fdtaddr};" \
45 "fdt resize 0x100000;" \
46 "for overlay in $name_overlays;" \
47 "do;" \
48 "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
49 "fdt apply ${dtboaddr};" \
50 "done;\0" \
51 "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
52 "${bootdir}/${name_kern}\0" \
53 "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \
54 "${bootdir}/${name_fit}\0" \
55 "partitions=" PARTS_DEFAULT
56
Bryan Brattlofe625bfe2022-12-23 19:15:24 -060057#define BOOTENV_DEV_TI_MMC(devtypeu, devtypel, instance) \
58 DEFAULT_MMC_TI_ARGS \
59 EXTRA_ENV_AM62A7_BOARD_SETTINGS_MMC \
60 "bootcmd_ti_mmc=" \
61 "run findfdt; run envboot; run init_mmc;" \
62 "run get_kern_mmc; run get_fdt_mmc;" \
63 "run get_overlay_mmc;" \
64 "run run_kern;\0"
65
66#define BOOTENV_DEV_NAME_TI_MMC(devtyeu, devtypel, instance) \
67 "ti_mmc "
68
69#if CONFIG_IS_ENABLED(CMD_MMC)
70 #define BOOT_TARGET_MMC(func) \
71 func(TI_MMC, ti_mmc, na)
72#else
73 #define BOOT_TARGET_MMC(func)
74#endif /* CONFIG_IS_ENABLED(CMD_MMC) */
75
76#define BOOT_TARGET_DEVICES(func) \
77 BOOT_TARGET_MMC(func)
78
79#include <config_distro_bootcmd.h>
80
Bryan Brattlof719bd652022-11-03 19:13:58 -050081/* Incorporate settings into the U-Boot environment */
Tom Rini0613c362022-12-04 10:03:50 -050082#define CFG_EXTRA_ENV_SETTINGS \
Bryan Brattlof719bd652022-11-03 19:13:58 -050083 DEFAULT_LINUX_BOOT_ENV \
Bryan Brattlofe625bfe2022-12-23 19:15:24 -060084 DEFAULT_FIT_TI_ARGS \
Bryan Brattlof719bd652022-11-03 19:13:58 -050085 EXTRA_ENV_AM62A7_BOARD_SETTINGS \
Bryan Brattlofe625bfe2022-12-23 19:15:24 -060086 BOOTENV
Bryan Brattlof719bd652022-11-03 19:13:58 -050087
88/* Now for the remaining common defines */
89#include <configs/ti_armv7_common.h>
90
91#endif /* __CONFIG_AM62A7_EVM_H */