j721e_evm.h 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Configuration header file for K3 J721E EVM
  4. *
  5. * Copyright (C) 2018-2020 Texas Instruments Incorporated - https://www.ti.com/
  6. * Lokesh Vutla <lokeshvutla@ti.com>
  7. */
  8. #ifndef __CONFIG_J721E_EVM_H
  9. #define __CONFIG_J721E_EVM_H
  10. #include <linux/sizes.h>
  11. #include <environment/ti/mmc.h>
  12. #include <environment/ti/k3_rproc.h>
  13. #include <environment/ti/ufs.h>
  14. #include <environment/ti/k3_dfu.h>
  15. /* DDR Configuration */
  16. #define CONFIG_SYS_SDRAM_BASE1 0x880000000
  17. /* SPL Loader Configuration */
  18. #if defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
  19. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \
  20. CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE)
  21. #define CONFIG_SYS_UBOOT_BASE 0x50280000
  22. /* Image load address in RAM for DFU boot*/
  23. #else
  24. #define CONFIG_SYS_UBOOT_BASE 0x50080000
  25. /*
  26. * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
  27. * possible (to allow the build to go through), as this directly affects
  28. * our memory footprint. The less we use for BSS the more we have available
  29. * for everything else.
  30. */
  31. #define CONFIG_SPL_BSS_MAX_SIZE 0xA000
  32. /*
  33. * Link BSS to be within SPL in a dedicated region located near the top of
  34. * the MCU SRAM, this way making it available also before relocation. Note
  35. * that we are not using the actual top of the MCU SRAM as there is a memory
  36. * location filled in by the boot ROM that we want to read out without any
  37. * interference from the C context.
  38. */
  39. #define CONFIG_SPL_BSS_START_ADDR (CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX -\
  40. CONFIG_SPL_BSS_MAX_SIZE)
  41. /* Set the stack right below the SPL BSS section */
  42. #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_BSS_START_ADDR
  43. /* Configure R5 SPL post-relocation malloc pool in DDR */
  44. #define CONFIG_SYS_SPL_MALLOC_START 0x84000000
  45. #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_16M
  46. /* Image load address in RAM for DFU boot*/
  47. #endif
  48. #ifdef CONFIG_SYS_K3_SPL_ATF
  49. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "tispl.bin"
  50. #endif
  51. #define CONFIG_SPL_MAX_SIZE CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
  52. #define CONFIG_SYS_BOOTM_LEN SZ_64M
  53. #define CONFIG_CQSPI_REF_CLK 133333333
  54. /* HyperFlash related configuration */
  55. #define CONFIG_SYS_MAX_FLASH_BANKS_DETECT 1
  56. /* U-Boot general configuration */
  57. #define EXTRA_ENV_J721E_BOARD_SETTINGS \
  58. "default_device_tree=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
  59. "findfdt=" \
  60. "setenv name_fdt ${default_device_tree};" \
  61. "setenv fdtfile ${name_fdt}\0" \
  62. "name_kern=Image\0" \
  63. "console=ttyS2,115200n8\0" \
  64. "args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 " \
  65. "${mtdparts}\0" \
  66. "run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}\0"
  67. #define PARTS_DEFAULT \
  68. /* Linux partitions */ \
  69. "uuid_disk=${uuid_gpt_disk};" \
  70. "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
  71. #ifdef CONFIG_SYS_K3_SPL_ATF
  72. #if defined(CONFIG_TARGET_J721E_R5_EVM)
  73. #define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
  74. "addr_mainr5f0_0load=0x88000000\0" \
  75. "name_mainr5f0_0fw=/lib/firmware/j7-main-r5f0_0-fw\0" \
  76. "addr_mcur5f0_0load=0x89000000\0" \
  77. "name_mcur5f0_0fw=/lib/firmware/j7-mcu-r5f0_0-fw\0"
  78. #elif defined(CONFIG_TARGET_J7200_R5_EVM)
  79. #define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
  80. "addr_mcur5f0_0load=0x89000000\0" \
  81. "name_mcur5f0_0fw=/lib/firmware/j7200-mcu-r5f0_0-fw\0"
  82. #endif /* CONFIG_TARGET_J721E_R5_EVM */
  83. #else
  84. #define EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC ""
  85. #endif /* CONFIG_SYS_K3_SPL_ATF */
  86. /* U-Boot MMC-specific configuration */
  87. #define EXTRA_ENV_J721E_BOARD_SETTINGS_MMC \
  88. "boot=mmc\0" \
  89. "mmcdev=1\0" \
  90. "bootpart=1:2\0" \
  91. "bootdir=/boot\0" \
  92. EXTRA_ENV_R5_SPL_RPROC_FW_ARGS_MMC \
  93. "rd_spec=-\0" \
  94. "init_mmc=run args_all args_mmc\0" \
  95. "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${name_fdt}\0" \
  96. "get_overlay_mmc=" \
  97. "fdt address ${fdtaddr};" \
  98. "fdt resize 0x100000;" \
  99. "for overlay in $name_overlays;" \
  100. "do;" \
  101. "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
  102. "fdt apply ${dtboaddr};" \
  103. "done;\0" \
  104. "partitions=" PARTS_DEFAULT \
  105. "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
  106. "${bootdir}/${name_kern}\0" \
  107. "get_fit_mmc=load mmc ${bootpart} ${addr_fit} " \
  108. "${bootdir}/${name_fit}\0" \
  109. "partitions=" PARTS_DEFAULT
  110. /* Set the default list of remote processors to boot */
  111. #if defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
  112. #ifdef DEFAULT_RPROCS
  113. #undef DEFAULT_RPROCS
  114. #endif
  115. #endif
  116. #ifdef CONFIG_TARGET_J721E_A72_EVM
  117. #define DEFAULT_RPROCS "" \
  118. "3 /lib/firmware/j7-main-r5f0_1-fw " \
  119. "4 /lib/firmware/j7-main-r5f1_0-fw " \
  120. "5 /lib/firmware/j7-main-r5f1_1-fw " \
  121. "6 /lib/firmware/j7-c66_0-fw " \
  122. "7 /lib/firmware/j7-c66_1-fw " \
  123. "8 /lib/firmware/j7-c71_0-fw "
  124. #endif /* CONFIG_TARGET_J721E_A72_EVM */
  125. #ifdef CONFIG_TARGET_J7200_A72_EVM
  126. #define DEFAULT_RPROCS "" \
  127. "2 /lib/firmware/j7200-main-r5f0_0-fw " \
  128. "3 /lib/firmware/j7200-main-r5f0_1-fw "
  129. #endif /* CONFIG_TARGET_J7200_A72_EVM */
  130. /* set default dfu_bufsiz to 128KB (sector size of OSPI) */
  131. #define EXTRA_ENV_DFUARGS \
  132. "dfu_bufsiz=0x20000\0" \
  133. DFU_ALT_INFO_MMC \
  134. DFU_ALT_INFO_EMMC \
  135. DFU_ALT_INFO_RAM \
  136. DFU_ALT_INFO_OSPI
  137. #if defined(CONFIG_TARGET_J721E_A72_EVM) || defined(CONFIG_TARGET_J7200_A72_EVM)
  138. #define EXTRA_ENV_J721E_BOARD_SETTINGS_MTD \
  139. "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
  140. "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
  141. #else
  142. #define EXTRA_ENV_J721E_BOARD_SETTINGS_MTD
  143. #endif
  144. #if CONFIG_IS_ENABLED(CMD_PXE)
  145. # define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
  146. #else
  147. # define BOOT_TARGET_PXE(func)
  148. #endif
  149. #if CONFIG_IS_ENABLED(CMD_DHCP)
  150. # define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
  151. #else
  152. # define BOOT_TARGET_DHCP(func)
  153. #endif
  154. #define BOOT_TARGET_DEVICES(func) \
  155. func(MMC, mmc, 1) \
  156. func(MMC, mmc, 0) \
  157. BOOT_TARGET_PXE(func) \
  158. BOOT_TARGET_DHCP(func)
  159. #include <config_distro_bootcmd.h>
  160. /* Incorporate settings into the U-Boot environment */
  161. #define CONFIG_EXTRA_ENV_SETTINGS \
  162. DEFAULT_LINUX_BOOT_ENV \
  163. DEFAULT_MMC_TI_ARGS \
  164. DEFAULT_FIT_TI_ARGS \
  165. EXTRA_ENV_J721E_BOARD_SETTINGS \
  166. EXTRA_ENV_J721E_BOARD_SETTINGS_MMC \
  167. EXTRA_ENV_RPROC_SETTINGS \
  168. EXTRA_ENV_DFUARGS \
  169. DEFAULT_UFS_TI_ARGS \
  170. EXTRA_ENV_J721E_BOARD_SETTINGS_MTD \
  171. BOOTENV
  172. /* Now for the remaining common defines */
  173. #include <configs/ti_armv7_common.h>
  174. /* MMC ENV related defines */
  175. #endif /* __CONFIG_J721E_EVM_H */