omap3_logic.h 8.3 KB

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