omap3_logic.h 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. #ifdef CONFIG_SPL_BUILD
  16. /*
  17. * Disable MMC DM for SPL build and can be re-enabled after adding
  18. * DM support in SPL
  19. */
  20. #undef CONFIG_DM_MMC
  21. #undef OMAP_HSMMC_USE_GPIO
  22. /* select serial console configuration for SPL */
  23. #undef CONFIG_CONS_INDEX
  24. #define CONFIG_CONS_INDEX 1
  25. #define CONFIG_SYS_NS16550_COM1 OMAP34XX_UART1
  26. #endif
  27. /*
  28. * We are only ever GP parts and will utilize all of the "downloaded image"
  29. * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
  30. * order to allow for BCH8 to fit in.
  31. */
  32. #undef CONFIG_SPL_TEXT_BASE
  33. #define CONFIG_SPL_FRAMEWORK
  34. #define CONFIG_SPL_TEXT_BASE 0x40200000
  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. /* Hardware drivers */
  41. #define CONFIG_USB_OMAP3
  42. /* I2C */
  43. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* EEPROM AT24C64 */
  44. /* USB */
  45. #define CONFIG_USB_MUSB_OMAP2PLUS
  46. #define CONFIG_USB_MUSB_PIO_ONLY
  47. /* TWL4030 */
  48. #define CONFIG_TWL4030_USB
  49. /* Board NAND Info. */
  50. #ifdef CONFIG_NAND
  51. #define CONFIG_SYS_NAND_ADDR NAND_BASE /* physical address */
  52. /* to access nand */
  53. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of */
  54. /* NAND devices */
  55. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  56. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  57. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  58. #define CONFIG_SYS_NAND_OOBSIZE 64
  59. #define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024)
  60. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  61. #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
  62. 13, 14, 16, 17, 18, 19, 20, 21, 22, \
  63. 23, 24, 25, 26, 27, 28, 30, 31, 32, \
  64. 33, 34, 35, 36, 37, 38, 39, 40, 41, \
  65. 42, 44, 45, 46, 47, 48, 49, 50, 51, \
  66. 52, 53, 54, 55, 56}
  67. #define CONFIG_SYS_NAND_ECCSIZE 512
  68. #define CONFIG_SYS_NAND_ECCBYTES 13
  69. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
  70. #define CONFIG_SYS_NAND_MAX_OOBFREE 2
  71. #define CONFIG_SYS_NAND_MAX_ECCPOS 56
  72. #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */
  73. #define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
  74. #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  75. #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:"\
  76. "512k(MLO),"\
  77. "1792k(u-boot),"\
  78. "128k(spl-os)," \
  79. "128k(u-boot-env),"\
  80. "6m(kernel),-(fs)"
  81. #endif
  82. /* Environment information */
  83. #define CONFIG_PREBOOT \
  84. "setenv preboot;" \
  85. "nand unlock;" \
  86. "saveenv;"
  87. #define CONFIG_EXTRA_ENV_SETTINGS \
  88. DEFAULT_LINUX_BOOT_ENV \
  89. "mtdids=" MTDIDS_DEFAULT "\0" \
  90. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  91. "mmcdev=0\0" \
  92. "mmcroot=/dev/mmcblk0p2 rw\0" \
  93. "mmcrootfstype=ext4 rootwait\0" \
  94. "nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
  95. "nandrootfstype=ubifs rootwait\0" \
  96. "autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
  97. "if run loadbootscript; then " \
  98. "run bootscript; " \
  99. "else " \
  100. "run defaultboot;" \
  101. "fi; " \
  102. "else run defaultboot; fi\0" \
  103. "defaultboot=run mmcramboot\0" \
  104. "consoledevice=ttyO0\0" \
  105. "setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
  106. "dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
  107. "rotation=0\0" \
  108. "vrfb_arg=if itest ${rotation} -ne 0; then " \
  109. "setenv bootargs ${bootargs} omapfb.vrfb=y " \
  110. "omapfb.rotate=${rotation}; " \
  111. "fi\0" \
  112. "optargs=ignore_loglevel early_printk no_console_suspend\0" \
  113. "common_bootargs=run setconsole; setenv bootargs " \
  114. "${bootargs} "\
  115. "console=${console} " \
  116. "${mtdparts} "\
  117. "${optargs}; " \
  118. "run vrfb_arg\0" \
  119. "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  120. "bootscript=echo 'Running bootscript from mmc ...'; " \
  121. "source ${loadaddr}\0" \
  122. "loadimage=mmc rescan; " \
  123. "load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
  124. "ramdisksize=64000\0" \
  125. "ramdiskimage=rootfs.ext2.gz.uboot\0" \
  126. "loadramdisk=mmc rescan; " \
  127. "load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
  128. "ramargs=setenv bootargs "\
  129. "root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
  130. "mmcargs=setenv bootargs "\
  131. "root=${mmcroot} rootfstype=${mmcrootfstype}\0" \
  132. "nandargs=setenv bootargs "\
  133. "root=${nandroot} " \
  134. "rootfstype=${nandrootfstype}\0" \
  135. "nfsargs=setenv serverip ${tftpserver}; " \
  136. "setenv bootargs root=/dev/nfs " \
  137. "nfsroot=${nfsrootpath} " \
  138. "ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
  139. "nfsrootpath=/opt/nfs-exports/omap\0" \
  140. "autoload=no\0" \
  141. "loadfdt=mmc rescan; " \
  142. "load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
  143. "mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
  144. "run mmcargs; " \
  145. "run common_bootargs; " \
  146. "run dump_bootargs; " \
  147. "run loadimage; " \
  148. "run loadfdt;\0 " \
  149. "mmcbootz=setenv bootfile zImage; " \
  150. "run mmcbootcommon; "\
  151. "bootz ${loadaddr} - ${fdtaddr}\0" \
  152. "mmcboot=setenv bootfile uImage; "\
  153. "run mmcbootcommon; "\
  154. "bootm ${loadaddr} - ${fdtaddr}\0" \
  155. "mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
  156. "run ramargs; " \
  157. "run common_bootargs; " \
  158. "run dump_bootargs; " \
  159. "run loadimage; " \
  160. "run loadfdt; " \
  161. "run loadramdisk\0" \
  162. "mmcramboot=setenv bootfile uImage; " \
  163. "run mmcrambootcommon; " \
  164. "bootm ${loadaddr} ${rdaddr} ${fdtimage}\0" \
  165. "mmcrambootz=setenv bootfile zImage; " \
  166. "run mmcrambootcommon; " \
  167. "bootz ${loadaddr} ${rdaddr} ${fdtimage}\0" \
  168. "tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
  169. "run ramargs; " \
  170. "run common_bootargs; " \
  171. "run dump_bootargs; " \
  172. "tftpboot ${loadaddr} ${zimage}; " \
  173. "tftpboot ${rdaddr} ${ramdiskimage}; " \
  174. "bootm ${loadaddr} ${rdaddr}\0" \
  175. "tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
  176. "dhcp;" \
  177. "run nfsargs;" \
  178. "run common_bootargs;" \
  179. "run dump_bootargs;" \
  180. "tftpboot $loadaddr zImage;" \
  181. "bootz $loadaddr\0" \
  182. "nandbootcommon=echo 'Booting kernel from NAND...';" \
  183. "nand unlock;" \
  184. "run nandargs;" \
  185. "run common_bootargs;" \
  186. "run dump_bootargs;" \
  187. "nand read ${loadaddr} kernel;" \
  188. "nand read ${fdtaddr} spl-os;\0" \
  189. "nandbootz=run nandbootcommon; "\
  190. "bootz ${loadaddr} - ${fdtaddr}\0"\
  191. "nandboot=run nandbootcommon; "\
  192. "bootm ${loadaddr} - ${fdtaddr}\0"\
  193. #define CONFIG_BOOTCOMMAND \
  194. "run autoboot"
  195. /* Miscellaneous configurable options */
  196. /* memtest works on */
  197. #define CONFIG_SYS_MEMTEST_START (OMAP34XX_SDRC_CS0)
  198. #define CONFIG_SYS_MEMTEST_END (OMAP34XX_SDRC_CS0 + \
  199. 0x01F00000) /* 31MB */
  200. /* FLASH and environment organization */
  201. /* **** PISMO SUPPORT *** */
  202. #if defined(CONFIG_CMD_NAND)
  203. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  204. #endif
  205. /* Monitor at start of flash */
  206. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  207. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
  208. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  209. #define CONFIG_ENV_OFFSET 0x260000
  210. #define CONFIG_ENV_ADDR 0x260000
  211. /* Defines for SPL */
  212. /* NAND: SPL falcon mode configs */
  213. #ifdef CONFIG_SPL_OS_BOOT
  214. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
  215. #endif
  216. #endif /* __CONFIG_H */