omap3_logic.h 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. /*
  2. * (C) Copyright 2011 Logic Product Development <www.logicpd.com>
  3. * Peter Barada <peter.barada@logicpd.com>
  4. *
  5. * Configuration settings for the Logic OMAP35x/DM37x SOM LV/Torpedo
  6. * reference boards.
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef __CONFIG_H
  11. #define __CONFIG_H
  12. /*
  13. * High Level Configuration Options
  14. */
  15. #define CONFIG_OMAP /* in a TI OMAP core */
  16. #define CONFIG_OMAP3_LOGIC /* working with Logic OMAP boards */
  17. #define CONFIG_OMAP_GPIO
  18. #define CONFIG_OMAP_COMMON
  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_SYS_TEXT_BASE 0x80400000
  24. #define CONFIG_SDRC /* The chip has SDRC controller */
  25. #include <asm/arch/cpu.h> /* get chip and board defs */
  26. #include <asm/arch/omap.h>
  27. /*
  28. * Display CPU and Board information
  29. */
  30. #define CONFIG_DISPLAY_CPUINFO
  31. #define CONFIG_DISPLAY_BOARDINFO
  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 /* misc_init_r dumps the die id */
  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_CMDLINE_EDITING /* cmd line edit/history */
  41. #define CONFIG_ZERO_BOOTDELAY_CHECK /* check keypress w/no delay */
  42. /*
  43. * Size of malloc() pool
  44. */
  45. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
  46. /* Sector */
  47. #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + (128 << 10))
  48. /*
  49. * Hardware drivers
  50. */
  51. /*
  52. * NS16550 Configuration
  53. */
  54. #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
  55. #define CONFIG_SYS_NS16550
  56. #define CONFIG_SYS_NS16550_SERIAL
  57. #define CONFIG_SYS_NS16550_REG_SIZE (-4)
  58. #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
  59. /*
  60. * select serial console configuration
  61. */
  62. #define CONFIG_CONS_INDEX 1
  63. #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
  64. #define CONFIG_SERIAL1 1 /* UART1 on OMAP Logic boards */
  65. /* allow to overwrite serial and ethaddr */
  66. #define CONFIG_ENV_OVERWRITE
  67. #define CONFIG_BAUDRATE 115200
  68. #define CONFIG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\
  69. 115200}
  70. #define CONFIG_GENERIC_MMC
  71. #define CONFIG_MMC
  72. #define CONFIG_OMAP_HSMMC
  73. #define CONFIG_DOS_PARTITION
  74. /* commands to include */
  75. #define CONFIG_CMD_CACHE
  76. #define CONFIG_CMD_EXT2 /* EXT2 Support */
  77. #define CONFIG_CMD_FAT /* FAT support */
  78. #define CONFIG_CMD_JFFS2 /* JFFS2 Support */
  79. #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */
  80. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  81. #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  82. #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(x-loader),"\
  83. "1920k(u-boot),128k(u-boot-env),"\
  84. "4m(kernel),-(fs)"
  85. #define CONFIG_CMD_I2C /* I2C serial bus support */
  86. #define CONFIG_CMD_MMC /* MMC support */
  87. #define CONFIG_CMD_NAND /* NAND support */
  88. #define CONFIG_CMD_NAND_LOCK_UNLOCK /* nand (un)lock commands */
  89. #define CONFIG_CMD_PING
  90. #define CONFIG_CMD_DHCP
  91. #define CONFIG_SYS_NO_FLASH
  92. /*
  93. * I2C
  94. */
  95. #define CONFIG_SYS_I2C
  96. #define CONFIG_SYS_OMAP24_I2C_SPEED 100000
  97. #define CONFIG_SYS_OMAP24_I2C_SLAVE 1
  98. #define CONFIG_SYS_I2C_OMAP34XX
  99. /*
  100. * TWL4030
  101. */
  102. #define CONFIG_TWL4030_POWER
  103. /*
  104. * Board NAND Info.
  105. */
  106. #define CONFIG_SYS_NAND_QUIET_TEST
  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 */
  114. /* NAND devices */
  115. #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
  116. #define CONFIG_JFFS2_NAND
  117. /* nand device jffs2 lives on */
  118. #define CONFIG_JFFS2_DEV "nand0"
  119. /* start of jffs2 partition */
  120. #define CONFIG_JFFS2_PART_OFFSET 0x680000
  121. #define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */
  122. /* partition */
  123. /* Environment information */
  124. #define CONFIG_BOOTDELAY 2
  125. /*
  126. * PREBOOT assumes the 4.3" display is attached. User can interrupt
  127. * and modify display variable to suit their needs.
  128. */
  129. #define CONFIG_PREBOOT \
  130. "echo ======================NOTICE============================;"\
  131. "echo \"The u-boot environment is not set.\";" \
  132. "echo \"If using a display a valid display varible for your panel\";" \
  133. "echo \"needs to be set.\";" \
  134. "echo \"Valid display options are:\";" \
  135. "echo \" 2 == LQ121S1DG31 TFT SVGA (12.1) Sharp\";" \
  136. "echo \" 3 == LQ036Q1DA01 TFT QVGA (3.6) Sharp w/ASIC\";" \
  137. "echo \" 5 == LQ064D343 TFT VGA (6.4) Sharp\";" \
  138. "echo \" 7 == LQ10D368 TFT VGA (10.4) Sharp\";" \
  139. "echo \" 15 == LQ043T1DG01 TFT WQVGA (4.3) Sharp (DEFAULT)\";" \
  140. "echo \" vga[-dvi or -hdmi] LCD VGA 640x480\";" \
  141. "echo \" svga[-dvi or -hdmi] LCD SVGA 800x600\";" \
  142. "echo \" xga[-dvi or -hdmi] LCD XGA 1024x768\";" \
  143. "echo \" 720p[-dvi or -hdmi] LCD 720P 1280x720\";" \
  144. "echo \"Defaulting to 4.3 LCD panel (display=15).\";" \
  145. "setenv display 15;" \
  146. "setenv preboot;" \
  147. "saveenv;"
  148. #define CONFIG_EXTRA_ENV_SETTINGS \
  149. "loadaddr=0x81000000\0" \
  150. "bootfile=uImage\0" \
  151. "mtdids=" MTDIDS_DEFAULT "\0" \
  152. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  153. "mmcdev=0\0" \
  154. "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
  155. "if run loadbootscript; then " \
  156. "run bootscript; " \
  157. "else " \
  158. "run defaultboot;" \
  159. "fi; " \
  160. "else run defaultboot; fi\0" \
  161. "defaultboot=run mmcramboot\0" \
  162. "consoledevice=ttyO0\0" \
  163. "display=15\0" \
  164. "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
  165. "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
  166. "rotation=0\0" \
  167. "vrfb_arg=if itest ${rotation} -ne 0; then " \
  168. "setenv bootargs ${bootargs} omapfb.vrfb=y " \
  169. "omapfb.rotate=${rotation}; " \
  170. "fi\0" \
  171. "otherbootargs=ignore_loglevel early_printk no_console_suspend\0" \
  172. "addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \
  173. "common_bootargs=setenv bootargs ${bootargs} display=${display} " \
  174. "${otherbootargs};" \
  175. "run addmtdparts; " \
  176. "run vrfb_arg\0" \
  177. "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  178. "bootscript=echo 'Running bootscript from mmc ...'; " \
  179. "source ${loadaddr}\0" \
  180. "loaduimage=mmc rescan ${mmcdev}; " \
  181. "fatload mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
  182. "ramdisksize=64000\0" \
  183. "ramdiskaddr=0x82000000\0" \
  184. "ramdiskimage=rootfs.ext2.gz.uboot\0" \
  185. "ramargs=run setconsole; setenv bootargs console=${console} " \
  186. "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
  187. "mmcramboot=echo 'Booting kernel from mmc w/ramdisk...'; " \
  188. "run ramargs; " \
  189. "run common_bootargs; " \
  190. "run dump_bootargs; " \
  191. "run loaduimage; " \
  192. "fatload mmc ${mmcdev} ${ramdiskaddr} ${ramdiskimage}; "\
  193. "bootm ${loadaddr} ${ramdiskaddr}\0" \
  194. "ramboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
  195. "run ramargs; " \
  196. "run common_bootargs; " \
  197. "run dump_bootargs; " \
  198. "tftpboot ${loadaddr} ${bootfile}; "\
  199. "tftpboot ${ramdiskaddr} ${ramdiskimage}; "\
  200. "bootm ${loadaddr} ${ramdiskaddr}\0"
  201. #define CONFIG_BOOTCOMMAND \
  202. "run autoboot"
  203. #define CONFIG_AUTO_COMPLETE
  204. /*
  205. * Miscellaneous configurable options
  206. */
  207. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  208. #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
  209. #define CONFIG_SYS_PROMPT "OMAP Logic # "
  210. #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
  211. /* Print Buffer Size */
  212. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  213. sizeof(CONFIG_SYS_PROMPT) + 16)
  214. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  215. /* Boot Argument Buffer Size */
  216. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  217. /* memtest works on */
  218. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  219. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  220. 0x01F00000) /* 31MB */
  221. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load */
  222. /* address */
  223. /*
  224. * OMAP3 has 12 GP timers, they can be driven by the system clock
  225. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  226. * This rate is divided by a local divisor.
  227. */
  228. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  229. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  230. /*
  231. * Physical Memory Map
  232. */
  233. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  234. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  235. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  236. /*
  237. * FLASH and environment organization
  238. */
  239. /* **** PISMO SUPPORT *** */
  240. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  241. #if defined(CONFIG_CMD_NAND)
  242. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  243. #elif defined(CONFIG_CMD_ONENAND)
  244. #define CONFIG_SYS_FLASH_BASE ONENAND_MAP
  245. #endif
  246. /* Monitor at start of flash */
  247. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  248. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  249. #if defined(CONFIG_CMD_NAND)
  250. #define CONFIG_NAND_OMAP_GPMC
  251. #define CONFIG_ENV_IS_IN_NAND
  252. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  253. #endif
  254. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  255. #define CONFIG_ENV_ADDR CONFIG_ENV_OFFSET
  256. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  257. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  258. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  259. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  260. CONFIG_SYS_INIT_RAM_SIZE - \
  261. GENERATED_GBL_DATA_SIZE)
  262. /*
  263. * SMSC922x Ethernet
  264. */
  265. #if defined(CONFIG_CMD_NET)
  266. #define CONFIG_SMC911X
  267. #define CONFIG_SMC911X_16_BIT
  268. #define CONFIG_SMC911X_BASE 0x08000000
  269. #endif /* (CONFIG_CMD_NET) */
  270. /*
  271. * BOOTP fields
  272. */
  273. #define CONFIG_BOOTP_SUBNETMASK 0x00000001
  274. #define CONFIG_BOOTP_GATEWAY 0x00000002
  275. #define CONFIG_BOOTP_HOSTNAME 0x00000004
  276. #define CONFIG_BOOTP_BOOTPATH 0x00000010
  277. #endif /* __CONFIG_H */