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