blob: d7ec31708a3adde155adb504e7e406f4a6a94d8e [file] [log] [blame]
Dave Gerlach33b72582021-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>
Aswath Govindraju26f32c32021-06-04 22:00:38 +053015#include <asm/arch/am64_hardware.h>
Aswath Govindrajuce7ad572021-06-04 22:00:40 +053016#include <environment/ti/k3_dfu.h>
Dave Gerlach33b72582021-04-23 11:27:42 -050017
18/* DDR Configuration */
19#define CONFIG_SYS_SDRAM_BASE1 0x880000000
20
Lokesh Vutlaaad16142021-05-06 16:44:53 +053021#if defined(CONFIG_TARGET_AM642_A53_EVM)
Lokesh Vutlaaad16142021-05-06 16:44:53 +053022#else
Dave Gerlach33b72582021-04-23 11:27:42 -050023/*
Dave Gerlach33b72582021-04-23 11:27:42 -050024 * 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.
29 */
Aswath Govindraju26f32c32021-06-04 22:00:38 +053030#define CONFIG_SPL_BSS_START_ADDR (TI_SRAM_SCRATCH_BOARD_EEPROM_START -\
Dave Gerlach33b72582021-04-23 11:27:42 -050031 CONFIG_SPL_BSS_MAX_SIZE)
Lokesh Vutlaaad16142021-05-06 16:44:53 +053032/* Set the stack right below the SPL BSS section */
Dave Gerlach33b72582021-04-23 11:27:42 -050033/* 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
Lokesh Vutlaaad16142021-05-06 16:44:53 +053036#endif
Dave Gerlach33b72582021-04-23 11:27:42 -050037
38#define PARTS_DEFAULT \
39 /* Linux partitions */ \
40 "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
41
42/* U-Boot general configuration */
43#define EXTRA_ENV_AM642_BOARD_SETTINGS \
Dave Gerlach33b72582021-04-23 11:27:42 -050044 "findfdt=" \
Lokesh Vutla5af71f22021-05-06 16:44:55 +053045 "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" \
Dave Gerlach33b72582021-04-23 11:27:42 -050051 "name_kern=Image\0" \
52 "console=ttyS2,115200n8\0" \
53 "args_all=setenv 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_AM642_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" \
Lokesh Vutla5af71f22021-05-06 16:44:55 +053065 "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Dave Gerlach33b72582021-04-23 11:27:42 -050066 "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
Aswath Govindraju3c015572021-08-04 18:42:46 +053080#define EXTRA_ENV_AM642_BOARD_SETTING_USBMSC \
81 "args_usb=run finduuid;setenv bootargs console=${console} " \
82 "${optargs} " \
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" \
87 "get_overlay_usb=" \
88 "fdt address ${fdtaddr};" \
89 "fdt resize 0x100000;" \
90 "for overlay in $name_overlays;" \
91 "do;" \
92 "load usb ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
93 "fdt apply ${dtboaddr};" \
94 "done;\0" \
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;" \
101 "usb start;" \
102 "run findfdt;" \
103 "run init_usb;" \
104 "run get_kern_usb;" \
105 "run get_fdt_usb;" \
106 "run run_kern\0"
107
Aswath Govindrajuce7ad572021-06-04 22:00:40 +0530108#define EXTRA_ENV_DFUARGS \
109 DFU_ALT_INFO_MMC \
110 DFU_ALT_INFO_EMMC \
111 DFU_ALT_INFO_RAM \
112 DFU_ALT_INFO_OSPI
113
Dave Gerlach33b72582021-04-23 11:27:42 -0500114/* 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 \
Aswath Govindrajuce7ad572021-06-04 22:00:40 +0530119 EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \
Aswath Govindraju3c015572021-08-04 18:42:46 +0530120 EXTRA_ENV_DFUARGS \
121 EXTRA_ENV_AM642_BOARD_SETTING_USBMSC
Dave Gerlach33b72582021-04-23 11:27:42 -0500122
123/* Now for the remaining common defines */
124#include <configs/ti_armv7_common.h>
125
Aswath Govindrajuce7ad572021-06-04 22:00:40 +0530126#define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
127
Dave Gerlach33b72582021-04-23 11:27:42 -0500128#endif /* __CONFIG_AM642_EVM_H */