am64x_evm.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /* 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. #ifndef __CONFIG_AM642_EVM_H
  9. #define __CONFIG_AM642_EVM_H
  10. #include <linux/sizes.h>
  11. #include <config_distro_bootcmd.h>
  12. #include <environment/ti/mmc.h>
  13. #include <asm/arch/am64_hardware.h>
  14. #include <environment/ti/k3_dfu.h>
  15. /* DDR Configuration */
  16. #define CONFIG_SYS_SDRAM_BASE1 0x880000000
  17. #ifdef CONFIG_SYS_K3_SPL_ATF
  18. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "tispl.bin"
  19. #endif
  20. #ifndef CONFIG_CPU_V7R
  21. #define CONFIG_SKIP_LOWLEVEL_INIT
  22. #endif
  23. #define CONFIG_SPL_MAX_SIZE CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
  24. #if defined(CONFIG_TARGET_AM642_A53_EVM)
  25. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SPL_TEXT_BASE + \
  26. CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE - 4)
  27. #else
  28. /*
  29. * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
  30. * possible (to allow the build to go through), as this directly affects
  31. * our memory footprint. The less we use for BSS the more we have available
  32. * for everything else.
  33. */
  34. #define CONFIG_SPL_BSS_MAX_SIZE 0x1000
  35. /*
  36. * Link BSS to be within SPL in a dedicated region located near the top of
  37. * the MCU SRAM, this way making it available also before relocation. Note
  38. * that we are not using the actual top of the MCU SRAM as there is a memory
  39. * location filled in by the boot ROM that we want to read out without any
  40. * interference from the C context.
  41. */
  42. #define CONFIG_SPL_BSS_START_ADDR (TI_SRAM_SCRATCH_BOARD_EEPROM_START -\
  43. CONFIG_SPL_BSS_MAX_SIZE)
  44. /* Set the stack right below the SPL BSS section */
  45. #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SPL_BSS_START_ADDR
  46. /* Configure R5 SPL post-relocation malloc pool in DDR */
  47. #define CONFIG_SYS_SPL_MALLOC_START 0x84000000
  48. #define CONFIG_SYS_SPL_MALLOC_SIZE SZ_16M
  49. #endif
  50. #define PARTS_DEFAULT \
  51. /* Linux partitions */ \
  52. "name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}\0"
  53. /* U-Boot general configuration */
  54. #define EXTRA_ENV_AM642_BOARD_SETTINGS \
  55. "findfdt=" \
  56. "if test $board_name = am64x_gpevm; then " \
  57. "setenv fdtfile k3-am642-evm.dtb; fi; " \
  58. "if test $board_name = am64x_skevm; then " \
  59. "setenv fdtfile k3-am642-sk.dtb; fi;" \
  60. "if test $fdtfile = undefined; then " \
  61. "echo WARNING: Could not determine device tree to use; fi; \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. /* U-Boot MMC-specific configuration */
  68. #define EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \
  69. "boot=mmc\0" \
  70. "mmcdev=1\0" \
  71. "bootpart=1:2\0" \
  72. "bootdir=/boot\0" \
  73. "rd_spec=-\0" \
  74. "init_mmc=run args_all args_mmc\0" \
  75. "get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  76. "get_overlay_mmc=" \
  77. "fdt address ${fdtaddr};" \
  78. "fdt resize 0x100000;" \
  79. "for overlay in $name_overlays;" \
  80. "do;" \
  81. "load mmc ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
  82. "fdt apply ${dtboaddr};" \
  83. "done;\0" \
  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. #define EXTRA_ENV_AM642_BOARD_SETTING_USBMSC \
  90. "args_usb=run finduuid;setenv bootargs console=${console} " \
  91. "${optargs} " \
  92. "root=PARTUUID=${uuid} rw " \
  93. "rootfstype=${mmcrootfstype}\0" \
  94. "init_usb=run args_all args_usb\0" \
  95. "get_fdt_usb=load usb ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  96. "get_overlay_usb=" \
  97. "fdt address ${fdtaddr};" \
  98. "fdt resize 0x100000;" \
  99. "for overlay in $name_overlays;" \
  100. "do;" \
  101. "load usb ${bootpart} ${dtboaddr} ${bootdir}/${overlay} && " \
  102. "fdt apply ${dtboaddr};" \
  103. "done;\0" \
  104. "get_kern_usb=load usb ${bootpart} ${loadaddr} " \
  105. "${bootdir}/${name_kern}\0" \
  106. "get_fit_usb=load usb ${bootpart} ${addr_fit} " \
  107. "${bootdir}/${name_fit}\0" \
  108. "usbboot=setenv boot usb;" \
  109. "setenv bootpart 0:2;" \
  110. "usb start;" \
  111. "run findfdt;" \
  112. "run init_usb;" \
  113. "run get_kern_usb;" \
  114. "run get_fdt_usb;" \
  115. "run run_kern\0"
  116. #define EXTRA_ENV_DFUARGS \
  117. DFU_ALT_INFO_MMC \
  118. DFU_ALT_INFO_EMMC \
  119. DFU_ALT_INFO_RAM \
  120. DFU_ALT_INFO_OSPI
  121. /* Incorporate settings into the U-Boot environment */
  122. #define CONFIG_EXTRA_ENV_SETTINGS \
  123. DEFAULT_LINUX_BOOT_ENV \
  124. DEFAULT_MMC_TI_ARGS \
  125. EXTRA_ENV_AM642_BOARD_SETTINGS \
  126. EXTRA_ENV_AM642_BOARD_SETTINGS_MMC \
  127. EXTRA_ENV_DFUARGS \
  128. EXTRA_ENV_AM642_BOARD_SETTING_USBMSC
  129. /* Now for the remaining common defines */
  130. #include <configs/ti_armv7_common.h>
  131. #define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
  132. #endif /* __CONFIG_AM642_EVM_H */