omap3_beagle.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2006-2008
  4. * Texas Instruments.
  5. * Richard Woodruff <r-woodruff2@ti.com>
  6. * Syed Mohammed Khasim <x0khasim@ti.com>
  7. *
  8. * Configuration settings for the TI OMAP3530 Beagle board.
  9. */
  10. #ifndef __CONFIG_H
  11. #define __CONFIG_H
  12. #include <configs/ti_omap3_common.h>
  13. /*
  14. * We are only ever GP parts and will utilize all of the "downloaded image"
  15. * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB).
  16. */
  17. #define CONFIG_CMDLINE_TAG
  18. #define CONFIG_SETUP_MEMORY_TAGS
  19. #define CONFIG_INITRD_TAG
  20. #define CONFIG_REVISION_TAG
  21. /* NAND */
  22. #if defined(CONFIG_MTD_RAW_NAND)
  23. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  24. #define CONFIG_SYS_MAX_NAND_DEVICE 1
  25. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  26. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  27. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  28. #define CONFIG_SYS_NAND_OOBSIZE 64
  29. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  30. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  31. #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
  32. 10, 11, 12, 13}
  33. #define CONFIG_SYS_NAND_ECCSIZE 512
  34. #define CONFIG_SYS_NAND_ECCBYTES 3
  35. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
  36. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  37. #define CONFIG_SYS_ENV_SECT_SIZE SZ_128K
  38. #define CONFIG_ENV_OVERWRITE
  39. /* NAND: SPL falcon mode configs */
  40. #if defined(CONFIG_SPL_OS_BOOT)
  41. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000
  42. #endif /* CONFIG_SPL_OS_BOOT */
  43. #endif /* CONFIG_MTD_RAW_NAND */
  44. /* USB EHCI */
  45. #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 147
  46. /* Enable Multi Bus support for I2C */
  47. #define CONFIG_I2C_MULTI_BUS
  48. /* DSS Support */
  49. /* TWL4030 LED Support */
  50. #define MEM_LAYOUT_ENV_SETTINGS \
  51. DEFAULT_LINUX_BOOT_ENV
  52. #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
  53. "bootcmd_" #devtypel #instance "=" \
  54. "setenv mmcdev " #instance "; " \
  55. "run mmcboot\0"
  56. #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
  57. #devtypel #instance " "
  58. #if defined(CONFIG_MTD_RAW_NAND)
  59. #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
  60. "bootcmd_" #devtypel #instance "=" \
  61. "if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
  62. "echo NAND boot disabled: No mtdids and/or mtdparts; " \
  63. "else " \
  64. "run nandboot; " \
  65. "fi\0"
  66. #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
  67. #devtypel #instance " "
  68. #define BOOT_TARGET_DEVICES(func) \
  69. func(MMC, mmc, 0) \
  70. func(LEGACY_MMC, legacy_mmc, 0) \
  71. func(UBIFS, ubifs, 0) \
  72. func(NAND, nand, 0)
  73. #else /* !CONFIG_MTD_RAW_NAND */
  74. #define BOOT_TARGET_DEVICES(func) \
  75. func(MMC, mmc, 0) \
  76. func(LEGACY_MMC, legacy_mmc, 0)
  77. #endif /* CONFIG_MTD_RAW_NAND */
  78. #include <config_distro_bootcmd.h>
  79. #define CONFIG_EXTRA_ENV_SETTINGS \
  80. MEM_LAYOUT_ENV_SETTINGS \
  81. "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
  82. "fdt_high=0xffffffff\0" \
  83. "console=ttyO2,115200n8\0" \
  84. "bootdir=/boot\0" \
  85. "bootenv=uEnv.txt\0" \
  86. "bootfile=zImage\0" \
  87. "bootpart=0:2\0" \
  88. "bootubivol=rootfs\0" \
  89. "bootubipart=rootfs\0" \
  90. "usbtty=cdc_acm\0" \
  91. "mpurate=auto\0" \
  92. "buddy=none\0" \
  93. "camera=none\0" \
  94. "vram=12M\0" \
  95. "dvimode=640x480MR-16@60\0" \
  96. "defaultdisplay=dvi\0" \
  97. "defaultargs=setenv defargs " \
  98. "mpurate=${mpurate} " \
  99. "buddy=${buddy} "\
  100. "camera=${camera} "\
  101. "vram=${vram} " \
  102. "omapfb.mode=dvi:${dvimode} " \
  103. "omapdss.def_disp=${defaultdisplay}\0" \
  104. "optargs=\0" \
  105. "findfdt=" \
  106. "if test $beaglerev = AxBx; then " \
  107. "setenv fdtfile omap3-beagle.dtb; fi; " \
  108. "if test $beaglerev = Cx; then " \
  109. "setenv fdtfile omap3-beagle.dtb; fi; " \
  110. "if test $beaglerev = C4; then " \
  111. "setenv fdtfile omap3-beagle.dtb; fi; " \
  112. "if test $beaglerev = xMAB; then " \
  113. "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
  114. "if test $beaglerev = xMC; then " \
  115. "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
  116. "if test $fdtfile = undefined; then " \
  117. "echo WARNING: Could not determine device tree to use; fi\0" \
  118. "mmcdev=0\0" \
  119. "mmcpart=2\0" \
  120. "mmcroot=/dev/mmcblk0p2 rw\0" \
  121. "mmcrootfstype=ext4 rootwait\0" \
  122. "mmcargs=run defaultargs; setenv bootargs console=${console} " \
  123. "${mtdparts} " \
  124. "${defargs} " \
  125. "${optargs} " \
  126. "root=${mmcroot} " \
  127. "rootfstype=${mmcrootfstype}\0" \
  128. "userbutton_xm=gpio input 4;\0" \
  129. "userbutton_nonxm=gpio input 7;\0" \
  130. "userbutton=if gpio input 173; then " \
  131. "run userbutton_xm; " \
  132. "else " \
  133. "run userbutton_nonxm; " \
  134. "fi;\0" \
  135. "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
  136. "ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
  137. "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
  138. "env import -t ${loadaddr} ${filesize}\0" \
  139. "mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
  140. "mmc dev ${mmcdev}; " \
  141. "if mmc rescan; then " \
  142. "if run userbutton; then " \
  143. "setenv bootenv uEnv.txt;" \
  144. "else " \
  145. "setenv bootenv user.txt;" \
  146. "fi;" \
  147. "run loadbootenv && run importbootenv; " \
  148. "run ext4bootenv && run importbootenv; " \
  149. "if test -n $uenvcmd; then " \
  150. "echo Running uenvcmd ...; " \
  151. "run uenvcmd; " \
  152. "fi; " \
  153. "fi\0" \
  154. "validatefdt=" \
  155. "if test $beaglerev = xMAB; then " \
  156. "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
  157. "setenv fdtfile omap3-beagle-xm.dtb; " \
  158. "fi; " \
  159. "fi; \0" \
  160. "loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  161. "loaddtb=run validatefdt; ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  162. "mmcboot=run mmcbootenv; " \
  163. "if run loadimage && run loaddtb; then " \
  164. "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
  165. "run mmcargs; " \
  166. "if test ${bootfile} = uImage; then " \
  167. "bootm ${loadaddr} - ${fdtaddr}; " \
  168. "fi; " \
  169. "if test ${bootfile} = zImage; then " \
  170. "bootz ${loadaddr} - ${fdtaddr}; " \
  171. "fi; " \
  172. "fi\0" \
  173. "nandroot=ubi0:rootfs ubi.mtd=rootfs rw\0" \
  174. "nandrootfstype=ubifs rootwait\0" \
  175. "nandargs=run defaultargs; setenv bootargs console=${console} " \
  176. "${mtdparts} " \
  177. "${defargs} " \
  178. "${optargs} " \
  179. "root=${nandroot} " \
  180. "rootfstype=${nandrootfstype}\0" \
  181. "nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
  182. "echo Booting uImage from NAND MTD 'kernel' partition ...; " \
  183. "run nandargs; " \
  184. "bootm ${loadaddr} - ${fdtaddr}; " \
  185. "fi\0" \
  186. "loadramdisk=ext4load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
  187. "ramdisk=rootfs.ext2.gz.uboot\0" \
  188. "ramdisk_size=16384\0" \
  189. "ramroot=/dev/ram rw\0" \
  190. "ramrootfstype=ext2\0" \
  191. "ramargs=run defaultargs; setenv bootargs console=${console} " \
  192. "${mtdparts} " \
  193. "${defargs} " \
  194. "${optargs} " \
  195. "root=${ramroot} ramdisk_size=${ramdisk_size} " \
  196. "rootfstype=${ramrootfstype}\0" \
  197. "ramboot=run mmcbootenv; " \
  198. "if run loadimage && run loaddtb && run loadramdisk; then " \
  199. "echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} w/ramdisk ...; " \
  200. "run ramargs; " \
  201. "bootz ${loadaddr} ${rdaddr} ${fdtaddr}; " \
  202. "fi\0" \
  203. BOOTENV
  204. #endif /* __CONFIG_H */