am3517_crane.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /*
  2. * am3517_crane.h - Default configuration for AM3517 CraneBoard.
  3. *
  4. * Author: Srinath.R <srinath@mistralsolutions.com>
  5. *
  6. * Based on include/configs/am3517evm.h
  7. *
  8. * Copyright (C) 2011 Mistral Solutions pvt Ltd
  9. *
  10. * SPDX-License-Identifier: GPL-2.0+
  11. */
  12. #ifndef __CONFIG_H
  13. #define __CONFIG_H
  14. /*
  15. * High Level Configuration Options
  16. */
  17. #define CONFIG_OMAP 1 /* in a TI OMAP core */
  18. #define CONFIG_OMAP3_AM3517CRANE 1 /* working with CRANEBOARD */
  19. /* Common ARM Erratas */
  20. #define CONFIG_ARM_ERRATA_454179
  21. #define CONFIG_ARM_ERRATA_430973
  22. #define CONFIG_ARM_ERRATA_621766
  23. #define CONFIG_EMIF4 /* The chip has EMIF4 controller */
  24. #include <asm/arch/cpu.h> /* get chip and board defs */
  25. #include <asm/arch/omap.h>
  26. /* Clock Defines */
  27. #define V_OSCK 26000000 /* Clock output from T2 */
  28. #define V_SCLK (V_OSCK >> 1)
  29. #define CONFIG_MISC_INIT_R
  30. #define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
  31. #define CONFIG_SETUP_MEMORY_TAGS 1
  32. #define CONFIG_INITRD_TAG 1
  33. #define CONFIG_REVISION_TAG 1
  34. /*
  35. * Size of malloc() pool
  36. */
  37. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB sector */
  38. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10))
  39. /* initial data */
  40. /*
  41. * DDR related
  42. */
  43. #define CONFIG_SYS_CS0_SIZE (256 * 1024 * 1024)
  44. /*
  45. * Hardware drivers
  46. */
  47. /*
  48. * NS16550 Configuration
  49. */
  50. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  51. #define CONFIG_SYS_NS16550_SERIAL
  52. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  53. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  54. /*
  55. * select serial console configuration
  56. */
  57. #define CONFIG_CONS_INDEX 3
  58. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  59. #define CONFIG_SERIAL3 3 /* UART3 on CRANEBOARD */
  60. /* allow to overwrite serial and ethaddr */
  61. #define CONFIG_ENV_OVERWRITE
  62. #define CONFIG_BAUDRATE 115200
  63. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\
  64. 115200}
  65. #define CONFIG_GENERIC_MMC 1
  66. #define CONFIG_OMAP_HSMMC 1
  67. #define CONFIG_DOS_PARTITION 1
  68. /*
  69. * USB configuration
  70. * Enable CONFIG_USB_MUSB_HCD for Host functionalities MSC, keyboard
  71. * Enable CONFIG_USB_MUSB_UDC for Device functionalities.
  72. */
  73. #define CONFIG_USB_AM35X 1
  74. #define CONFIG_USB_MUSB_HCD 1
  75. #ifdef CONFIG_USB_AM35X
  76. #ifdef CONFIG_USB_MUSB_HCD
  77. #define CONGIG_CMD_STORAGE
  78. #ifdef CONFIG_USB_KEYBOARD
  79. #define CONFIG_SYS_USB_EVENT_POLL
  80. #define CONFIG_PREBOOT "usb start"
  81. #endif /* CONFIG_USB_KEYBOARD */
  82. #endif /* CONFIG_USB_MUSB_HCD */
  83. #ifdef CONFIG_USB_MUSB_UDC
  84. /* USB device configuration */
  85. #define CONFIG_USB_DEVICE 1
  86. #define CONFIG_USB_TTY 1
  87. /* Change these to suit your needs */
  88. #define CONFIG_USBD_VENDORID 0x0451
  89. #define CONFIG_USBD_PRODUCTID 0x5678
  90. #define CONFIG_USBD_MANUFACTURER "Texas Instruments"
  91. #define CONFIG_USBD_PRODUCT_NAME "AM3517CRANE"
  92. #endif /* CONFIG_USB_MUSB_UDC */
  93. #endif /* CONFIG_USB_AM35X */
  94. /* commands to include */
  95. #define CONFIG_CMD_JFFS2 /* JFFS2 Support */
  96. #define CONFIG_CMD_NAND /* NAND support */
  97. #define CONFIG_SYS_NO_FLASH
  98. #define CONFIG_SYS_I2C
  99. #define CONFIG_SYS_OMAP24_I2C_SPEED 100000
  100. #define CONFIG_SYS_OMAP24_I2C_SLAVE 1
  101. #define CONFIG_SYS_I2C_OMAP34XX
  102. /*
  103. * Board NAND Info.
  104. */
  105. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  106. /* to access nand */
  107. #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
  108. /* to access */
  109. /* nand at CS0 */
  110. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
  111. /* NAND devices */
  112. #define CONFIG_JFFS2_NAND
  113. /* nand device jffs2 lives on */
  114. #define CONFIG_JFFS2_DEV "nand0"
  115. /* start of jffs2 partition */
  116. #define CONFIG_JFFS2_PART_OFFSET 0x680000
  117. #define CONFIG_JFFS2_PART_SIZE 0xf980000 /* sz of jffs2 part */
  118. /* Environment information */
  119. #define CONFIG_BOOTFILE "uImage"
  120. #define CONFIG_EXTRA_ENV_SETTINGS \
  121. "loadaddr=0x82000000\0" \
  122. "console=ttyS2,115200n8\0" \
  123. "mmcdev=0\0" \
  124. "mmcargs=setenv bootargs console=${console} " \
  125. "root=/dev/mmcblk0p2 rw " \
  126. "rootfstype=ext3 rootwait\0" \
  127. "nandargs=setenv bootargs console=${console} " \
  128. "root=/dev/mtdblock4 rw " \
  129. "rootfstype=jffs2\0" \
  130. "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  131. "bootscript=echo Running bootscript from mmc ...; " \
  132. "source ${loadaddr}\0" \
  133. "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
  134. "mmcboot=echo Booting from mmc ...; " \
  135. "run mmcargs; " \
  136. "bootm ${loadaddr}\0" \
  137. "nandboot=echo Booting from nand ...; " \
  138. "run nandargs; " \
  139. "nand read ${loadaddr} 280000 400000; " \
  140. "bootm ${loadaddr}\0" \
  141. #define CONFIG_BOOTCOMMAND \
  142. "mmc dev ${mmcdev}; if mmc rescan; then " \
  143. "if run loadbootscript; then " \
  144. "run bootscript; " \
  145. "else " \
  146. "if run loaduimage; then " \
  147. "run mmcboot; " \
  148. "else run nandboot; " \
  149. "fi; " \
  150. "fi; " \
  151. "else run nandboot; fi"
  152. #define CONFIG_AUTO_COMPLETE 1
  153. /*
  154. * Miscellaneous configurable options
  155. */
  156. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  157. #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
  158. /* Print Buffer Size */
  159. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  160. sizeof(CONFIG_SYS_PROMPT) + 16)
  161. #define CONFIG_SYS_MAXARGS 32 /* max number of command */
  162. /* args */
  163. /* Boot Argument Buffer Size */
  164. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  165. /* memtest works on */
  166. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  167. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  168. 0x01F00000) /* 31MB */
  169. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load */
  170. /* address */
  171. /*
  172. * AM3517 has 12 GP timers, they can be driven by the system clock
  173. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  174. * This rate is divided by a local divisor.
  175. */
  176. #define CONFIG_SYS_TIMERBASE OMAP34XX_GPT2
  177. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  178. /*-----------------------------------------------------------------------
  179. * Physical Memory Map
  180. */
  181. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  182. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  183. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  184. /*-----------------------------------------------------------------------
  185. * FLASH and environment organization
  186. */
  187. /* **** PISMO SUPPORT *** */
  188. #define CONFIG_SYS_MAX_FLASH_SECT 520 /* max number of sectors */
  189. /* on one chip */
  190. #define CONFIG_SYS_MAX_FLASH_BANKS 2 /* max number of flash banks */
  191. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  192. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  193. /* Monitor at start of flash */
  194. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  195. #define CONFIG_NAND_OMAP_GPMC
  196. #define CONFIG_ENV_IS_IN_NAND 1
  197. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  198. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB sector */
  199. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  200. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  201. /*-----------------------------------------------------------------------
  202. * CFI FLASH driver setup
  203. */
  204. /* timeout values are in ticks */
  205. #define CONFIG_SYS_FLASH_ERASE_TOUT (100 * CONFIG_SYS_HZ)
  206. #define CONFIG_SYS_FLASH_WRITE_TOUT (100 * CONFIG_SYS_HZ)
  207. /* Flash banks JFFS2 should use */
  208. #define CONFIG_SYS_MAX_MTD_BANKS (CONFIG_SYS_MAX_FLASH_BANKS + \
  209. CONFIG_SYS_MAX_NAND_DEVICE)
  210. #define CONFIG_SYS_JFFS2_MEM_NAND
  211. /* use flash_info[2] */
  212. #define CONFIG_SYS_JFFS2_FIRST_BANK CONFIG_SYS_MAX_FLASH_BANKS
  213. #define CONFIG_SYS_JFFS2_NUM_BANKS 1
  214. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  215. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  216. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  217. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  218. CONFIG_SYS_INIT_RAM_SIZE - \
  219. GENERATED_GBL_DATA_SIZE)
  220. /* Defines for SPL */
  221. #define CONFIG_SPL_FRAMEWORK
  222. #define CONFIG_SPL_BOARD_INIT
  223. #define CONFIG_SPL_NAND_SIMPLE
  224. #define CONFIG_SPL_TEXT_BASE 0x40200800
  225. #define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \
  226. CONFIG_SPL_TEXT_BASE)
  227. #define CONFIG_SPL_BSS_START_ADDR 0x80000000
  228. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
  229. #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  230. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
  231. #define CONFIG_SPL_NAND_BASE
  232. #define CONFIG_SPL_NAND_DRIVERS
  233. #define CONFIG_SPL_NAND_ECC
  234. #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
  235. /* NAND boot config */
  236. #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
  237. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  238. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  239. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  240. #define CONFIG_SYS_NAND_OOBSIZE 64
  241. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  242. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  243. #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
  244. 10, 11, 12, 13}
  245. #define CONFIG_SYS_NAND_ECCSIZE 512
  246. #define CONFIG_SYS_NAND_ECCBYTES 3
  247. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
  248. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  249. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  250. /*
  251. * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  252. * 64 bytes before this address should be set aside for u-boot.img's
  253. * header. That is 0x800FFFC0--0x80100000 should not be used for any
  254. * other needs.
  255. */
  256. #define CONFIG_SYS_TEXT_BASE 0x80100000
  257. #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
  258. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  259. #endif /* __CONFIG_H */