ls1043a_common.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /*
  2. * Copyright (C) 2015 Freescale Semiconductor
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __LS1043A_COMMON_H
  7. #define __LS1043A_COMMON_H
  8. /* SPL build */
  9. #ifdef CONFIG_SPL_BUILD
  10. #define SPL_NO_FMAN
  11. #define SPL_NO_DSPI
  12. #define SPL_NO_PCIE
  13. #define SPL_NO_ENV
  14. #define SPL_NO_MISC
  15. #define SPL_NO_USB
  16. #define SPL_NO_SATA
  17. #define SPL_NO_QE
  18. #define SPL_NO_EEPROM
  19. #endif
  20. #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_NAND_BOOT))
  21. #define SPL_NO_MMC
  22. #endif
  23. #if (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SD_BOOT))
  24. #define SPL_NO_IFC
  25. #endif
  26. #define CONFIG_REMAKE_ELF
  27. #define CONFIG_FSL_LAYERSCAPE
  28. #define CONFIG_MP
  29. #define CONFIG_GICV2
  30. #include <asm/arch/stream_id_lsch2.h>
  31. #include <asm/arch/config.h>
  32. /* Link Definitions */
  33. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_FSL_OCRAM_BASE + 0xfff0)
  34. #define CONFIG_SUPPORT_RAW_INITRD
  35. #define CONFIG_SKIP_LOWLEVEL_INIT
  36. #define CONFIG_VERY_BIG_RAM
  37. #define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000
  38. #define CONFIG_SYS_FSL_DDR_SDRAM_BASE_PHY 0
  39. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
  40. #define CONFIG_SYS_DDR_BLOCK2_BASE 0x880000000ULL
  41. #define CPU_RELEASE_ADDR secondary_boot_func
  42. /* Generic Timer Definitions */
  43. #define COUNTER_FREQUENCY 25000000 /* 25MHz */
  44. /* Size of malloc() pool */
  45. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 1024 * 1024)
  46. /* Serial Port */
  47. #define CONFIG_CONS_INDEX 1
  48. #define CONFIG_SYS_NS16550_SERIAL
  49. #define CONFIG_SYS_NS16550_REG_SIZE 1
  50. #define CONFIG_SYS_NS16550_CLK (get_serial_clock())
  51. #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
  52. /* SD boot SPL */
  53. #ifdef CONFIG_SD_BOOT
  54. #define CONFIG_SPL_FRAMEWORK
  55. #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds"
  56. #define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
  57. #define CONFIG_SPL_TEXT_BASE 0x10000000
  58. #define CONFIG_SPL_MAX_SIZE 0x17000
  59. #define CONFIG_SPL_STACK 0x1001e000
  60. #define CONFIG_SPL_PAD_TO 0x1d000
  61. #define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_TEXT_BASE + \
  62. CONFIG_SYS_MONITOR_LEN)
  63. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  64. #define CONFIG_SPL_BSS_START_ADDR 0x80100000
  65. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000
  66. #ifdef CONFIG_SECURE_BOOT
  67. #define CONFIG_U_BOOT_HDR_SIZE (16 << 10)
  68. /*
  69. * HDR would be appended at end of image and copied to DDR along
  70. * with U-Boot image. Here u-boot max. size is 512K. So if binary
  71. * size increases then increase this size in case of secure boot as
  72. * it uses raw u-boot image instead of fit image.
  73. */
  74. #define CONFIG_SYS_MONITOR_LEN (0x100000 + CONFIG_U_BOOT_HDR_SIZE)
  75. #else
  76. #define CONFIG_SYS_MONITOR_LEN 0x100000
  77. #endif /* ifdef CONFIG_SECURE_BOOT */
  78. #endif
  79. /* NAND SPL */
  80. #ifdef CONFIG_NAND_BOOT
  81. #define CONFIG_SPL_PBL_PAD
  82. #define CONFIG_SPL_FRAMEWORK
  83. #define CONFIG_SPL_LDSCRIPT "arch/arm/cpu/armv8/u-boot-spl.lds"
  84. #define CONFIG_SPL_TARGET "u-boot-with-spl.bin"
  85. #define CONFIG_SPL_TEXT_BASE 0x10000000
  86. #define CONFIG_SPL_MAX_SIZE 0x1a000
  87. #define CONFIG_SPL_STACK 0x1001d000
  88. #define CONFIG_SYS_NAND_U_BOOT_DST CONFIG_SYS_TEXT_BASE
  89. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  90. #define CONFIG_SYS_SPL_MALLOC_START 0x80200000
  91. #define CONFIG_SPL_BSS_START_ADDR 0x80100000
  92. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  93. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000
  94. #ifdef CONFIG_SECURE_BOOT
  95. #define CONFIG_U_BOOT_HDR_SIZE (16 << 10)
  96. #endif /* ifdef CONFIG_SECURE_BOOT */
  97. #ifdef CONFIG_U_BOOT_HDR_SIZE
  98. /*
  99. * HDR would be appended at end of image and copied to DDR along
  100. * with U-Boot image. Here u-boot max. size is 512K. So if binary
  101. * size increases then increase this size in case of secure boot as
  102. * it uses raw u-boot image instead of fit image.
  103. */
  104. #define CONFIG_SYS_MONITOR_LEN (0x100000 + CONFIG_U_BOOT_HDR_SIZE)
  105. #else
  106. #define CONFIG_SYS_MONITOR_LEN 0x100000
  107. #endif /* ifdef CONFIG_U_BOOT_HDR_SIZE */
  108. #endif
  109. /* IFC */
  110. #ifndef SPL_NO_IFC
  111. #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
  112. #define CONFIG_FSL_IFC
  113. /*
  114. * CONFIG_SYS_FLASH_BASE has the final address (core view)
  115. * CONFIG_SYS_FLASH_BASE_PHYS has the final address (IFC view)
  116. * CONFIG_SYS_FLASH_BASE_PHYS_EARLY has the temporary IFC address
  117. * CONFIG_SYS_TEXT_BASE is linked to 0x60000000 for booting
  118. */
  119. #define CONFIG_SYS_FLASH_BASE 0x60000000
  120. #define CONFIG_SYS_FLASH_BASE_PHYS CONFIG_SYS_FLASH_BASE
  121. #define CONFIG_SYS_FLASH_BASE_PHYS_EARLY 0x00000000
  122. #ifdef CONFIG_MTD_NOR_FLASH
  123. #define CONFIG_FLASH_CFI_DRIVER
  124. #define CONFIG_SYS_FLASH_CFI
  125. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  126. #define CONFIG_SYS_FLASH_QUIET_TEST
  127. #define CONFIG_FLASH_SHOW_PROGRESS 45 /* count down from 45/5: 9..1 */
  128. #endif
  129. #endif
  130. #endif
  131. /* I2C */
  132. #define CONFIG_SYS_I2C
  133. #define CONFIG_SYS_I2C_MXC
  134. #define CONFIG_SYS_I2C_MXC_I2C1
  135. #define CONFIG_SYS_I2C_MXC_I2C2
  136. #define CONFIG_SYS_I2C_MXC_I2C3
  137. #define CONFIG_SYS_I2C_MXC_I2C4
  138. /* PCIe */
  139. #ifndef SPL_NO_PCIE
  140. #define CONFIG_PCIE1 /* PCIE controller 1 */
  141. #define CONFIG_PCIE2 /* PCIE controller 2 */
  142. #define CONFIG_PCIE3 /* PCIE controller 3 */
  143. #ifdef CONFIG_PCI
  144. #define CONFIG_NET_MULTI
  145. #define CONFIG_PCI_SCAN_SHOW
  146. #define CONFIG_CMD_PCI
  147. #endif
  148. #endif
  149. /* Command line configuration */
  150. #ifndef SPL_NO_ENV
  151. #define CONFIG_CMD_ENV
  152. #endif
  153. /* MMC */
  154. #ifndef SPL_NO_MMC
  155. #ifdef CONFIG_MMC
  156. #define CONFIG_FSL_ESDHC
  157. #define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33
  158. #endif
  159. #endif
  160. /* DSPI */
  161. #ifndef SPL_NO_DSPI
  162. #define CONFIG_FSL_DSPI
  163. #ifdef CONFIG_FSL_DSPI
  164. #define CONFIG_DM_SPI_FLASH
  165. #define CONFIG_SPI_FLASH_STMICRO /* cs0 */
  166. #define CONFIG_SPI_FLASH_SST /* cs1 */
  167. #define CONFIG_SPI_FLASH_EON /* cs2 */
  168. #if !defined(CONFIG_QSPI_BOOT) && !defined(CONFIG_SD_BOOT_QSPI)
  169. #define CONFIG_SF_DEFAULT_BUS 1
  170. #define CONFIG_SF_DEFAULT_CS 0
  171. #endif
  172. #endif
  173. #endif
  174. /* FMan ucode */
  175. #ifndef SPL_NO_FMAN
  176. #define CONFIG_SYS_DPAA_FMAN
  177. #ifdef CONFIG_SYS_DPAA_FMAN
  178. #define CONFIG_SYS_FM_MURAM_SIZE 0x60000
  179. #ifdef CONFIG_NAND_BOOT
  180. /* Store Fman ucode at offeset 0x160000(11 blocks). */
  181. #define CONFIG_SYS_QE_FMAN_FW_IN_NAND
  182. #define CONFIG_SYS_FMAN_FW_ADDR (11 * CONFIG_SYS_NAND_BLOCK_SIZE)
  183. #elif defined(CONFIG_SD_BOOT)
  184. /*
  185. * PBL SD boot image should stored at 0x1000(8 blocks), the size of the image is
  186. * about 1MB (2040 blocks), Env is stored after the image, and the env size is
  187. * 0x2000 (16 blocks), 8 + 2040 + 16 = 2064, enlarge it to 2080(0x820).
  188. */
  189. #define CONFIG_SYS_QE_FMAN_FW_IN_MMC
  190. #define CONFIG_SYS_FMAN_FW_ADDR (512 * 0x820)
  191. #elif defined(CONFIG_QSPI_BOOT)
  192. #define CONFIG_SYS_QE_FW_IN_SPIFLASH
  193. #define CONFIG_SYS_FMAN_FW_ADDR 0x400d0000
  194. #define CONFIG_ENV_SPI_BUS 0
  195. #define CONFIG_ENV_SPI_CS 0
  196. #define CONFIG_ENV_SPI_MAX_HZ 1000000
  197. #define CONFIG_ENV_SPI_MODE 0x03
  198. #else
  199. #define CONFIG_SYS_QE_FMAN_FW_IN_NOR
  200. /* FMan fireware Pre-load address */
  201. #define CONFIG_SYS_FMAN_FW_ADDR 0x60300000
  202. #endif
  203. #define CONFIG_SYS_QE_FMAN_FW_LENGTH 0x10000
  204. #define CONFIG_SYS_FDT_PAD (0x3000 + CONFIG_SYS_QE_FMAN_FW_LENGTH)
  205. #endif
  206. #endif
  207. /* Miscellaneous configurable options */
  208. #define CONFIG_SYS_LOAD_ADDR (CONFIG_SYS_DDR_SDRAM_BASE + 0x10000000)
  209. #define CONFIG_HWCONFIG
  210. #define HWCONFIG_BUFFER_SIZE 128
  211. #ifndef SPL_NO_MISC
  212. #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
  213. #define MTDPARTS_DEFAULT "mtdparts=spi0.0:1m(uboot)," \
  214. "5m(kernel),1m(dtb),9m(file_system)"
  215. #else
  216. #define MTDPARTS_DEFAULT "mtdparts=60000000.nor:" \
  217. "2m@0x100000(nor_bank0_uboot),"\
  218. "40m@0x1100000(nor_bank0_fit)," \
  219. "7m(nor_bank0_user)," \
  220. "2m@0x4100000(nor_bank4_uboot)," \
  221. "40m@0x5100000(nor_bank4_fit),"\
  222. "-(nor_bank4_user);" \
  223. "7e800000.flash:" \
  224. "1m(nand_uboot),1m(nand_uboot_env)," \
  225. "20m(nand_fit);spi0.0:1m(uboot)," \
  226. "5m(kernel),1m(dtb),9m(file_system)"
  227. #endif
  228. /* Initial environment variables */
  229. #define CONFIG_EXTRA_ENV_SETTINGS \
  230. "hwconfig=fsl_ddr:bank_intlv=auto\0" \
  231. "loadaddr=0x80100000\0" \
  232. "fdt_high=0xffffffffffffffff\0" \
  233. "initrd_high=0xffffffffffffffff\0" \
  234. "kernel_start=0x61100000\0" \
  235. "kernel_load=0xa0000000\0" \
  236. "kernel_size=0x2800000\0" \
  237. "console=ttyS0,115200\0" \
  238. "mtdparts=" MTDPARTS_DEFAULT "\0"
  239. #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \
  240. "earlycon=uart8250,mmio,0x21c0500 " \
  241. MTDPARTS_DEFAULT
  242. #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
  243. #define CONFIG_BOOTCOMMAND "sf probe && sf read $kernel_load " \
  244. "e0000 f00000 && bootm $kernel_load"
  245. #else
  246. #define CONFIG_BOOTCOMMAND "cp.b $kernel_start $kernel_load " \
  247. "$kernel_size && bootm $kernel_load"
  248. #endif
  249. #endif
  250. /* Monitor Command Prompt */
  251. #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
  252. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  253. sizeof(CONFIG_SYS_PROMPT) + 16)
  254. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot args buffer */
  255. #define CONFIG_SYS_LONGHELP
  256. #ifndef SPL_NO_MISC
  257. #define CONFIG_CMDLINE_EDITING 1
  258. #endif
  259. #define CONFIG_AUTO_COMPLETE
  260. #define CONFIG_SYS_MAXARGS 64 /* max command args */
  261. #define CONFIG_SYS_BOOTM_LEN (64 << 20) /* Increase max gunzip size */
  262. /* Hash command with SHA acceleration supported in hardware */
  263. #ifdef CONFIG_FSL_CAAM
  264. #define CONFIG_CMD_HASH
  265. #define CONFIG_SHA_HW_ACCEL
  266. #endif
  267. #endif /* __LS1043A_COMMON_H */