omap3_logic.h 9.9 KB

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