baltos.h 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. /*
  2. * am335x_evm.h
  3. *
  4. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation version 2.
  9. *
  10. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  11. * kind, whether express or implied; without even the implied warranty
  12. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef __CONFIG_BALTOS_H
  16. #define __CONFIG_BALTOS_H
  17. #include <linux/sizes.h>
  18. #include <configs/ti_am335x_common.h>
  19. #define CONFIG_MACH_TYPE MACH_TYPE_AM335XEVM
  20. /* Clock Defines */
  21. #define V_OSCK 24000000 /* Clock output from T2 */
  22. #define V_SCLK (V_OSCK)
  23. /* FIT support */
  24. #define CONFIG_SYS_BOOTM_LEN SZ_64M
  25. #ifdef CONFIG_MTD_RAW_NAND
  26. #define NANDARGS \
  27. "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
  28. "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
  29. "nandargs=setenv bootargs console=${console} " \
  30. "${optargs} " \
  31. "${mtdparts} " \
  32. "root=${nandroot} " \
  33. "rootfstype=${nandrootfstype}\0" \
  34. "nandroot=ubi0:rootfs rw ubi.mtd=5\0" \
  35. "nandrootfstype=ubifs rootwait=1\0" \
  36. "nandboot=echo Booting from nand ...; " \
  37. "run nandargs; " \
  38. "setenv loadaddr 0x84000000; " \
  39. "ubi part UBI; " \
  40. "ubifsmount ubi0:kernel; " \
  41. "ubifsload $loadaddr kernel-fit.itb;" \
  42. "ubifsumount; " \
  43. "bootm ${loadaddr}#conf${board_name}; " \
  44. "if test $? -ne 0; then echo Using default FIT config; " \
  45. "bootm ${loadaddr}; fi;\0"
  46. #else
  47. #define NANDARGS ""
  48. #endif
  49. #ifndef CONFIG_SPL_BUILD
  50. #define CONFIG_EXTRA_ENV_SETTINGS \
  51. DEFAULT_LINUX_BOOT_ENV \
  52. "boot_fdt=try\0" \
  53. "bootpart=0:2\0" \
  54. "bootdir=/boot\0" \
  55. "bootfile=zImage\0" \
  56. "fdtfile=undefined\0" \
  57. "console=ttyO0,115200n8\0" \
  58. "partitions=" \
  59. "uuid_disk=${uuid_gpt_disk};" \
  60. "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
  61. "optargs=\0" \
  62. "mmcdev=0\0" \
  63. "mmcroot=/dev/mmcblk0p2 ro\0" \
  64. "usbroot=/dev/sda2 ro\0" \
  65. "mmcrootfstype=ext4 rootwait\0" \
  66. "usbrootfstype=ext4 rootwait\0" \
  67. "rootpath=/export/rootfs\0" \
  68. "nfsopts=nolock\0" \
  69. "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
  70. "::off\0" \
  71. "ramroot=/dev/ram0 rw\0" \
  72. "ramrootfstype=ext2\0" \
  73. "mmcargs=setenv bootargs console=${console} " \
  74. "${optargs} " \
  75. "${mtdparts} " \
  76. "root=${mmcroot} " \
  77. "rootfstype=${mmcrootfstype}\0" \
  78. "usbargs=setenv bootargs console=${console} " \
  79. "${optargs} " \
  80. "${mtdparts} " \
  81. "root=${usbroot} " \
  82. "rootfstype=${usbrootfstype}\0" \
  83. "spiroot=/dev/mtdblock4 rw\0" \
  84. "spirootfstype=jffs2\0" \
  85. "spisrcaddr=0xe0000\0" \
  86. "spiimgsize=0x362000\0" \
  87. "spibusno=0\0" \
  88. "spiargs=setenv bootargs console=${console} " \
  89. "${optargs} " \
  90. "root=${spiroot} " \
  91. "rootfstype=${spirootfstype}\0" \
  92. "netargs=setenv bootargs console=${console} " \
  93. "${optargs} " \
  94. "root=/dev/nfs " \
  95. "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
  96. "ip=dhcp\0" \
  97. "bootenv=uEnv.txt\0" \
  98. "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
  99. "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
  100. "importbootenv=echo Importing environment from mmc ...; " \
  101. "env import -t $loadaddr $filesize\0" \
  102. "usbimportbootenv=echo Importing environment from USB ...; " \
  103. "env import -t $loadaddr $filesize\0" \
  104. "ramargs=setenv bootargs console=${console} " \
  105. "${optargs} " \
  106. "root=${ramroot} " \
  107. "rootfstype=${ramrootfstype}\0" \
  108. "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
  109. "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  110. "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
  111. "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  112. "usbloados=run usbargs; " \
  113. "bootm ${loadaddr}#conf${board_name}; " \
  114. "if test $? -ne 0; then " \
  115. "echo Using default FIT configuration; " \
  116. "bootm ${loadaddr}; " \
  117. "fi;\0" \
  118. "mmcloados=run mmcargs; " \
  119. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  120. "if run loadfdt; then " \
  121. "bootz ${loadaddr} - ${fdtaddr}; " \
  122. "else " \
  123. "if test ${boot_fdt} = try; then " \
  124. "bootz; " \
  125. "else " \
  126. "echo WARN: Cannot load the DT; " \
  127. "fi; " \
  128. "fi; " \
  129. "else " \
  130. "bootz; " \
  131. "fi;\0" \
  132. "usbboot=usb reset; " \
  133. "if usb storage; then " \
  134. "echo USB drive found;" \
  135. "if run usbloadbootenv; then " \
  136. "echo Loaded environment from ${bootenv};" \
  137. "run usbimportbootenv;" \
  138. "fi;" \
  139. "if test -n $uenvcmd; then " \
  140. "echo Running uenvcmd ...;" \
  141. "run uenvcmd;" \
  142. "fi;" \
  143. "if run usbloadimage; then " \
  144. "run usbloados;" \
  145. "fi;" \
  146. "fi;\0" \
  147. "mmcboot=mmc dev ${mmcdev}; " \
  148. "if mmc rescan; then " \
  149. "echo SD/MMC found on device ${mmcdev};" \
  150. "if run loadbootenv; then " \
  151. "echo Loaded environment from ${bootenv};" \
  152. "run importbootenv;" \
  153. "fi;" \
  154. "if test -n $uenvcmd; then " \
  155. "echo Running uenvcmd ...;" \
  156. "run uenvcmd;" \
  157. "fi;" \
  158. "if run loadimage; then " \
  159. "run mmcloados;" \
  160. "fi;" \
  161. "fi;\0" \
  162. "spiboot=echo Booting from spi ...; " \
  163. "run spiargs; " \
  164. "sf probe ${spibusno}:0; " \
  165. "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
  166. "bootz ${loadaddr}\0" \
  167. "netboot=echo Booting from network ...; " \
  168. "setenv autoload no; " \
  169. "dhcp; " \
  170. "tftp ${loadaddr} ${bootfile}; " \
  171. "tftp ${fdtaddr} ${fdtfile}; " \
  172. "run netargs; " \
  173. "bootz ${loadaddr} - ${fdtaddr}\0" \
  174. "ramboot=echo Booting from ramdisk ...; " \
  175. "run ramargs; " \
  176. "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
  177. "findfdt=setenv fdtfile am335x-baltos.dtb\0" \
  178. NANDARGS
  179. /*DFUARGS*/
  180. #endif
  181. #define CONFIG_BOOTCOMMAND \
  182. "run findfdt; " \
  183. "run usbboot;" \
  184. "run mmcboot;" \
  185. "setenv mmcdev 1; " \
  186. "setenv bootpart 1:2; " \
  187. "run mmcboot;" \
  188. "run nandboot;"
  189. /* NS16550 Configuration */
  190. #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
  191. #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
  192. #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
  193. #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
  194. #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
  195. #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
  196. #define CONFIG_ENV_EEPROM_IS_ON_I2C
  197. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
  198. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  199. /* PMIC support */
  200. #define CONFIG_POWER_TPS65910
  201. /* SPL */
  202. #ifndef CONFIG_NOR_BOOT
  203. #ifdef CONFIG_MTD_RAW_NAND
  204. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  205. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  206. CONFIG_SYS_NAND_PAGE_SIZE)
  207. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  208. #define CONFIG_SYS_NAND_OOBSIZE 64
  209. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  210. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  211. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  212. 10, 11, 12, 13, 14, 15, 16, 17, \
  213. 18, 19, 20, 21, 22, 23, 24, 25, \
  214. 26, 27, 28, 29, 30, 31, 32, 33, \
  215. 34, 35, 36, 37, 38, 39, 40, 41, \
  216. 42, 43, 44, 45, 46, 47, 48, 49, \
  217. 50, 51, 52, 53, 54, 55, 56, 57, }
  218. #define CONFIG_SYS_NAND_ECCSIZE 512
  219. #define CONFIG_SYS_NAND_ECCBYTES 14
  220. #define CONFIG_SYS_NAND_ONFI_DETECTION
  221. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
  222. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  223. #endif
  224. #endif
  225. /*
  226. * USB configuration. We enable MUSB support, both for host and for
  227. * gadget. We set USB0 as peripheral and USB1 as host, based on the
  228. * board schematic and physical port wired to each. Then for host we
  229. * add mass storage support and for gadget we add both RNDIS ethernet
  230. * and DFU.
  231. */
  232. #define CONFIG_AM335X_USB0
  233. #define CONFIG_AM335X_USB0_MODE MUSB_HOST
  234. #define CONFIG_AM335X_USB1
  235. #define CONFIG_AM335X_USB1_MODE MUSB_OTG
  236. /* NAND support */
  237. #ifdef CONFIG_MTD_RAW_NAND
  238. #define GPMC_NAND_ECC_LP_x8_LAYOUT 1
  239. #endif
  240. #endif /* ! __CONFIG_BALTOS_H */