omap3_logic.h 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  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. #include <config_cmd_default.h>
  76. #define CONFIG_CMD_CACHE
  77. #define CONFIG_CMD_EXT2 /* EXT2 Support */
  78. #define CONFIG_CMD_FAT /* FAT support */
  79. #define CONFIG_CMD_JFFS2 /* JFFS2 Support */
  80. #define CONFIG_CMD_MTDPARTS /* Enable MTD parts commands */
  81. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  82. #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  83. #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:512k(x-loader),"\
  84. "1920k(u-boot),128k(u-boot-env),"\
  85. "4m(kernel),-(fs)"
  86. #define CONFIG_CMD_I2C /* I2C serial bus support */
  87. #define CONFIG_CMD_MMC /* MMC support */
  88. #define CONFIG_CMD_NAND /* NAND support */
  89. #define CONFIG_CMD_NAND_LOCK_UNLOCK /* nand (un)lock commands */
  90. #define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */
  91. #define CONFIG_CMD_PING
  92. #define CONFIG_CMD_DHCP
  93. #define CONFIG_CMD_SETEXPR /* Evaluate expressions */
  94. #undef CONFIG_CMD_FLASH /* flinfo, erase, protect */
  95. #undef CONFIG_CMD_FPGA /* FPGA configuration Support */
  96. #undef CONFIG_CMD_IMI /* iminfo */
  97. #undef CONFIG_CMD_IMLS /* List all found images */
  98. #define CONFIG_SYS_NO_FLASH
  99. /*
  100. * I2C
  101. */
  102. #define CONFIG_SYS_I2C
  103. #define CONFIG_SYS_OMAP24_I2C_SPEED 100000
  104. #define CONFIG_SYS_OMAP24_I2C_SLAVE 1
  105. #define CONFIG_SYS_I2C_OMAP34XX
  106. /*
  107. * TWL4030
  108. */
  109. #define CONFIG_TWL4030_POWER
  110. /*
  111. * Board NAND Info.
  112. */
  113. #define CONFIG_SYS_NAND_QUIET_TEST
  114. #define CONFIG_NAND_OMAP_GPMC
  115. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  116. /* to access nand */
  117. #define CONFIG_SYS_NAND_BASE NAND_BASE /* physical address */
  118. /* to access nand at */
  119. /* CS0 */
  120. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
  121. /* NAND devices */
  122. #define CONFIG_SYS_NAND_BUSWIDTH_16BIT 16
  123. #define CONFIG_JFFS2_NAND
  124. /* nand device jffs2 lives on */
  125. #define CONFIG_JFFS2_DEV "nand0"
  126. /* start of jffs2 partition */
  127. #define CONFIG_JFFS2_PART_OFFSET 0x680000
  128. #define CONFIG_JFFS2_PART_SIZE 0xf980000 /* size of jffs2 */
  129. /* partition */
  130. /* Environment information */
  131. #define CONFIG_BOOTDELAY 2
  132. /*
  133. * PREBOOT assumes the 4.3" display is attached. User can interrupt
  134. * and modify display variable to suit their needs.
  135. */
  136. #define CONFIG_PREBOOT \
  137. "echo ======================NOTICE============================;"\
  138. "echo \"The u-boot environment is not set.\";" \
  139. "echo \"If using a display a valid display varible for your panel\";" \
  140. "echo \"needs to be set.\";" \
  141. "echo \"Valid display options are:\";" \
  142. "echo \" 2 == LQ121S1DG31 TFT SVGA (12.1) Sharp\";" \
  143. "echo \" 3 == LQ036Q1DA01 TFT QVGA (3.6) Sharp w/ASIC\";" \
  144. "echo \" 5 == LQ064D343 TFT VGA (6.4) Sharp\";" \
  145. "echo \" 7 == LQ10D368 TFT VGA (10.4) Sharp\";" \
  146. "echo \" 15 == LQ043T1DG01 TFT WQVGA (4.3) Sharp (DEFAULT)\";" \
  147. "echo \" vga[-dvi or -hdmi] LCD VGA 640x480\";" \
  148. "echo \" svga[-dvi or -hdmi] LCD SVGA 800x600\";" \
  149. "echo \" xga[-dvi or -hdmi] LCD XGA 1024x768\";" \
  150. "echo \" 720p[-dvi or -hdmi] LCD 720P 1280x720\";" \
  151. "echo \"Defaulting to 4.3 LCD panel (display=15).\";" \
  152. "setenv display 15;" \
  153. "setenv preboot;" \
  154. "saveenv;"
  155. #define CONFIG_EXTRA_ENV_SETTINGS \
  156. "loadaddr=0x81000000\0" \
  157. "bootfile=uImage\0" \
  158. "mtdids=" MTDIDS_DEFAULT "\0" \
  159. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  160. "mmcdev=0\0" \
  161. "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
  162. "if run loadbootscript; then " \
  163. "run bootscript; " \
  164. "else " \
  165. "run defaultboot;" \
  166. "fi; " \
  167. "else run defaultboot; fi\0" \
  168. "defaultboot=run mmcramboot\0" \
  169. "consoledevice=ttyO0\0" \
  170. "display=15\0" \
  171. "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
  172. "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
  173. "rotation=0\0" \
  174. "vrfb_arg=if itest ${rotation} -ne 0; then " \
  175. "setenv bootargs ${bootargs} omapfb.vrfb=y " \
  176. "omapfb.rotate=${rotation}; " \
  177. "fi\0" \
  178. "otherbootargs=ignore_loglevel early_printk no_console_suspend\0" \
  179. "addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \
  180. "common_bootargs=setenv bootargs ${bootargs} display=${display} " \
  181. "${otherbootargs};" \
  182. "run addmtdparts; " \
  183. "run vrfb_arg\0" \
  184. "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  185. "bootscript=echo 'Running bootscript from mmc ...'; " \
  186. "source ${loadaddr}\0" \
  187. "loaduimage=mmc rescan ${mmcdev}; " \
  188. "fatload mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
  189. "ramdisksize=64000\0" \
  190. "ramdiskaddr=0x82000000\0" \
  191. "ramdiskimage=rootfs.ext2.gz.uboot\0" \
  192. "ramargs=run setconsole; setenv bootargs console=${console} " \
  193. "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
  194. "mmcramboot=echo 'Booting kernel from mmc w/ramdisk...'; " \
  195. "run ramargs; " \
  196. "run common_bootargs; " \
  197. "run dump_bootargs; " \
  198. "run loaduimage; " \
  199. "fatload mmc ${mmcdev} ${ramdiskaddr} ${ramdiskimage}; "\
  200. "bootm ${loadaddr} ${ramdiskaddr}\0" \
  201. "ramboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
  202. "run ramargs; " \
  203. "run common_bootargs; " \
  204. "run dump_bootargs; " \
  205. "tftpboot ${loadaddr} ${bootfile}; "\
  206. "tftpboot ${ramdiskaddr} ${ramdiskimage}; "\
  207. "bootm ${loadaddr} ${ramdiskaddr}\0"
  208. #define CONFIG_BOOTCOMMAND \
  209. "run autoboot"
  210. #define CONFIG_AUTO_COMPLETE
  211. /*
  212. * Miscellaneous configurable options
  213. */
  214. #define CONFIG_SYS_LONGHELP /* undef to save memory */
  215. #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
  216. #define CONFIG_SYS_PROMPT "OMAP Logic # "
  217. #define CONFIG_SYS_CBSIZE 512 /* Console I/O Buffer Size */
  218. /* Print Buffer Size */
  219. #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + \
  220. sizeof(CONFIG_SYS_PROMPT) + 16)
  221. #define CONFIG_SYS_MAXARGS 16 /* max number of command args */
  222. /* Boot Argument Buffer Size */
  223. #define CONFIG_SYS_BARGSIZE (CONFIG_SYS_CBSIZE)
  224. /* memtest works on */
  225. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  226. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  227. 0x01F00000) /* 31MB */
  228. #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0) /* default load */
  229. /* address */
  230. /*
  231. * OMAP3 has 12 GP timers, they can be driven by the system clock
  232. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  233. * This rate is divided by a local divisor.
  234. */
  235. #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
  236. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  237. /*
  238. * Physical Memory Map
  239. */
  240. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  241. #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
  242. #define PHYS_SDRAM_2 OMAP34XX_SDRC_CS1
  243. /*
  244. * FLASH and environment organization
  245. */
  246. /* **** PISMO SUPPORT *** */
  247. #define CONFIG_SYS_MONITOR_LEN (256 << 10) /* Reserve 2 sectors */
  248. #if defined(CONFIG_CMD_NAND)
  249. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  250. #elif defined(CONFIG_CMD_ONENAND)
  251. #define CONFIG_SYS_FLASH_BASE ONENAND_MAP
  252. #endif
  253. /* Monitor at start of flash */
  254. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  255. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  256. #if defined(CONFIG_CMD_NAND)
  257. #define CONFIG_NAND_OMAP_GPMC
  258. #define CONFIG_ENV_IS_IN_NAND
  259. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  260. #endif
  261. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  262. #define CONFIG_ENV_ADDR CONFIG_ENV_OFFSET
  263. #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
  264. #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
  265. #define CONFIG_SYS_INIT_RAM_SIZE 0x800
  266. #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
  267. CONFIG_SYS_INIT_RAM_SIZE - \
  268. GENERATED_GBL_DATA_SIZE)
  269. /*
  270. * SMSC922x Ethernet
  271. */
  272. #if defined(CONFIG_CMD_NET)
  273. #define CONFIG_SMC911X
  274. #define CONFIG_SMC911X_16_BIT
  275. #define CONFIG_SMC911X_BASE 0x08000000
  276. #endif /* (CONFIG_CMD_NET) */
  277. /*
  278. * BOOTP fields
  279. */
  280. #define CONFIG_BOOTP_SUBNETMASK 0x00000001
  281. #define CONFIG_BOOTP_GATEWAY 0x00000002
  282. #define CONFIG_BOOTP_HOSTNAME 0x00000004
  283. #define CONFIG_BOOTP_BOOTPATH 0x00000010
  284. #endif /* __CONFIG_H */