blob: 8e3ea670d0896336e01760f6c21c6b2d2441fddf [file] [log] [blame]
David Huang61098202022-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 Huang61098202022-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 Huang61098202022-01-25 20:56:31 +053028#endif
29
David Huang61098202022-01-25 20:56:31 +053030#define CONFIG_SYS_BOOTM_LEN SZ_64M
David Huang61098202022-01-25 20:56:31 +053031
David Huang61098202022-01-25 20:56:31 +053032/* U-Boot general configuration */
33#define EXTRA_ENV_J721S2_BOARD_SETTINGS \
34 "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
35 "findfdt=" \
36 "setenv name_fdt ${default_device_tree};" \
37 "setenv fdtfile ${name_fdt}\0" \
38 "name_kern=Image\0" \
39 "console=ttyS2,115200n8\0" \
40 "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02880000 " \
41 "${mtdparts}\0" \
42 "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
43
44#define PARTS_DEFAULT \
45 /* Linux partitions */ \
46 "uuid_disk=${uuid_gpt_disk};" \
47 "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
48
49#ifdef CONFIG_SYS_K3_SPL_ATF
50#if defined(CONFIG_TARGET_J721S2_R5_EVM)
51#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
52 "addr_mcur5f0_0load=0x89000000\0" \
53 "name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw\0"
54#elif defined(CONFIG_TARGET_J7200_R5_EVM)
55#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
56 "addr_mcur5f0_0load=0x89000000\0" \
57 "name_mcur5f0_0fw=/lib/firmware/j7200-mcu-r5f0_0-fw\0"
58#endif /* CONFIG_TARGET_J721S2_R5_EVM */
59#else
60#define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC ""
61#endif /* CONFIG_SYS_K3_SPL_ATF */
62
63/* U-Boot MMC-specific configuration */
64#define EXTRA_ENV_J721S2_BOARD_SETTINGS_MMC \
65 "boot=mmc\0" \
66 "mmcdev=1\0" \
67 "bootpart=1:2\0" \
68 "bootdir=/boot\0" \
69 EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
70 "rd_spec=-\0" \
71 "init_mmc=run args_all args_mmc\0" \
72 "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \
73 "get_overlay_mmc=" \
74 "fdt address ${fdtaddr};" \
75 "fdt resize 0x100000;" \
76 "for overlay in $name_overlays;" \
77 "do;" \
78 "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
79 "fdt apply ${dtboaddr};" \
80 "done;\0" \
81 "partitions=" PARTS_DEFAULT \
82 "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
83 "${bootdir}/${name_kern}\0" \
84 "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \
85 "${bootdir}/${name_fit}\0" \
86 "partitions=" PARTS_DEFAULT
87
88/* Set the default list of remote processors to boot */
89#if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
90#ifdef DEFAULT_RPROCS
91#undef DEFAULT_RPROCS
92#endif
93#endif
94
95#ifdef CONFIG_TARGET_J721S2_A72_EVM
96#define DEFAULT_RPROCS "" \
97 "2 /lib/firmware/j721s2-main-r5f0_0-fw " \
98 "3 /lib/firmware/j721s2-main-r5f0_1-fw " \
99 "4 /lib/firmware/j721s2-main-r5f1_0-fw " \
100 "5 /lib/firmware/j721s2-main-r5f1_1-fw " \
101 "6 /lib/firmware/j721s2-c71_0-fw " \
102 "7 /lib/firmware/j721s2-c71_1-fw "
103#endif /* CONFIG_TARGET_J721S2_A72_EVM */
104
105#ifdef CONFIG_TARGET_J7200_A72_EVM
106#define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY \
107 "do_main_cpsw0_qsgmii_phyinit=1\0" \
108 "init_main_cpsw0_qsgmii_phy=gpio set gpio@22_17;" \
109 "gpio clear gpio@22_16\0" \
110 "main_cpsw0_qsgmii_phyinit=" \
111 "if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1 && test ${dorprocboot} -eq 1 && " \
112 "test ${boot} = mmc; then " \
113 "run init_main_cpsw0_qsgmii_phy;" \
114 "fi;\0"
115#define DEFAULT_RPROCS "" \
116 "2 /lib/firmware/j7200-main-r5f0_0-fw " \
117 "3 /lib/firmware/j7200-main-r5f0_1-fw "
118#endif /* CONFIG_TARGET_J7200_A72_EVM */
119
120#ifndef EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY
121#define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY
122#endif
123
124/* set default dfu_bufsiz to 128KB (sector size of OSPI) */
125#define EXTRA_ENV_DFUARGS \
126 DFU_ALT_INFO_MMC \
127 DFU_ALT_INFO_EMMC \
128 DFU_ALT_INFO_RAM \
129 DFU_ALT_INFO_OSPI
130
131#if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
132#define EXTRA_ENV_J721S2_BOARD_SETTINGS_MTD \
133 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
134 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
135#else
136#define EXTRA_ENV_J721S2_BOARD_SETTINGS_MTD
137#endif
138
139/* Incorporate settings into the U-Boot environment */
140#define CONFIG_EXTRA_ENV_SETTINGS \
141 DEFAULT_LINUX_BOOT_ENV \
142 DEFAULT_MMC_TI_ARGS \
143 DEFAULT_FIT_TI_ARGS \
144 EXTRA_ENV_J721S2_BOARD_SETTINGS \
145 EXTRA_ENV_J721S2_BOARD_SETTINGS_MMC \
146 EXTRA_ENV_RPROC_SETTINGS \
147 EXTRA_ENV_DFUARGS \
148 DEFAULT_UFS_TI_ARGS \
149 EXTRA_ENV_J721S2_BOARD_SETTINGS_MTD \
150 EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY
151
152/* Now for the remaining common defines */
153#include <configs/ti_armv7_common.h>
154
155/* MMC ENV related defines */
156
157#endif /* __CONFIG_J721S2_EVM_H */