am3517_evm.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. /*
  2. * am3517_evm.h - Default configuration for AM3517 EVM board.
  3. *
  4. * Author: Vaibhav Hiremath <hvaibhav@ti.com>
  5. *
  6. * Based on omap3_evm_config.h
  7. *
  8. * Copyright (C) 2010 Texas Instruments Incorporated
  9. *
  10. * SPDX-License-Identifier: GPL-2.0+
  11. */
  12. #ifndef __CONFIG_H
  13. #define __CONFIG_H
  14. /* High Level Configuration Options */
  15. #define CONFIG_OMAP
  16. #define CONFIG_SYS_NO_FLASH
  17. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  18. /* Common ARM Erratas */
  19. #define CONFIG_ARM_ERRATA_454179
  20. #define CONFIG_ARM_ERRATA_430973
  21. #define CONFIG_ARM_ERRATA_621766
  22. #define CONFIG_EMIF4 /* The chip has EMIF4 controller */
  23. /*
  24. * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  25. * 64 bytes before this address should be set aside for u-boot.img's
  26. * header. That is 0x800FFFC0--0x80100000 should not be used for any
  27. * other needs.
  28. */
  29. #define CONFIG_SYS_TEXT_BASE 0x80100000
  30. #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
  31. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  32. #include <asm/arch/cpu.h> /* get chip and board defs */
  33. #include <asm/arch/omap.h>
  34. #define CONFIG_MISC_INIT_R
  35. #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
  36. #define CONFIG_SETUP_MEMORY_TAGS
  37. #define CONFIG_INITRD_TAG
  38. #define CONFIG_REVISION_TAG
  39. /* Clock Defines */
  40. #define V_OSCK 26000000 /* Clock output from T2 */
  41. #define V_SCLK (V_OSCK >> 1)
  42. /* Size of malloc() pool */
  43. #define CONFIG_SYS_MALLOC_LEN (16 << 20)
  44. /* Hardware drivers */
  45. /* OMAP GPIO configuration */
  46. #define CONFIG_OMAP_GPIO
  47. /* NS16550 Configuration */
  48. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  49. #define CONFIG_SYS_NS16550_SERIAL
  50. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  51. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  52. /* select serial console configuration */
  53. #define CONFIG_CONS_INDEX 3
  54. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  55. #define CONFIG_SERIAL3 3 /* UART3 on AM3517 EVM */
  56. /* allow to overwrite serial and ethaddr */
  57. #define CONFIG_ENV_OVERWRITE
  58. #define CONFIG_BAUDRATE 115200
  59. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\
  60. 115200}
  61. /* SD/MMC */
  62. #define CONFIG_GENERIC_MMC
  63. #define CONFIG_OMAP_HSMMC
  64. #define CONFIG_DOS_PARTITION
  65. /*
  66. * USB configuration
  67. * Enable CONFIG_USB_MUSB_HOST for Host functionalities MSC, keyboard
  68. * Enable CONFIG_USB_MUSB_GADGET for Device functionalities.
  69. */
  70. #define CONFIG_USB_MUSB_AM35X
  71. #define CONFIG_USB_MUSB_PIO_ONLY
  72. #ifdef CONFIG_USB_MUSB_AM35X
  73. #ifdef CONFIG_USB_MUSB_HOST
  74. #define CONGIG_CMD_STORAGE
  75. #ifdef CONFIG_USB_KEYBOARD
  76. #define CONFIG_SYS_USB_EVENT_POLL
  77. #define CONFIG_PREBOOT "usb start"
  78. #endif /* CONFIG_USB_KEYBOARD */
  79. #endif /* CONFIG_USB_MUSB_HOST */
  80. #ifdef CONFIG_USB_MUSB_GADGET
  81. #define CONFIG_USB_ETHER
  82. #define CONFIG_USB_ETH_RNDIS
  83. #endif /* CONFIG_USB_MUSB_GADGET */
  84. #endif /* CONFIG_USB_MUSB_AM35X */
  85. /* commands to include */
  86. #define CONFIG_CMD_NAND
  87. #define CONFIG_CMD_PART
  88. #define CONFIG_CMD_MTDPARTS
  89. /* I2C */
  90. #define CONFIG_SYS_I2C
  91. #define CONFIG_SYS_OMAP24_I2C_SPEED 100000
  92. #define CONFIG_SYS_OMAP24_I2C_SLAVE 1
  93. #define CONFIG_SYS_I2C_OMAP34XX
  94. /* Ethernet */
  95. #define CONFIG_DRIVER_TI_EMAC
  96. #define CONFIG_DRIVER_TI_EMAC_USE_RMII
  97. #define CONFIG_MII
  98. #define CONFIG_BOOTP_DEFAULT
  99. #define CONFIG_BOOTP_DNS
  100. #define CONFIG_BOOTP_DNS2
  101. #define CONFIG_BOOTP_SEND_HOSTNAME
  102. #define CONFIG_NET_RETRY_COUNT 10
  103. /* Board NAND Info. */
  104. #ifdef CONFIG_NAND
  105. #define CONFIG_NAND_OMAP_GPMC
  106. #define CONFIG_NAND_OMAP_GPMC_PREFETCH
  107. #define CONFIG_BCH
  108. #define CONFIG_CMD_UBIFS /* Read-only UBI volume operations */
  109. #define CONFIG_RBTREE /* required by CONFIG_CMD_UBI */
  110. #define CONFIG_LZO /* required by CONFIG_CMD_UBIFS */
  111. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  112. /* to access nand */
  113. #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
  114. /* to access */
  115. /* nand at CS0 */
  116. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
  117. /* NAND devices */
  118. #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
  119. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  120. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  121. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  122. #define CONFIG_SYS_NAND_OOBSIZE 64
  123. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
  124. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  125. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, 10, \
  126. 11, 12, 13, 14, 16, 17, 18, 19, 20, \
  127. 21, 22, 23, 24, 25, 26, 27, 28, 30, \
  128. 31, 32, 33, 34, 35, 36, 37, 38, 39, \
  129. 40, 41, 42, 44, 45, 46, 47, 48, 49, \
  130. 50, 51, 52, 53, 54, 55, 56 }
  131. #define CONFIG_SYS_NAND_ECCSIZE 512
  132. #define CONFIG_SYS_NAND_ECCBYTES 13
  133. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
  134. #define CONFIG_SYS_NAND_MAX_OOBFREE 2
  135. #define CONFIG_SYS_NAND_MAX_ECCPOS 56
  136. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  137. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  138. #define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
  139. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  140. /* NAND block size is 128 KiB. Synchronize these values with
  141. * corresponding Device Tree entries in Linux:
  142. * MLO(SPL) 4 * NAND_BLOCK_SIZE = 512 KiB @ 0x000000
  143. * U-Boot 15 * NAND_BLOCK_SIZE = 1920 KiB @ 0x080000
  144. * U-Boot environment 2 * NAND_BLOCK_SIZE = 256 KiB @ 0x260000
  145. * Kernel 64 * NAND_BLOCK_SIZE = 8 MiB @ 0x2A0000
  146. * DTB 4 * NAND_BLOCK_SIZE = 512 KiB @ 0xAA0000
  147. * RootFS Remaining Flash Space @ 0xB20000
  148. */
  149. #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  150. #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:" \
  151. "512k(MLO)," \
  152. "1920k(u-boot)," \
  153. "256k(u-boot-env)," \
  154. "8m(kernel)," \
  155. "512k(dtb)," \
  156. "-(rootfs)"
  157. #else
  158. #define MTDIDS_DEFAULT
  159. #define MTDPARTS_DEFAULT
  160. #endif /* CONFIG_NAND */
  161. /* Environment information */
  162. #define CONFIG_BOOTFILE "uImage"
  163. #define CONFIG_EXTRA_ENV_SETTINGS \
  164. "loadaddr=0x82000000\0" \
  165. "console=ttyO2,115200n8\0" \
  166. "fdtfile=am3517-evm.dtb\0" \
  167. "fdtaddr=0x82C00000\0" \
  168. "vram=16M\0" \
  169. "bootenv=uEnv.txt\0" \
  170. "cmdline=\0" \
  171. "optargs=\0" \
  172. "mtdids=" MTDIDS_DEFAULT "\0" \
  173. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  174. "mmcdev=0\0" \
  175. "mmcpart=1\0" \
  176. "mmcroot=/dev/mmcblk0p2 rw\0" \
  177. "mmcrootfstype=ext4 rootwait fixrtc\0" \
  178. "mmcargs=setenv bootargs console=${console} " \
  179. "${mtdparts} " \
  180. "${optargs} " \
  181. "root=${mmcroot} " \
  182. "rootfstype=${mmcrootfstype} " \
  183. "${cmdline}\0" \
  184. "nandargs=setenv bootargs console=${console} " \
  185. "${mtdparts} " \
  186. "${optargs} " \
  187. "root=ubi0:rootfs rw ubi.mtd=rootfs " \
  188. "rootfstype=ubifs rootwait " \
  189. "${cmdline}\0" \
  190. "loadbootenv=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootenv}\0"\
  191. "importbootenv=echo Importing environment from mmc ...; " \
  192. "env import -t ${loadaddr} ${filesize}\0" \
  193. "bootscript=echo Running bootscript from mmc ...; " \
  194. "source ${loadaddr}\0" \
  195. "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${bootfile}\0" \
  196. "loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${fdtfile}\0" \
  197. "mmcboot=echo Booting from mmc ...; " \
  198. "run mmcargs; " \
  199. "bootz ${loadaddr} - ${fdtaddr}\0" \
  200. "nandboot=echo Booting from nand ...; " \
  201. "run nandargs; " \
  202. "nand read ${loadaddr} 2a0000 800000; " \
  203. "nand read ${fdtaddr} aa0000 80000; " \
  204. "bootm ${loadaddr} - ${fdtaddr}\0" \
  205. #define CONFIG_BOOTCOMMAND \
  206. "mmc dev ${mmcdev}; if mmc rescan; then " \
  207. "echo SD/MMC found on device $mmcdev; " \
  208. "if run loadbootenv; then " \
  209. "run importbootenv; " \
  210. "fi; " \
  211. "echo Checking if uenvcmd is set ...; " \
  212. "if test -n $uenvcmd; then " \
  213. "echo Running uenvcmd ...; " \
  214. "run uenvcmd; " \
  215. "fi; " \
  216. "echo Running default loadimage ...; " \
  217. "setenv bootfile zImage; " \
  218. "if run loadimage; then " \
  219. "run loadfdt; " \
  220. "run mmcboot; " \
  221. "fi; " \
  222. "else run nandboot; fi"
  223. /* Miscellaneous configurable options */
  224. #define CONFIG_AUTO_COMPLETE
  225. #define CONFIG_CMDLINE_EDITING
  226. #define CONFIG_SYS_LONGHELP
  227. #define CONFIG_PARTITION_UUIDS
  228. /* We set the max number of command args high to avoid HUSH bugs. */
  229. #define CONFIG_SYS_MAXARGS 64
  230. /* Console I/O Buffer Size */
  231. #define CONFIG_SYS_CBSIZE 512
  232. /* Print Buffer Size */
  233. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \
  234. + sizeof(CONFIG_SYS_PROMPT) + 16)
  235. /* Boot Argument Buffer Size */
  236. #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
  237. /* memtest works on */
  238. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  239. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  240. 0x01F00000) /* 31MB */
  241. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load */
  242. /* address */
  243. /*
  244. * AM3517 has 12 GP timers, they can be driven by the system clock
  245. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  246. * This rate is divided by a local divisor.
  247. */
  248. #define CONFIG_SYS_TIMERBASE OMAP34XX_GPT2
  249. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  250. /* Physical Memory Map */
  251. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  252. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  253. #define CONFIG_SYS_CS0_SIZE (256 * 1024 * 1024)
  254. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  255. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  256. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  257. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  258. CONFIG_SYS_INIT_RAM_SIZE - \
  259. GENERATED_GBL_DATA_SIZE)
  260. /* FLASH and environment organization */
  261. /* **** PISMO SUPPORT *** */
  262. #define CONFIG_SYS_MAX_FLASH_SECT 520 /* max number of sectors */
  263. /* on one chip */
  264. #define CONFIG_SYS_MAX_FLASH_BANKS 2 /* max number of flash banks */
  265. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  266. #if defined(CONFIG_NAND)
  267. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  268. #endif
  269. /* Monitor at start of flash */
  270. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  271. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  272. #define CONFIG_ENV_SIZE CONFIG_SYS_ENV_SECT_SIZE
  273. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  274. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  275. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  276. #define CONFIG_ENV_IS_IN_NAND
  277. /* Defines for SPL */
  278. #define CONFIG_SPL_FRAMEWORK
  279. #define CONFIG_SPL_BOARD_INIT
  280. #define CONFIG_SPL_NAND_SIMPLE
  281. #define CONFIG_SPL_TEXT_BASE 0x40200000
  282. #define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \
  283. CONFIG_SPL_TEXT_BASE)
  284. #define CONFIG_SPL_BSS_START_ADDR 0x80000000
  285. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
  286. #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  287. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
  288. #define CONFIG_SPL_NAND_BASE
  289. #define CONFIG_SPL_NAND_DRIVERS
  290. #define CONFIG_SPL_NAND_ECC
  291. #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
  292. #endif /* __CONFIG_H */