am43xx_evm.h 6.2 KB

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