baltos.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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 MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */
  20. #define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM
  21. #define CONFIG_BOARD_LATE_INIT
  22. /* Clock Defines */
  23. #define V_OSCK 24000000 /* Clock output from T2 */
  24. #define V_SCLK (V_OSCK)
  25. /* Custom script for NOR */
  26. #define CONFIG_SYS_LDSCRIPT "board/vscom/baltos/u-boot.lds"
  27. /* Always 128 KiB env size */
  28. #define CONFIG_ENV_SIZE (128 << 10)
  29. /* Enhance our eMMC support / experience. */
  30. #define CONFIG_CMD_GPT
  31. #define CONFIG_EFI_PARTITION
  32. #define CONFIG_PARTITION_UUIDS
  33. #define CONFIG_CMD_PART
  34. /* FIT support */
  35. #define CONFIG_SYS_BOOTM_LEN SZ_64M
  36. /* UBI Support */
  37. #define CONFIG_CMD_MTDPARTS
  38. #define CONFIG_MTD_PARTITIONS
  39. #define CONFIG_MTD_DEVICE
  40. #define CONFIG_RBTREE
  41. #define CONFIG_LZO
  42. #define CONFIG_CMD_UBIFS
  43. /* I2C configuration */
  44. #undef CONFIG_SYS_OMAP24_I2C_SPEED
  45. #define CONFIG_SYS_OMAP24_I2C_SPEED 1000
  46. #ifdef CONFIG_NAND
  47. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x00080000
  48. #ifdef CONFIG_SPL_OS_BOOT
  49. #define CONFIG_CMD_SPL_NAND_OFS 0x00080000 /* os parameters */
  50. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
  51. #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
  52. #endif
  53. #define NANDARGS \
  54. "mtdids=" MTDIDS_DEFAULT "\0" \
  55. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  56. "nandargs=setenv bootargs console=${console} " \
  57. "${optargs} " \
  58. "${mtdparts} " \
  59. "root=${nandroot} " \
  60. "rootfstype=${nandrootfstype}\0" \
  61. "nandroot=ubi0:rootfs rw ubi.mtd=5\0" \
  62. "nandrootfstype=ubifs rootwait=1\0" \
  63. "nandboot=echo Booting from nand ...; " \
  64. "run nandargs; " \
  65. "setenv loadaddr 0x84000000; " \
  66. "ubi part UBI; " \
  67. "ubifsmount ubi0:kernel; " \
  68. "ubifsload $loadaddr kernel-fit.itb;" \
  69. "ubifsumount; " \
  70. "bootm ${loadaddr}#conf${board_name}; " \
  71. "if test $? -ne 0; then echo Using default FIT config; " \
  72. "bootm ${loadaddr}; fi;\0"
  73. #else
  74. #define NANDARGS ""
  75. #endif
  76. #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  77. #ifndef CONFIG_SPL_BUILD
  78. #define CONFIG_EXTRA_ENV_SETTINGS \
  79. DEFAULT_LINUX_BOOT_ENV \
  80. "boot_fdt=try\0" \
  81. "bootpart=0:2\0" \
  82. "bootdir=/boot\0" \
  83. "bootfile=zImage\0" \
  84. "fdtfile=undefined\0" \
  85. "console=ttyO0,115200n8\0" \
  86. "partitions=" \
  87. "uuid_disk=${uuid_gpt_disk};" \
  88. "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
  89. "optargs=\0" \
  90. "mmcdev=0\0" \
  91. "mmcroot=/dev/mmcblk0p2 ro\0" \
  92. "usbroot=/dev/sda2 ro\0" \
  93. "mmcrootfstype=ext4 rootwait\0" \
  94. "usbrootfstype=ext4 rootwait\0" \
  95. "rootpath=/export/rootfs\0" \
  96. "nfsopts=nolock\0" \
  97. "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
  98. "::off\0" \
  99. "ramroot=/dev/ram0 rw\0" \
  100. "ramrootfstype=ext2\0" \
  101. "mmcargs=setenv bootargs console=${console} " \
  102. "${optargs} " \
  103. "${mtdparts} " \
  104. "root=${mmcroot} " \
  105. "rootfstype=${mmcrootfstype}\0" \
  106. "usbargs=setenv bootargs console=${console} " \
  107. "${optargs} " \
  108. "${mtdparts} " \
  109. "root=${usbroot} " \
  110. "rootfstype=${usbrootfstype}\0" \
  111. "spiroot=/dev/mtdblock4 rw\0" \
  112. "spirootfstype=jffs2\0" \
  113. "spisrcaddr=0xe0000\0" \
  114. "spiimgsize=0x362000\0" \
  115. "spibusno=0\0" \
  116. "spiargs=setenv bootargs console=${console} " \
  117. "${optargs} " \
  118. "root=${spiroot} " \
  119. "rootfstype=${spirootfstype}\0" \
  120. "netargs=setenv bootargs console=${console} " \
  121. "${optargs} " \
  122. "root=/dev/nfs " \
  123. "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
  124. "ip=dhcp\0" \
  125. "bootenv=uEnv.txt\0" \
  126. "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
  127. "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
  128. "importbootenv=echo Importing environment from mmc ...; " \
  129. "env import -t $loadaddr $filesize\0" \
  130. "usbimportbootenv=echo Importing environment from USB ...; " \
  131. "env import -t $loadaddr $filesize\0" \
  132. "ramargs=setenv bootargs console=${console} " \
  133. "${optargs} " \
  134. "root=${ramroot} " \
  135. "rootfstype=${ramrootfstype}\0" \
  136. "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
  137. "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  138. "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
  139. "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
  140. "usbloados=run usbargs; " \
  141. "bootm ${loadaddr}#conf${board_name}; " \
  142. "if test $? -ne 0; then " \
  143. "echo Using default FIT configuration; " \
  144. "bootm ${loadaddr}; " \
  145. "fi;\0" \
  146. "mmcloados=run mmcargs; " \
  147. "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
  148. "if run loadfdt; then " \
  149. "bootz ${loadaddr} - ${fdtaddr}; " \
  150. "else " \
  151. "if test ${boot_fdt} = try; then " \
  152. "bootz; " \
  153. "else " \
  154. "echo WARN: Cannot load the DT; " \
  155. "fi; " \
  156. "fi; " \
  157. "else " \
  158. "bootz; " \
  159. "fi;\0" \
  160. "usbboot=usb reset; " \
  161. "if usb storage; then " \
  162. "echo USB drive found;" \
  163. "if run usbloadbootenv; then " \
  164. "echo Loaded environment from ${bootenv};" \
  165. "run usbimportbootenv;" \
  166. "fi;" \
  167. "if test -n $uenvcmd; then " \
  168. "echo Running uenvcmd ...;" \
  169. "run uenvcmd;" \
  170. "fi;" \
  171. "if run usbloadimage; then " \
  172. "run usbloados;" \
  173. "fi;" \
  174. "fi;\0" \
  175. "mmcboot=mmc dev ${mmcdev}; " \
  176. "if mmc rescan; then " \
  177. "echo SD/MMC found on device ${mmcdev};" \
  178. "if run loadbootenv; then " \
  179. "echo Loaded environment from ${bootenv};" \
  180. "run importbootenv;" \
  181. "fi;" \
  182. "if test -n $uenvcmd; then " \
  183. "echo Running uenvcmd ...;" \
  184. "run uenvcmd;" \
  185. "fi;" \
  186. "if run loadimage; then " \
  187. "run mmcloados;" \
  188. "fi;" \
  189. "fi;\0" \
  190. "spiboot=echo Booting from spi ...; " \
  191. "run spiargs; " \
  192. "sf probe ${spibusno}:0; " \
  193. "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
  194. "bootz ${loadaddr}\0" \
  195. "netboot=echo Booting from network ...; " \
  196. "setenv autoload no; " \
  197. "dhcp; " \
  198. "tftp ${loadaddr} ${bootfile}; " \
  199. "tftp ${fdtaddr} ${fdtfile}; " \
  200. "run netargs; " \
  201. "bootz ${loadaddr} - ${fdtaddr}\0" \
  202. "ramboot=echo Booting from ramdisk ...; " \
  203. "run ramargs; " \
  204. "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
  205. "findfdt=setenv fdtfile am335x-baltos.dtb\0" \
  206. NANDARGS
  207. /*DFUARGS*/
  208. #endif
  209. #define CONFIG_BOOTCOMMAND \
  210. "run findfdt; " \
  211. "run usbboot;" \
  212. "run mmcboot;" \
  213. "setenv mmcdev 1; " \
  214. "setenv bootpart 1:2; " \
  215. "run mmcboot;" \
  216. "run nandboot;"
  217. /* NS16550 Configuration */
  218. #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
  219. #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
  220. #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
  221. #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
  222. #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
  223. #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
  224. #define CONFIG_BAUDRATE 115200
  225. #define CONFIG_CMD_EEPROM
  226. #define CONFIG_ENV_EEPROM_IS_ON_I2C
  227. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
  228. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  229. /* PMIC support */
  230. #define CONFIG_POWER_TPS65910
  231. /* SPL */
  232. #ifndef CONFIG_NOR_BOOT
  233. /* Bootcount using the RTC block */
  234. #define CONFIG_BOOTCOUNT_LIMIT
  235. #define CONFIG_BOOTCOUNT_AM33XX
  236. /* USB gadget RNDIS */
  237. /* General network SPL, both CPSW and USB gadget RNDIS */
  238. #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"*/
  239. #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
  240. #ifdef CONFIG_NAND
  241. #define CONFIG_NAND_OMAP_GPMC
  242. #define CONFIG_NAND_OMAP_GPMC_PREFETCH
  243. #define CONFIG_NAND_OMAP_ELM
  244. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  245. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  246. CONFIG_SYS_NAND_PAGE_SIZE)
  247. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  248. #define CONFIG_SYS_NAND_OOBSIZE 64
  249. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  250. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  251. #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
  252. 10, 11, 12, 13, 14, 15, 16, 17, \
  253. 18, 19, 20, 21, 22, 23, 24, 25, \
  254. 26, 27, 28, 29, 30, 31, 32, 33, \
  255. 34, 35, 36, 37, 38, 39, 40, 41, \
  256. 42, 43, 44, 45, 46, 47, 48, 49, \
  257. 50, 51, 52, 53, 54, 55, 56, 57, }
  258. #define CONFIG_SYS_NAND_ECCSIZE 512
  259. #define CONFIG_SYS_NAND_ECCBYTES 14
  260. #define CONFIG_SYS_NAND_ONFI_DETECTION
  261. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
  262. #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
  263. #endif
  264. #endif
  265. /*
  266. * USB configuration. We enable MUSB support, both for host and for
  267. * gadget. We set USB0 as peripheral and USB1 as host, based on the
  268. * board schematic and physical port wired to each. Then for host we
  269. * add mass storage support and for gadget we add both RNDIS ethernet
  270. * and DFU.
  271. */
  272. #define CONFIG_USB_MUSB_DSPS
  273. #define CONFIG_ARCH_MISC_INIT
  274. #define CONFIG_USB_MUSB_PIO_ONLY
  275. #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
  276. #define CONFIG_AM335X_USB0
  277. #define CONFIG_AM335X_USB0_MODE MUSB_HOST
  278. #define CONFIG_AM335X_USB1
  279. #define CONFIG_AM335X_USB1_MODE MUSB_OTG
  280. #ifdef CONFIG_USB_MUSB_GADGET
  281. #define CONFIG_USB_ETHER
  282. #define CONFIG_USB_ETH_RNDIS
  283. #define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
  284. #endif /* CONFIG_USB_MUSB_GADGET */
  285. #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
  286. /* disable host part of MUSB in SPL */
  287. /* disable EFI partitions and partition UUID support */
  288. #undef CONFIG_PARTITION_UUIDS
  289. #undef CONFIG_EFI_PARTITION
  290. /*
  291. * Disable CPSW SPL support so we fit within the 101KiB limit.
  292. */
  293. #endif
  294. /* Network. */
  295. #define CONFIG_PHY_GIGE
  296. #define CONFIG_PHYLIB
  297. #define CONFIG_PHY_ADDR 0
  298. #define CONFIG_PHY_SMSC
  299. #define CONFIG_MII
  300. #define CONFIG_PHY_ATHEROS
  301. /* NAND support */
  302. #ifdef CONFIG_NAND
  303. #define CONFIG_CMD_NAND
  304. #define GPMC_NAND_ECC_LP_x8_LAYOUT 1
  305. #if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
  306. #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
  307. #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \
  308. "128k(SPL.backup1)," \
  309. "128k(SPL.backup2)," \
  310. "128k(SPL.backup3)," \
  311. "1920k(u-boot)," \
  312. "-(UBI)"
  313. #define CONFIG_ENV_IS_NOWHERE
  314. #endif
  315. #endif
  316. #endif /* ! __CONFIG_BALTOS_H */