bav335x.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /*
  2. * bav335x.h
  3. *
  4. * Copyright (c) 2012-2014 Birdland Audio - http://birdland.com/oem
  5. * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation version 2.
  10. *
  11. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  12. * kind, whether express or implied; without even the implied warranty
  13. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. #ifndef __CONFIG_BAV335X_H
  17. #define __CONFIG_BAV335X_H
  18. #include <configs/ti_am335x_common.h>
  19. #define CONFIG_ENV_IS_NOWHERE
  20. #ifndef CONFIG_SPL_BUILD
  21. # define CONFIG_TIMESTAMP
  22. # define CONFIG_LZO
  23. # ifdef CONFIG_ENABLE_VBOOT
  24. # endif
  25. #endif
  26. #define CONFIG_SYS_BOOTM_LEN (16 << 20)
  27. #define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */
  28. #define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM
  29. #define CONFIG_BOARD_LATE_INIT
  30. /* Clock Defines */
  31. #define V_OSCK 24000000 /* Clock output from T2 */
  32. #define V_SCLK (V_OSCK)
  33. /* Custom script for NOR */
  34. #define CONFIG_SYS_LDSCRIPT "board/birdland/bav335x/u-boot.lds"
  35. /* Always 128 KiB env size */
  36. #define CONFIG_ENV_SIZE (128 << 10)
  37. /* Enhance our eMMC support / experience. */
  38. #define CONFIG_CMD_GPT
  39. #define CONFIG_EFI_PARTITION
  40. #ifdef CONFIG_NAND
  41. #define NANDARGS \
  42. "mtdids=" MTDIDS_DEFAULT "\0" \
  43. "mtdparts=" MTDPARTS_DEFAULT "\0" \
  44. "nandargs=setenv bootargs console=${console} " \
  45. "${optargs} " \
  46. "root=${nandroot} " \
  47. "rootfstype=${nandrootfstype}\0" \
  48. "nandroot=ubi0:rootfs rw ubi.mtd=9,2048\0" \
  49. "nandrootfstype=ubifs rootwait=1\0" \
  50. "nandboot=echo Booting from nand ...; " \
  51. "run nandargs; " \
  52. "nand read ${fdtaddr} u-boot-spl-os; " \
  53. "nand read ${loadaddr} kernel; " \
  54. "bootz ${loadaddr} - ${fdtaddr}\0"
  55. #else
  56. #define NANDARGS ""
  57. #endif
  58. #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
  59. #ifndef CONFIG_SPL_BUILD
  60. #define CONFIG_EXTRA_ENV_SETTINGS \
  61. DEFAULT_LINUX_BOOT_ENV \
  62. "boot_fdt=try\0" \
  63. "bootpart=0:2\0" \
  64. "bootdir=\0" \
  65. "fdtdir=/dtbs\0" \
  66. "bootfile=zImage\0" \
  67. "fdtfile=undefined\0" \
  68. "console=ttyO0,115200n8\0" \
  69. "loadaddr=0x82000000\0" \
  70. "fdtaddr=0x88000000\0" \
  71. "rdaddr=0x88080000\0" \
  72. "initrd_high=0xffffffff\0" \
  73. "fdt_high=0xffffffff\0" \
  74. "partitions=" \
  75. "uuid_disk=${uuid_gpt_disk};" \
  76. "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
  77. "optargs=\0" \
  78. "cmdline=\0" \
  79. "mmcdev=0\0" \
  80. "mmcpart=1\0" \
  81. "mmcroot=/dev/mmcblk0p2 ro\0" \
  82. "mmcrootfstype=ext4 rootwait fixrtc\0" \
  83. "rootpath=/export/rootfs\0" \
  84. "nfsopts=nolock\0" \
  85. "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off\0" \
  86. "ramroot=/dev/ram0 rw\0" \
  87. "ramrootfstype=ext2\0" \
  88. "mmcargs=setenv bootargs console=${console} ${optargs} " \
  89. "root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}\0" \
  90. "server_ip=192.168.1.100\0" \
  91. "gw_ip=192.168.1.1\0" \
  92. "netmask=255.255.255.0\0" \
  93. "hostname=\0" \
  94. "device=eth0\0" \
  95. "autoconf=off\0" \
  96. "root_dir=/home/userid/targetNFS\0" \
  97. "nfs_options=,vers=3\0" \
  98. "nfsrootfstype=ext4 rootwait fixrtc\0" \
  99. "nfsargs=setenv bootargs console=${console} ${optargs} " \
  100. "root=/dev/nfs rw rootfstype=${nfsrootfstype} " \
  101. "nfsroot=${nfsroot} ip=${ip} ${cmdline}\0" \
  102. "netargs=setenv bootargs console=${console} " \
  103. "${optargs} root=/dev/nfs " \
  104. "nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp\0" \
  105. "bootenv=uEnv.txt\0" \
  106. "script=boot.scr\0" \
  107. "scriptfile=${script}\0" \
  108. "loadbootscript=load mmc ${bootpart} ${loadaddr} ${scriptfile};\0" \
  109. "bootscript=echo Running bootscript from mmc${bootpart} ...; " \
  110. "source ${loadaddr}\0" \
  111. "loadbootenv=load mmc ${bootpart} ${loadaddr} ${bootenv}\0" \
  112. "importbootenv=echo Importing environment from mmc ...; " \
  113. "env import -t -r $loadaddr $filesize\0" \
  114. "ramargs=setenv bootargs console=${console} " \
  115. "${optargs} root=${ramroot} rootfstype=${ramrootfstype}\0" \
  116. "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
  117. "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
  118. "loadrd=load mmc ${bootpart} ${rdaddr} " \
  119. "${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \
  120. "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; " \
  121. "load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
  122. "mmcboot=mmc dev ${mmcdev}; " \
  123. "if mmc rescan; then " \
  124. "gpio set 54;" \
  125. "setenv bootpart ${mmcdev}:1; " \
  126. "if test -e mmc ${bootpart} /etc/fstab; then " \
  127. "setenv mmcpart 1;" \
  128. "fi; " \
  129. "echo Checking for: /uEnv.txt ...;" \
  130. "if test -e mmc ${bootpart} /uEnv.txt; then " \
  131. "if run loadbootenv; then " \
  132. "gpio set 55;" \
  133. "echo Loaded environment from ${bootenv};" \
  134. "run importbootenv;" \
  135. "fi;" \
  136. "echo Checking if uenvcmd is set ...;" \
  137. "if test -n ${uenvcmd}; then " \
  138. "gpio set 56; " \
  139. "echo Running uenvcmd ...;" \
  140. "run uenvcmd;" \
  141. "fi;" \
  142. "echo Checking if client_ip is set ...;" \
  143. "if test -n ${client_ip}; then " \
  144. "if test -n ${dtb}; then " \
  145. "setenv fdtfile ${dtb};" \
  146. "echo using ${fdtfile} ...;" \
  147. "fi;" \
  148. "gpio set 56; " \
  149. "if test -n ${uname_r}; then " \
  150. "echo Running nfsboot_uname_r ...;" \
  151. "run nfsboot_uname_r;" \
  152. "fi;" \
  153. "echo Running nfsboot ...;" \
  154. "run nfsboot;" \
  155. "fi;" \
  156. "fi; " \
  157. "echo Checking for: /${script} ...;" \
  158. "if test -e mmc ${bootpart} /${script}; then " \
  159. "gpio set 55;" \
  160. "setenv scriptfile ${script};" \
  161. "run loadbootscript;" \
  162. "echo Loaded script from ${scriptfile};" \
  163. "gpio set 56; " \
  164. "run bootscript;" \
  165. "fi; " \
  166. "echo Checking for: /boot/${script} ...;" \
  167. "if test -e mmc ${bootpart} /boot/${script}; then " \
  168. "gpio set 55;" \
  169. "setenv scriptfile /boot/${script};" \
  170. "run loadbootscript;" \
  171. "echo Loaded script from ${scriptfile};" \
  172. "gpio set 56; " \
  173. "run bootscript;" \
  174. "fi; " \
  175. "echo Checking for: /boot/uEnv.txt ...;" \
  176. "for i in 1 2 3 4 5 6 7 ; do " \
  177. "setenv mmcpart ${i};" \
  178. "setenv bootpart ${mmcdev}:${mmcpart};" \
  179. "if test -e mmc ${bootpart} /boot/uEnv.txt; then " \
  180. "gpio set 55;" \
  181. "load mmc ${bootpart} ${loadaddr} " \
  182. "/boot/uEnv.txt;" \
  183. "env import -t ${loadaddr} ${filesize};" \
  184. "echo Loaded environment from /boot/uEnv.txt;" \
  185. "if test -n ${dtb}; then " \
  186. "setenv fdtfile ${dtb};" \
  187. "echo Using: dtb=${fdtfile} ...;" \
  188. "fi;" \
  189. "echo Checking if uname_r is set in " \
  190. "/boot/uEnv.txt...;" \
  191. "if test -n ${uname_r}; then " \
  192. "gpio set 56; " \
  193. "echo Running uname_boot ...;" \
  194. "setenv mmcroot /dev/mmcblk${mmcdev}" \
  195. "p${mmcpart} ro;" \
  196. "run uname_boot;" \
  197. "fi;" \
  198. "fi;" \
  199. "done;" \
  200. "fi;\0" \
  201. "netboot=echo Booting from network ...; " \
  202. "setenv autoload no; " \
  203. "dhcp; " \
  204. "tftp ${loadaddr} ${bootfile}; " \
  205. "tftp ${fdtaddr} ${fdtfile}; " \
  206. "run netargs; " \
  207. "bootz ${loadaddr} - ${fdtaddr}\0" \
  208. "nfsboot=echo Booting from ${server_ip} ...; " \
  209. "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
  210. "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}" \
  211. ":${device}:${autoconf}; " \
  212. "setenv autoload no; " \
  213. "setenv serverip ${server_ip}; " \
  214. "setenv ipaddr ${client_ip}; " \
  215. "tftp ${loadaddr} ${bootfile}; " \
  216. "tftp ${fdtaddr} dtbs/${fdtfile}; " \
  217. "run nfsargs; " \
  218. "bootz ${loadaddr} - ${fdtaddr}\0" \
  219. "nfsboot_uname_r=echo Booting from ${server_ip} ...; " \
  220. "setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
  221. "setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}" \
  222. ":${device}:${autoconf}; " \
  223. "setenv autoload no; " \
  224. "setenv serverip ${server_ip}; " \
  225. "setenv ipaddr ${client_ip}; " \
  226. "tftp ${loadaddr} vmlinuz-${uname_r}; " \
  227. "tftp ${fdtaddr} dtbs/${uname_r}/${fdtfile}; " \
  228. "run nfsargs; " \
  229. "bootz ${loadaddr} - ${fdtaddr}\0" \
  230. "ramboot=echo Booting from ramdisk ...; " \
  231. "run ramargs; " \
  232. "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
  233. "findfdt="\
  234. "if test $board_rev = B; then " \
  235. "setenv fdtfile birdland_bav335b.dtb; " \
  236. "setenv fdtbase am335x-boneblack; fi; " \
  237. "if test $board_rev = A; then " \
  238. "setenv fdtfile birdland_bav335a.dtb; " \
  239. "setenv fdtbase am335x-boneblack; fi; " \
  240. "if test $fdtfile = undefined; then " \
  241. "echo WARNING: Could not determine device tree to use; fi; \0" \
  242. "uname_boot="\
  243. "setenv bootdir /boot; " \
  244. "setenv bootfile vmlinuz-${uname_r}; " \
  245. "if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
  246. "echo loading ${bootdir}/${bootfile} ...; "\
  247. "run loadimage;" \
  248. "setenv fdtdir /boot/dtbs/${uname_r}; " \
  249. "if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \
  250. "run loadfdt;" \
  251. "else " \
  252. "setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
  253. "if test -e mmc ${bootpart} ${fdtdir}/" \
  254. "${fdtfile}; then " \
  255. "run loadfdt;" \
  256. "else " \
  257. "setenv fdtdir /boot/dtb-${uname_r}; " \
  258. "if test -e mmc ${bootpart} ${fdtdir}" \
  259. "/${fdtfile}; then " \
  260. "run loadfdt;" \
  261. "else " \
  262. "setenv fdtdir /boot/dtbs; " \
  263. "if test -e mmc ${bootpart} ${fdtdir}" \
  264. "/${fdtfile}; then " \
  265. "run loadfdt;" \
  266. "else " \
  267. "echo; echo unable to find " \
  268. "[${fdtfile}] " \
  269. "did you name it correctly?" \
  270. "echo booting fallback " \
  271. "[/boot/dtbs/" \
  272. "${uname_r}" \
  273. "/${fdtbase}.dtb]...;" \
  274. "setenv fdtdir /boot/dtbs/" \
  275. "${uname_r}; " \
  276. "setenv fdtfile " \
  277. "${fdtbase}.dtb; " \
  278. "run loadfdt;" \
  279. "fi;" \
  280. "fi;" \
  281. "fi;" \
  282. "fi;" \
  283. "fi; " \
  284. "setenv rdfile initrd.img-${uname_r}; " \
  285. "if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \
  286. "echo loading ${bootdir}/${rdfile} ...; "\
  287. "run loadrd;" \
  288. "if test -n ${uuid}; then " \
  289. "setenv mmcroot UUID=${uuid} ro;" \
  290. "fi;" \
  291. "run mmcargs;" \
  292. "echo debug: [${bootargs}] ... ;" \
  293. "echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} " \
  294. "${fdtaddr}] ... ;" \
  295. "bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
  296. "else " \
  297. "run mmcargs;" \
  298. "echo debug: [${bootargs}] ... ;" \
  299. "echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \
  300. "bootz ${loadaddr} - ${fdtaddr}; " \
  301. "fi;" \
  302. "fi;\0" \
  303. NANDARGS \
  304. DFUARGS
  305. #endif
  306. #define CONFIG_BOOTCOMMAND \
  307. "gpio set 53; " \
  308. "i2c mw 0x24 1 0x3e; " \
  309. "run findfdt; " \
  310. "setenv mmcdev 0; " \
  311. "setenv bootpart 0:1; " \
  312. "run mmcboot;" \
  313. "gpio clear 56; " \
  314. "gpio clear 55; " \
  315. "gpio clear 54; " \
  316. "setenv mmcdev 1; " \
  317. "setenv bootpart 1:1; " \
  318. "run mmcboot;"
  319. /* NS16550 Configuration */
  320. #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0 */
  321. #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
  322. #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
  323. #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
  324. #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
  325. #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
  326. #define CONFIG_BAUDRATE 115200
  327. #define CONFIG_CMD_EEPROM
  328. #define CONFIG_ENV_EEPROM_IS_ON_I2C
  329. #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
  330. #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
  331. /* PMIC support */
  332. #define CONFIG_POWER_TPS65217
  333. #define CONFIG_POWER_TPS65910
  334. /* SPL */
  335. #ifndef CONFIG_NOR_BOOT
  336. /* Bootcount using the RTC block */
  337. #define CONFIG_BOOTCOUNT_LIMIT
  338. #define CONFIG_BOOTCOUNT_AM33XX
  339. #define CONFIG_SYS_BOOTCOUNT_BE
  340. /* USB gadget RNDIS */
  341. #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
  342. #endif
  343. #ifdef CONFIG_NAND
  344. /* NAND: device related configs */
  345. #define CONFIG_SYS_NAND_5_ADDR_CYCLE
  346. #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
  347. CONFIG_SYS_NAND_PAGE_SIZE)
  348. #define CONFIG_SYS_NAND_PAGE_SIZE 2048
  349. #define CONFIG_SYS_NAND_OOBSIZE 64
  350. #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
  351. /* NAND: driver related configs */
  352. #define CONFIG_NAND_OMAP_GPMC
  353. #define CONFIG_NAND_OMAP_ELM
  354. #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
  355. #define CONFIG_SYS_NAND_ECCPOS { \
  356. 2, 3, 4, 5, 6, 7, 8, 9, \
  357. 10, 11, 12, 13, 14, 15, 16, 17, \
  358. 18, 19, 20, 21, 22, 23, 24, 25, \
  359. 26, 27, 28, 29, 30, 31, 32, 33, \
  360. 34, 35, 36, 37, 38, 39, 40, 41, \
  361. 42, 43, 44, 45, 46, 47, 48, 49, \
  362. 50, 51, 52, 53, 54, 55, 56, 57, }
  363. #define CONFIG_SYS_NAND_ECCSIZE 512
  364. #define CONFIG_SYS_NAND_ECCBYTES 14
  365. #define CONFIG_SYS_NAND_ONFI_DETECTION
  366. #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
  367. #define MTDIDS_DEFAULT "nand0=nand.0"
  368. #define MTDPARTS_DEFAULT \
  369. "mtdparts=nand.0:" \
  370. "128k(NAND.SPL)," \
  371. "128k(NAND.SPL.backup1)," \
  372. "128k(NAND.SPL.backup2)," \
  373. "128k(NAND.SPL.backup3)," \
  374. "256k(NAND.u-boot-spl-os)," \
  375. "1m(NAND.u-boot)," \
  376. "128k(NAND.u-boot-env)," \
  377. "128k(NAND.u-boot-env.backup1)," \
  378. "8m(NAND.kernel)," \
  379. "-(NAND.rootfs)"
  380. #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000
  381. #undef CONFIG_ENV_IS_NOWHERE
  382. #define CONFIG_ENV_IS_IN_NAND
  383. #define CONFIG_ENV_OFFSET 0x001c0000
  384. #define CONFIG_ENV_OFFSET_REDUND 0x001e0000
  385. #define CONFIG_SYS_ENV_SECT_SIZE CONFIG_SYS_NAND_BLOCK_SIZE
  386. /* NAND: SPL related configs */
  387. #ifdef CONFIG_SPL_NAND_SUPPORT
  388. #define CONFIG_SPL_NAND_AM33XX_BCH
  389. #endif
  390. #ifdef CONFIG_SPL_OS_BOOT
  391. #define CONFIG_CMD_SPL_NAND_OFS 0x00080000 /* os parameters */
  392. #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
  393. #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
  394. #endif
  395. #endif /* !CONFIG_NAND */
  396. /*
  397. * For NOR boot, we must set this to the start of where NOR is mapped
  398. * in memory.
  399. */
  400. #ifdef CONFIG_NOR_BOOT
  401. #define CONFIG_SYS_TEXT_BASE 0x08000000
  402. #endif
  403. /*
  404. * USB configuration. We enable MUSB support, both for host and for
  405. * gadget. We set USB0 as peripheral and USB1 as host, based on the
  406. * board schematic and physical port wired to each. Then for host we
  407. * add mass storage support and for gadget we add both RNDIS ethernet
  408. * and DFU.
  409. */
  410. #define CONFIG_USB_MUSB_DSPS
  411. #define CONFIG_ARCH_MISC_INIT
  412. #define CONFIG_USB_MUSB_PIO_ONLY
  413. #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
  414. #define CONFIG_AM335X_USB0
  415. #define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
  416. #define CONFIG_AM335X_USB1
  417. #define CONFIG_AM335X_USB1_MODE MUSB_HOST
  418. #ifndef CONFIG_SPL_USBETH_SUPPORT
  419. /* Fastboot */
  420. #define CONFIG_USB_FUNCTION_FASTBOOT
  421. #define CONFIG_CMD_FASTBOOT
  422. #define CONFIG_ANDROID_BOOT_IMAGE
  423. #define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR
  424. #define CONFIG_FASTBOOT_BUF_SIZE 0x07000000
  425. #define CONFIG_FASTBOOT_FLASH_MMC_DEV 1
  426. #endif
  427. #ifdef CONFIG_USB_MUSB_GADGET
  428. #define CONFIG_USB_FUNCTION_MASS_STORAGE
  429. #endif /* CONFIG_USB_MUSB_GADGET */
  430. #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
  431. /* disable host part of MUSB in SPL */
  432. /* disable EFI partitions and partition UUID support */
  433. #undef CONFIG_PARTITION_UUIDS
  434. #undef CONFIG_EFI_PARTITION
  435. #endif
  436. /* USB Device Firmware Update support */
  437. #ifndef CONFIG_SPL_BUILD
  438. #define DFU_ALT_INFO_MMC \
  439. "dfu_alt_info_mmc=" \
  440. "boot part 0 1;" \
  441. "rootfs part 0 2;" \
  442. "MLO fat 0 1;" \
  443. "MLO.raw raw 0x100 0x100;" \
  444. "u-boot.img.raw raw 0x300 0x400;" \
  445. "spl-os-args.raw raw 0x80 0x80;" \
  446. "spl-os-image.raw raw 0x900 0x2000;" \
  447. "spl-os-args fat 0 1;" \
  448. "spl-os-image fat 0 1;" \
  449. "u-boot.img fat 0 1;" \
  450. "uEnv.txt fat 0 1\0"
  451. #ifdef CONFIG_NAND
  452. #define DFU_ALT_INFO_NAND \
  453. "dfu_alt_info_nand=" \
  454. "SPL part 0 1;" \
  455. "SPL.backup1 part 0 2;" \
  456. "SPL.backup2 part 0 3;" \
  457. "SPL.backup3 part 0 4;" \
  458. "u-boot part 0 5;" \
  459. "u-boot-spl-os part 0 6;" \
  460. "kernel part 0 8;" \
  461. "rootfs part 0 9\0"
  462. #else
  463. #define DFU_ALT_INFO_NAND ""
  464. #endif
  465. #define DFU_ALT_INFO_RAM \
  466. "dfu_alt_info_ram=" \
  467. "kernel ram 0x80200000 0xD80000;" \
  468. "fdt ram 0x80F80000 0x80000;" \
  469. "ramdisk ram 0x81000000 0x4000000\0"
  470. #define DFUARGS \
  471. "dfu_alt_info_emmc=rawemmc raw 0 3751936\0" \
  472. DFU_ALT_INFO_MMC \
  473. DFU_ALT_INFO_RAM \
  474. DFU_ALT_INFO_NAND
  475. #endif
  476. /*
  477. * Default to using SPI for environment, etc.
  478. * 0x000000 - 0x020000 : SPL (128KiB)
  479. * 0x020000 - 0x0A0000 : U-Boot (512KiB)
  480. * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB)
  481. * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB)
  482. * 0x0E0000 - 0x442000 : Linux Kernel
  483. * 0x442000 - 0x800000 : Userland
  484. */
  485. #if defined(CONFIG_SPI_BOOT)
  486. /* SPL related */
  487. #define CONFIG_SPL_SPI_LOAD
  488. #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
  489. #define CONFIG_ENV_IS_IN_SPI_FLASH
  490. #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
  491. #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
  492. #define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
  493. #define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */
  494. #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */
  495. #define MTDIDS_DEFAULT "nor0=m25p80-flash.0"
  496. #define MTDPARTS_DEFAULT "mtdparts=m25p80-flash.0:128k(SPL)," \
  497. "512k(u-boot),128k(u-boot-env1)," \
  498. "128k(u-boot-env2),3464k(kernel)," \
  499. "-(rootfs)"
  500. #elif defined(CONFIG_EMMC_BOOT)
  501. #undef CONFIG_ENV_IS_NOWHERE
  502. #define CONFIG_ENV_IS_IN_MMC
  503. #define CONFIG_SYS_MMC_ENV_DEV 1
  504. #define CONFIG_SYS_MMC_ENV_PART 2
  505. #define CONFIG_ENV_OFFSET 0x0
  506. #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
  507. #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
  508. #endif
  509. /* SPI flash. */
  510. #define CONFIG_SF_DEFAULT_SPEED 24000000
  511. /* Network. */
  512. #define CONFIG_PHY_GIGE
  513. #define CONFIG_PHYLIB
  514. #define CONFIG_PHY_SMSC
  515. /*
  516. * NOR Size = 16 MiB
  517. * Number of Sectors/Blocks = 128
  518. * Sector Size = 128 KiB
  519. * Word length = 16 bits
  520. * Default layout:
  521. * 0x000000 - 0x07FFFF : U-Boot (512 KiB)
  522. * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB)
  523. * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB)
  524. * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB)
  525. * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB)
  526. */
  527. #if defined(CONFIG_NOR)
  528. #undef CONFIG_SYS_NO_FLASH
  529. #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
  530. #define CONFIG_SYS_FLASH_PROTECTION
  531. #define CONFIG_SYS_FLASH_CFI
  532. #define CONFIG_FLASH_CFI_DRIVER
  533. #define CONFIG_FLASH_CFI_MTD
  534. #define CONFIG_SYS_MAX_FLASH_SECT 128
  535. #define CONFIG_SYS_MAX_FLASH_BANKS 1
  536. #define CONFIG_SYS_FLASH_BASE (0x08000000)
  537. #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
  538. #define CONFIG_SYS_FLASH_SIZE 0x01000000
  539. #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
  540. /* Reduce SPL size by removing unlikey targets */
  541. #ifdef CONFIG_NOR_BOOT
  542. #define CONFIG_ENV_IS_IN_FLASH
  543. #define CONFIG_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
  544. #define CONFIG_ENV_OFFSET (512 << 10) /* 512 KiB */
  545. #define CONFIG_ENV_OFFSET_REDUND (768 << 10) /* 768 KiB */
  546. #define MTDIDS_DEFAULT "nor0=physmap-flash.0"
  547. #define MTDPARTS_DEFAULT \
  548. "mtdparts=physmap-flash.0:" \
  549. "512k(u-boot)," \
  550. "128k(u-boot-env1)," \
  551. "128k(u-boot-env2)," \
  552. "4m(kernel),-(rootfs)"
  553. #endif
  554. #endif /* NOR support */
  555. #endif /* ! __CONFIG_AM335X_EVM_H */