1 /* 2 * siemens am33x common board options 3 * (C) Copyright 2013 Siemens Schweiz AG 4 * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de. 5 * 6 * Based on: 7 * U-Boot file:/include/configs/am335x_evm.h 8 * 9 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ 10 * 11 * SPDX-License-Identifier: GPL-2.0+ 12 */ 13 14 #ifndef __CONFIG_SIEMENS_AM33X_COMMON_H 15 #define __CONFIG_SIEMENS_AM33X_COMMON_H 16 17 #define CONFIG_AM33XX 18 #define CONFIG_OMAP 19 #define CONFIG_OMAP_COMMON 20 21 #include <asm/arch/omap.h> 22 23 #define CONFIG_DMA_COHERENT 24 #define CONFIG_DMA_COHERENT_SIZE (1 << 20) 25 26 #define CONFIG_ENV_SIZE (0x2000) 27 #define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024) 28 #define CONFIG_SYS_LONGHELP /* undef to save memory */ 29 #define CONFIG_BOARD_LATE_INIT 30 #define CONFIG_SYS_NO_FLASH 31 #ifdef CONFIG_SIEMENS_MACH_TYPE 32 #define CONFIG_MACH_TYPE CONFIG_SIEMENS_MACH_TYPE 33 #endif 34 35 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */ 36 #define CONFIG_SETUP_MEMORY_TAGS 37 #define CONFIG_INITRD_TAG 38 39 #define CONFIG_SYS_CACHELINE_SIZE 64 40 41 /* commands to include */ 42 #define CONFIG_CMD_ASKENV 43 #define CONFIG_CMD_CACHE 44 45 #define CONFIG_ENV_VARS_UBOOT_CONFIG 46 #ifndef CONFIG_SPL_BUILD 47 #define CONFIG_ROOTPATH "/opt/eldk" 48 #endif 49 50 #define CONFIG_ENV_OVERWRITE 1 51 #define CONFIG_ENV_IS_NOWHERE 52 53 #define CONFIG_SYS_LONGHELP 54 #define CONFIG_CMDLINE_EDITING 55 #define CONFIG_AUTO_COMPLETE 56 #define CONFIG_SYS_AUTOLOAD "yes" 57 58 /* Clock Defines */ 59 #define V_OSCK 24000000 /* Clock output from T2 */ 60 #define V_SCLK (V_OSCK) 61 62 /* We set the max number of command args high to avoid HUSH bugs. */ 63 #define CONFIG_SYS_MAXARGS 32 64 65 /* Console I/O Buffer Size */ 66 #define CONFIG_SYS_CBSIZE 1024 67 68 /* Print Buffer Size */ 69 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \ 70 + sizeof(CONFIG_SYS_PROMPT) + 16) 71 72 /* Boot Argument Buffer Size */ 73 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE 74 75 /* 76 * memtest works on 8 MB in DRAM after skipping 32MB from 77 * start addr of ram disk 78 */ 79 #define CONFIG_SYS_MEMTEST_START (PHYS_DRAM_1 + (64 * 1024 * 1024)) 80 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START \ 81 + (8 * 1024 * 1024)) 82 83 #define CONFIG_SYS_LOAD_ADDR 0x81000000 /* Default load address */ 84 85 #define CONFIG_MMC 86 #define CONFIG_GENERIC_MMC 87 #define CONFIG_OMAP_HSMMC 88 #define CONFIG_CMD_MMC 89 #define CONFIG_DOS_PARTITION 90 #define CONFIG_CMD_FAT 91 #define CONFIG_CMD_EXT2 92 93 #define CONFIG_SPI 94 #define CONFIG_OMAP3_SPI 95 #define CONFIG_MTD_DEVICE 96 #define CONFIG_SF_DEFAULT_SPEED (75000000) 97 98 /* Physical Memory Map */ 99 #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */ 100 #define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */ 101 102 #define CONFIG_SYS_SDRAM_BASE PHYS_DRAM_1 103 #define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \ 104 GENERATED_GBL_DATA_SIZE) 105 /* Platform/Board specific defs */ 106 #define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */ 107 #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */ 108 109 /* NS16550 Configuration */ 110 #define CONFIG_SYS_NS16550_SERIAL 111 #define CONFIG_SYS_NS16550_REG_SIZE (-4) 112 #define CONFIG_SYS_NS16550_CLK (48000000) 113 #define CONFIG_SYS_NS16550_COM1 0x44e09000 114 #define CONFIG_SYS_NS16550_COM4 0x481a6000 115 116 #define CONFIG_BAUDRATE 115200 117 118 #define CONFIG_SYS_CONSOLE_INFO_QUIET 119 #define CONFIG_SERIAL1 1 120 #define CONFIG_CONS_INDEX 1 121 122 /* I2C Configuration */ 123 #define CONFIG_I2C 124 #define CONFIG_SYS_I2C 125 #define CONFIG_SYS_OMAP24_I2C_SPEED 100000 126 #define CONFIG_SYS_OMAP24_I2C_SLAVE 1 127 #define CONFIG_SYS_I2C_OMAP24XX 128 129 /* Defines for SPL */ 130 #define CONFIG_SPL_FRAMEWORK 131 #define CONFIG_SPL_TEXT_BASE 0x402F0400 132 #define CONFIG_SPL_MAX_SIZE (101 * 1024) 133 134 #define CONFIG_SPL_BSS_START_ADDR 0x80000000 135 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */ 136 137 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */ 138 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1 139 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" 140 #define CONFIG_SPL_MMC_SUPPORT 141 #define CONFIG_SPL_FAT_SUPPORT 142 #define CONFIG_FS_FAT 143 #define CONFIG_SPL_I2C_SUPPORT 144 145 #define CONFIG_SPL_LIBCOMMON_SUPPORT 146 #define CONFIG_SPL_LIBDISK_SUPPORT 147 #define CONFIG_SPL_LIBGENERIC_SUPPORT 148 #define CONFIG_SPL_SERIAL_SUPPORT 149 #define CONFIG_SPL_YMODEM_SUPPORT 150 151 #define CONFIG_SPL_GPIO_SUPPORT 152 #define CONFIG_SPL_WATCHDOG_SUPPORT 153 154 #define CONFIG_SPL_SPI_SUPPORT 155 #define CONFIG_SPL_SPI_FLASH_SUPPORT 156 #define CONFIG_SPL_SPI_LOAD 157 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000 158 159 #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds" 160 161 #define CONFIG_SPL_BOARD_INIT 162 #define CONFIG_SPL_NAND_AM33XX_BCH 163 #define CONFIG_SPL_NAND_SUPPORT 164 #define CONFIG_SPL_NAND_BASE 165 #define CONFIG_SPL_NAND_DRIVERS 166 #define CONFIG_SPL_NAND_ECC 167 #define CONFIG_SYS_NAND_5_ADDR_CYCLE 168 #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \ 169 CONFIG_SYS_NAND_PAGE_SIZE) 170 #define CONFIG_SYS_NAND_PAGE_SIZE 2048 171 #define CONFIG_SYS_NAND_OOBSIZE 64 172 #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024) 173 #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS 174 #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ 175 10, 11, 12, 13, 14, 15, 16, 17, \ 176 18, 19, 20, 21, 22, 23, 24, 25, \ 177 26, 27, 28, 29, 30, 31, 32, 33, \ 178 34, 35, 36, 37, 38, 39, 40, 41, \ 179 42, 43, 44, 45, 46, 47, 48, 49, \ 180 50, 51, 52, 53, 54, 55, 56, 57, } 181 182 #define CONFIG_SYS_NAND_ECCSIZE 512 183 #define CONFIG_SYS_NAND_ECCBYTES 14 184 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW 185 186 #define CONFIG_SYS_NAND_ECCSTEPS 4 187 #define CONFIG_SYS_NAND_ECCTOTAL (CONFIG_SYS_NAND_ECCBYTES * \ 188 CONFIG_SYS_NAND_ECCSTEPS) 189 190 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE 191 192 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000 193 194 /* 195 * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM 196 * 64 bytes before this address should be set aside for u-boot.img's 197 * header. That is 0x800FFFC0--0x80100000 should not be used for any 198 * other needs. 199 */ 200 #define CONFIG_SYS_TEXT_BASE 0x80100000 201 #define CONFIG_SYS_SPL_MALLOC_START 0x80208000 202 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 203 204 /* 205 * Since SPL did pll and ddr initialization for us, 206 * we don't need to do it twice. 207 */ 208 #ifndef CONFIG_SPL_BUILD 209 #define CONFIG_SKIP_LOWLEVEL_INIT 210 #endif 211 212 #ifndef CONFIG_SPL_BUILD 213 /* 214 * USB configuration 215 */ 216 #define CONFIG_USB_MUSB_DSPS 217 #define CONFIG_ARCH_MISC_INIT 218 #define CONFIG_USB_MUSB_PIO_ONLY 219 #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT 220 #undef CONFIG_USB_GADGET_DUALSPEED 221 222 #define CONFIG_AM335X_USB0 223 #define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL 224 #define CONFIG_AM335X_USB1 225 #define CONFIG_AM335X_USB1_MODE MUSB_HOST 226 #ifdef CONFIG_USB_MUSB_HOST 227 #define CONFIG_USB_STORAGE 228 #endif 229 230 #ifdef CONFIG_USB_MUSB_GADGET 231 #define CONFIG_USB_ETHER 232 #define CONFIG_USB_ETH_RNDIS 233 #define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00" 234 #endif /* CONFIG_USB_MUSB_GADGET */ 235 236 /* USB DRACO ID as default */ 237 #define CONFIG_USBD_HS 238 239 /* USB Device Firmware Update support */ 240 #define CONFIG_USB_FUNCTION_DFU 241 #define CONFIG_DFU_NAND 242 #define CONFIG_CMD_DFU 243 #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 << 20) 244 #define DFU_MANIFEST_POLL_TIMEOUT 25000 245 246 #endif /* CONFIG_SPL_BUILD */ 247 248 /* 249 * Default to using SPI for environment, etc. We have multiple copies 250 * of SPL as the ROM will check these locations. 251 * 0x0 - 0x20000 : First copy of SPL 252 * 0x20000 - 0x40000 : Second copy of SPL 253 * 0x40000 - 0x60000 : Third copy of SPL 254 * 0x60000 - 0x80000 : Fourth copy of SPL 255 * 0x80000 - 0xDF000 : U-Boot 256 * 0xDF000 - 0xE0000 : U-Boot Environment 257 * 0xE0000 - 0x442000 : Linux Kernel 258 * 0x442000 - 0x800000 : Userland 259 */ 260 #if defined(CONFIG_SPI_BOOT) 261 # undef CONFIG_ENV_IS_NOWHERE 262 # define CONFIG_ENV_IS_IN_SPI_FLASH 263 # define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED 264 # define CONFIG_ENV_OFFSET (892 << 10) /* 892 KiB in */ 265 # define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */ 266 #endif /* SPI support */ 267 268 /* Unsupported features */ 269 #undef CONFIG_USE_IRQ 270 271 #define CONFIG_DRIVER_TI_CPSW 272 #define CONFIG_MII 273 #define CONFIG_PHY_GIGE 274 #define CONFIG_PHYLIB 275 #define CONFIG_CMD_MII 276 #define CONFIG_BOOTP_DEFAULT 277 #define CONFIG_BOOTP_DNS 278 #define CONFIG_BOOTP_DNS2 279 #define CONFIG_BOOTP_SEND_HOSTNAME 280 #define CONFIG_BOOTP_GATEWAY 281 #define CONFIG_BOOTP_SUBNETMASK 282 #define CONFIG_NET_RETRY_COUNT 10 283 284 #define CONFIG_NAND 285 /* NAND support */ 286 #ifdef CONFIG_NAND 287 #define CONFIG_CMD_NAND 288 289 /* UBI Support */ 290 #ifndef CONFIG_SPL_BUILD 291 #define CONFIG_CMD_MTDPARTS 292 #define CONFIG_MTD_PARTITIONS 293 #define CONFIG_MTD_DEVICE 294 #define CONFIG_RBTREE 295 #define CONFIG_LZO 296 #define CONFIG_CMD_UBI 297 #define CONFIG_CMD_UBIFS 298 #endif 299 300 /* Commen environment */ 301 #define CONFIG_PREBOOT 302 #define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \ 303 "setenv bootargs ${bootargs};" \ 304 "mtdparts default;" \ 305 "draco_led 1;" \ 306 "dfu 0 nand 0;" \ 307 "draco_led 0;\0" \ 308 309 #define COMMON_ENV_NAND_BOOT \ 310 "nand_boot=echo Booting from nand; " \ 311 "if test ${upgrade_available} -eq 1; then " \ 312 "if test ${bootcount} -gt ${bootlimit}; " \ 313 "then " \ 314 "setenv upgrade_available 0;" \ 315 "setenv ${partitionset_active} true;" \ 316 "if test -n ${A}; then " \ 317 "setenv partitionset_active B; " \ 318 "env delete A; " \ 319 "fi;" \ 320 "if test -n ${B}; then " \ 321 "setenv partitionset_active A; " \ 322 "env delete B; " \ 323 "fi;" \ 324 "saveenv; " \ 325 "fi;" \ 326 "fi;" \ 327 "echo set ${partitionset_active}...;" \ 328 "run nand_args; " 329 330 #define COMMON_ENV_NAND_CMDS "flash_self=run nand_boot\0" \ 331 "flash_self_test=setenv testargs test; " \ 332 "run nand_boot\0" \ 333 "dfu_start=echo Preparing for dfu mode ...; " \ 334 "run dfu_args; \0" 335 336 #define COMMON_ENV_SETTINGS \ 337 "verify=no \0" \ 338 "project_dir=targetdir\0" \ 339 "upgrade_available=0\0" \ 340 "altbootcmd=run bootcmd\0" \ 341 "bootlimit=3\0" \ 342 "partitionset_active=A\0" \ 343 "loadaddr=0x82000000\0" \ 344 "kloadaddr=0x81000000\0" \ 345 "script_addr=0x81900000\0" \ 346 "console=console=ttyMTD,mtdoops console=ttyO0,115200n8 panic=5\0" \ 347 "nfsopts=nolock rw\0" \ 348 "ip_method=none\0" \ 349 "bootenv=uEnv.txt\0" \ 350 "bootargs_defaults=setenv bootargs " \ 351 "console=${console} " \ 352 "${testargs} " \ 353 "${optargs}\0" \ 354 "siemens_help=echo; "\ 355 "echo Type 'run flash_self' to use kernel and root " \ 356 "filesystem on memory; echo Type 'run flash_self_test' to " \ 357 "use kernel and root filesystem on memory, boot in test " \ 358 "mode; echo Not ready yet: 'run flash_nfs' to use kernel " \ 359 "from memory and root filesystem over NFS; echo Type " \ 360 "'run net_nfs' to get Kernel over TFTP and mount root " \ 361 "filesystem over NFS; " \ 362 "echo Set partitionset_active variable to 'A' " \ 363 "or 'B' to select kernel and rootfs partition; " \ 364 "echo" \ 365 "\0" 366 367 /* 368 * Variant 1 partition layout 369 * chip-size = 256MiB 370 *| name | size | address area | 371 *------------------------------------------------------- 372 *| spl | 128.000 KiB | 0x 0..0x 1ffff | 373 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff | 374 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff | 375 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff | 376 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff | 377 *| uboot.env | 128.000 KiB | 0x 260000..0x 27ffff | 378 *| kernel_a | 5.000 MiB | 0x 280000..0x 77ffff | 379 *| kernel_b | 5.000 MiB | 0x 780000..0x c7ffff | 380 *| mtdoops | 8.000 MiB | 0x c80000..0x 147ffff | 381 *| rootfs | 235.500 MiB | 0x 1480000..0x fffffff | 382 *------------------------------------------------------- 383 */ 384 #define MTDIDS_NAME_STR "omap2-nand.0" 385 #define MTDIDS_DEFAULT "nand0=" MTDIDS_NAME_STR 386 #define MTDPARTS_DEFAULT_V1 "mtdparts=" MTDIDS_NAME_STR ":" \ 387 "128k(spl)," \ 388 "128k(spl.backup1)," \ 389 "128k(spl.backup2)," \ 390 "128k(spl.backup3)," \ 391 "1920k(u-boot)," \ 392 "128k(uboot.env)," \ 393 "5120k(kernel_a)," \ 394 "5120k(kernel_b)," \ 395 "8192k(mtdoops)," \ 396 "-(rootfs)" 397 398 #define DFU_ALT_INFO_NAND_V1 \ 399 "spl part 0 1;" \ 400 "spl.backup1 part 0 2;" \ 401 "spl.backup2 part 0 3;" \ 402 "spl.backup3 part 0 4;" \ 403 "u-boot part 0 5;" \ 404 "u-boot.env part 0 6;" \ 405 "kernel_a part 0 7;" \ 406 "kernel_b part 0 8;" \ 407 "rootfs partubi 0 10" 408 409 #define CONFIG_ENV_SETTINGS_NAND_V1 \ 410 "nand_active_ubi_vol=rootfs_a\0" \ 411 "nand_active_ubi_vol_A=rootfs_a\0" \ 412 "nand_active_ubi_vol_B=rootfs_b\0" \ 413 "nand_root_fs_type=ubifs rootwait=1\0" \ 414 "nand_src_addr=0x280000\0" \ 415 "nand_src_addr_A=0x280000\0" \ 416 "nand_src_addr_B=0x780000\0" \ 417 "nand_args=run bootargs_defaults;" \ 418 "mtdparts default;" \ 419 "setenv ${partitionset_active} true;" \ 420 "if test -n ${A}; then " \ 421 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \ 422 "setenv nand_src_addr ${nand_src_addr_A};" \ 423 "fi;" \ 424 "if test -n ${B}; then " \ 425 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \ 426 "setenv nand_src_addr ${nand_src_addr_B};" \ 427 "fi;" \ 428 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \ 429 "ubi.mtd=9,2048;" \ 430 "setenv bootargs ${bootargs} " \ 431 "root=${nand_root} noinitrd ${mtdparts} " \ 432 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \ 433 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \ 434 "=mtdoops\0" \ 435 COMMON_ENV_DFU_ARGS \ 436 "dfu_alt_info=" DFU_ALT_INFO_NAND_V1 "\0" \ 437 COMMON_ENV_NAND_BOOT \ 438 "nand read.i ${kloadaddr} ${nand_src_addr} " \ 439 "${nand_img_size}; bootm ${kloadaddr}\0" \ 440 COMMON_ENV_NAND_CMDS 441 442 #define CONFIG_ENV_SETTINGS_V1 \ 443 COMMON_ENV_SETTINGS \ 444 "net_args=run bootargs_defaults;" \ 445 "mtdparts default;" \ 446 "setenv bootfile ${project_dir}/kernel/uImage;" \ 447 "setenv rootpath /home/projects/${project_dir}/rootfs;" \ 448 "setenv bootargs ${bootargs} " \ 449 "root=/dev/nfs ${mtdparts} " \ 450 "nfsroot=${serverip}:${rootpath},${nfsopts} " \ 451 "ip=${ipaddr}:${serverip}:" \ 452 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ 453 "net_nfs=echo Booting from network ...; " \ 454 "run net_args; " \ 455 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \ 456 "bootm ${kloadaddr}\0" 457 458 /* 459 * Variant 2 partition layout 460 * chip-size = 256MiB or 512 MiB 461 *| name | size | address area | 462 *------------------------------------------------------- 463 *| spl | 128.000 KiB | 0x 0..0x 1ffff | 464 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff | 465 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff | 466 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff | 467 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff | 468 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff | 469 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff | 470 *| mtdoops | 512.000 KiB | 0x 360000..0x 3dffff | 471 *| (256) rootfs | 252.125 MiB | 0x 3E0000..0x fffffff | 472 *| (512) rootfs | 508.125 MiB | 0x 3E0000..0x1fffffff | 473 *------------------------------------------------------- 474 */ 475 476 #define MTDPARTS_DEFAULT_V2 "mtdparts=" MTDIDS_NAME_STR ":" \ 477 "128k(spl)," \ 478 "128k(spl.backup1)," \ 479 "128k(spl.backup2)," \ 480 "128k(spl.backup3)," \ 481 "1920k(u-boot)," \ 482 "512k(u-boot.env0)," \ 483 "512k(u-boot.env1)," \ 484 "512k(mtdoops)," \ 485 "-(rootfs)" 486 487 #define DFU_ALT_INFO_NAND_V2 \ 488 "spl part 0 1;" \ 489 "spl.backup1 part 0 2;" \ 490 "spl.backup2 part 0 3;" \ 491 "spl.backup3 part 0 4;" \ 492 "u-boot part 0 5;" \ 493 "u-boot.env0 part 0 6;" \ 494 "u-boot.env1 part 0 7;" \ 495 "rootfs partubi 0 9" \ 496 497 #define CONFIG_ENV_SETTINGS_NAND_V2 \ 498 "nand_active_ubi_vol=rootfs_a\0" \ 499 "rootfs_name=rootfs\0" \ 500 "kernel_name=uImage\0"\ 501 "nand_root_fs_type=ubifs rootwait=1\0" \ 502 "nand_args=run bootargs_defaults;" \ 503 "mtdparts default;" \ 504 "setenv ${partitionset_active} true;" \ 505 "if test -n ${A}; then " \ 506 "setenv nand_active_ubi_vol ${rootfs_name}_a;" \ 507 "fi;" \ 508 "if test -n ${B}; then " \ 509 "setenv nand_active_ubi_vol ${rootfs_name}_b;" \ 510 "fi;" \ 511 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \ 512 "ubi.mtd=rootfs,2048;" \ 513 "setenv bootargs ${bootargs} " \ 514 "root=${nand_root} noinitrd ${mtdparts} " \ 515 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \ 516 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \ 517 "=mtdoops\0" \ 518 COMMON_ENV_DFU_ARGS \ 519 "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \ 520 COMMON_ENV_NAND_BOOT \ 521 "ubi part rootfs 2048;" \ 522 "ubifsmount ubi0:${nand_active_ubi_vol};" \ 523 "ubifsload ${kloadaddr} boot/${kernel_name};" \ 524 "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \ 525 "bootm ${kloadaddr} - ${loadaddr}\0" \ 526 "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \ 527 "bootm ${kloadaddr} - ${loadaddr}\0" \ 528 COMMON_ENV_NAND_CMDS 529 530 #define CONFIG_ENV_SETTINGS_V2 \ 531 COMMON_ENV_SETTINGS \ 532 "net_args=run bootargs_defaults;" \ 533 "mtdparts default;" \ 534 "setenv bootfile ${project_dir}/kernel/uImage;" \ 535 "setenv bootdtb ${project_dir}/kernel/dtb;" \ 536 "setenv rootpath /home/projects/${project_dir}/rootfs;" \ 537 "setenv bootargs ${bootargs} " \ 538 "root=/dev/nfs ${mtdparts} " \ 539 "nfsroot=${serverip}:${rootpath},${nfsopts} " \ 540 "ip=${ipaddr}:${serverip}:" \ 541 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ 542 "net_nfs=echo Booting from network ...; " \ 543 "run net_args; " \ 544 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \ 545 "tftpboot ${loadaddr} ${serverip}:${bootdtb}; " \ 546 "bootm ${kloadaddr} - ${loadaddr}\0" 547 548 /* 549 * Variant 3 partition layout 550 * chip-size = 512MiB 551 *| name | size | address area | 552 *------------------------------------------------------- 553 *| spl | 128.000 KiB | 0x 0..0x 1ffff | 554 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff | 555 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff | 556 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff | 557 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff | 558 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff | 559 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff | 560 *| rootfs | 300.000 MiB | 0x 360000..0x12f5ffff | 561 *| mtdoops | 512.000 KiB | 0x12f60000..0x12fdffff | 562 *|configuration | 104.125 MiB | 0x12fe0000..0x1fffffff | 563 *------------------------------------------------------- 564 */ 565 566 #define MTDPARTS_DEFAULT_V3 "mtdparts=" MTDIDS_NAME_STR ":" \ 567 "128k(spl)," \ 568 "128k(spl.backup1)," \ 569 "128k(spl.backup2)," \ 570 "128k(spl.backup3)," \ 571 "1920k(u-boot)," \ 572 "512k(u-boot.env0)," \ 573 "512k(u-boot.env1)," \ 574 "300m(rootfs)," \ 575 "512k(mtdoops)," \ 576 "-(configuration)" 577 578 #define CONFIG_NAND_OMAP_GPMC 579 #define CONFIG_NAND_OMAP_ELM 580 #define CONFIG_SYS_NAND_BASE (0x08000000) /* physical address */ 581 /* to access nand at */ 582 /* CS0 */ 583 #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND 584 devices */ 585 #if !defined(CONFIG_SPI_BOOT) 586 #undef CONFIG_ENV_IS_NOWHERE 587 #define CONFIG_ENV_IS_IN_NAND 588 #define CONFIG_ENV_OFFSET 0x260000 /* environment starts here */ 589 #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ 590 #endif 591 #endif 592 593 #define CONFIG_OMAP_GPIO 594 595 /* Gpio cmd support */ 596 597 /* Watchdog */ 598 #define CONFIG_HW_WATCHDOG 599 600 /* Reboot after 60 sec if bootcmd fails */ 601 #define CONFIG_RESET_TO_RETRY 602 #define CONFIG_BOOT_RETRY_TIME 60 603 604 #define CONFIG_BOOTCOUNT_LIMIT 605 #define CONFIG_BOOTCOUNT_ENV 606 607 #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */ 608