David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 1 | /* 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 */ |
Tom Rini | aa6e94d | 2022-11-16 13:10:37 -0500 | [diff] [blame] | 20 | #define CFG_SYS_SDRAM_BASE1 0x880000000 |
David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 21 | |
| 22 | /* SPL Loader Configuration */ |
| 23 | #if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM) |
Tom Rini | 65cc0e2 | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 24 | #define CFG_SYS_UBOOT_BASE 0x50280000 |
David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 25 | /* Image load address in RAM for DFU boot*/ |
| 26 | #else |
Tom Rini | 65cc0e2 | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 27 | #define CFG_SYS_UBOOT_BASE 0x50080000 |
David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 28 | #endif |
| 29 | |
David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 30 | /* 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};" \ |
Sinthu Raja | 9787ecf | 2023-01-10 21:17:58 +0530 | [diff] [blame] | 35 | "if test $board_name = j721s2; then " \ |
| 36 | "setenv name_fdt k3-j721s2-common-proc-board.dtb; fi;" \ |
| 37 | "if test $board_name = am68-sk; then " \ |
| 38 | "setenv name_fdt k3-am68-sk-base-board.dtb; fi;"\ |
David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 39 | "setenv fdtfile ${name_fdt}\0" \ |
| 40 | "name_kern=Image\0" \ |
| 41 | "console=ttyS2,115200n8\0" \ |
| 42 | "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02880000 " \ |
| 43 | "${mtdparts}\0" \ |
| 44 | "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0" |
| 45 | |
| 46 | #define PARTS_DEFAULT \ |
| 47 | /* Linux partitions */ \ |
| 48 | "uuid_disk=${uuid_gpt_disk};" \ |
| 49 | "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" |
| 50 | |
| 51 | #ifdef CONFIG_SYS_K3_SPL_ATF |
| 52 | #if defined(CONFIG_TARGET_J721S2_R5_EVM) |
| 53 | #define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \ |
| 54 | "addr_mcur5f0_0load=0x89000000\0" \ |
| 55 | "name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw\0" |
| 56 | #elif defined(CONFIG_TARGET_J7200_R5_EVM) |
| 57 | #define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \ |
| 58 | "addr_mcur5f0_0load=0x89000000\0" \ |
| 59 | "name_mcur5f0_0fw=/lib/firmware/j7200-mcu-r5f0_0-fw\0" |
| 60 | #endif /* CONFIG_TARGET_J721S2_R5_EVM */ |
| 61 | #else |
| 62 | #define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC "" |
| 63 | #endif /* CONFIG_SYS_K3_SPL_ATF */ |
| 64 | |
| 65 | /* U-Boot MMC-specific configuration */ |
| 66 | #define EXTRA_ENV_J721S2_BOARD_SETTINGS_MMC \ |
| 67 | "boot=mmc\0" \ |
| 68 | "mmcdev=1\0" \ |
| 69 | "bootpart=1:2\0" \ |
| 70 | "bootdir=/boot\0" \ |
| 71 | EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \ |
| 72 | "rd_spec=-\0" \ |
| 73 | "init_mmc=run args_all args_mmc\0" \ |
| 74 | "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \ |
| 75 | "get_overlay_mmc=" \ |
| 76 | "fdt address ${fdtaddr};" \ |
| 77 | "fdt resize 0x100000;" \ |
| 78 | "for overlay in $name_overlays;" \ |
| 79 | "do;" \ |
| 80 | "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \ |
| 81 | "fdt apply ${dtboaddr};" \ |
| 82 | "done;\0" \ |
| 83 | "partitions=" PARTS_DEFAULT \ |
| 84 | "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \ |
| 85 | "${bootdir}/${name_kern}\0" \ |
| 86 | "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \ |
| 87 | "${bootdir}/${name_fit}\0" \ |
| 88 | "partitions=" PARTS_DEFAULT |
| 89 | |
| 90 | /* Set the default list of remote processors to boot */ |
| 91 | #if defined(CONFIG_TARGET_J721S2_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM) |
| 92 | #ifdef DEFAULT_RPROCS |
| 93 | #undef DEFAULT_RPROCS |
| 94 | #endif |
| 95 | #endif |
| 96 | |
| 97 | #ifdef CONFIG_TARGET_J721S2_A72_EVM |
| 98 | #define DEFAULT_RPROCS "" \ |
| 99 | "2 /lib/firmware/j721s2-main-r5f0_0-fw " \ |
| 100 | "3 /lib/firmware/j721s2-main-r5f0_1-fw " \ |
| 101 | "4 /lib/firmware/j721s2-main-r5f1_0-fw " \ |
| 102 | "5 /lib/firmware/j721s2-main-r5f1_1-fw " \ |
| 103 | "6 /lib/firmware/j721s2-c71_0-fw " \ |
| 104 | "7 /lib/firmware/j721s2-c71_1-fw " |
| 105 | #endif /* CONFIG_TARGET_J721S2_A72_EVM */ |
| 106 | |
| 107 | #ifdef CONFIG_TARGET_J7200_A72_EVM |
| 108 | #define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY \ |
| 109 | "do_main_cpsw0_qsgmii_phyinit=1\0" \ |
| 110 | "init_main_cpsw0_qsgmii_phy=gpio set gpio@22_17;" \ |
| 111 | "gpio clear gpio@22_16\0" \ |
| 112 | "main_cpsw0_qsgmii_phyinit=" \ |
| 113 | "if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1 && test ${dorprocboot} -eq 1 && " \ |
| 114 | "test ${boot} = mmc; then " \ |
| 115 | "run init_main_cpsw0_qsgmii_phy;" \ |
| 116 | "fi;\0" |
| 117 | #define DEFAULT_RPROCS "" \ |
| 118 | "2 /lib/firmware/j7200-main-r5f0_0-fw " \ |
| 119 | "3 /lib/firmware/j7200-main-r5f0_1-fw " |
| 120 | #endif /* CONFIG_TARGET_J7200_A72_EVM */ |
| 121 | |
| 122 | #ifndef EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY |
| 123 | #define EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY |
| 124 | #endif |
| 125 | |
| 126 | /* set default dfu_bufsiz to 128KB (sector size of OSPI) */ |
| 127 | #define EXTRA_ENV_DFUARGS \ |
| 128 | DFU_ALT_INFO_MMC \ |
| 129 | DFU_ALT_INFO_EMMC \ |
| 130 | DFU_ALT_INFO_RAM \ |
| 131 | DFU_ALT_INFO_OSPI |
| 132 | |
David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 133 | /* Incorporate settings into the U-Boot environment */ |
Tom Rini | 0613c36 | 2022-12-04 10:03:50 -0500 | [diff] [blame] | 134 | #define CFG_EXTRA_ENV_SETTINGS \ |
David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 135 | DEFAULT_LINUX_BOOT_ENV \ |
| 136 | DEFAULT_MMC_TI_ARGS \ |
| 137 | DEFAULT_FIT_TI_ARGS \ |
| 138 | EXTRA_ENV_J721S2_BOARD_SETTINGS \ |
| 139 | EXTRA_ENV_J721S2_BOARD_SETTINGS_MMC \ |
| 140 | EXTRA_ENV_RPROC_SETTINGS \ |
| 141 | EXTRA_ENV_DFUARGS \ |
| 142 | DEFAULT_UFS_TI_ARGS \ |
David Huang | 681023a | 2022-01-25 20:56:31 +0530 | [diff] [blame] | 143 | EXTRA_ENV_CONFIG_MAIN_CPSW0_QSGMII_PHY |
| 144 | |
| 145 | /* Now for the remaining common defines */ |
| 146 | #include <configs/ti_armv7_common.h> |
| 147 | |
| 148 | /* MMC ENV related defines */ |
| 149 | |
| 150 | #endif /* __CONFIG_J721S2_EVM_H */ |