xilinx_zynqmp.h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. /*
  2. * Configuration for Xilinx ZynqMP
  3. * (C) Copyright 2014 - 2015 Xilinx, Inc.
  4. * Michal Simek <michal.simek@xilinx.com>
  5. *
  6. * Based on Configuration for Versatile Express
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef __XILINX_ZYNQMP_H
  11. #define __XILINX_ZYNQMP_H
  12. #define CONFIG_REMAKE_ELF
  13. /* #define CONFIG_ARMV8_SWITCH_TO_EL1 */
  14. #define CONFIG_SYS_NO_FLASH
  15. /* Generic Interrupt Controller Definitions */
  16. #define CONFIG_GICV2
  17. #define GICD_BASE 0xF9010000
  18. #define GICC_BASE 0xF9020000
  19. #define CONFIG_SYS_ALT_MEMTEST
  20. #define CONFIG_SYS_MEMTEST_SCRATCH 0xfffc0000
  21. #ifndef CONFIG_NR_DRAM_BANKS
  22. # define CONFIG_NR_DRAM_BANKS 2
  23. #endif
  24. #define CONFIG_SYS_MEMTEST_START 0
  25. #define CONFIG_SYS_MEMTEST_END 1000
  26. /* Have release address at the end of 256MB for now */
  27. #define CPU_RELEASE_ADDR 0xFFFFFF0
  28. #define CONFIG_SYS_INIT_SP_ADDR CONFIG_SYS_TEXT_BASE
  29. /* Generic Timer Definitions - setup in EL3. Setup by ATF for other cases */
  30. #if !defined(COUNTER_FREQUENCY)
  31. # define COUNTER_FREQUENCY 100000000
  32. #endif
  33. /* Size of malloc() pool */
  34. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x2000000)
  35. /* Serial setup */
  36. #define CONFIG_ARM_DCC
  37. #define CONFIG_CPU_ARMV8
  38. #define CONFIG_ZYNQ_SERIAL
  39. #define CONFIG_CONS_INDEX 0
  40. #define CONFIG_BAUDRATE 115200
  41. #define CONFIG_SYS_BAUDRATE_TABLE \
  42. { 4800, 9600, 19200, 38400, 57600, 115200 }
  43. /* Command line configuration */
  44. #define CONFIG_CMD_ENV
  45. #define CONFIG_MP
  46. /* BOOTP options */
  47. #define CONFIG_BOOTP_BOOTFILESIZE
  48. #define CONFIG_BOOTP_BOOTPATH
  49. #define CONFIG_BOOTP_GATEWAY
  50. #define CONFIG_BOOTP_HOSTNAME
  51. #define CONFIG_BOOTP_MAY_FAIL
  52. #define CONFIG_BOOTP_DNS
  53. #define CONFIG_BOOTP_PXE
  54. #define CONFIG_BOOTP_SUBNETMASK
  55. /* Diff from config_distro_defaults.h */
  56. #define CONFIG_SUPPORT_RAW_INITRD
  57. #if !defined(CONFIG_SPL_BUILD)
  58. #define CONFIG_ENV_VARS_UBOOT_CONFIG
  59. #endif
  60. #define CONFIG_AUTO_COMPLETE
  61. #if defined(CONFIG_MMC_SDHCI_ZYNQ)
  62. # define CONFIG_SUPPORT_EMMC_BOOT
  63. # ifndef CONFIG_ZYNQ_SDHCI_MAX_FREQ
  64. # define CONFIG_ZYNQ_SDHCI_MAX_FREQ 200000000
  65. # endif
  66. # define CONFIG_ENV_IS_IN_FAT
  67. # define FAT_ENV_DEVICE_AND_PART "0:auto"
  68. # define FAT_ENV_FILE "uboot.env"
  69. # define FAT_ENV_INTERFACE "mmc"
  70. #endif
  71. #if defined(CONFIG_MMC_SDHCI_ZYNQ) || defined(CONFIG_ZYNQMP_USB)
  72. # define CONFIG_FAT_WRITE
  73. #endif
  74. #ifdef CONFIG_NAND_ARASAN
  75. # define CONFIG_CMD_NAND_LOCK_UNLOCK
  76. # define CONFIG_SYS_MAX_NAND_DEVICE 1
  77. # define CONFIG_SYS_NAND_SELF_INIT
  78. # define CONFIG_SYS_NAND_ONFI_DETECTION
  79. # define CONFIG_MTD_DEVICE
  80. #endif
  81. /* Miscellaneous configurable options */
  82. #define CONFIG_SYS_LOAD_ADDR 0x8000000
  83. #if defined(CONFIG_ZYNQMP_USB)
  84. #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
  85. #define CONFIG_SYS_DFU_DATA_BUF_SIZE 0x1800000
  86. #define DFU_DEFAULT_POLL_TIMEOUT 300
  87. #define CONFIG_USB_CABLE_CHECK
  88. #define CONFIG_CMD_THOR_DOWNLOAD
  89. #define CONFIG_USB_FUNCTION_THOR
  90. #define CONFIG_THOR_RESET_OFF
  91. #define DFU_ALT_INFO_RAM \
  92. "dfu_ram_info=" \
  93. "setenv dfu_alt_info " \
  94. "Image ram $kernel_addr $kernel_size\\\\;" \
  95. "system.dtb ram $fdt_addr $fdt_size\0" \
  96. "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \
  97. "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"
  98. #define DFU_ALT_INFO \
  99. DFU_ALT_INFO_RAM
  100. #ifndef CONFIG_SPL_BUILD
  101. # define CONFIG_USB_FUNCTION_FASTBOOT
  102. # define CONFIG_CMD_FASTBOOT
  103. # define CONFIG_ANDROID_BOOT_IMAGE
  104. # define CONFIG_FASTBOOT_BUF_ADDR 0x100000
  105. # define CONFIG_FASTBOOT_BUF_SIZE 0x6000000
  106. # define CONFIG_FASTBOOT_FLASH
  107. # ifdef CONFIG_MMC_SDHCI_ZYNQ
  108. # define CONFIG_FASTBOOT_FLASH_MMC_DEV 0
  109. # endif
  110. # define CONFIG_RANDOM_UUID
  111. # define PARTS_DEFAULT \
  112. "partitions=uuid_disk=${uuid_gpt_disk};" \
  113. "name=""boot"",size=16M,uuid=${uuid_gpt_boot};" \
  114. "name=""Linux"",size=-M,uuid=${uuid_gpt_Linux}\0"
  115. #endif
  116. #endif
  117. #if !defined(DFU_ALT_INFO)
  118. # define DFU_ALT_INFO
  119. #endif
  120. #if !defined(PARTS_DEFAULT)
  121. # define PARTS_DEFAULT
  122. #endif
  123. /* Do not preserve environment */
  124. #if !defined(CONFIG_ENV_IS_IN_FAT)
  125. #define CONFIG_ENV_IS_NOWHERE 1
  126. #endif
  127. #define CONFIG_ENV_SIZE 0x8000
  128. /* Monitor Command Prompt */
  129. /* Console I/O Buffer Size */
  130. #define CONFIG_SYS_CBSIZE 2048
  131. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  132. sizeof(CONFIG_SYS_PROMPT) + 16)
  133. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  134. #define CONFIG_SYS_LONGHELP
  135. #define CONFIG_CMDLINE_EDITING
  136. #define CONFIG_SYS_MAXARGS 64
  137. /* Ethernet driver */
  138. #if defined(CONFIG_ZYNQ_GEM)
  139. # define CONFIG_NET_MULTI
  140. # define CONFIG_MII
  141. # define CONFIG_SYS_FAULT_ECHO_LINK_DOWN
  142. # define CONFIG_PHY_MARVELL
  143. # define CONFIG_PHY_NATSEMI
  144. # define CONFIG_PHY_TI
  145. # define CONFIG_PHY_GIGE
  146. # define CONFIG_PHY_VITESSE
  147. # define CONFIG_PHY_REALTEK
  148. # define PHY_ANEG_TIMEOUT 20000
  149. #endif
  150. /* I2C */
  151. #if defined(CONFIG_SYS_I2C_ZYNQ)
  152. # define CONFIG_SYS_I2C
  153. # define CONFIG_SYS_I2C_ZYNQ_SPEED 100000
  154. # define CONFIG_SYS_I2C_ZYNQ_SLAVE 0
  155. #endif
  156. /* EEPROM */
  157. #ifdef CONFIG_ZYNQMP_EEPROM
  158. # define CONFIG_CMD_EEPROM
  159. # define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  160. # define CONFIG_SYS_I2C_EEPROM_ADDR 0x54
  161. # define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4
  162. # define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
  163. # define CONFIG_SYS_EEPROM_SIZE (64 * 1024)
  164. #endif
  165. #ifdef CONFIG_SATA_CEVA
  166. #define CONFIG_LIBATA
  167. #define CONFIG_SCSI_AHCI
  168. #define CONFIG_SYS_SCSI_MAX_SCSI_ID 2
  169. #define CONFIG_SYS_SCSI_MAX_LUN 1
  170. #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
  171. CONFIG_SYS_SCSI_MAX_LUN)
  172. #define CONFIG_SCSI
  173. #endif
  174. #define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
  175. #define CONFIG_BOARD_EARLY_INIT_R
  176. #define CONFIG_CLOCKS
  177. #define ENV_MEM_LAYOUT_SETTINGS \
  178. "fdt_high=10000000\0" \
  179. "initrd_high=10000000\0" \
  180. "fdt_addr_r=0x40000000\0" \
  181. "pxefile_addr_r=0x10000000\0" \
  182. "kernel_addr_r=0x18000000\0" \
  183. "scriptaddr=0x02000000\0" \
  184. "ramdisk_addr_r=0x02100000\0" \
  185. #if defined(CONFIG_MMC_SDHCI_ZYNQ)
  186. # define BOOT_TARGET_DEVICES_MMC(func) func(MMC, mmc, 0) func(MMC, mmc, 1)
  187. #else
  188. # define BOOT_TARGET_DEVICES_MMC(func)
  189. #endif
  190. #if defined(CONFIG_SATA_CEVA)
  191. # define BOOT_TARGET_DEVICES_SCSI(func) func(SCSI, scsi, 0)
  192. #else
  193. # define BOOT_TARGET_DEVICES_SCSI(func)
  194. #endif
  195. #if defined(CONFIG_ZYNQMP_USB)
  196. # define BOOT_TARGET_DEVICES_USB(func) func(USB, usb, 0) func(USB, usb, 1)
  197. #else
  198. # define BOOT_TARGET_DEVICES_USB(func)
  199. #endif
  200. #define BOOT_TARGET_DEVICES(func) \
  201. BOOT_TARGET_DEVICES_MMC(func) \
  202. BOOT_TARGET_DEVICES_USB(func) \
  203. BOOT_TARGET_DEVICES_SCSI(func) \
  204. func(PXE, pxe, na) \
  205. func(DHCP, dhcp, na)
  206. #include <config_distro_bootcmd.h>
  207. /* Initial environment variables */
  208. #ifndef CONFIG_EXTRA_ENV_SETTINGS
  209. #define CONFIG_EXTRA_ENV_SETTINGS \
  210. ENV_MEM_LAYOUT_SETTINGS \
  211. BOOTENV \
  212. DFU_ALT_INFO
  213. #endif
  214. /* SPL can't handle all huge variables - define just DFU */
  215. #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU_SUPPORT)
  216. #undef CONFIG_EXTRA_ENV_SETTINGS
  217. # define CONFIG_EXTRA_ENV_SETTINGS \
  218. "dfu_alt_info_ram=uboot.bin ram 0x8000000 0x1000000;" \
  219. "atf-uboot.ub ram 0x10000000 0x1000000;" \
  220. "Image ram 0x80000 0x3f80000;" \
  221. "system.dtb ram 0x4000000 0x100000\0" \
  222. "dfu_bufsiz=0x1000\0"
  223. #endif
  224. #define CONFIG_SPL_TEXT_BASE 0xfffc0000
  225. #define CONFIG_SPL_STACK 0xfffffffc
  226. #define CONFIG_SPL_MAX_SIZE 0x40000
  227. /* Just random location in OCM */
  228. #define CONFIG_SPL_BSS_START_ADDR 0x0
  229. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000
  230. #define CONFIG_SPL_FRAMEWORK
  231. #define CONFIG_SPL_BOARD_INIT
  232. /* u-boot is like dtb */
  233. #define CONFIG_SPL_FS_LOAD_ARGS_NAME "u-boot.bin"
  234. #define CONFIG_SYS_SPL_ARGS_ADDR 0x8000000
  235. /* ATF is my kernel image */
  236. #define CONFIG_SPL_FS_LOAD_KERNEL_NAME "atf-uboot.ub"
  237. /* FIT load address for RAM boot */
  238. #define CONFIG_SPL_LOAD_FIT_ADDRESS 0x10000000
  239. /* MMC support */
  240. #ifdef CONFIG_MMC_SDHCI_ZYNQ
  241. # define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  242. # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0 /* unused */
  243. # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 /* unused */
  244. # define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0 /* unused */
  245. # define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
  246. #endif
  247. #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_DFU_SUPPORT)
  248. # undef CONFIG_CMD_BOOTD
  249. # define CONFIG_SPL_ENV_SUPPORT
  250. # define CONFIG_SPL_HASH_SUPPORT
  251. # define CONFIG_ENV_MAX_ENTRIES 10
  252. # define CONFIG_SYS_SPL_MALLOC_START 0x20000000
  253. # define CONFIG_SYS_SPL_MALLOC_SIZE 0x10000000
  254. #ifdef CONFIG_SPL_SYS_MALLOC_SIMPLE
  255. # error "Disable CONFIG_SPL_SYS_MALLOC_SIMPLE. Full malloc needs to be used"
  256. #endif
  257. #endif
  258. #endif /* __XILINX_ZYNQMP_H */