configs: Enable distroboot on am625
[platform/kernel/u-boot.git] / include / configs / am62x_evm.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Configuration header file for K3 AM625 SoC family
4  *
5  * Copyright (C) 2020-2022 Texas Instruments Incorporated - https://www.ti.com/
6  *      Suman Anna <s-anna@ti.com>
7  */
8
9 #ifndef __CONFIG_AM625_EVM_H
10 #define __CONFIG_AM625_EVM_H
11
12 #include <config_distro_bootcmd.h>
13 #include <environment/ti/mmc.h>
14
15 /* DDR Configuration */
16 #define CFG_SYS_SDRAM_BASE1             0x880000000
17
18 #ifdef CONFIG_CMD_MMC
19 #define DISTRO_BOOT_DEV_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
20 #else
21 #define DISTRO_BOOT_DEV_MMC(func)
22 #endif
23
24 #ifdef CONFIG_CMD_PXE
25 #define DISTRO_BOOT_DEV_PXE(func) func(PXE, pxe, na)
26 #else
27 #define DISTRO_BOOT_DEV_PXE(func)
28 #endif
29
30 #ifdef CONFIG_CMD_DHCP
31 #define DISTRO_BOOT_DEV_DHCP(func) func(DHCP, dhcp, na)
32 #else
33 #define DISTRO_BOOT_DEV_DHCP(func)
34 #endif
35
36 #define BOOT_TARGET_DEVICES(func) \
37         DISTRO_BOOT_DEV_MMC(func) \
38         DISTRO_BOOT_DEV_PXE(func) \
39         DISTRO_BOOT_DEV_DHCP(func)
40
41 #define PARTS_DEFAULT \
42         /* Linux partitions */ \
43         "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
44
45 /* U-Boot general configuration */
46 #define EXTRA_ENV_AM625_BOARD_SETTINGS                                  \
47         "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0"      \
48         "findfdt="                                                      \
49                 "setenv name_fdt ${default_device_tree};"               \
50                 "setenv fdtfile ${name_fdt}\0"                          \
51         "name_kern=Image\0"                                             \
52         "console=ttyS2,115200n8\0"                                      \
53         "args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 " \
54                 "${mtdparts}\0"                                         \
55         "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
56
57 /* U-Boot MMC-specific configuration */
58 #define EXTRA_ENV_AM625_BOARD_SETTINGS_MMC                              \
59         "boot=mmc\0"                                                    \
60         "mmcdev=1\0"                                                    \
61         "bootpart=1:2\0"                                                \
62         "bootdir=/boot\0"                                               \
63         "rd_spec=-\0"                                                   \
64         "init_mmc=run args_all args_mmc\0"                              \
65         "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \
66         "get_overlay_mmc="                                              \
67                 "fdt address ${fdtaddr};"                               \
68                 "fdt resize 0x100000;"                                  \
69                 "for overlay in $name_overlays;"                        \
70                 "do;"                                                   \
71                 "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && "    \
72                 "fdt apply ${dtboaddr};"                                \
73                 "done;\0"                                               \
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
79
80 /* Incorporate settings into the U-Boot environment */
81 #define CFG_EXTRA_ENV_SETTINGS                                  \
82         DEFAULT_LINUX_BOOT_ENV                                          \
83         DEFAULT_MMC_TI_ARGS                                             \
84         EXTRA_ENV_AM625_BOARD_SETTINGS                                  \
85         EXTRA_ENV_AM625_BOARD_SETTINGS_MMC                              \
86         BOOTENV
87
88 /* Now for the remaining common defines */
89 #include <configs/ti_armv7_common.h>
90
91 #endif /* __CONFIG_AM625_EVM_H */