omap3_beagle.h 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. /*
  2. * (C) Copyright 2006-2008
  3. * Texas Instruments.
  4. * Richard Woodruff <r-woodruff2@ti.com>
  5. * Syed Mohammed Khasim <x0khasim@ti.com>
  6. *
  7. * Configuration settings for the TI OMAP3530 Beagle board.
  8. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  11. #ifndef __CONFIG_H
  12. #define __CONFIG_H
  13. #define CONFIG_NR_DRAM_BANKS 2 /* CS1 may or may not be populated */
  14. /*
  15. * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  16. * 64 bytes before this address should be set aside for u-boot.img's
  17. * header. That is 0x800FFFC0--0x80100000 should not be used for any
  18. * other needs. We use this rather than the inherited defines from
  19. * ti_armv7_common.h for backwards compatibility.
  20. */
  21. #define CONFIG_SYS_TEXT_BASE 0x80100000
  22. #define CONFIG_SPL_BSS_START_ADDR 0x80000000
  23. #define CONFIG_SPL_BSS_MAX_SIZE (512 << 10) /* 512 KB */
  24. #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
  25. #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
  26. #include <configs/ti_omap3_common.h>
  27. #define CONFIG_MISC_INIT_R
  28. #define CONFIG_REVISION_TAG 1
  29. #define CONFIG_ENV_OVERWRITE
  30. /* Status LED */
  31. /* Enable Multi Bus support for I2C */
  32. #define CONFIG_I2C_MULTI_BUS 1
  33. /* Probe all devices */
  34. #define CONFIG_SYS_I2C_NOPROBES {{0x0, 0x0}}
  35. /* USB */
  36. #define CONFIG_USB_MUSB_OMAP2PLUS
  37. #define CONFIG_USB_MUSB_PIO_ONLY
  38. #define CONFIG_TWL4030_USB 1
  39. #define CONFIG_USB_ETHER
  40. #define CONFIG_USB_ETHER_RNDIS
  41. #define CONFIG_USB_FUNCTION_FASTBOOT
  42. #define CONFIG_CMD_FASTBOOT
  43. #define CONFIG_ANDROID_BOOT_IMAGE
  44. #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
  45. #define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
  46. /* USB EHCI */
  47. #define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO 147
  48. #define CONFIG_USB_HOST_ETHER
  49. #define CONFIG_USB_ETHER_ASIX
  50. #define CONFIG_USB_ETHER_MCS7830
  51. #define CONFIG_USB_ETHER_SMSC95XX
  52. /* commands to include */
  53. #define MTDIDS_DEFAULT "nand0=nand"
  54. #define MTDPARTS_DEFAULT "mtdparts=nand:512k(x-loader),"\
  55. "1920k(u-boot),128k(u-boot-env),"\
  56. "4m(kernel),-(fs)"
  57. #define CONFIG_CMD_NAND /* NAND support */
  58. #define CONFIG_VIDEO_OMAP3 /* DSS Support */
  59. /*
  60. * TWL4030
  61. */
  62. #define CONFIG_TWL4030_LED 1
  63. /*
  64. * Board NAND Info.
  65. */
  66. #define CONFIG_NAND_OMAP_GPMC
  67. #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND */
  68. /* devices */
  69. #define BOOT_TARGET_DEVICES(func) \
  70. func(MMC, mmc, 0)
  71. #define CONFIG_BOOTCOMMAND \
  72. "run findfdt; " \
  73. "run distro_bootcmd; " \
  74. "mmc dev ${mmcdev}; if mmc rescan; then " \
  75. "if run userbutton; then " \
  76. "setenv bootenv uEnv.txt;" \
  77. "else " \
  78. "setenv bootenv user.txt;" \
  79. "fi;" \
  80. "echo SD/MMC found on device ${mmcdev};" \
  81. "if run loadbootenv; then " \
  82. "echo Loaded environment from ${bootenv};" \
  83. "run importbootenv;" \
  84. "fi;" \
  85. "if test -n $uenvcmd; then " \
  86. "echo Running uenvcmd ...;" \
  87. "run uenvcmd;" \
  88. "fi;" \
  89. "if run loadbootscript; then " \
  90. "run bootscript; " \
  91. "else " \
  92. "if run loadimage; then " \
  93. "run mmcboot;" \
  94. "fi;" \
  95. "fi; " \
  96. "fi;" \
  97. "run nandboot;" \
  98. "setenv bootfile zImage;" \
  99. "if run loadimage; then " \
  100. "run loadfdt;" \
  101. "run mmcbootz; " \
  102. "fi; " \
  103. #include <config_distro_bootcmd.h>
  104. #define CONFIG_EXTRA_ENV_SETTINGS \
  105. "loadaddr=0x80200000\0" \
  106. "kernel_addr_r=0x80200000\0" \
  107. "rdaddr=0x81000000\0" \
  108. "initrd_addr_r=0x81000000\0" \
  109. "fdt_high=0xffffffff\0" \
  110. "fdtaddr=0x80f80000\0" \
  111. "fdt_addr_r=0x80f80000\0" \
  112. "usbtty=cdc_acm\0" \
  113. "bootfile=uImage\0" \
  114. "ramdisk=ramdisk.gz\0" \
  115. "bootdir=/boot\0" \
  116. "bootpart=0:2\0" \
  117. "console=ttyO2,115200n8\0" \
  118. "mpurate=auto\0" \
  119. "buddy=none\0" \
  120. "optargs=\0" \
  121. "camera=none\0" \
  122. "vram=12M\0" \
  123. "dvimode=640x480MR-16@60\0" \
  124. "defaultdisplay=dvi\0" \
  125. "mmcdev=0\0" \
  126. "mmcroot=/dev/mmcblk0p2 rw\0" \
  127. "mmcrootfstype=ext3 rootwait\0" \
  128. "nandroot=ubi0:rootfs ubi.mtd=4\0" \
  129. "nandrootfstype=ubifs\0" \
  130. "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=0x81000000,64M\0" \
  131. "ramrootfstype=ext2\0" \
  132. "mmcargs=setenv bootargs console=${console} " \
  133. "${optargs} " \
  134. "mpurate=${mpurate} " \
  135. "buddy=${buddy} "\
  136. "camera=${camera} "\
  137. "vram=${vram} " \
  138. "omapfb.mode=dvi:${dvimode} " \
  139. "omapdss.def_disp=${defaultdisplay} " \
  140. "root=${mmcroot} " \
  141. "rootfstype=${mmcrootfstype}\0" \
  142. "nandargs=setenv bootargs console=${console} " \
  143. "${optargs} " \
  144. "mpurate=${mpurate} " \
  145. "buddy=${buddy} "\
  146. "camera=${camera} "\
  147. "vram=${vram} " \
  148. "omapfb.mode=dvi:${dvimode} " \
  149. "omapdss.def_disp=${defaultdisplay} " \
  150. "root=${nandroot} " \
  151. "rootfstype=${nandrootfstype}\0" \
  152. "findfdt=" \
  153. "if test $beaglerev = AxBx; then " \
  154. "setenv fdtfile omap3-beagle.dtb; fi; " \
  155. "if test $beaglerev = Cx; then " \
  156. "setenv fdtfile omap3-beagle.dtb; fi; " \
  157. "if test $beaglerev = C4; then " \
  158. "setenv fdtfile omap3-beagle.dtb; fi; " \
  159. "if test $beaglerev = xMAB; then " \
  160. "setenv fdtfile omap3-beagle-xm-ab.dtb; fi; " \
  161. "if test $beaglerev = xMC; then " \
  162. "setenv fdtfile omap3-beagle-xm.dtb; fi; " \
  163. "if test $fdtfile = undefined; then " \
  164. "echo WARNING: Could not determine device tree to use; fi; \0" \
  165. "validatefdt=" \
  166. "if test $beaglerev = xMAB; then " \
  167. "if test ! -e mmc ${bootpart} ${bootdir}/${fdtfile}; then " \
  168. "setenv fdtfile omap3-beagle-xm.dtb; " \
  169. "fi; " \
  170. "fi; \0" \
  171. "bootenv=uEnv.txt\0" \
  172. "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
  173. "importbootenv=echo Importing environment from mmc ...; " \
  174. "env import -t -r $loadaddr $filesize\0" \
  175. "ramargs=setenv bootargs console=${console} " \
  176. "${optargs} " \
  177. "mpurate=${mpurate} " \
  178. "buddy=${buddy} "\
  179. "vram=${vram} " \
  180. "omapfb.mode=dvi:${dvimode} " \
  181. "omapdss.def_disp=${defaultdisplay} " \
  182. "root=${ramroot} " \
  183. "rootfstype=${ramrootfstype}\0" \
  184. "loadramdisk=load mmc ${bootpart} ${rdaddr} ${bootdir}/${ramdisk}\0" \
  185. "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  186. "loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
  187. "bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
  188. "source ${loadaddr}\0" \
  189. "loadfdt=run validatefdt; load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  190. "mmcboot=echo Booting from mmc ...; " \
  191. "run mmcargs; " \
  192. "bootm ${loadaddr}\0" \
  193. "mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \
  194. "run mmcargs; " \
  195. "bootz ${loadaddr} - ${fdtaddr}\0" \
  196. "nandboot=echo Booting from nand ...; " \
  197. "run nandargs; " \
  198. "nand read ${loadaddr} 280000 400000; " \
  199. "bootm ${loadaddr}\0" \
  200. "ramboot=echo Booting from ramdisk ...; " \
  201. "run ramargs; " \
  202. "bootm ${loadaddr}\0" \
  203. "userbutton=if gpio input 173; then run userbutton_xm; " \
  204. "else run userbutton_nonxm; fi;\0" \
  205. "userbutton_xm=gpio input 4;\0" \
  206. "userbutton_nonxm=gpio input 7;\0" \
  207. BOOTENV
  208. /*
  209. * OMAP3 has 12 GP timers, they can be driven by the system clock
  210. * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
  211. * This rate is divided by a local divisor.
  212. */
  213. #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
  214. /*-----------------------------------------------------------------------
  215. * FLASH and environment organization
  216. */
  217. /* **** PISMO SUPPORT *** */
  218. #if defined(CONFIG_CMD_NAND)
  219. #define CONFIG_SYS_FLASH_BASE NAND_BASE
  220. #endif
  221. /* Monitor at start of flash */
  222. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  223. #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
  224. #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
  225. #define ONENAND_ENV_OFFSET 0x260000 /* environment starts here */
  226. #define SMNAND_ENV_OFFSET 0x260000 /* environment starts here */
  227. #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  228. #define CONFIG_ENV_OFFSET SMNAND_ENV_OFFSET
  229. #define CONFIG_ENV_ADDR SMNAND_ENV_OFFSET
  230. #define CONFIG_OMAP3_SPI
  231. /* Defines for SPL */
  232. #define CONFIG_SPL_OMAP3_ID_NAND
  233. /* NAND boot config */
  234. #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
  235. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  236. #define CONFIG_SYS_NAND_PAGE_COUNT 64
  237. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  238. #define CONFIG_SYS_NAND_OOBSIZE 64
  239. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  240. #define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
  241. #define CONFIG_SYS_NAND_ECCPOS {2, 3, 4, 5, 6, 7, 8, 9,\
  242. 10, 11, 12, 13}
  243. #define CONFIG_SYS_NAND_ECCSIZE 512
  244. #define CONFIG_SYS_NAND_ECCBYTES 3
  245. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_HAM1_CODE_HW
  246. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
  247. /* NAND: SPL falcon mode configs */
  248. #ifdef CONFIG_SPL_OS_BOOT
  249. #define CONFIG_CMD_SPL_NAND_OFS 0x240000
  250. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
  251. #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
  252. #endif
  253. #endif /* __CONFIG_H */