blob: 932d7d3c8cb56952fa2599c084f9d2258014be66 [file] [log] [blame]
David Huang681023a2022-01-25 20:56:31 +05301/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Configuration header file for K3 J721S2 EVM
4 *
5 * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com/
6 * David Huang <d-huang@ti.com>
7 */
8
9#ifndef __CONFIG_J721S2_EVM_H
10#define __CONFIG_J721S2_EVM_H
11
12#include <linux/sizes.h>
13#include <config_distro_bootcmd.h>
14#include <environment/ti/mmc.h>
15#include <environment/ti/k3_rproc.h>
16#include <environment/ti/ufs.h>
17#include <environment/ti/k3_dfu.h>
18
19/* DDR Configuration */
20#define CONFIG_SYS_SDRAM_BASE1 0x880000000
21
22/* SPL Loader Configuration */
23#if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
David Huang681023a2022-01-25 20:56:31 +053024#define CONFIG_SYS_UBOOT_BASE 0x50280000
25/* Image load address in RAM for DFU boot*/
26#else
27#define CONFIG_SYS_UBOOT_BASE 0x50080000
David Huang681023a2022-01-25 20:56:31 +053028#endif
29
David Huang681023a2022-01-25 20:56:31 +053030/* U-Boot general configuration */
31#define EXTRA_ENV_J721S2_BOARD_SETTINGS \
32 "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
33 "findfdt=" \
34 "setenv name_fdt ${default_device_tree};" \
35 "setenv fdtfile ${name_fdt}\0" \
36 "name_kern=Image\0" \
37 "console=ttyS2,115200n8\0" \
38 "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02880000 " \
39 "${mtdparts}\0" \
40 "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
41
42#define PARTS_DEFAULT \
43 /* Linux partitions */ \
44 "uuid_disk=${uuid_gpt_disk};" \
45 "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
46
47#ifdef CONFIG_SYS_K3_SPL_ATF
48#if defined(CONFIG_TARGET_J721S2_R5_EVM)
49#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
50 "addr_mcur5f0_0load=0x89000000\0" \
51 "name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw\0"
52#elif defined(CONFIG_TARGET_J7200_R5_EVM)
53#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
54 "addr_mcur5f0_0load=0x89000000\0" \
55 "name_mcur5f0_0fw=/lib/firmware/j7200-mcu-r5f0_0-fw\0"
56#endif /* CONFIG_TARGET_J721S2_R5_EVM */
57#else
58#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC ""
59#endif /* CONFIG_SYS_K3_SPL_ATF */
60
61/* U-Boot MMC-specific configuration */
62#define EXTRA_ENV_J721S2_BOARD_SETTINGS_MMC \
63 "boot=mmc\0" \
64 "mmcdev=1\0" \
65 "bootpart=1:2\0" \
66 "bootdir=/boot\0" \
67 EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
68 "rd_spec=-\0" \
69 "init_mmc=run args_all args_mmc\0" \
70 "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \
71 "get_overlay_mmc=" \
72 "fdt address ${fdtaddr};" \
73 "fdt resize 0x100000;" \
74 "for overlay in $name_overlays;" \
75 "do;" \
76 "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
77 "fdt apply ${dtboaddr};" \
78 "done;\0" \
79 "partitions=" PARTS_DEFAULT \
80 "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
81 "${bootdir}/${name_kern}\0" \
82 "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \
83 "${bootdir}/${name_fit}\0" \
84 "partitions=" PARTS_DEFAULT
85
86/* Set the default list of remote processors to boot */
87#if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
88#ifdef DEFAULT_RPROCS
89#undef DEFAULT_RPROCS
90#endif
91#endif
92
93#ifdef CONFIG_TARGET_J721S2_A72_EVM
94#define DEFAULT_RPROCS "" \
95 "2 /lib/firmware/j721s2-main-r5f0_0-fw " \
96 "3 /lib/firmware/j721s2-main-r5f0_1-fw " \
97 "4 /lib/firmware/j721s2-main-r5f1_0-fw " \
98 "5 /lib/firmware/j721s2-main-r5f1_1-fw " \
99 "6 /lib/firmware/j721s2-c71_0-fw " \
100 "7 /lib/firmware/j721s2-c71_1-fw "
101#endif /* CONFIG_TARGET_J721S2_A72_EVM */
102
103#ifdef CONFIG_TARGET_J7200_A72_EVM
104#define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY \
105 "do_main_cpsw0_qsgmii_phyinit=1\0" \
106 "init_main_cpsw0_qsgmii_phy=gpio set gpio@22_17;" \
107 "gpio clear gpio@22_16\0" \
108 "main_cpsw0_qsgmii_phyinit=" \
109 "if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1 && test ${dorprocboot} -eq 1 && " \
110 "test ${boot} = mmc; then " \
111 "run init_main_cpsw0_qsgmii_phy;" \
112 "fi;\0"
113#define DEFAULT_RPROCS "" \
114 "2 /lib/firmware/j7200-main-r5f0_0-fw " \
115 "3 /lib/firmware/j7200-main-r5f0_1-fw "
116#endif /* CONFIG_TARGET_J7200_A72_EVM */
117
118#ifndef EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY
119#define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY
120#endif
121
122/* set default dfu_bufsiz to 128KB (sector size of OSPI) */
123#define EXTRA_ENV_DFUARGS \
124 DFU_ALT_INFO_MMC \
125 DFU_ALT_INFO_EMMC \
126 DFU_ALT_INFO_RAM \
127 DFU_ALT_INFO_OSPI
128
David Huang681023a2022-01-25 20:56:31 +0530129/* Incorporate settings into the U-Boot environment */
130#define CONFIG_EXTRA_ENV_SETTINGS \
131 DEFAULT_LINUX_BOOT_ENV \
132 DEFAULT_MMC_TI_ARGS \
133 DEFAULT_FIT_TI_ARGS \
134 EXTRA_ENV_J721S2_BOARD_SETTINGS \
135 EXTRA_ENV_J721S2_BOARD_SETTINGS_MMC \
136 EXTRA_ENV_RPROC_SETTINGS \
137 EXTRA_ENV_DFUARGS \
138 DEFAULT_UFS_TI_ARGS \
David Huang681023a2022-01-25 20:56:31 +0530139 EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY
140
141/* Now for the remaining common defines */
142#include <configs/ti_armv7_common.h>
143
144/* MMC ENV related defines */
145
146#endif /* __CONFIG_J721S2_EVM_H */