tao3530.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. /*
  2. * Configuration settings for the TechNexion TAO-3530 SOM
  3. * equipped on Thunder baseboard.
  4. *
  5. * Edward Lin <linuxfae@technexion.com>
  6. * Tapani Utriainen <linuxfae@technexion.com>
  7. *
  8. * Copyright (C) 2013 Stefan Roese <sr@denx.de>
  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 /* in a TI OMAP core */
  18. #define CONFIG_OMAP_GPIO
  19. /* Common ARM Erratas */
  20. #define CONFIG_ARM_ERRATA_454179
  21. #define CONFIG_ARM_ERRATA_430973
  22. #define CONFIG_ARM_ERRATA_621766
  23. #define MACH_TYPE_OMAP3_TAO3530 2836
  24. #define CONFIG_SDRC /* Has an SDRC controller */
  25. #include <asm/arch/cpu.h> /* get chip and board defs */
  26. #include <asm/arch/omap.h>
  27. /* Clock Defines */
  28. #define V_OSCK 26000000 /* Clock output from T2 */
  29. #define V_SCLK (V_OSCK >> 1)
  30. #define CONFIG_MISC_INIT_R
  31. #define CONFIG_CMDLINE_TAG
  32. #define CONFIG_SETUP_MEMORY_TAGS
  33. #define CONFIG_INITRD_TAG
  34. #define CONFIG_REVISION_TAG
  35. /*
  36. * Size of malloc() pool
  37. */
  38. #define CONFIG_SYS_MALLOC_LEN (4 << 20)
  39. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB sector */
  40. /*
  41. * Hardware drivers
  42. */
  43. /*
  44. * NS16550 Configuration
  45. */
  46. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  47. #define CONFIG_SYS_NS16550_SERIAL
  48. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  49. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  50. /*
  51. * select serial console configuration
  52. */
  53. #define CONFIG_CONS_INDEX 3
  54. #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
  55. /* allow to overwrite serial and ethaddr */
  56. #define CONFIG_ENV_OVERWRITE
  57. #define CONFIG_BAUDRATE 115200
  58. #define CONFIG_GENERIC_MMC
  59. #define CONFIG_OMAP_HSMMC
  60. #define CONFIG_DOS_PARTITION
  61. /* GPIO banks */
  62. #define CONFIG_OMAP3_GPIO_2 /* GPIO32 ..63 is in GPIO bank 2 */
  63. #define CONFIG_OMAP3_GPIO_3 /* GPIO64 ..95 is in GPIO bank 3 */
  64. #define CONFIG_OMAP3_GPIO_4 /* GPIO96 ..127 is in GPIO bank 4 */
  65. #define CONFIG_OMAP3_GPIO_5 /* GPIO128..159 is in GPIO bank 5 */
  66. #define CONFIG_OMAP3_GPIO_6 /* GPIO160..191 is in GPIO bank 6 */
  67. /* commands to include */
  68. #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */
  69. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  70. #define MTDIDS_DEFAULT "nand0=nand"
  71. #define MTDPARTS_DEFAULT "mtdparts=nand:512k(x-loader),"\
  72. "1920k(u-boot),128k(u-boot-env),"\
  73. "4m(kernel),-(fs)"
  74. #define CONFIG_CMD_NAND /* NAND support */
  75. #define CONFIG_SYS_NO_FLASH
  76. #define CONFIG_SYS_I2C
  77. #define CONFIG_SYS_I2C_OMAP34XX
  78. #define CONFIG_SYS_OMAP24_I2C_SPEED 100000
  79. #define CONFIG_SYS_OMAP24_I2C_SLAVE 1
  80. #define CONFIG_I2C_MULTI_BUS
  81. /*
  82. * TWL4030
  83. */
  84. #define CONFIG_TWL4030_POWER
  85. #define CONFIG_TWL4030_LED
  86. /*
  87. * Board NAND Info.
  88. */
  89. #define CONFIG_NAND_OMAP_GPMC
  90. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  91. /* to access nand */
  92. #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
  93. /* to access nand at */
  94. /* CS0 */
  95. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
  96. /* devices */
  97. #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
  98. /* Environment information */
  99. #define CONFIG_EXTRA_ENV_SETTINGS \
  100. "loadaddr=0x82000000\0" \
  101. "console=ttyO2,115200n8\0" \
  102. "mpurate=600\0" \
  103. "dvi_mode=omapfb.mode=dvi:1280x720-24@60\0" \
  104. "tv_mode=omapfb.mode=tv:ntsc\0" \
  105. "video_mode=omapdss.def_disp=lcd vram=6M omapfb.vram=0:2M,1:2M,2:2M\0" \
  106. "lcd_mode=omapfb.mode=lcd:800x480@60 \0" \
  107. "extra_options= \0" \
  108. "mmcdev=0\0" \
  109. "mmcroot=/dev/mmcblk0p2 rw\0" \
  110. "mmcrootfstype=ext3 rootwait\0" \
  111. "nandroot=ubi0:rootfs ubi.mtd=4\0" \
  112. "nandrootfstype=ubifs\0" \
  113. "mmcargs=setenv bootargs console=${console} " \
  114. "mpurate=${mpurate} " \
  115. "${video_mode} " \
  116. "root=${mmcroot} " \
  117. "rootfstype=${mmcrootfstype} " \
  118. "${extra_options}\0" \
  119. "nandargs=setenv bootargs console=${console} " \
  120. "mpurate=${mpurate} " \
  121. "${video_mode} " \
  122. "${network_setting} " \
  123. "root=${nandroot} " \
  124. "rootfstype=${nandrootfstype} "\
  125. "${extra_options}\0" \
  126. "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  127. "bootscript=echo Running bootscript from mmc ...; " \
  128. "source ${loadaddr}\0" \
  129. "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
  130. "mmcboot=echo Booting from mmc ...; " \
  131. "run mmcargs; " \
  132. "bootm ${loadaddr}\0" \
  133. "nandboot=echo Booting from nand ...; " \
  134. "run nandargs; " \
  135. "nand read ${loadaddr} 280000 400000; " \
  136. "bootm ${loadaddr}\0" \
  137. #define CONFIG_BOOTCOMMAND \
  138. "if mmc rescan ${mmcdev}; then " \
  139. "if run loadbootscript; then " \
  140. "run bootscript; " \
  141. "else " \
  142. "if run loaduimage; then " \
  143. "run mmcboot; " \
  144. "else run nandboot; " \
  145. "fi; " \
  146. "fi; " \
  147. "else run nandboot; fi"
  148. /*
  149. * Miscellaneous configurable options
  150. */
  151. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  152. #define CONFIG_SYS_CBSIZE 256 /* Console I/O Buffer Size */
  153. /* turn on command-line edit/hist/auto */
  154. #define CONFIG_CMDLINE_EDITING
  155. #define CONFIG_COMMAND_HISTORY
  156. #define CONFIG_AUTO_COMPLETE
  157. /* Print Buffer Size */
  158. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  159. sizeof(CONFIG_SYS_PROMPT) + 16)
  160. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  161. /* Boot Argument Buffer Size */
  162. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  163. #define CONFIG_SYS_ALT_MEMTEST 1
  164. #define CONFIG_SYS_MEMTEST_START (0x82000000) /* memtest */
  165. /* defaults */
  166. #define CONFIG_SYS_MEMTEST_END (0x83FFFFFF) /* 64MB */
  167. #define CONFIG_SYS_MEMTEST_SCRATCH (0x81000000) /* dummy address */
  168. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default */
  169. /* load address */
  170. #define CONFIG_SYS_TEXT_BASE 0x80008000
  171. /*
  172. * OMAP3 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. * Stack sizes
  180. *
  181. * The stack sizes are set up in start.S using the settings below
  182. */
  183. #define CONFIG_STACKSIZE (128 << 10) /* regular stack 128 KiB */
  184. /*
  185. * Physical Memory Map
  186. */
  187. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  188. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  189. #define PHYS_SDRAM_1_SIZE (32 << 20) /* at least 32 MiB */
  190. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  191. /*
  192. * FLASH and environment organization
  193. */
  194. /* **** PISMO SUPPORT *** */
  195. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  196. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  197. /* Monitor at start of flash */
  198. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  199. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  200. #define CONFIG_ENV_IS_IN_NAND 1
  201. #define ONENAND_ENV_OFFSET 0x260000 /* environment starts here */
  202. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  203. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10)
  204. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  205. #define CONFIG_ENV_ADDR CONFIG_ENV_OFFSET
  206. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  207. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  208. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  209. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  210. CONFIG_SYS_INIT_RAM_SIZE - \
  211. GENERATED_GBL_DATA_SIZE)
  212. #define CONFIG_OMAP3_SPI
  213. /*
  214. * USB
  215. *
  216. * Currently only EHCI is enabled, the MUSB OTG controller
  217. * is not enabled.
  218. */
  219. /* USB EHCI */
  220. #define CONFIG_USB_EHCI
  221. #define CONFIG_USB_EHCI_OMAP
  222. #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 162
  223. #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
  224. #define CONFIG_USB_HOST_ETHER
  225. #define CONFIG_USB_ETHER_SMSC95XX
  226. #define CONFIG_USB_ETHER
  227. #define CONFIG_USB_ETHER_RNDIS
  228. #define CONGIG_CMD_STORAGE
  229. /* Defines for SPL */
  230. #define CONFIG_SPL_FRAMEWORK
  231. #define CONFIG_SPL_NAND_SIMPLE
  232. #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
  233. #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
  234. #define CONFIG_SPL_BOARD_INIT
  235. #define CONFIG_SPL_NAND_BASE
  236. #define CONFIG_SPL_NAND_DRIVERS
  237. #define CONFIG_SPL_NAND_ECC
  238. #define CONFIG_SPL_OMAP3_ID_NAND
  239. #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
  240. /* NAND boot config */
  241. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  242. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  243. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  244. #define CONFIG_SYS_NAND_OOBSIZE 64
  245. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
  246. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  247. /*
  248. * Use the ECC/OOB layout from omap_gpmc.h that matches your chip:
  249. * SP vs LP, 8bit vs 16bit: GPMC_NAND_HW_ECC_LAYOUT
  250. */
  251. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  252. 10, 11, 12, 13 }
  253. #define CONFIG_SYS_NAND_ECCSIZE 512
  254. #define CONFIG_SYS_NAND_ECCBYTES 3
  255. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
  256. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  257. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  258. #define CONFIG_SPL_TEXT_BASE 0x40200800
  259. #define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \
  260. CONFIG_SPL_TEXT_BASE)
  261. /*
  262. * Use 0x80008000 as TEXT_BASE here for compatibility reasons with the
  263. * older x-loader implementations. And move the BSS area so that it
  264. * doesn't overlap with TEXT_BASE.
  265. */
  266. #define CONFIG_SYS_TEXT_BASE 0x80008000
  267. #define CONFIG_SPL_BSS_START_ADDR 0x80100000
  268. #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
  269. #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
  270. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  271. #endif /* __CONFIG_H */