am3517_evm.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * am3517_evm.h - Default configuration for AM3517 EVM board.
  4. *
  5. * Author: Vaibhav Hiremath <hvaibhav@ti.com>
  6. *
  7. * Based on omap3_evm_config.h
  8. *
  9. * Copyright (C) 2010 Texas Instruments Incorporated
  10. */
  11. #ifndef __CONFIG_H
  12. #define __CONFIG_H
  13. #include <configs/ti_omap3_common.h>
  14. #define CONFIG_REVISION_TAG
  15. /* Hardware drivers */
  16. /* allow to overwrite serial and ethaddr */
  17. #define CONFIG_ENV_OVERWRITE
  18. /*
  19. * USB configuration
  20. * Enable CONFIG_USB_MUSB_HOST for Host functionalities MSC, keyboard
  21. * Enable CONFIG_USB_MUSB_GADGET for Device functionalities.
  22. */
  23. #ifdef CONFIG_SPL_BUILD
  24. #undef CONFIG_USB_EHCI_OMAP
  25. #else
  26. #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 57
  27. #endif
  28. /* I2C */
  29. /* Ethernet */
  30. #define CONFIG_DRIVER_TI_EMAC_USE_RMII
  31. #define CONFIG_BOOTP_DEFAULT
  32. #define CONFIG_BOOTP_SEND_HOSTNAME
  33. #define CONFIG_NET_RETRY_COUNT 10
  34. /* Board NAND Info. */
  35. #ifdef CONFIG_MTD_RAW_NAND
  36. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  37. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  38. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  39. #define CONFIG_SYS_NAND_OOBSIZE 64
  40. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
  41. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  42. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, 10, \
  43. 11, 12, 13, 14, 16, 17, 18, 19, 20, \
  44. 21, 22, 23, 24, 25, 26, 27, 28, 30, \
  45. 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  46. 40, 41, 42, 44, 45, 46, 47, 48, 49, \
  47. 50, 51, 52, 53, 54, 55, 56 }
  48. #define CONFIG_SYS_NAND_ECCSIZE 512
  49. #define CONFIG_SYS_NAND_ECCBYTES 13
  50. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
  51. #define CONFIG_SYS_NAND_MAX_OOBFREE 2
  52. #define CONFIG_SYS_NAND_MAX_ECCPOS 56
  53. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  54. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  55. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000
  56. /* NAND block size is 128 KiB. Synchronize these values with
  57. * corresponding Device Tree entries in Linux:
  58. * MLO(SPL) 4 * NAND_BLOCK_SIZE = 512 KiB @ 0x000000
  59. * U-Boot 15 * NAND_BLOCK_SIZE = 1920 KiB @ 0x080000
  60. * U-Boot environment 2 * NAND_BLOCK_SIZE = 256 KiB @ 0x260000
  61. * Kernel 64 * NAND_BLOCK_SIZE = 8 MiB @ 0x2A0000
  62. * DTB 4 * NAND_BLOCK_SIZE = 512 KiB @ 0xAA0000
  63. * RootFS Remaining Flash Space @ 0xB20000
  64. */
  65. #endif /* CONFIG_MTD_RAW_NAND */
  66. /* Environment information */
  67. #define CONFIG_BOOTFILE "uImage"
  68. #define CONFIG_EXTRA_ENV_SETTINGS \
  69. "loadaddr=0x82000000\0" \
  70. "console=ttyS2,115200n8\0" \
  71. "fdtfile=am3517-evm.dtb\0" \
  72. "fdtaddr=0x82C00000\0" \
  73. "vram=16M\0" \
  74. "bootenv=uEnv.txt\0" \
  75. "cmdline=\0" \
  76. "optargs=\0" \
  77. "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
  78. "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
  79. "mmcdev=0\0" \
  80. "mmcpart=1\0" \
  81. "mmcroot=/dev/mmcblk0p2 rw\0" \
  82. "mmcrootfstype=ext4 rootwait fixrtc\0" \
  83. "mmcargs=setenv bootargs console=${console} " \
  84. "${mtdparts} " \
  85. "${optargs} " \
  86. "root=${mmcroot} " \
  87. "rootfstype=${mmcrootfstype} " \
  88. "${cmdline}\0" \
  89. "nandargs=setenv bootargs console=${console} " \
  90. "${mtdparts} " \
  91. "${optargs} " \
  92. "root=ubi0:rootfs rw ubi.mtd=rootfs " \
  93. "rootfstype=ubifs rootwait " \
  94. "${cmdline}\0" \
  95. "loadbootenv=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootenv}\0"\
  96. "importbootenv=echo Importing environment from mmc ...; " \
  97. "env import -t ${loadaddr} ${filesize}\0" \
  98. "bootscript=echo Running bootscript from mmc ...; " \
  99. "source ${loadaddr}\0" \
  100. "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootfile}\0" \
  101. "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${fdtfile}\0" \
  102. "mmcboot=echo Booting from mmc ...; " \
  103. "run mmcargs; " \
  104. "bootz ${loadaddr} - ${fdtaddr}\0" \
  105. "nandboot=echo Booting from nand ...; " \
  106. "run nandargs; " \
  107. "nand read ${loadaddr} 2a0000 800000; " \
  108. "nand read ${fdtaddr} aa0000 80000; " \
  109. "bootm ${loadaddr} - ${fdtaddr}\0" \
  110. #define CONFIG_BOOTCOMMAND \
  111. "mmc dev ${mmcdev}; if mmc rescan; then " \
  112. "echo SD/MMC found on device $mmcdev; " \
  113. "if run loadbootenv; then " \
  114. "run importbootenv; " \
  115. "fi; " \
  116. "echo Checking if uenvcmd is set ...; " \
  117. "if test -n $uenvcmd; then " \
  118. "echo Running uenvcmd ...; " \
  119. "run uenvcmd; " \
  120. "fi; " \
  121. "echo Running default loadimage ...; " \
  122. "setenv bootfile zImage; " \
  123. "if run loadimage; then " \
  124. "run loadfdt; " \
  125. "run mmcboot; " \
  126. "fi; " \
  127. "else run nandboot; fi"
  128. /* Miscellaneous configurable options */
  129. /* We set the max number of command args high to avoid HUSH bugs. */
  130. #define CONFIG_SYS_MAXARGS 64
  131. /* Print Buffer Size */
  132. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \
  133. + sizeof(CONFIG_SYS_PROMPT) + 16)
  134. /* Boot Argument Buffer Size */
  135. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  136. /* memtest works on */
  137. /* Physical Memory Map */
  138. #define CONFIG_SYS_CS0_SIZE (256 * 1024 * 1024)
  139. /* FLASH and environment organization */
  140. /* **** PISMO SUPPORT *** */
  141. #define CONFIG_SYS_MAX_FLASH_SECT 520 /* max number of sectors */
  142. /* on one chip */
  143. #define CONFIG_SYS_MAX_FLASH_BANKS 2 /* max number of flash banks */
  144. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  145. #if defined(CONFIG_MTD_RAW_NAND)
  146. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  147. #endif
  148. /* Monitor at start of flash */
  149. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  150. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  151. /* Defines for SPL */
  152. #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  153. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
  154. #define CONFIG_SPL_NAND_BASE
  155. #define CONFIG_SPL_NAND_DRIVERS
  156. #define CONFIG_SPL_NAND_ECC
  157. #endif /* __CONFIG_H */