am335x_evm.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. /*
  2. * am335x_evm.h
  3. *
  4. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation version 2.
  9. *
  10. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  11. * kind, whether express or implied; without even the implied warranty
  12. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef __CONFIG_AM335X_EVM_H
  16. #define __CONFIG_AM335X_EVM_H
  17. #include <configs/ti_am335x_common.h>
  18. #define CONFIG_SYS_MEMTEST_START 0x80000000
  19. #define CONFIG_SYS_MEMTEST_END 0x9fffffff
  20. #ifndef CONFIG_SPL_BUILD
  21. # define CONFIG_TIMESTAMP
  22. # define CONFIG_LZO
  23. #endif
  24. #define CONFIG_SYS_BOOTM_LEN (16 << 20)
  25. #define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */
  26. #define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM
  27. #define CONFIG_BOARD_LATE_INIT
  28. /* Clock Defines */
  29. #define V_OSCK 24000000 /* Clock output from T2 */
  30. #define V_SCLK (V_OSCK)
  31. /* Custom script for NOR */
  32. #define CONFIG_SYS_LDSCRIPT "board/ti/am335x/u-boot.lds"
  33. /* Always 128 KiB env size */
  34. #define CONFIG_ENV_SIZE (256 << 10)//(128 << 10)/*++++ vern,set up environment,20180710 ---*/
  35. /* Enhance our eMMC support / experience. */
  36. #define CONFIG_CMD_GPT
  37. #define CONFIG_EFI_PARTITION
  38. #ifdef CONFIG_NAND
  39. /*++++ vern,set up environment,20161127 +++*/
  40. /*#define CONFIG_ENV_IS_IN_NAND *//*++++ vern,set up environment,20161127 ---*/
  41. #define NANDARGS \
  42. "bootargs=console=ttyS0,115200n8 mem=512M root=/dev/ram0 rw rootfstype=ext4 initrd=0x81000000,128M ramdisk_size=134217728\0" \
  43. "ipaddr=192.168.1.10\0" \
  44. "serverip=192.168.1.1\0" \
  45. "gatewayip=192.168.1.1\0" \
  46. "netmask=255.255.255.0\0" \
  47. "nandboot=" \
  48. "nand read 0x80F80000 0x00300000 0x00080000;" \
  49. "nand read 0x85200000 0x00400000 0x00A00000;" \
  50. "nand read 0x81000000 0x03000000 0x03000000;" \
  51. "bootz 0x85200000 - 0x80F80000\0"
  52. /*
  53. #define NANDARGS \
  54. "mtdids=" MTDIDS_DEFAULT "\0" \
  55. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  56. "nandargs=setenv bootargs console=${console} " \
  57. "${optargs} " \
  58. "root=${nandroot} " \
  59. "rootfstype=${nandrootfstype}\0" \
  60. "nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048\0" \
  61. "nandrootfstype=ubifs rootwait=1\0" \
  62. "nandboot=echo Booting from nand ...; " \
  63. "run nandargs; " \
  64. "nand read ${fdtaddr} NAND.u-boot-spl-os; " \
  65. "nand read ${loadaddr} NAND.kernel; " \
  66. "bootz ${loadaddr} - ${fdtaddr}\0"
  67. */
  68. /*--- vern,set up environment,20161127 ---*/
  69. #else
  70. #define NANDARGS ""
  71. #endif
  72. #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  73. #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
  74. "bootcmd_" #devtypel #instance "=" \
  75. "setenv mmcdev " #instance"; "\
  76. "setenv bootpart " #instance":2 ; "\
  77. "run mmcboot\0"
  78. #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
  79. #devtypel #instance " "
  80. #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
  81. "bootcmd_" #devtypel "=" \
  82. "run nandboot\0"
  83. #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
  84. #devtypel #instance " "
  85. #define BOOT_TARGET_DEVICES(func) \
  86. func(MMC, mmc, 0) \
  87. func(LEGACY_MMC, legacy_mmc, 0) \
  88. func(MMC, mmc, 1) \
  89. func(LEGACY_MMC, legacy_mmc, 1) \
  90. func(NAND, nand, 0) \
  91. func(PXE, pxe, na) \
  92. func(DHCP, dhcp, na)
  93. /*++++ vern,set up environment,20161127 +++*/
  94. #define CONFIG_BOOTCOMMAND "run nandboot;"
  95. /*
  96. #define CONFIG_BOOTCOMMAND \
  97. "if test ${boot_fit} -eq 1; then " \
  98. "run update_to_fit;" \
  99. "fi;" \
  100. "run findfdt; " \
  101. "run init_console; " \
  102. "run envboot; " \
  103. "run distro_bootcmd"
  104. */
  105. /*--- vern,set up environment,20161127 ---*/
  106. #include <config_distro_bootcmd.h>
  107. #ifndef CONFIG_SPL_BUILD
  108. #include <environment/ti/dfu.h>
  109. #include <environment/ti/mmc.h>
  110. /*++++ vern,set up environment,20161127 +++*/
  111. #define CONFIG_EXTRA_ENV_SETTINGS NANDARGS
  112. /*
  113. #define CONFIG_EXTRA_ENV_SETTINGS \
  114. DEFAULT_LINUX_BOOT_ENV \
  115. DEFAULT_MMC_TI_ARGS \
  116. DEFAULT_FIT_TI_ARGS \
  117. "bootpart=0:2\0" \
  118. "bootdir=/boot\0" \
  119. "bootfile=zImage\0" \
  120. "fdtfile=undefined\0" \
  121. "console=ttyO0,115200n8\0" \
  122. "partitions=" \
  123. "uuid_disk=${uuid_gpt_disk};" \
  124. "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
  125. "optargs=\0" \
  126. "ramroot=/dev/ram0 rw\0" \
  127. "ramrootfstype=ext2\0" \
  128. "spiroot=/dev/mtdblock4 rw\0" \
  129. "spirootfstype=jffs2\0" \
  130. "spisrcaddr=0xe0000\0" \
  131. "spiimgsize=0x362000\0" \
  132. "spibusno=0\0" \
  133. "spiargs=setenv bootargs console=${console} " \
  134. "${optargs} " \
  135. "root=${spiroot} " \
  136. "rootfstype=${spirootfstype}\0" \
  137. "ramargs=setenv bootargs console=${console} " \
  138. "${optargs} " \
  139. "root=${ramroot} " \
  140. "rootfstype=${ramrootfstype}\0" \
  141. "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
  142. "spiboot=echo Booting from spi ...; " \
  143. "run spiargs; " \
  144. "sf probe ${spibusno}:0; " \
  145. "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
  146. "bootz ${loadaddr}\0" \
  147. "ramboot=echo Booting from ramdisk ...; " \
  148. "run ramargs; " \
  149. "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
  150. "findfdt="\
  151. "if test $board_name = A335BONE; then " \
  152. "setenv fdtfile am335x-bone.dtb; fi; " \
  153. "if test $board_name = A335BNLT; then " \
  154. "setenv fdtfile am335x-boneblack.dtb; fi; " \
  155. "if test $board_name = BBG1; then " \
  156. "setenv fdtfile am335x-bonegreen.dtb; fi; " \
  157. "if test $board_name = A33515BB; then " \
  158. "setenv fdtfile am335x-evm.dtb; fi; " \
  159. "if test $board_name = A335X_SK; then " \
  160. "setenv fdtfile am335x-evmsk.dtb; fi; " \
  161. "if test $board_name = A335_ICE; then " \
  162. "setenv fdtfile am335x-icev2.dtb; fi; " \
  163. "if test $fdtfile = undefined; then " \
  164. "echo WARNING: Could not determine device tree to use; fi; \0" \
  165. "init_console=" \
  166. "if test $board_name = A335_ICE; then "\
  167. "setenv console ttyO3,115200n8;" \
  168. "else " \
  169. "setenv console ttyO0,115200n8;" \
  170. "fi;\0" \
  171. NANDARGS \
  172. NETARGS \
  173. DFUARGS \
  174. BOOTENV
  175. */
  176. /*--- vern,set up environment,20161127 ---*/
  177. #endif
  178. /* NS16550 Configuration */
  179. #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
  180. #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
  181. #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
  182. #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
  183. #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
  184. #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
  185. #define CONFIG_BAUDRATE 115200
  186. #define CONFIG_CMD_EEPROM
  187. #define CONFIG_ENV_EEPROM_IS_ON_I2C
  188. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
  189. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  190. /* PMIC support */
  191. #define CONFIG_POWER_TPS65217
  192. #define CONFIG_POWER_TPS65910
  193. /* SPL */
  194. #ifndef CONFIG_NOR_BOOT
  195. /* Bootcount using the RTC block */
  196. #define CONFIG_BOOTCOUNT_LIMIT
  197. #define CONFIG_BOOTCOUNT_AM33XX
  198. #define CONFIG_SYS_BOOTCOUNT_BE
  199. /* USB gadget RNDIS */
  200. #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
  201. #endif
  202. #ifdef CONFIG_NAND
  203. /* NAND: device related configs */
  204. #if defined(MT29F8G08_BCH16)
  205. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  206. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \
  207. 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, \
  208. 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  209. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \
  210. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \
  211. 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, \
  212. 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \
  213. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \
  214. 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \
  215. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
  216. 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, \
  217. 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, \
  218. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, \
  219. 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, \
  220. 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, \
  221. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, \
  222. 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, \
  223. 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, \
  224. 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \
  225. 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, }
  226. #define CONFIG_SYS_NAND_ECCBYTES 26
  227. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH16_CODE_HW
  228. #define CONFIG_SYS_NAND_OOBSIZE 256//64 /*++++ vern,NAND,20161127 ---*/
  229. #define CONFIG_SYS_NAND_PAGE_SIZE 4096//2048 /*++++ vern,NAND,20161127 ---*/
  230. #define CONFIG_SYS_NAND_BLOCK_SIZE (64*4096)//(128*1024)/*++++ vern,NAND,20161127 ---*/
  231. #elif defined(MT29F16G08_BCH16)
  232. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  233. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \
  234. 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, \
  235. 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  236. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \
  237. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \
  238. 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, \
  239. 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \
  240. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \
  241. 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \
  242. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
  243. 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, \
  244. 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, \
  245. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, \
  246. 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, \
  247. 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, \
  248. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, \
  249. 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, \
  250. 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, \
  251. 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \
  252. 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, }
  253. #define CONFIG_SYS_NAND_ECCBYTES 26
  254. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH16_CODE_HW
  255. #define CONFIG_SYS_NAND_OOBSIZE 224//64 /*++++ vern,NAND,20161127 ---*/
  256. #define CONFIG_SYS_NAND_PAGE_SIZE 4096//2048 /*++++ vern,NAND,20161127 ---*/
  257. #define CONFIG_SYS_NAND_BLOCK_SIZE (64*4096)//(128*1024)/*++++ vern,NAND,20161127 ---*/
  258. #elif defined(MT29F16G08)
  259. #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, \
  260. 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, \
  261. 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  262. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, \
  263. 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, \
  264. 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, \
  265. 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, \
  266. 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \
  267. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
  268. 110, 111, 112, 113 }
  269. #define CONFIG_SYS_NAND_ECCBYTES 14
  270. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
  271. #define CONFIG_SYS_NAND_OOBSIZE 224//64 /*++++ vern,NAND,20161127 ---*/
  272. #define CONFIG_SYS_NAND_PAGE_SIZE 4096//2048 /*++++ vern,NAND,20161127 ---*/
  273. #define CONFIG_SYS_NAND_BLOCK_SIZE (64*4096)//(128*1024)/*++++ vern,NAND,20161127 ---*/
  274. #else
  275. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  276. 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, \
  277. 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, \
  278. 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  279. 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, \
  280. 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, \
  281. 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, \
  282. 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, \
  283. 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, \
  284. 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, \
  285. 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, \
  286. 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, \
  287. 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, \
  288. 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, \
  289. 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, \
  290. 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, \
  291. 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, \
  292. 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, \
  293. 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, \
  294. 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, \
  295. 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, }
  296. #define CONFIG_SYS_NAND_ECCBYTES 26
  297. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH16_CODE_HW
  298. #define CONFIG_SYS_NAND_OOBSIZE 224//64 /*++++ vern,NAND,20161127 ---*/
  299. #define CONFIG_SYS_NAND_PAGE_SIZE 4096//2048 /*++++ vern,NAND,20161127 ---*/
  300. #define CONFIG_SYS_NAND_BLOCK_SIZE (64*4096)//(128*1024)/*++++ vern,NAND,20161127 ---*/
  301. #endif
  302. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  303. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  304. CONFIG_SYS_NAND_PAGE_SIZE)
  305. #define CONFIG_SYS_NAND_ECCSIZE 512
  306. /* NAND: driver related configs */
  307. #define CONFIG_NAND_OMAP_GPMC
  308. #define CONFIG_NAND_OMAP_GPMC_PREFETCH
  309. #define CONFIG_NAND_OMAP_ELM
  310. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  311. /*++++ vern,NAND,20161127 +++*/
  312. /*--- vern,NAND,20161127 ---*/
  313. #define CONFIG_SYS_NAND_ONFI_DETECTION
  314. #define MTDIDS_DEFAULT "nand0=nand.0"
  315. /*++++ vern,set up environment,20161127 +++*/
  316. /*
  317. #define MTDPARTS_DEFAULT "mtdparts=nand.0:" \
  318. "128k(NAND.SPL)," \
  319. "128k(NAND.SPL.backup1)," \
  320. "128k(NAND.SPL.backup2)," \
  321. "128k(NAND.SPL.backup3)," \
  322. "256k(NAND.u-boot-spl-os)," \
  323. "1m(NAND.u-boot)," \
  324. "128k(NAND.u-boot-env)," \
  325. "128k(NAND.u-boot-env.backup1)," \
  326. "8m(NAND.kernel)," \
  327. "-(NAND.file-system)"
  328. */
  329. /*#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000*/
  330. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x00080000
  331. /*--- vern,set up environment,20161127 ---*/
  332. /* NAND: SPL related configs */
  333. #ifdef CONFIG_SPL_NAND_SUPPORT
  334. #define CONFIG_SPL_NAND_AM33XX_BCH
  335. #endif
  336. #ifdef CONFIG_SPL_OS_BOOT
  337. #define CONFIG/*++++ vern,set up environment,20161127 +++*/
  338. /*#define CONFIG_CMD_SPL_NAND_OFS 0x00080000 *//* os parameters */
  339. #define CONFIG_CMD_SPL_NAND_OFS 0x00300000 /* os parameters */
  340. /*#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 *//* kernel offset */
  341. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00400000 /* kernel offset */
  342. /*--- vern,set up environment,20161127 ---*/
  343. #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
  344. #endif
  345. #endif /* !CONFIG_NAND */
  346. /*
  347. * For NOR boot, we must set this to the start of where NOR is mapped
  348. * in memory.
  349. */
  350. #ifdef CONFIG_NOR_BOOT
  351. #define CONFIG_SYS_TEXT_BASE 0x08000000
  352. #endif
  353. /*
  354. * USB configuration. We enable MUSB support, both for host and for
  355. * gadget. We set USB0 as peripheral and USB1 as host, based on the
  356. * board schematic and physical port wired to each. Then for host we
  357. * add mass storage support and for gadget we add both RNDIS ethernet
  358. * and DFU.
  359. */
  360. #define CONFIG_USB_MUSB_DSPS
  361. #define CONFIG_ARCH_MISC_INIT
  362. #define CONFIG_USB_MUSB_PIO_ONLY
  363. #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
  364. #define CONFIG_AM335X_USB0
  365. #define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
  366. #define CONFIG_AM335X_USB1
  367. #define CONFIG_AM335X_USB1_MODE MUSB_HOST
  368. #ifndef CONFIG_SPL_USBETH_SUPPORT
  369. /* Fastboot */
  370. #define CONFIG_USB_FUNCTION_FASTBOOT
  371. #define CONFIG_CMD_FASTBOOT
  372. #define CONFIG_ANDROID_BOOT_IMAGE
  373. #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
  374. #define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
  375. #define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
  376. #endif
  377. #ifdef CONFIG_USB_MUSB_GADGET
  378. #define CONFIG_USB_ETHER
  379. #define CONFIG_USB_ETH_RNDIS
  380. #define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
  381. #endif /* CONFIG_USB_MUSB_GADGET */
  382. /*
  383. * Disable MMC DM for SPL build and can be re-enabled after adding
  384. * DM support in SPL
  385. */
  386. #ifdef CONFIG_SPL_BUILD
  387. #undef CONFIG_DM_MMC
  388. #undef CONFIG_TIMER
  389. #undef CONFIG_DM_USB
  390. #undef CONFIG_DM_NAND
  391. #endif
  392. #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
  393. /* disable host part of MUSB in SPL */
  394. /* disable EFI partitions and partition UUID support */
  395. #undef CONFIG_PARTITION_UUIDS
  396. #undef CONFIG_EFI_PARTITION
  397. #endif
  398. /* USB Device Firmware Update support */
  399. #ifndef CONFIG_SPL_BUILD
  400. #define DFUARGS \
  401. "dfu_alt_info_emmc=rawemmc raw 0 3751936\0" \
  402. DFU_ALT_INFO_MMC \
  403. DFU_ALT_INFO_RAM \
  404. DFU_ALT_INFO_NAND
  405. #endif
  406. /*
  407. * Default to using SPI for environment, etc.
  408. * 0x000000 - 0x020000 : SPL (128KiB)
  409. * 0x020000 - 0x0A0000 : U-Boot (512KiB)
  410. * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB)
  411. * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB)
  412. * 0x0E0000 - 0x442000 : Linux Kernel
  413. * 0x442000 - 0x800000 : Userland
  414. */
  415. #if defined(CONFIG_SPI_BOOT)
  416. /* SPL related */
  417. #define CONFIG_SPL_SPI_LOAD
  418. #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
  419. #define CONFIG_ENV_IS_IN_SPI_FLASH
  420. #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
  421. #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
  422. #define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
  423. #define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */
  424. #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */
  425. #define MTDIDS_DEFAULT "nor0=m25p80-flash.0"
  426. #define MTDPARTS_DEFAULT "mtdparts=m25p80-flash.0:128k(SPL)," \
  427. "512k(u-boot),128k(u-boot-env1)," \
  428. "128k(u-boot-env2),3464k(kernel)," \
  429. "-(rootfs)"
  430. #elif defined(CONFIG_EMMC_BOOT)
  431. #define CONFIG_ENV_IS_IN_MMC
  432. #define CONFIG_SYS_MMC_ENV_DEV 1
  433. #define CONFIG_SYS_MMC_ENV_PART 2
  434. #define CONFIG_ENV_OFFSET 0x0
  435. #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
  436. #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
  437. #elif defined(CONFIG_NOR_BOOT)
  438. #define CONFIG_ENV_IS_IN_FLASH
  439. #define CONFIG_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  440. #define CONFIG_ENV_OFFSET (512 << 10) /* 512 KiB */
  441. #define CONFIG_ENV_OFFSET_REDUND (768 << 10) /* 768 KiB */
  442. #define MTDIDS_DEFAULT "nor0=physmap-flash.0"
  443. #define MTDPARTS_DEFAULT "mtdparts=physmap-flash.0:" \
  444. "512k(u-boot)," \
  445. "128k(u-boot-env1)," \
  446. "128k(u-boot-env2)," \
  447. "4m(kernel),-(rootfs)"
  448. #elif defined(CONFIG_ENV_IS_IN_NAND)
  449. /*++++ vern,set up environment,20161127 +++*/
  450. /*#define CONFIG_ENV_OFFSET 0x001c0000*/
  451. #define CONFIG_ENV_OFFSET 0x00180000
  452. /*#define CONFIG_ENV_OFFSET_REDUND 0x001e0000*/
  453. /*--- vern,set up environment,20161127 ---*/
  454. #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
  455. #elif !defined(CONFIG_ENV_IS_NOWHERE)
  456. /* Not NAND, SPI, NOR or eMMC env, so put ENV in a file on FAT */
  457. //#define CONFIG_ENV_IS_IN_FAT /*++++ vern,set up environment,20180710 ---*/
  458. #define FAT_ENV_INTERFACE "mmc"
  459. #define FAT_ENV_DEVICE_AND_PART "0:1"
  460. #define FAT_ENV_FILE "uboot.env"
  461. #endif
  462. /* SPI flash. */
  463. #define CONFIG_SF_DEFAULT_SPEED 24000000
  464. /* Network. */
  465. #define CONFIG_PHY_GIGE
  466. #define CONFIG_PHYLIB
  467. #define CONFIG_PHY_SMSC
  468. /* Enable Atheros phy driver */
  469. #define CONFIG_PHY_ATHEROS
  470. /*
  471. * NOR Size = 16 MiB
  472. * Number of Sectors/Blocks = 128
  473. * Sector Size = 128 KiB
  474. * Word length = 16 bits
  475. * Default layout:
  476. * 0x000000 - 0x07FFFF : U-Boot (512 KiB)
  477. * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB)
  478. * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB)
  479. * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB)
  480. * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB)
  481. */
  482. #if defined(CONFIG_NOR)
  483. #undef CONFIG_SYS_NO_FLASH
  484. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  485. #define CONFIG_SYS_FLASH_PROTECTION
  486. #define CONFIG_SYS_FLASH_CFI
  487. #define CONFIG_FLASH_CFI_DRIVER
  488. #define CONFIG_FLASH_CFI_MTD
  489. #define CONFIG_SYS_MAX_FLASH_SECT 128
  490. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  491. #define CONFIG_SYS_FLASH_BASE (0x08000000)
  492. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
  493. #define CONFIG_SYS_FLASH_SIZE 0x01000000
  494. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  495. #endif /* NOR support */
  496. #ifdef CONFIG_DRIVER_TI_CPSW
  497. #define CONFIG_CLOCK_SYNTHESIZER
  498. #define CLK_SYNTHESIZER_I2C_ADDR 0x65
  499. #endif
  500. #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_TI_SECURE_DEVICE)
  501. #undef CONFIG_EFI_PARTITION
  502. #endif /* CONFIG_SPL_BUILD && CONFIG_TI_SECURE_DEVICE */
  503. #endif /* ! __CONFIG_AM335X_EVM_H */