omap3_logic.h 6.8 KB

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