omap3_logic.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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. /* High Level Configuration Options */
  13. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  14. #include <configs/ti_omap3_common.h>
  15. /*
  16. * We are only ever GP parts and will utilize all of the "downloaded image"
  17. * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
  18. * order to allow for BCH8 to fit in.
  19. */
  20. #undef CONFIG_SPL_TEXT_BASE
  21. #define CONFIG_SPL_TEXT_BASE 0x40200000
  22. #define CONFIG_BOARD_LATE_INIT
  23. #define CONFIG_MISC_INIT_R /* misc_init_r dumps the die id */
  24. #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
  25. #define CONFIG_SETUP_MEMORY_TAGS
  26. #define CONFIG_INITRD_TAG
  27. #define CONFIG_REVISION_TAG
  28. #define CONFIG_CMDLINE_EDITING /* cmd line edit/history */
  29. /* Hardware drivers */
  30. /* GPIO banks */
  31. #define CONFIG_OMAP3_GPIO_6 /* GPIO160..191 is in GPIO bank 6 */
  32. #define CONFIG_USB_OMAP3
  33. /* select serial console configuration */
  34. #undef CONFIG_CONS_INDEX
  35. #define CONFIG_CONS_INDEX 1
  36. #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
  37. #define CONFIG_SERIAL1 1 /* UART1 on OMAP Logic boards */
  38. /* commands to include */
  39. #define CONFIG_CMD_NAND
  40. #define CONFIG_CMD_MTDPARTS
  41. #define CONFIG_CMD_NAND_LOCK_UNLOCK /* nand (un)lock commands */
  42. /* I2C */
  43. #define CONFIG_SYS_I2C_OMAP34XX
  44. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
  45. #define EXPANSION_EEPROM_I2C_BUS 2 /* I2C Bus for AT24C64 */
  46. #define CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID
  47. /* USB */
  48. #define CONFIG_USB_MUSB_OMAP2PLUS
  49. #define CONFIG_USB_MUSB_PIO_ONLY
  50. #define CONFIG_USB_ETHER
  51. #define CONFIG_USB_ETHER_RNDIS
  52. #define CONFIG_USB_FUNCTION_FASTBOOT
  53. #define CONFIG_CMD_FASTBOOT
  54. #define CONFIG_ANDROID_BOOT_IMAGE
  55. #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
  56. #define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
  57. /* TWL4030 */
  58. #define CONFIG_TWL4030_PWM
  59. #define CONFIG_TWL4030_USB
  60. /* Board NAND Info. */
  61. #ifdef CONFIG_NAND
  62. #define CONFIG_NAND_OMAP_GPMC
  63. #define CONFIG_CMD_UBIFS /* Read-only UBI volume operations */
  64. #define CONFIG_RBTREE /* required by CONFIG_CMD_UBI */
  65. #define CONFIG_LZO /* required by CONFIG_CMD_UBIFS */
  66. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  67. /* to access nand */
  68. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
  69. /* NAND devices */
  70. #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
  71. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  72. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  73. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  74. #define CONFIG_SYS_NAND_OOBSIZE 64
  75. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
  76. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  77. #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
  78. 13, 14, 16, 17, 18, 19, 20, 21, 22, \
  79. 23, 24, 25, 26, 27, 28, 30, 31, 32, \
  80. 33, 34, 35, 36, 37, 38, 39, 40, 41, \
  81. 42, 44, 45, 46, 47, 48, 49, 50, 51, \
  82. 52, 53, 54, 55, 56}
  83. #define CONFIG_SYS_NAND_ECCSIZE 512
  84. #define CONFIG_SYS_NAND_ECCBYTES 13
  85. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
  86. #define CONFIG_BCH
  87. #define CONFIG_SYS_NAND_MAX_OOBFREE 2
  88. #define CONFIG_SYS_NAND_MAX_ECCPOS 56
  89. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  90. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  91. #define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
  92. #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  93. #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:"\
  94. "512k(MLO),"\
  95. "1792k(u-boot),"\
  96. "128k(spl-os)," \
  97. "128k(u-boot-env),"\
  98. "6m(kernel),-(fs)"
  99. #endif
  100. /* Environment information */
  101. #define CONFIG_PREBOOT \
  102. "setenv preboot;" \
  103. "nand unlock;" \
  104. "saveenv;"
  105. #define CONFIG_EXTRA_ENV_SETTINGS \
  106. "loadaddr=0x81000000\0" \
  107. "uimage=uImage\0" \
  108. "zimage=zImage\0" \
  109. "mtdids=" MTDIDS_DEFAULT "\0" \
  110. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  111. "mmcdev=0\0" \
  112. "mmcroot=/dev/mmcblk0p2 rw\0" \
  113. "mmcrootfstype=ext4 rootwait\0" \
  114. "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
  115. "nandrootfstype=ubifs rootwait\0" \
  116. "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
  117. "if run loadbootscript; then " \
  118. "run bootscript; " \
  119. "else " \
  120. "run defaultboot;" \
  121. "fi; " \
  122. "else run defaultboot; fi\0" \
  123. "defaultboot=run mmcramboot\0" \
  124. "consoledevice=ttyO0\0" \
  125. "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
  126. "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
  127. "rotation=0\0" \
  128. "vrfb_arg=if itest ${rotation} -ne 0; then " \
  129. "setenv bootargs ${bootargs} omapfb.vrfb=y " \
  130. "omapfb.rotate=${rotation}; " \
  131. "fi\0" \
  132. "optargs=ignore_loglevel early_printk no_console_suspend\0" \
  133. "addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \
  134. "common_bootargs=setenv bootargs ${bootargs} " \
  135. "${optargs};" \
  136. "run addmtdparts; " \
  137. "run vrfb_arg\0" \
  138. "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  139. "bootscript=echo 'Running bootscript from mmc ...'; " \
  140. "source ${loadaddr}\0" \
  141. "loaduimage=mmc rescan; " \
  142. "fatload mmc ${mmcdev} ${loadaddr} ${uimage}\0" \
  143. "loadzimage=mmc rescan; " \
  144. "fatload mmc ${mmcdev} ${loadaddr} ${zimage}\0" \
  145. "ramdisksize=64000\0" \
  146. "ramdiskaddr=0x82000000\0" \
  147. "ramdiskimage=rootfs.ext2.gz.uboot\0" \
  148. "loadramdisk=mmc rescan; " \
  149. "fatload mmc ${mmcdev} ${ramdiskaddr} ${ramdiskimage}\0" \
  150. "ramargs=run setconsole; setenv bootargs console=${console} " \
  151. "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
  152. "mmcargs=run setconsole; setenv bootargs console=${console} " \
  153. "${optargs} " \
  154. "root=${mmcroot} " \
  155. "rootfstype=${mmcrootfstype}\0" \
  156. "nandargs=run setconsole; setenv bootargs console=${console} " \
  157. "${optargs} " \
  158. "root=${nandroot} " \
  159. "rootfstype=${nandrootfstype}\0" \
  160. "nfsargs=run setconsole; setenv serverip ${tftpserver}; " \
  161. "setenv bootargs console=${console} root=/dev/nfs " \
  162. "nfsroot=${nfsrootpath} " \
  163. "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
  164. "nfsrootpath=/opt/nfs-exports/omap\0" \
  165. "autoload=no\0" \
  166. "fdtaddr=0x86000000\0" \
  167. "loadfdtimage=mmc rescan; " \
  168. "fatload mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
  169. "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \
  170. "run mmcargs; " \
  171. "run common_bootargs; " \
  172. "run dump_bootargs; " \
  173. "run loadzimage; " \
  174. "run loadfdtimage; " \
  175. "bootz ${loadaddr} - ${fdtaddr}\0" \
  176. "mmcramboot=echo 'Booting uImage kernel from mmc w/ramdisk...'; " \
  177. "run ramargs; " \
  178. "run common_bootargs; " \
  179. "run dump_bootargs; " \
  180. "run loaduimage; " \
  181. "run loadramdisk; " \
  182. "bootm ${loadaddr} ${ramdiskaddr}\0" \
  183. "mmcrambootz=echo 'Booting zImage kernel from mmc w/ramdisk...'; " \
  184. "run ramargs; " \
  185. "run common_bootargs; " \
  186. "run dump_bootargs; " \
  187. "run loadzimage; " \
  188. "run loadramdisk; " \
  189. "run loadfdtimage; " \
  190. "bootz ${loadaddr} ${ramdiskaddr} ${fdtaddr};\0" \
  191. "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
  192. "run ramargs; " \
  193. "run common_bootargs; " \
  194. "run dump_bootargs; " \
  195. "tftpboot ${loadaddr} ${zimage}; " \
  196. "tftpboot ${ramdiskaddr} ${ramdiskimage}; " \
  197. "bootm ${loadaddr} ${ramdiskaddr}\0" \
  198. "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
  199. "dhcp;" \
  200. "run nfsargs;" \
  201. "run common_bootargs;" \
  202. "run dump_bootargs;" \
  203. "tftpboot $loadaddr zImage;" \
  204. "bootz $loadaddr\0"
  205. #define CONFIG_BOOTCOMMAND \
  206. "run autoboot"
  207. /* Miscellaneous configurable options */
  208. #define CONFIG_AUTO_COMPLETE
  209. /* memtest works on */
  210. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  211. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  212. 0x01F00000) /* 31MB */
  213. /* FLASH and environment organization */
  214. /* **** PISMO SUPPORT *** */
  215. #if defined(CONFIG_CMD_NAND)
  216. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  217. #endif
  218. /* Monitor at start of flash */
  219. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  220. #define CONFIG_ENV_IS_IN_NAND 1
  221. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
  222. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  223. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  224. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  225. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  226. /* SMSC922x Ethernet */
  227. #if defined(CONFIG_CMD_NET)
  228. #define CONFIG_SMC911X
  229. #define CONFIG_SMC911X_32_BIT
  230. #define CONFIG_SMC911X_BASE 0x08000000
  231. #endif /* (CONFIG_CMD_NET) */
  232. /* Defines for SPL */
  233. #define CONFIG_SPL_OMAP3_ID_NAND
  234. /* NAND: SPL falcon mode configs */
  235. #ifdef CONFIG_SPL_OS_BOOT
  236. #define CONFIG_CMD_SPL_NAND_OFS 0x240000
  237. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
  238. #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
  239. #endif
  240. #endif /* __CONFIG_H */