blob: d84a8db97edeafe5808c1c31a19bc11c7403fcae [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>
Aswath Govindraju832aed62021-06-04 22:00:38 +053015#include <asm/arch/am64_hardware.h>
Aswath Govindrajuf96108b2021-06-04 22:00:40 +053016#include <environment/ti/k3_dfu.h>
Dave Gerlach3dc33f12021-04-23 11:27:42 -050017
18/* DDR Configuration */
19#define CONFIG_SYS_SDRAM_BASE1 0x880000000
20
21#ifdef CONFIG_SYS_K3_SPL_ATF
22#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "tispl.bin"
23#endif
24
Dave Gerlach3dc33f12021-04-23 11:27:42 -050025#define CONFIG_SPL_MAX_SIZE CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
Lokesh Vutla31c47172021-05-06 16:44:53 +053026#if defined(CONFIG_TARGET_AM642_A53_EVM)
Aswath Govindraju4f13a5f2022-04-19 20:56:02 +053027#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + SZ_4M)
Lokesh Vutla31c47172021-05-06 16:44:53 +053028#else
Dave Gerlach3dc33f12021-04-23 11:27:42 -050029/*
30 * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
31 * possible (to allow the build to go through), as this directly affects
32 * our memory footprint. The less we use for BSS the more we have available
33 * for everything else.
34 */
Vignesh Raghavendra1e556d42022-01-21 12:47:53 +053035#define CONFIG_SPL_BSS_MAX_SIZE 0x4000
Dave Gerlach3dc33f12021-04-23 11:27:42 -050036/*
37 * Link BSS to be within SPL in a dedicated region located near the top of
38 * the MCU SRAM, this way making it available also before relocation. Note
39 * that we are not using the actual top of the MCU SRAM as there is a memory
40 * location filled in by the boot ROM that we want to read out without any
41 * interference from the C context.
42 */
Aswath Govindraju832aed62021-06-04 22:00:38 +053043#define CONFIG_SPL_BSS_START_ADDR (TI_SRAM_SCRATCH_BOARD_EEPROM_START -\
Dave Gerlach3dc33f12021-04-23 11:27:42 -050044 CONFIG_SPL_BSS_MAX_SIZE)
Lokesh Vutla31c47172021-05-06 16:44:53 +053045/* Set the stack right below the SPL BSS section */
46#define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_BSS_START_ADDR
Dave Gerlach3dc33f12021-04-23 11:27:42 -050047/* Configure R5 SPL post-relocation malloc pool in DDR */
48#define CONFIG_SYS_SPL_MALLOC_START 0x84000000
49#define CONFIG_SYS_SPL_MALLOC_SIZE SZ_16M
Lokesh Vutla31c47172021-05-06 16:44:53 +053050#endif
Dave Gerlach3dc33f12021-04-23 11:27:42 -050051
52#define PARTS_DEFAULT \
53 /* Linux partitions */ \
54 "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
55
56/* U-Boot general configuration */
57#define EXTRA_ENV_AM642_BOARD_SETTINGS \
Dave Gerlach3dc33f12021-04-23 11:27:42 -050058 "findfdt=" \
Lokesh Vutlab6587352021-05-06 16:44:55 +053059 "if test $board_name = am64x_gpevm; then " \
60 "setenv fdtfile k3-am642-evm.dtb; fi; " \
61 "if test $board_name = am64x_skevm; then " \
62 "setenv fdtfile k3-am642-sk.dtb; fi;" \
63 "if test $fdtfile = undefined; then " \
64 "echo WARNING: Could not determine device tree to use; fi; \0" \
Dave Gerlach3dc33f12021-04-23 11:27:42 -050065 "name_kern=Image\0" \
66 "console=ttyS2,115200n8\0" \
67 "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \
68 "${mtdparts}\0" \
69 "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
70
71/* U-Boot MMC-specific configuration */
72#define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \
73 "boot=mmc\0" \
74 "mmcdev=1\0" \
75 "bootpart=1:2\0" \
76 "bootdir=/boot\0" \
77 "rd_spec=-\0" \
78 "init_mmc=run args_all args_mmc\0" \
Lokesh Vutlab6587352021-05-06 16:44:55 +053079 "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Dave Gerlach3dc33f12021-04-23 11:27:42 -050080 "get_overlay_mmc=" \
81 "fdt address ${fdtaddr};" \
82 "fdt resize 0x100000;" \
83 "for overlay in $name_overlays;" \
84 "do;" \
85 "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
86 "fdt apply ${dtboaddr};" \
87 "done;\0" \
88 "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
89 "${bootdir}/${name_kern}\0" \
90 "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \
91 "${bootdir}/${name_fit}\0" \
92 "partitions=" PARTS_DEFAULT
93
Aswath Govindrajuc92c7712021-08-04 18:42:46 +053094#define EXTRA_ENV_AM642_BOARD_SETTING_USBMSC \
95 "args_usb=run finduuid;setenv bootargs console=${console} " \
96 "${optargs} " \
97 "root=PARTUUID=${uuid} rw " \
98 "rootfstype=${mmcrootfstype}\0" \
99 "init_usb=run args_all args_usb\0" \
100 "get_fdt_usb=load usb ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
101 "get_overlay_usb=" \
102 "fdt address ${fdtaddr};" \
103 "fdt resize 0x100000;" \
104 "for overlay in $name_overlays;" \
105 "do;" \
106 "load usb ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
107 "fdt apply ${dtboaddr};" \
108 "done;\0" \
109 "get_kern_usb=load usb ${bootpart} ${loadaddr} " \
110 "${bootdir}/${name_kern}\0" \
111 "get_fit_usb=load usb ${bootpart} ${addr_fit} " \
112 "${bootdir}/${name_fit}\0" \
113 "usbboot=setenv boot usb;" \
114 "setenv bootpart 0:2;" \
115 "usb start;" \
116 "run findfdt;" \
117 "run init_usb;" \
118 "run get_kern_usb;" \
119 "run get_fdt_usb;" \
120 "run run_kern\0"
121
Aswath Govindrajuf96108b2021-06-04 22:00:40 +0530122#define EXTRA_ENV_DFUARGS \
123 DFU_ALT_INFO_MMC \
124 DFU_ALT_INFO_EMMC \
125 DFU_ALT_INFO_RAM \
126 DFU_ALT_INFO_OSPI
127
Dave Gerlach3dc33f12021-04-23 11:27:42 -0500128/* Incorporate settings into the U-Boot environment */
129#define CONFIG_EXTRA_ENV_SETTINGS \
130 DEFAULT_LINUX_BOOT_ENV \
131 DEFAULT_MMC_TI_ARGS \
132 EXTRA_ENV_AM642_BOARD_SETTINGS \
Aswath Govindrajuf96108b2021-06-04 22:00:40 +0530133 EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \
Aswath Govindrajuc92c7712021-08-04 18:42:46 +0530134 EXTRA_ENV_DFUARGS \
135 EXTRA_ENV_AM642_BOARD_SETTING_USBMSC
Dave Gerlach3dc33f12021-04-23 11:27:42 -0500136
137/* Now for the remaining common defines */
138#include <configs/ti_armv7_common.h>
139
Aswath Govindrajuf96108b2021-06-04 22:00:40 +0530140#define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
141
Dave Gerlach3dc33f12021-04-23 11:27:42 -0500142#endif /* __CONFIG_AM642_EVM_H */