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