ls1021aiot.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. /*
  2. * Copyright 2016 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __CONFIG_H
  7. #define __CONFIG_H
  8. #define CONFIG_LS102XA
  9. #define CONFIG_ARMV7_SECURE_BASE OCRAM_BASE_S_ADDR
  10. #define CONFIG_SYS_FSL_CLK
  11. #define CONFIG_BOARD_EARLY_INIT_F
  12. /*
  13. * Size of malloc() pool
  14. */
  15. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 16 * 1024 * 1024)
  16. #define CONFIG_SYS_INIT_RAM_ADDR OCRAM_BASE_ADDR
  17. #define CONFIG_SYS_INIT_RAM_SIZE OCRAM_SIZE
  18. /* XHCI Support - enabled by default */
  19. #define CONFIG_HAS_FSL_XHCI_USB
  20. #ifdef CONFIG_HAS_FSL_XHCI_USB
  21. #define CONFIG_USB_XHCI_FSL
  22. #define CONFIG_USB_XHCI_DWC3
  23. #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
  24. #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS 2
  25. #endif
  26. #if defined(CONFIG_HAS_FSL_DR_USB) || defined(CONFIG_HAS_FSL_XHCI_USB)
  27. #define CONFIG_USB_STORAGE
  28. #define CONFIG_CMD_EXT2
  29. #endif
  30. /*
  31. * Generic Timer Definitions
  32. */
  33. #define GENERIC_TIMER_CLK 12500000
  34. #define CONFIG_SYS_CLK_FREQ 100000000
  35. #define CONFIG_DDR_CLK_FREQ 100000000
  36. /*
  37. * DDR: 800 MHz ( 1600 MT/s data rate )
  38. */
  39. #define DDR_SDRAM_CFG 0x470c0008
  40. #define DDR_CS0_BNDS 0x008000bf
  41. #define DDR_CS0_CONFIG 0x80014302
  42. #define DDR_TIMING_CFG_0 0x50550004
  43. #define DDR_TIMING_CFG_1 0xbcb38c56
  44. #define DDR_TIMING_CFG_2 0x0040d120
  45. #define DDR_TIMING_CFG_3 0x010e1000
  46. #define DDR_TIMING_CFG_4 0x00000001
  47. #define DDR_TIMING_CFG_5 0x03401400
  48. #define DDR_SDRAM_CFG_2 0x00401010
  49. #define DDR_SDRAM_MODE 0x00061c60
  50. #define DDR_SDRAM_MODE_2 0x00180000
  51. #define DDR_SDRAM_INTERVAL 0x18600618
  52. #define DDR_DDR_WRLVL_CNTL 0x8655f605
  53. #define DDR_DDR_WRLVL_CNTL_2 0x05060607
  54. #define DDR_DDR_WRLVL_CNTL_3 0x05050505
  55. #define DDR_DDR_CDR1 0x80040000
  56. #define DDR_DDR_CDR2 0x00000001
  57. #define DDR_SDRAM_CLK_CNTL 0x02000000
  58. #define DDR_DDR_ZQ_CNTL 0x89080600
  59. #define DDR_CS0_CONFIG_2 0
  60. #define DDR_SDRAM_CFG_MEM_EN 0x80000000
  61. #define SDRAM_CFG2_D_INIT 0x00000010
  62. #define DDR_CDR2_VREF_TRAIN_EN 0x00000080
  63. #define SDRAM_CFG2_FRC_SR 0x80000000
  64. #define SDRAM_CFG_BI 0x00000001
  65. #ifdef CONFIG_RAMBOOT_PBL
  66. #define CONFIG_SYS_FSL_PBL_PBI \
  67. board/freescale/ls1021aiot/ls102xa_pbi.cfg
  68. #endif
  69. #ifdef CONFIG_SD_BOOT
  70. #define CONFIG_SYS_FSL_PBL_RCW \
  71. board/freescale/ls1021aiot/ls102xa_rcw_sd.cfg
  72. #define CONFIG_SPL_FRAMEWORK
  73. #define CONFIG_SPL_LDSCRIPT "arch/$(ARCH)/cpu/u-boot-spl.lds"
  74. #define CONFIG_SPL_LIBCOMMON_SUPPORT
  75. #define CONFIG_SPL_LIBGENERIC_SUPPORT
  76. #define CONFIG_SPL_ENV_SUPPORT
  77. #define CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
  78. #define CONFIG_SPL_I2C_SUPPORT
  79. #define CONFIG_SPL_WATCHDOG_SUPPORT
  80. #define CONFIG_SPL_SERIAL_SUPPORT
  81. #define CONFIG_SPL_MMC_SUPPORT
  82. #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0xe8
  83. #define CONFIG_SPL_TEXT_BASE 0x10000000
  84. #define CONFIG_SPL_MAX_SIZE 0x1a000
  85. #define CONFIG_SPL_STACK 0x1001d000
  86. #define CONFIG_SPL_PAD_TO 0x1c000
  87. #define CONFIG_SYS_TEXT_BASE 0x82000000
  88. #define CONFIG_SYS_SPL_MALLOC_START (CONFIG_SYS_TEXT_BASE + \
  89. CONFIG_SYS_MONITOR_LEN)
  90. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  91. #define CONFIG_SPL_BSS_START_ADDR 0x80100000
  92. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000
  93. #define CONFIG_SYS_MONITOR_LEN 0x80000
  94. #define CONFIG_SYS_NO_FLASH
  95. #endif
  96. #ifdef CONFIG_QSPI_BOOT
  97. #define CONFIG_SYS_TEXT_BASE 0x40010000
  98. #endif
  99. #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
  100. #define CONFIG_SYS_NO_FLASH
  101. #endif
  102. #define CONFIG_NR_DRAM_BANKS 1
  103. #define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000UL
  104. #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE
  105. #define CONFIG_FSL_CAAM /* Enable CAAM */
  106. /*
  107. * Serial Port
  108. */
  109. #define CONFIG_CONS_INDEX 1
  110. #define CONFIG_SYS_NS16550_SERIAL
  111. #define CONFIG_SYS_NS16550_REG_SIZE 1
  112. #define CONFIG_SYS_NS16550_CLK get_serial_clock()
  113. #define CONFIG_BAUDRATE 115200
  114. /*
  115. * I2C
  116. */
  117. #define CONFIG_CMD_I2C
  118. #define CONFIG_SYS_I2C
  119. #define CONFIG_SYS_I2C_MXC
  120. #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
  121. #define CONFIG_SYS_I2C_MXC_I2C2 /* enable I2C bus 2 */
  122. #define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
  123. /* EEPROM */
  124. #define CONFIG_ID_EEPROM
  125. #define CONFIG_SYS_I2C_EEPROM_NXID
  126. #define CONFIG_SYS_EEPROM_BUS_NUM 0
  127. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x51
  128. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  129. /*
  130. * MMC
  131. */
  132. #define CONFIG_CMD_MMC
  133. #define CONFIG_FSL_ESDHC
  134. #define CONFIG_GENERIC_MMC
  135. /* SATA */
  136. #define CONFIG_BOARD_LATE_INIT
  137. #define CONFIG_CMD_SCSI
  138. #define CONFIG_LIBATA
  139. #define CONFIG_SCSI_AHCI
  140. #define CONFIG_SCSI_AHCI_PLAT
  141. #ifndef PCI_DEVICE_ID_FREESCALE_AHCI
  142. #define PCI_DEVICE_ID_FREESCALE_AHCI 0x0440
  143. #endif
  144. #define CONFIG_SCSI_DEV_LIST {PCI_VENDOR_ID_FREESCALE, \
  145. PCI_DEVICE_ID_FREESCALE_AHCI}
  146. #define CONFIG_SYS_SCSI_MAX_SCSI_ID 1
  147. #define CONFIG_SYS_SCSI_MAX_LUN 1
  148. #define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
  149. CONFIG_SYS_SCSI_MAX_LUN)
  150. #define CONFIG_CMD_FAT
  151. #define CONFIG_DOS_PARTITION
  152. /* SPI */
  153. #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
  154. #define CONFIG_SPI_FLASH_SPANSION
  155. /* QSPI */
  156. #define QSPI0_AMBA_BASE 0x40000000
  157. #define FSL_QSPI_FLASH_SIZE (1 << 24)
  158. #define FSL_QSPI_FLASH_NUM 2
  159. #define CONFIG_SPI_FLASH_BAR
  160. #define CONFIG_SPI_FLASH_SPANSION
  161. #endif
  162. /* DM SPI */
  163. #if defined(CONFIG_FSL_DSPI) || defined(CONFIG_FSL_QSPI)
  164. #define CONFIG_CMD_SF
  165. #define CONFIG_DM_SPI_FLASH
  166. #endif
  167. /*
  168. * eTSEC
  169. */
  170. #define CONFIG_TSEC_ENET
  171. #ifdef CONFIG_TSEC_ENET
  172. #define CONFIG_MII
  173. #define CONFIG_MII_DEFAULT_TSEC 1
  174. #define CONFIG_TSEC1 1
  175. #define CONFIG_TSEC1_NAME "eTSEC1"
  176. #define CONFIG_TSEC2 1
  177. #define CONFIG_TSEC2_NAME "eTSEC2"
  178. #define TSEC1_PHY_ADDR 1
  179. #define TSEC2_PHY_ADDR 3
  180. #define TSEC1_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  181. #define TSEC2_FLAGS (TSEC_GIGABIT | TSEC_REDUCED)
  182. #define TSEC1_PHYIDX 0
  183. #define TSEC2_PHYIDX 0
  184. #define CONFIG_ETHPRIME "eTSEC2"
  185. #define CONFIG_PHY_GIGE
  186. #define CONFIG_PHYLIB
  187. #define CONFIG_PHY_ATHEROS
  188. #define CONFIG_HAS_ETH0
  189. #define CONFIG_HAS_ETH1
  190. #define CONFIG_HAS_ETH2
  191. #endif
  192. /* PCIe */
  193. #define CONFIG_PCI /* Enable PCI/PCIE */
  194. #define CONFIG_PCIE1 /* PCIE controler 1 */
  195. #define CONFIG_PCIE2 /* PCIE controler 2 */
  196. /* Use common FSL Layerscape PCIe code */
  197. #define CONFIG_PCIE_LAYERSCAPE
  198. #define FSL_PCIE_COMPAT "fsl,ls1021a-pcie"
  199. #define CONFIG_SYS_PCI_64BIT
  200. #define CONFIG_SYS_PCIE_CFG0_PHYS_OFF 0x00000000
  201. #define CONFIG_SYS_PCIE_CFG0_SIZE 0x00001000 /* 4k */
  202. #define CONFIG_SYS_PCIE_CFG1_PHYS_OFF 0x00001000
  203. #define CONFIG_SYS_PCIE_CFG1_SIZE 0x00001000 /* 4k */
  204. #define CONFIG_SYS_PCIE_IO_BUS 0x00000000
  205. #define CONFIG_SYS_PCIE_IO_PHYS_OFF 0x00010000
  206. #define CONFIG_SYS_PCIE_IO_SIZE 0x00010000 /* 64k */
  207. #define CONFIG_SYS_PCIE_MEM_BUS 0x08000000
  208. #define CONFIG_SYS_PCIE_MEM_PHYS_OFF 0x04000000
  209. #define CONFIG_SYS_PCIE_MEM_SIZE 0x08000000 /* 128M */
  210. #ifdef CONFIG_PCI
  211. #define CONFIG_PCI_PNP
  212. #define CONFIG_PCI_SCAN_SHOW
  213. #define CONFIG_CMD_PCI
  214. #endif
  215. #define CONFIG_CMD_PING
  216. #define CONFIG_CMD_DHCP
  217. #define CONFIG_CMD_MII
  218. #define CONFIG_CMDLINE_TAG
  219. #define CONFIG_CMDLINE_EDITING
  220. #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT)
  221. #undef CONFIG_CMD_IMLS
  222. #endif
  223. #define CONFIG_PEN_ADDR_BIG_ENDIAN
  224. #define CONFIG_LAYERSCAPE_NS_ACCESS
  225. #define CONFIG_SMP_PEN_ADDR 0x01ee0200
  226. #define CONFIG_TIMER_CLK_FREQ 12500000
  227. #define CONFIG_HWCONFIG
  228. #define HWCONFIG_BUFFER_SIZE 256
  229. #define CONFIG_FSL_DEVICE_DISABLE
  230. #define CONFIG_EXTRA_ENV_SETTINGS \
  231. "bootargs=root=/dev/ram0 rw console=ttyS0,115200\0" \
  232. "initrd_high=0xffffffff\0" \
  233. "fdt_high=0xffffffff\0"
  234. /*
  235. * Miscellaneous configurable options
  236. */
  237. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  238. #define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
  239. #define CONFIG_AUTO_COMPLETE
  240. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  241. #define CONFIG_SYS_PBSIZE \
  242. (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
  243. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  244. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  245. #define CONFIG_CMD_GREPENV
  246. #define CONFIG_CMD_MEMINFO
  247. #define CONFIG_SYS_LOAD_ADDR 0x82000000
  248. #define CONFIG_LS102XA_STREAM_ID
  249. /*
  250. * Stack sizes
  251. * The stack sizes are set up in start.S using the settings below
  252. */
  253. #define CONFIG_STACKSIZE (30 * 1024)
  254. #define CONFIG_SYS_INIT_SP_OFFSET \
  255. (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
  256. #define CONFIG_SYS_INIT_SP_ADDR \
  257. (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
  258. #ifdef CONFIG_SPL_BUILD
  259. #define CONFIG_SYS_MONITOR_BASE CONFIG_SPL_TEXT_BASE
  260. #else
  261. /* start of monitor */
  262. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE
  263. #endif
  264. #define CONFIG_SYS_QE_FW_ADDR 0x67f40000
  265. /*
  266. * Environment
  267. */
  268. #define CONFIG_ENV_OVERWRITE
  269. #if defined(CONFIG_SD_BOOT)
  270. #define CONFIG_ENV_OFFSET 0x100000
  271. #define CONFIG_ENV_IS_IN_MMC
  272. #define CONFIG_SYS_MMC_ENV_DEV 0
  273. #define CONFIG_ENV_SIZE 0x2000
  274. #elif defined(CONFIG_QSPI_BOOT)
  275. #define CONFIG_ENV_IS_IN_SPI_FLASH
  276. #define CONFIG_ENV_SIZE 0x2000
  277. #define CONFIG_ENV_OFFSET 0x100000
  278. #define CONFIG_ENV_SECT_SIZE 0x10000
  279. #endif
  280. #define CONFIG_OF_BOARD_SETUP
  281. #define CONFIG_OF_STDOUT_VIA_ALIAS
  282. #define CONFIG_CMD_BOOTZ
  283. #define CONFIG_MISC_INIT_R
  284. /* Hash command with SHA acceleration supported in hardware */
  285. #ifdef CONFIG_FSL_CAAM
  286. #define CONFIG_CMD_HASH
  287. #define CONFIG_SHA_HW_ACCEL
  288. #endif
  289. #include <asm/fsl_secure_boot.h>
  290. #endif