am43xx_evm.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * am43xx_evm.h
  4. *
  5. * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  6. */
  7. #ifndef __CONFIG_AM43XX_EVM_H
  8. #define __CONFIG_AM43XX_EVM_H
  9. #define CONFIG_MAX_RAM_BANK_SIZE (1024 << 21) /* 2GB */
  10. #define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
  11. #include <asm/arch/omap.h>
  12. /* NS16550 Configuration */
  13. #define CONFIG_SYS_NS16550_CLK 48000000
  14. #if !defined(CONFIG_SPL_DM) || !defined(CONFIG_DM_SERIAL)
  15. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  16. #define CONFIG_SYS_NS16550_SERIAL
  17. #endif
  18. /* I2C Configuration */
  19. #define CONFIG_ENV_EEPROM_IS_ON_I2C
  20. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
  21. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  22. /* Power */
  23. #if !CONFIG_IS_ENABLED(DM_I2C)
  24. #define CONFIG_POWER
  25. #define CONFIG_POWER_I2C
  26. #endif
  27. #define CONFIG_POWER_TPS65218
  28. #define CONFIG_POWER_TPS62362
  29. /* SPL defines. */
  30. #define CONFIG_SYS_SPL_ARGS_ADDR (CONFIG_SYS_SDRAM_BASE + \
  31. (128 << 20))
  32. /* Enabling L2 Cache */
  33. #define CONFIG_SYS_L2_PL310
  34. #define CONFIG_SYS_PL310_BASE 0x48242000
  35. /*
  36. * Since SPL did pll and ddr initialization for us,
  37. * we don't need to do it twice.
  38. */
  39. #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_QSPI_BOOT)
  40. #define CONFIG_SKIP_LOWLEVEL_INIT
  41. #endif
  42. /*
  43. * When building U-Boot such that there is no previous loader
  44. * we need to call board_early_init_f. This is taken care of in
  45. * s_init when we have SPL used.
  46. */
  47. /* Now bring in the rest of the common code. */
  48. #include <configs/ti_armv7_omap.h>
  49. /* Clock Defines */
  50. #define V_OSCK 24000000 /* Clock output from T2 */
  51. #define V_SCLK (V_OSCK)
  52. /* NS16550 Configuration */
  53. #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
  54. /* SPL USB Support */
  55. #if defined(CONFIG_SPL_USB_HOST) || !defined(CONFIG_SPL_BUILD)
  56. #define CONFIG_SYS_USB_FAT_BOOT_PARTITION 1
  57. #define CONFIG_USB_XHCI_OMAP
  58. #define CONFIG_AM437X_USB2PHY2_HOST
  59. #endif
  60. #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_USB_ETHER)
  61. #undef CONFIG_USB_DWC3_PHY_OMAP
  62. #undef CONFIG_USB_DWC3_OMAP
  63. #undef CONFIG_USB_DWC3
  64. #undef CONFIG_USB_DWC3_GADGET
  65. #undef CONFIG_USB_GADGET_DOWNLOAD
  66. #undef CONFIG_USB_GADGET_VBUS_DRAW
  67. #undef CONFIG_USB_GADGET_MANUFACTURER
  68. #undef CONFIG_USB_GADGET_VENDOR_NUM
  69. #undef CONFIG_USB_GADGET_PRODUCT_NUM
  70. #undef CONFIG_USB_GADGET_DUALSPEED
  71. #endif
  72. /*
  73. * Disable MMC DM for SPL build and can be re-enabled after adding
  74. * DM support in SPL
  75. */
  76. #ifdef CONFIG_SPL_BUILD
  77. #undef CONFIG_TIMER
  78. #endif
  79. #ifndef CONFIG_SPL_BUILD
  80. /* USB Device Firmware Update support */
  81. #define DFUARGS \
  82. "dfu_bufsiz=0x10000\0" \
  83. DFU_ALT_INFO_MMC \
  84. DFU_ALT_INFO_EMMC \
  85. DFU_ALT_INFO_RAM \
  86. DFU_ALT_INFO_QSPI_XIP
  87. #else
  88. #define DFUARGS
  89. #endif
  90. #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
  91. "bootcmd_" #devtypel "=" \
  92. "run nandboot\0"
  93. #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
  94. #devtypel #instance " "
  95. #define BOOT_TARGET_DEVICES(func) \
  96. func(MMC, mmc, 0) \
  97. func(USB, usb, 0) \
  98. func(NAND, nand, 0) \
  99. func(PXE, pxe, na) \
  100. func(DHCP, dhcp, na)
  101. #include <config_distro_bootcmd.h>
  102. #ifndef CONFIG_SPL_BUILD
  103. #include <environment/ti/dfu.h>
  104. #define CONFIG_EXTRA_ENV_SETTINGS \
  105. DEFAULT_LINUX_BOOT_ENV \
  106. "fdtfile=undefined\0" \
  107. "finduuid=part uuid mmc 0:2 uuid\0" \
  108. "console=ttyO0,115200n8\0" \
  109. "partitions=" \
  110. "uuid_disk=${uuid_gpt_disk};" \
  111. "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
  112. "optargs=\0" \
  113. "ramroot=/dev/ram0 rw\0" \
  114. "ramrootfstype=ext2\0" \
  115. "ramargs=setenv bootargs console=${console} " \
  116. "${optargs} " \
  117. "root=${ramroot} " \
  118. "rootfstype=${ramrootfstype}\0" \
  119. "loadramdisk=load ${devtype} ${devnum} ${rdaddr} ramdisk.gz\0" \
  120. "findfdt="\
  121. "if test $board_name = AM43EPOS; then " \
  122. "setenv fdtfile am43x-epos-evm.dtb; fi; " \
  123. "if test $board_name = AM43__GP; then " \
  124. "setenv fdtfile am437x-gp-evm.dtb; fi; " \
  125. "if test $board_name = AM43XXHS; then " \
  126. "setenv fdtfile am437x-gp-evm.dtb; fi; " \
  127. "if test $board_name = AM43__SK; then " \
  128. "setenv fdtfile am437x-sk-evm.dtb; fi; " \
  129. "if test $board_name = AM43_IDK; then " \
  130. "setenv fdtfile am437x-idk-evm.dtb; fi; " \
  131. "if test $fdtfile = undefined; then " \
  132. "echo WARNING: Could not determine device tree; fi; \0" \
  133. NANDARGS \
  134. NETARGS \
  135. DFUARGS \
  136. BOOTENV
  137. #endif
  138. #ifndef CONFIG_SPL_BUILD
  139. /* CPSW Ethernet */
  140. #define CONFIG_NET_RETRY_COUNT 10
  141. #endif
  142. #define PHY_ANEG_TIMEOUT 8000 /* PHY needs longer aneg time at 1G */
  143. #define CONFIG_SYS_RX_ETH_BUFFER 64
  144. /* NAND support */
  145. #ifdef CONFIG_MTD_RAW_NAND
  146. /* NAND: device related configs */
  147. #define CONFIG_SYS_NAND_PAGE_SIZE 4096
  148. #define CONFIG_SYS_NAND_OOBSIZE 224
  149. #define CONFIG_SYS_NAND_BLOCK_SIZE (256*1024)
  150. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  151. CONFIG_SYS_NAND_PAGE_SIZE)
  152. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  153. /* NAND: driver related configs */
  154. #define CONFIG_SYS_NAND_ONFI_DETECTION
  155. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH16_CODE_HW
  156. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  157. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  158. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \
  159. 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, \
  160. 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  161. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \
  162. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \
  163. 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, \
  164. 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \
  165. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \
  166. 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \
  167. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
  168. 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, \
  169. 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, \
  170. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, \
  171. 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, \
  172. 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, \
  173. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, \
  174. 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, \
  175. 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, \
  176. 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \
  177. 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, \
  178. }
  179. #define CONFIG_SYS_NAND_ECCSIZE 512
  180. #define CONFIG_SYS_NAND_ECCBYTES 26
  181. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x00180000
  182. /* NAND: SPL related configs */
  183. /* NAND: SPL falcon mode configs */
  184. #ifdef CONFIG_SPL_OS_BOOT
  185. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00300000 /* kernel offset */
  186. #endif
  187. #define NANDARGS \
  188. "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
  189. "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
  190. "nandargs=setenv bootargs console=${console} " \
  191. "${optargs} " \
  192. "root=${nandroot} " \
  193. "rootfstype=${nandrootfstype}\0" \
  194. "nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,4096\0" \
  195. "nandrootfstype=ubifs rootwait=1\0" \
  196. "nandboot=echo Booting from nand ...; " \
  197. "run nandargs; " \
  198. "nand read ${fdtaddr} NAND.u-boot-spl-os; " \
  199. "nand read ${loadaddr} NAND.kernel; " \
  200. "bootz ${loadaddr} - ${fdtaddr}\0"
  201. #define NANDBOOT "run nandboot; "
  202. #else /* !CONFIG_MTD_RAW_NAND */
  203. #define NANDARGS
  204. #define NANDBOOT
  205. #endif /* CONFIG_MTD_RAW_NAND */
  206. #if defined(CONFIG_TI_SECURE_DEVICE)
  207. /* Avoid relocating onto firewalled area at end of DRAM */
  208. #define CONFIG_PRAM (64 * 1024)
  209. #endif /* CONFIG_TI_SECURE_DEVICE */
  210. #endif /* __CONFIG_AM43XX_EVM_H */