cm_t35.h 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. /*
  2. * (C) Copyright 2011 CompuLab, Ltd.
  3. * Mike Rapoport <mike@compulab.co.il>
  4. * Igor Grinberg <grinberg@compulab.co.il>
  5. *
  6. * Based on omap3_beagle.h
  7. * (C) Copyright 2006-2008
  8. * Texas Instruments.
  9. * Richard Woodruff <r-woodruff2@ti.com>
  10. * Syed Mohammed Khasim <x0khasim@ti.com>
  11. *
  12. * Configuration settings for the CompuLab CM-T35 and CM-T3730 boards
  13. *
  14. * SPDX-License-Identifier: GPL-2.0+
  15. */
  16. #ifndef __CONFIG_H
  17. #define __CONFIG_H
  18. #define CONFIG_SYS_CACHELINE_SIZE 64
  19. /*
  20. * High Level Configuration Options
  21. */
  22. #define CONFIG_OMAP /* in a TI OMAP core */
  23. #define CONFIG_OMAP_GPIO
  24. #define CONFIG_CM_T3X /* working with CM-T35 and CM-T3730 */
  25. /* Common ARM Erratas */
  26. #define CONFIG_ARM_ERRATA_454179
  27. #define CONFIG_ARM_ERRATA_430973
  28. #define CONFIG_ARM_ERRATA_621766
  29. #define CONFIG_SDRC /* The chip has SDRC controller */
  30. #include <asm/arch/cpu.h> /* get chip and board defs */
  31. #include <asm/arch/omap.h>
  32. /* Clock Defines */
  33. #define V_OSCK 26000000 /* Clock output from T2 */
  34. #define V_SCLK (V_OSCK >> 1)
  35. #define CONFIG_MISC_INIT_R
  36. #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
  37. #define CONFIG_SETUP_MEMORY_TAGS
  38. #define CONFIG_INITRD_TAG
  39. #define CONFIG_REVISION_TAG
  40. #define CONFIG_SERIAL_TAG
  41. /*
  42. * Size of malloc() pool
  43. */
  44. #define CONFIG_ENV_SIZE (16 << 10) /* 16 KiB */
  45. /* Sector */
  46. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10))
  47. /*
  48. * Hardware drivers
  49. */
  50. /*
  51. * NS16550 Configuration
  52. */
  53. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  54. #define CONFIG_SYS_NS16550_SERIAL
  55. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  56. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  57. /*
  58. * select serial console configuration
  59. */
  60. #define CONFIG_CONS_INDEX 3
  61. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  62. #define CONFIG_SERIAL3 3 /* UART3 */
  63. /* allow to overwrite serial and ethaddr */
  64. #define CONFIG_ENV_OVERWRITE
  65. #define CONFIG_BAUDRATE 115200
  66. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\
  67. 115200}
  68. #define CONFIG_GENERIC_MMC
  69. #define CONFIG_OMAP_HSMMC
  70. #define CONFIG_DOS_PARTITION
  71. /* USB */
  72. #define CONFIG_USB_OMAP3
  73. #define CONFIG_USB_EHCI
  74. #define CONFIG_USB_EHCI_OMAP
  75. #define CONFIG_USB_MUSB_UDC
  76. #define CONFIG_TWL4030_USB
  77. /* USB device configuration */
  78. #define CONFIG_USB_DEVICE
  79. #define CONFIG_USB_TTY
  80. /* commands to include */
  81. #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */
  82. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  83. #define CONFIG_MTD_PARTITIONS
  84. #define MTDIDS_DEFAULT "nand0=nand"
  85. #define MTDPARTS_DEFAULT "mtdparts=nand:512k(x-loader),"\
  86. "1920k(u-boot),256k(u-boot-env),"\
  87. "4m(kernel),-(fs)"
  88. #define CONFIG_CMD_NAND /* NAND support */
  89. #define CONFIG_SYS_NO_FLASH
  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. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50
  95. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  96. #define CONFIG_SYS_I2C_EEPROM_BUS 0
  97. #define CONFIG_I2C_MULTI_BUS
  98. /*
  99. * TWL4030
  100. */
  101. #define CONFIG_TWL4030_POWER
  102. #define CONFIG_TWL4030_LED
  103. /*
  104. * Board NAND Info.
  105. */
  106. #define CONFIG_NAND_OMAP_GPMC
  107. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  108. /* to access nand */
  109. #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
  110. /* to access nand at */
  111. /* CS0 */
  112. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
  113. /* devices */
  114. /* Environment information */
  115. #define CONFIG_EXTRA_ENV_SETTINGS \
  116. "loadaddr=0x82000000\0" \
  117. "usbtty=cdc_acm\0" \
  118. "console=ttyO2,115200n8\0" \
  119. "mpurate=500\0" \
  120. "vram=12M\0" \
  121. "dvimode=1024x768MR-16@60\0" \
  122. "defaultdisplay=dvi\0" \
  123. "mmcdev=0\0" \
  124. "mmcroot=/dev/mmcblk0p2 rw\0" \
  125. "mmcrootfstype=ext4 rootwait\0" \
  126. "nandroot=/dev/mtdblock4 rw\0" \
  127. "nandrootfstype=ubifs\0" \
  128. "mmcargs=setenv bootargs console=${console} " \
  129. "mpurate=${mpurate} " \
  130. "vram=${vram} " \
  131. "omapfb.mode=dvi:${dvimode} " \
  132. "omapdss.def_disp=${defaultdisplay} " \
  133. "root=${mmcroot} " \
  134. "rootfstype=${mmcrootfstype}\0" \
  135. "nandargs=setenv bootargs console=${console} " \
  136. "mpurate=${mpurate} " \
  137. "vram=${vram} " \
  138. "omapfb.mode=dvi:${dvimode} " \
  139. "omapdss.def_disp=${defaultdisplay} " \
  140. "root=${nandroot} " \
  141. "rootfstype=${nandrootfstype}\0" \
  142. "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  143. "bootscript=echo Running bootscript from mmc ...; " \
  144. "source ${loadaddr}\0" \
  145. "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
  146. "mmcboot=echo Booting from mmc ...; " \
  147. "run mmcargs; " \
  148. "bootm ${loadaddr}\0" \
  149. "nandboot=echo Booting from nand ...; " \
  150. "run nandargs; " \
  151. "nand read ${loadaddr} 2a0000 400000; " \
  152. "bootm ${loadaddr}\0" \
  153. #define CONFIG_BOOTCOMMAND \
  154. "mmc dev ${mmcdev}; if mmc rescan; then " \
  155. "if run loadbootscript; then " \
  156. "run bootscript; " \
  157. "else " \
  158. "if run loaduimage; then " \
  159. "run mmcboot; " \
  160. "else run nandboot; " \
  161. "fi; " \
  162. "fi; " \
  163. "else run nandboot; fi"
  164. /*
  165. * Miscellaneous configurable options
  166. */
  167. #define CONFIG_AUTO_COMPLETE
  168. #define CONFIG_CMDLINE_EDITING
  169. #define CONFIG_TIMESTAMP
  170. #define CONFIG_SYS_AUTOLOAD "no"
  171. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  172. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  173. /* Print Buffer Size */
  174. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  175. sizeof(CONFIG_SYS_PROMPT) + 16)
  176. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  177. /* Boot Argument Buffer Size */
  178. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  179. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0) /* memtest */
  180. /* works on */
  181. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  182. 0x01F00000) /* 31MB */
  183. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default */
  184. /* load address */
  185. /*
  186. * OMAP3 has 12 GP timers, they can be driven by the system clock
  187. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  188. * This rate is divided by a local divisor.
  189. */
  190. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  191. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  192. /*-----------------------------------------------------------------------
  193. * Physical Memory Map
  194. */
  195. #define CONFIG_NR_DRAM_BANKS 1 /* CS1 is never populated */
  196. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  197. /*-----------------------------------------------------------------------
  198. * FLASH and environment organization
  199. */
  200. /* **** PISMO SUPPORT *** */
  201. /* Monitor at start of flash */
  202. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  203. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  204. #define CONFIG_ENV_IS_IN_NAND
  205. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  206. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  207. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  208. #if defined(CONFIG_CMD_NET)
  209. #define CONFIG_SMC911X
  210. #define CONFIG_SMC911X_32_BIT
  211. #define CM_T3X_SMC911X_BASE 0x2C000000
  212. #define SB_T35_SMC911X_BASE (CM_T3X_SMC911X_BASE + (16 << 20))
  213. #define CONFIG_SMC911X_BASE CM_T3X_SMC911X_BASE
  214. #endif /* (CONFIG_CMD_NET) */
  215. /* additions for new relocation code, must be added to all boards */
  216. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  217. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  218. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  219. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  220. CONFIG_SYS_INIT_RAM_SIZE - \
  221. GENERATED_GBL_DATA_SIZE)
  222. /* Status LED */
  223. #define CONFIG_STATUS_LED /* Status LED enabled */
  224. #define CONFIG_BOARD_SPECIFIC_LED
  225. #define CONFIG_GPIO_LED
  226. #define GREEN_LED_GPIO 186 /* CM-T35 Green LED is GPIO186 */
  227. #define GREEN_LED_DEV 0
  228. #define STATUS_LED_BIT GREEN_LED_GPIO
  229. #define STATUS_LED_STATE STATUS_LED_ON
  230. #define STATUS_LED_PERIOD (CONFIG_SYS_HZ / 2)
  231. #define STATUS_LED_BOOT GREEN_LED_DEV
  232. #define CONFIG_SPLASHIMAGE_GUARD
  233. /* GPIO banks */
  234. #ifdef CONFIG_STATUS_LED
  235. #define CONFIG_OMAP3_GPIO_6 /* GPIO186 is in GPIO bank 6 */
  236. #endif
  237. /* Display Configuration */
  238. #define CONFIG_OMAP3_GPIO_2
  239. #define CONFIG_OMAP3_GPIO_5
  240. #define CONFIG_VIDEO_OMAP3
  241. #define LCD_BPP LCD_COLOR16
  242. #define CONFIG_SPLASH_SCREEN
  243. #define CONFIG_SPLASH_SOURCE
  244. #define CONFIG_CMD_BMP
  245. #define CONFIG_BMP_16BPP
  246. #define CONFIG_SCF0403_LCD
  247. #define CONFIG_OMAP3_SPI
  248. /* Defines for SPL */
  249. #define CONFIG_SPL_FRAMEWORK
  250. #define CONFIG_SPL_NAND_SIMPLE
  251. #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  252. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
  253. #define CONFIG_SPL_BOARD_INIT
  254. #define CONFIG_SPL_NAND_BASE
  255. #define CONFIG_SPL_NAND_DRIVERS
  256. #define CONFIG_SPL_NAND_ECC
  257. #define CONFIG_SPL_OMAP3_ID_NAND
  258. #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
  259. /* NAND boot config */
  260. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  261. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  262. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  263. #define CONFIG_SYS_NAND_OOBSIZE 64
  264. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
  265. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  266. /*
  267. * Use the ECC/OOB layout from omap_gpmc.h that matches your chip:
  268. * SP vs LP, 8bit vs 16bit: GPMC_NAND_HW_ECC_LAYOUT
  269. */
  270. #define CONFIG_SYS_NAND_ECCPOS { 1, 2, 3, 4, 5, 6, 7, 8, 9, \
  271. 10, 11, 12 }
  272. #define CONFIG_SYS_NAND_ECCSIZE 512
  273. #define CONFIG_SYS_NAND_ECCBYTES 3
  274. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
  275. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  276. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  277. #define CONFIG_SPL_TEXT_BASE 0x40200800
  278. #define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \
  279. CONFIG_SPL_TEXT_BASE)
  280. /*
  281. * Use 0x80008000 as TEXT_BASE here for compatibility reasons with the
  282. * older x-loader implementations. And move the BSS area so that it
  283. * doesn't overlap with TEXT_BASE.
  284. */
  285. #define CONFIG_SYS_TEXT_BASE 0x80008000
  286. #define CONFIG_SPL_BSS_START_ADDR 0x80100000
  287. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
  288. #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
  289. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  290. /* EEPROM */
  291. #define CONFIG_CMD_EEPROM
  292. #define CONFIG_ENV_EEPROM_IS_ON_I2C
  293. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1
  294. #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 4
  295. #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 5
  296. #define CONFIG_SYS_EEPROM_SIZE 256
  297. #define CONFIG_CMD_EEPROM_LAYOUT
  298. #define CONFIG_EEPROM_LAYOUT_HELP_STRING "legacy, v1, v2, v3"
  299. #endif /* __CONFIG_H */