cm_t3517.h 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. /*
  2. * (C) Copyright 2013 CompuLab, Ltd.
  3. * Author: Igor Grinberg <grinberg@compulab.co.il>
  4. *
  5. * Configuration settings for the CompuLab CM-T3517 board
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #ifndef __CONFIG_H
  10. #define __CONFIG_H
  11. /*
  12. * High Level Configuration Options
  13. */
  14. #define CONFIG_OMAP /* in a TI OMAP core */
  15. #define CONFIG_CM_T3517 /* working with CM-T3517 */
  16. /* Common ARM Erratas */
  17. #define CONFIG_ARM_ERRATA_454179
  18. #define CONFIG_ARM_ERRATA_430973
  19. #define CONFIG_ARM_ERRATA_621766
  20. #define CONFIG_SYS_TEXT_BASE 0x80008000
  21. /*
  22. * This is needed for the DMA stuff.
  23. * Although the default iss 64, we still define it
  24. * to be on the safe side once the default is changed.
  25. */
  26. #define CONFIG_EMIF4 /* The chip has EMIF4 controller */
  27. #include <asm/arch/cpu.h> /* get chip and board defs */
  28. #include <asm/arch/omap.h>
  29. #define CONFIG_MACH_TYPE MACH_TYPE_CM_T3517
  30. /* Clock Defines */
  31. #define V_OSCK 26000000 /* Clock output from T2 */
  32. #define V_SCLK (V_OSCK >> 1)
  33. #define CONFIG_MISC_INIT_R
  34. /*
  35. * The early kernel mapping on ARM currently only maps from the base of DRAM
  36. * to the end of the kernel image. The kernel is loaded at DRAM base + 0x8000.
  37. * The early kernel pagetable uses DRAM base + 0x4000 to DRAM base + 0x8000,
  38. * so that leaves DRAM base to DRAM base + 0x4000 available.
  39. */
  40. #define CONFIG_SYS_BOOTMAPSZ 0x4000
  41. #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
  42. #define CONFIG_SETUP_MEMORY_TAGS
  43. #define CONFIG_INITRD_TAG
  44. #define CONFIG_REVISION_TAG
  45. #define CONFIG_SERIAL_TAG
  46. /*
  47. * Size of malloc() pool
  48. */
  49. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
  50. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10))
  51. /*
  52. * Hardware drivers
  53. */
  54. /*
  55. * NS16550 Configuration
  56. */
  57. #define CONFIG_SYS_NS16550_SERIAL
  58. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  59. #define CONFIG_SYS_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  60. /*
  61. * select serial console configuration
  62. */
  63. #define CONFIG_CONS_INDEX 3
  64. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  65. #define CONFIG_SERIAL3 3 /* UART3 */
  66. /* allow to overwrite serial and ethaddr */
  67. #define CONFIG_ENV_OVERWRITE
  68. #define CONFIG_BAUDRATE 115200
  69. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\
  70. 115200}
  71. #define CONFIG_OMAP_GPIO
  72. #define CONFIG_GENERIC_MMC
  73. #define CONFIG_OMAP_HSMMC
  74. #define CONFIG_DOS_PARTITION
  75. /* USB */
  76. #define CONFIG_USB_MUSB_AM35X
  77. #ifndef CONFIG_USB_MUSB_AM35X
  78. #define CONFIG_USB_OMAP3
  79. #define CONFIG_USB_EHCI
  80. #define CONFIG_USB_EHCI_OMAP
  81. #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 146
  82. #define CONFIG_OMAP_EHCI_PHY2_RESET_GPIO 147
  83. #else /* !CONFIG_USB_MUSB_AM35X */
  84. #define CONFIG_USB_MUSB_PIO_ONLY
  85. #endif /* CONFIG_USB_MUSB_AM35X */
  86. /* commands to include */
  87. #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */
  88. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  89. #define CONFIG_MTD_PARTITIONS
  90. #define MTDIDS_DEFAULT "nand0=nand"
  91. #define MTDPARTS_DEFAULT "mtdparts=nand:512k(x-loader),"\
  92. "1920k(u-boot),256k(u-boot-env),"\
  93. "4m(kernel),-(fs)"
  94. #define CONFIG_CMD_NAND /* NAND support */
  95. #define CONFIG_SYS_NO_FLASH
  96. #define CONFIG_SYS_I2C
  97. #define CONFIG_SYS_OMAP24_I2C_SPEED 400000
  98. #define CONFIG_SYS_OMAP24_I2C_SLAVE 1
  99. #define CONFIG_SYS_I2C_OMAP34XX
  100. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
  101. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  102. #define CONFIG_SYS_I2C_EEPROM_BUS 0
  103. #define CONFIG_I2C_MULTI_BUS
  104. /*
  105. * Board NAND Info.
  106. */
  107. #define CONFIG_NAND_OMAP_GPMC
  108. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  109. /* to access nand */
  110. #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
  111. /* to access nand at */
  112. /* CS0 */
  113. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
  114. /* devices */
  115. /* Environment information */
  116. #define CONFIG_EXTRA_ENV_SETTINGS \
  117. "loadaddr=0x82000000\0" \
  118. "baudrate=115200\0" \
  119. "console=ttyO2,115200n8\0" \
  120. "netretry=yes\0" \
  121. "mpurate=auto\0" \
  122. "vram=12M\0" \
  123. "dvimode=1024x768MR-16@60\0" \
  124. "defaultdisplay=dvi\0" \
  125. "mmcdev=0\0" \
  126. "mmcroot=/dev/mmcblk0p2 rw rootwait\0" \
  127. "mmcrootfstype=ext4\0" \
  128. "nandroot=/dev/mtdblock4 rw\0" \
  129. "nandrootfstype=ubifs\0" \
  130. "mmcargs=setenv bootargs console=${console} " \
  131. "mpurate=${mpurate} " \
  132. "vram=${vram} " \
  133. "omapfb.mode=dvi:${dvimode} " \
  134. "omapdss.def_disp=${defaultdisplay} " \
  135. "root=${mmcroot} " \
  136. "rootfstype=${mmcrootfstype}\0" \
  137. "nandargs=setenv bootargs console=${console} " \
  138. "mpurate=${mpurate} " \
  139. "vram=${vram} " \
  140. "omapfb.mode=dvi:${dvimode} " \
  141. "omapdss.def_disp=${defaultdisplay} " \
  142. "root=${nandroot} " \
  143. "rootfstype=${nandrootfstype}\0" \
  144. "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  145. "bootscript=echo Running bootscript from mmc ...; " \
  146. "source ${loadaddr}\0" \
  147. "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
  148. "mmcboot=echo Booting from mmc ...; " \
  149. "run mmcargs; " \
  150. "bootm ${loadaddr}\0" \
  151. "nandboot=echo Booting from nand ...; " \
  152. "run nandargs; " \
  153. "nand read ${loadaddr} 2a0000 400000; " \
  154. "bootm ${loadaddr}\0" \
  155. #define CONFIG_BOOTCOMMAND \
  156. "mmc dev ${mmcdev}; if mmc rescan; then " \
  157. "if run loadbootscript; then " \
  158. "run bootscript; " \
  159. "else " \
  160. "if run loaduimage; then " \
  161. "run mmcboot; " \
  162. "else run nandboot; " \
  163. "fi; " \
  164. "fi; " \
  165. "else run nandboot; fi"
  166. /*
  167. * Miscellaneous configurable options
  168. */
  169. #define CONFIG_AUTO_COMPLETE
  170. #define CONFIG_CMDLINE_EDITING
  171. #define CONFIG_TIMESTAMP
  172. #define CONFIG_SYS_AUTOLOAD "no"
  173. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  174. #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
  175. /* Print Buffer Size */
  176. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  177. sizeof(CONFIG_SYS_PROMPT) + 16)
  178. #define CONFIG_SYS_MAXARGS 32 /* max number of command args */
  179. /* Boot Argument Buffer Size */
  180. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  181. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0 + 0x02000000)
  182. /*
  183. * AM3517 has 12 GP timers, they can be driven by the system clock
  184. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  185. * This rate is divided by a local divisor.
  186. */
  187. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  188. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  189. #define CONFIG_SYS_HZ 1000
  190. /*-----------------------------------------------------------------------
  191. * Physical Memory Map
  192. */
  193. #define CONFIG_NR_DRAM_BANKS 1 /* CM-T3517 DRAM is only on CS0 */
  194. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  195. #define CONFIG_SYS_CS0_SIZE (256 << 20)
  196. /*-----------------------------------------------------------------------
  197. * FLASH and environment organization
  198. */
  199. /* **** PISMO SUPPORT *** */
  200. /* Monitor at start of flash */
  201. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  202. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  203. #define CONFIG_ENV_IS_IN_NAND
  204. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  205. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  206. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  207. #if defined(CONFIG_CMD_NET)
  208. #define CONFIG_DRIVER_TI_EMAC
  209. #define CONFIG_DRIVER_TI_EMAC_USE_RMII
  210. #define CONFIG_MII
  211. #define CONFIG_SMC911X
  212. #define CONFIG_SMC911X_32_BIT
  213. #define CONFIG_SMC911X_BASE (0x2C000000 + (16 << 20))
  214. #define CONFIG_ARP_TIMEOUT 200UL
  215. #define CONFIG_NET_RETRY_COUNT 5
  216. #endif /* CONFIG_CMD_NET */
  217. /* additions for new relocation code, must be added to all boards */
  218. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  219. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  220. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  221. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  222. CONFIG_SYS_INIT_RAM_SIZE - \
  223. GENERATED_GBL_DATA_SIZE)
  224. /* Status LED */
  225. #define CONFIG_STATUS_LED /* Status LED enabled */
  226. #define CONFIG_BOARD_SPECIFIC_LED
  227. #define CONFIG_GPIO_LED
  228. #define GREEN_LED_GPIO 186 /* CM-T3517 Green LED is GPIO186 */
  229. #define GREEN_LED_DEV 0
  230. #define STATUS_LED_BIT GREEN_LED_GPIO
  231. #define STATUS_LED_STATE STATUS_LED_ON
  232. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
  233. #define STATUS_LED_BOOT GREEN_LED_DEV
  234. /* GPIO banks */
  235. #ifdef CONFIG_STATUS_LED
  236. #define CONFIG_OMAP3_GPIO_6 /* GPIO186 is in GPIO bank 6 */
  237. #endif
  238. /* Display Configuration */
  239. #define CONFIG_OMAP3_GPIO_2
  240. #define CONFIG_OMAP3_GPIO_5
  241. #define CONFIG_VIDEO_OMAP3
  242. #define LCD_BPP LCD_COLOR16
  243. #define CONFIG_SPLASH_SCREEN
  244. #define CONFIG_SPLASHIMAGE_GUARD
  245. #define CONFIG_CMD_BMP
  246. #define CONFIG_BMP_16BPP
  247. #define CONFIG_SCF0403_LCD
  248. #define CONFIG_OMAP3_SPI
  249. /* EEPROM */
  250. #define CONFIG_CMD_EEPROM
  251. #define CONFIG_ENV_EEPROM_IS_ON_I2C
  252. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  253. #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4
  254. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
  255. #define CONFIG_SYS_EEPROM_SIZE 256
  256. #define CONFIG_CMD_EEPROM_LAYOUT
  257. #define CONFIG_EEPROM_LAYOUT_HELP_STRING "v1, v2, v3"
  258. #endif /* __CONFIG_H */