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