Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 2 | /* |
| 3 | * siemens am33x common board options |
| 4 | * (C) Copyright 2013 Siemens Schweiz AG |
| 5 | * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de. |
| 6 | * |
| 7 | * Based on: |
| 8 | * U-Boot file:/include/configs/am335x_evm.h |
| 9 | * |
| 10 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #ifndef __CONFIG_SIEMENS_AM33X_COMMON_H |
| 14 | #define __CONFIG_SIEMENS_AM33X_COMMON_H |
| 15 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 16 | #include <asm/arch/omap.h> |
| 17 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 18 | /* commands to include */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 19 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 20 | #ifndef CONFIG_SPL_BUILD |
| 21 | #define CONFIG_ROOTPATH "/opt/eldk" |
| 22 | #endif |
| 23 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 24 | #define CONFIG_SYS_AUTOLOAD "yes" |
| 25 | |
| 26 | /* Clock Defines */ |
| 27 | #define V_OSCK 24000000 /* Clock output from T2 */ |
| 28 | #define V_SCLK (V_OSCK) |
| 29 | |
| 30 | /* We set the max number of command args high to avoid HUSH bugs. */ |
| 31 | #define CONFIG_SYS_MAXARGS 32 |
| 32 | |
| 33 | /* Console I/O Buffer Size */ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 34 | #define CONFIG_SYS_CBSIZE 1024 |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 35 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 36 | /* Boot Argument Buffer Size */ |
| 37 | #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE |
| 38 | |
| 39 | /* |
| 40 | * memtest works on 8 MB in DRAM after skipping 32MB from |
| 41 | * start addr of ram disk |
| 42 | */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 43 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 44 | /* Physical Memory Map */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 45 | #define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */ |
| 46 | |
| 47 | #define CONFIG_SYS_SDRAM_BASE PHYS_DRAM_1 |
| 48 | #define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \ |
| 49 | GENERATED_GBL_DATA_SIZE) |
| 50 | /* Platform/Board specific defs */ |
| 51 | #define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */ |
| 52 | #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 53 | |
| 54 | /* NS16550 Configuration */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 55 | #define CONFIG_SYS_NS16550_SERIAL |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 56 | #define CONFIG_SYS_NS16550_CLK (48000000) |
| 57 | #define CONFIG_SYS_NS16550_COM1 0x44e09000 |
| 58 | #define CONFIG_SYS_NS16550_COM4 0x481a6000 |
| 59 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 60 | |
| 61 | /* I2C Configuration */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 62 | |
| 63 | /* Defines for SPL */ |
Tom Rini | fa2f81b | 2016-08-26 13:30:43 -0400 | [diff] [blame] | 64 | #define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \ |
| 65 | CONFIG_SPL_TEXT_BASE) |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 66 | |
| 67 | #define CONFIG_SPL_BSS_START_ADDR 0x80000000 |
| 68 | #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */ |
| 69 | |
Guillaume GARDET | 205b4f3 | 2014-10-15 17:53:11 +0200 | [diff] [blame] | 70 | #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img" |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 71 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 72 | #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \ |
| 73 | 10, 11, 12, 13, 14, 15, 16, 17, \ |
| 74 | 18, 19, 20, 21, 22, 23, 24, 25, \ |
| 75 | 26, 27, 28, 29, 30, 31, 32, 33, \ |
| 76 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
| 77 | 42, 43, 44, 45, 46, 47, 48, 49, \ |
| 78 | 50, 51, 52, 53, 54, 55, 56, 57, } |
| 79 | |
| 80 | #define CONFIG_SYS_NAND_ECCSIZE 512 |
| 81 | #define CONFIG_SYS_NAND_ECCBYTES 14 |
| 82 | |
| 83 | #define CONFIG_SYS_NAND_ECCSTEPS 4 |
| 84 | #define CONFIG_SYS_NAND_ECCTOTAL (CONFIG_SYS_NAND_ECCBYTES * \ |
| 85 | CONFIG_SYS_NAND_ECCSTEPS) |
| 86 | |
| 87 | #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE |
| 88 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 89 | /* |
| 90 | * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM |
| 91 | * 64 bytes before this address should be set aside for u-boot.img's |
| 92 | * header. That is 0x800FFFC0--0x80100000 should not be used for any |
| 93 | * other needs. |
| 94 | */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 95 | #define CONFIG_SYS_SPL_MALLOC_START 0x80208000 |
| 96 | #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000 |
| 97 | |
| 98 | /* |
| 99 | * Since SPL did pll and ddr initialization for us, |
| 100 | * we don't need to do it twice. |
| 101 | */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 102 | |
| 103 | #ifndef CONFIG_SPL_BUILD |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 104 | |
Samuel Egli | 56eb3da | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 105 | /* USB DRACO ID as default */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 106 | #define CONFIG_USBD_HS |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 107 | |
| 108 | /* USB Device Firmware Update support */ |
Heiko Schocher | 401341d | 2014-03-18 08:09:57 +0100 | [diff] [blame] | 109 | #define DFU_MANIFEST_POLL_TIMEOUT 25000 |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 110 | |
| 111 | #endif /* CONFIG_SPL_BUILD */ |
| 112 | |
| 113 | /* |
| 114 | * Default to using SPI for environment, etc. We have multiple copies |
| 115 | * of SPL as the ROM will check these locations. |
| 116 | * 0x0 - 0x20000 : First copy of SPL |
| 117 | * 0x20000 - 0x40000 : Second copy of SPL |
| 118 | * 0x40000 - 0x60000 : Third copy of SPL |
| 119 | * 0x60000 - 0x80000 : Fourth copy of SPL |
| 120 | * 0x80000 - 0xDF000 : U-Boot |
| 121 | * 0xDF000 - 0xE0000 : U-Boot Environment |
| 122 | * 0xE0000 - 0x442000 : Linux Kernel |
| 123 | * 0x442000 - 0x800000 : Userland |
| 124 | */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 125 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 126 | /* NAND support */ |
Miquel Raynal | 88718be | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 127 | #ifdef CONFIG_MTD_RAW_NAND |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 128 | /* UBI Support */ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 129 | |
| 130 | /* Commen environment */ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 131 | #define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \ |
| 132 | "setenv bootargs ${bootargs};" \ |
| 133 | "mtdparts default;" \ |
| 134 | "draco_led 1;" \ |
| 135 | "dfu 0 nand 0;" \ |
| 136 | "draco_led 0;\0" \ |
| 137 | |
| 138 | #define COMMON_ENV_NAND_BOOT \ |
| 139 | "nand_boot=echo Booting from nand; " \ |
| 140 | "if test ${upgrade_available} -eq 1; then " \ |
| 141 | "if test ${bootcount} -gt ${bootlimit}; " \ |
| 142 | "then " \ |
| 143 | "setenv upgrade_available 0;" \ |
| 144 | "setenv ${partitionset_active} true;" \ |
| 145 | "if test -n ${A}; then " \ |
| 146 | "setenv partitionset_active B; " \ |
| 147 | "env delete A; " \ |
| 148 | "fi;" \ |
| 149 | "if test -n ${B}; then " \ |
| 150 | "setenv partitionset_active A; " \ |
| 151 | "env delete B; " \ |
| 152 | "fi;" \ |
| 153 | "saveenv; " \ |
| 154 | "fi;" \ |
| 155 | "fi;" \ |
| 156 | "echo set ${partitionset_active}...;" \ |
| 157 | "run nand_args; " |
| 158 | |
| 159 | #define COMMON_ENV_NAND_CMDS "flash_self=run nand_boot\0" \ |
| 160 | "flash_self_test=setenv testargs test; " \ |
| 161 | "run nand_boot\0" \ |
| 162 | "dfu_start=echo Preparing for dfu mode ...; " \ |
| 163 | "run dfu_args; \0" |
| 164 | |
| 165 | #define COMMON_ENV_SETTINGS \ |
| 166 | "verify=no \0" \ |
| 167 | "project_dir=targetdir\0" \ |
| 168 | "upgrade_available=0\0" \ |
| 169 | "altbootcmd=run bootcmd\0" \ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 170 | "partitionset_active=A\0" \ |
| 171 | "loadaddr=0x82000000\0" \ |
| 172 | "kloadaddr=0x81000000\0" \ |
| 173 | "script_addr=0x81900000\0" \ |
| 174 | "console=console=ttyMTD,mtdoops console=ttyO0,115200n8 panic=5\0" \ |
| 175 | "nfsopts=nolock rw\0" \ |
| 176 | "ip_method=none\0" \ |
| 177 | "bootenv=uEnv.txt\0" \ |
| 178 | "bootargs_defaults=setenv bootargs " \ |
| 179 | "console=${console} " \ |
| 180 | "${testargs} " \ |
| 181 | "${optargs}\0" \ |
| 182 | "siemens_help=echo; "\ |
| 183 | "echo Type 'run flash_self' to use kernel and root " \ |
| 184 | "filesystem on memory; echo Type 'run flash_self_test' to " \ |
| 185 | "use kernel and root filesystem on memory, boot in test " \ |
| 186 | "mode; echo Not ready yet: 'run flash_nfs' to use kernel " \ |
| 187 | "from memory and root filesystem over NFS; echo Type " \ |
| 188 | "'run net_nfs' to get Kernel over TFTP and mount root " \ |
| 189 | "filesystem over NFS; " \ |
| 190 | "echo Set partitionset_active variable to 'A' " \ |
| 191 | "or 'B' to select kernel and rootfs partition; " \ |
| 192 | "echo" \ |
| 193 | "\0" |
| 194 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 195 | /* |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 196 | * Variant 1 partition layout |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 197 | * chip-size = 256MiB |
| 198 | *| name | size | address area | |
| 199 | *------------------------------------------------------- |
| 200 | *| spl | 128.000 KiB | 0x 0..0x 1ffff | |
| 201 | *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff | |
| 202 | *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff | |
| 203 | *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff | |
| 204 | *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff | |
| 205 | *| uboot.env | 128.000 KiB | 0x 260000..0x 27ffff | |
| 206 | *| kernel_a | 5.000 MiB | 0x 280000..0x 77ffff | |
| 207 | *| kernel_b | 5.000 MiB | 0x 780000..0x c7ffff | |
| 208 | *| mtdoops | 8.000 MiB | 0x c80000..0x 147ffff | |
| 209 | *| rootfs | 235.500 MiB | 0x 1480000..0x fffffff | |
| 210 | *------------------------------------------------------- |
Tom Rini | 43ede0b | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 211 | |
| 212 | "mtdparts=omap2-nand.0:" \ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 213 | "128k(spl)," \ |
| 214 | "128k(spl.backup1)," \ |
| 215 | "128k(spl.backup2)," \ |
| 216 | "128k(spl.backup3)," \ |
| 217 | "1920k(u-boot)," \ |
| 218 | "128k(uboot.env)," \ |
| 219 | "5120k(kernel_a)," \ |
| 220 | "5120k(kernel_b)," \ |
| 221 | "8192k(mtdoops)," \ |
| 222 | "-(rootfs)" |
Tom Rini | 43ede0b | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 223 | */ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 224 | |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 225 | #define DFU_ALT_INFO_NAND_V1 \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 226 | "spl part 0 1;" \ |
| 227 | "spl.backup1 part 0 2;" \ |
| 228 | "spl.backup2 part 0 3;" \ |
| 229 | "spl.backup3 part 0 4;" \ |
| 230 | "u-boot part 0 5;" \ |
| 231 | "u-boot.env part 0 6;" \ |
| 232 | "kernel_a part 0 7;" \ |
| 233 | "kernel_b part 0 8;" \ |
| 234 | "rootfs partubi 0 10" |
| 235 | |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 236 | #define CONFIG_ENV_SETTINGS_NAND_V1 \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 237 | "nand_active_ubi_vol=rootfs_a\0" \ |
Samuel Egli | 56eb3da | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 238 | "nand_active_ubi_vol_A=rootfs_a\0" \ |
| 239 | "nand_active_ubi_vol_B=rootfs_b\0" \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 240 | "nand_root_fs_type=ubifs rootwait=1\0" \ |
| 241 | "nand_src_addr=0x280000\0" \ |
Samuel Egli | 56eb3da | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 242 | "nand_src_addr_A=0x280000\0" \ |
| 243 | "nand_src_addr_B=0x780000\0" \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 244 | "nand_args=run bootargs_defaults;" \ |
| 245 | "mtdparts default;" \ |
Samuel Egli | 56eb3da | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 246 | "setenv ${partitionset_active} true;" \ |
| 247 | "if test -n ${A}; then " \ |
| 248 | "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \ |
| 249 | "setenv nand_src_addr ${nand_src_addr_A};" \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 250 | "fi;" \ |
Samuel Egli | 56eb3da | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 251 | "if test -n ${B}; then " \ |
| 252 | "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \ |
| 253 | "setenv nand_src_addr ${nand_src_addr_B};" \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 254 | "fi;" \ |
| 255 | "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 256 | "ubi.mtd=9,${ubi_off};" \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 257 | "setenv bootargs ${bootargs} " \ |
| 258 | "root=${nand_root} noinitrd ${mtdparts} " \ |
| 259 | "rootfstype=${nand_root_fs_type} ip=${ip_method} " \ |
| 260 | "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \ |
| 261 | "=mtdoops\0" \ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 262 | COMMON_ENV_DFU_ARGS \ |
| 263 | "dfu_alt_info=" DFU_ALT_INFO_NAND_V1 "\0" \ |
| 264 | COMMON_ENV_NAND_BOOT \ |
| 265 | "nand read.i ${kloadaddr} ${nand_src_addr} " \ |
| 266 | "${nand_img_size}; bootm ${kloadaddr}\0" \ |
| 267 | COMMON_ENV_NAND_CMDS |
| 268 | |
| 269 | #define CONFIG_ENV_SETTINGS_V1 \ |
| 270 | COMMON_ENV_SETTINGS \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 271 | "net_args=run bootargs_defaults;" \ |
| 272 | "mtdparts default;" \ |
| 273 | "setenv bootfile ${project_dir}/kernel/uImage;" \ |
| 274 | "setenv rootpath /home/projects/${project_dir}/rootfs;" \ |
| 275 | "setenv bootargs ${bootargs} " \ |
| 276 | "root=/dev/nfs ${mtdparts} " \ |
| 277 | "nfsroot=${serverip}:${rootpath},${nfsopts} " \ |
Samuel Egli | 56eb3da | 2013-11-04 14:05:03 +0100 | [diff] [blame] | 278 | "ip=${ipaddr}:${serverip}:" \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 279 | "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 280 | "net_nfs=echo Booting from network ...; " \ |
| 281 | "run net_args; " \ |
| 282 | "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 283 | "bootm ${kloadaddr}\0" |
| 284 | |
| 285 | /* |
Tom Rini | 43ede0b | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 286 | * Variant 2 partition layout (default) |
Egli, Samuel | 0dd1c31 | 2015-07-01 17:57:39 +0200 | [diff] [blame] | 287 | * chip-size = 256MiB or 512 MiB |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 288 | *| name | size | address area | |
| 289 | *------------------------------------------------------- |
| 290 | *| spl | 128.000 KiB | 0x 0..0x 1ffff | |
| 291 | *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff | |
| 292 | *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff | |
| 293 | *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff | |
| 294 | *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff | |
| 295 | *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff | |
| 296 | *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff | |
Egli, Samuel | 0dd1c31 | 2015-07-01 17:57:39 +0200 | [diff] [blame] | 297 | *| mtdoops | 512.000 KiB | 0x 360000..0x 3dffff | |
| 298 | *| (256) rootfs | 252.125 MiB | 0x 3E0000..0x fffffff | |
| 299 | *| (512) rootfs | 508.125 MiB | 0x 3E0000..0x1fffffff | |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 300 | *------------------------------------------------------- |
| 301 | */ |
| 302 | |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 303 | #define DFU_ALT_INFO_NAND_V2 \ |
| 304 | "spl part 0 1;" \ |
| 305 | "spl.backup1 part 0 2;" \ |
| 306 | "spl.backup2 part 0 3;" \ |
| 307 | "spl.backup3 part 0 4;" \ |
| 308 | "u-boot part 0 5;" \ |
| 309 | "u-boot.env0 part 0 6;" \ |
| 310 | "u-boot.env1 part 0 7;" \ |
Egli, Samuel | 0dd1c31 | 2015-07-01 17:57:39 +0200 | [diff] [blame] | 311 | "rootfs partubi 0 9" \ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 312 | |
| 313 | #define CONFIG_ENV_SETTINGS_NAND_V2 \ |
| 314 | "nand_active_ubi_vol=rootfs_a\0" \ |
| 315 | "rootfs_name=rootfs\0" \ |
| 316 | "kernel_name=uImage\0"\ |
| 317 | "nand_root_fs_type=ubifs rootwait=1\0" \ |
| 318 | "nand_args=run bootargs_defaults;" \ |
| 319 | "mtdparts default;" \ |
| 320 | "setenv ${partitionset_active} true;" \ |
| 321 | "if test -n ${A}; then " \ |
| 322 | "setenv nand_active_ubi_vol ${rootfs_name}_a;" \ |
| 323 | "fi;" \ |
| 324 | "if test -n ${B}; then " \ |
| 325 | "setenv nand_active_ubi_vol ${rootfs_name}_b;" \ |
| 326 | "fi;" \ |
| 327 | "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \ |
Egli, Samuel | 0dd1c31 | 2015-07-01 17:57:39 +0200 | [diff] [blame] | 328 | "ubi.mtd=rootfs,2048;" \ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 329 | "setenv bootargs ${bootargs} " \ |
| 330 | "root=${nand_root} noinitrd ${mtdparts} " \ |
| 331 | "rootfstype=${nand_root_fs_type} ip=${ip_method} " \ |
| 332 | "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \ |
| 333 | "=mtdoops\0" \ |
| 334 | COMMON_ENV_DFU_ARGS \ |
| 335 | "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \ |
| 336 | COMMON_ENV_NAND_BOOT \ |
Heiko Schocher | 6b3943f | 2016-06-07 08:55:45 +0200 | [diff] [blame] | 337 | "ubi part rootfs ${ubi_off};" \ |
Heiko Schocher | 61159b7 | 2015-06-16 14:59:34 +0200 | [diff] [blame] | 338 | "ubifsmount ubi0:${nand_active_ubi_vol};" \ |
| 339 | "ubifsload ${kloadaddr} boot/${kernel_name};" \ |
| 340 | "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \ |
| 341 | "bootm ${kloadaddr} - ${loadaddr}\0" \ |
| 342 | "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \ |
| 343 | "bootm ${kloadaddr} - ${loadaddr}\0" \ |
| 344 | COMMON_ENV_NAND_CMDS |
| 345 | |
| 346 | #define CONFIG_ENV_SETTINGS_V2 \ |
| 347 | COMMON_ENV_SETTINGS \ |
| 348 | "net_args=run bootargs_defaults;" \ |
| 349 | "mtdparts default;" \ |
| 350 | "setenv bootfile ${project_dir}/kernel/uImage;" \ |
| 351 | "setenv bootdtb ${project_dir}/kernel/dtb;" \ |
| 352 | "setenv rootpath /home/projects/${project_dir}/rootfs;" \ |
| 353 | "setenv bootargs ${bootargs} " \ |
| 354 | "root=/dev/nfs ${mtdparts} " \ |
| 355 | "nfsroot=${serverip}:${rootpath},${nfsopts} " \ |
| 356 | "ip=${ipaddr}:${serverip}:" \ |
| 357 | "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \ |
| 358 | "net_nfs=echo Booting from network ...; " \ |
| 359 | "run net_args; " \ |
| 360 | "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \ |
| 361 | "tftpboot ${loadaddr} ${serverip}:${bootdtb}; " \ |
| 362 | "bootm ${kloadaddr} - ${loadaddr}\0" |
| 363 | |
Heiko Schocher | 578056c | 2015-06-15 14:56:41 +0200 | [diff] [blame] | 364 | /* |
| 365 | * Variant 3 partition layout |
| 366 | * chip-size = 512MiB |
| 367 | *| name | size | address area | |
| 368 | *------------------------------------------------------- |
| 369 | *| spl | 128.000 KiB | 0x 0..0x 1ffff | |
| 370 | *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff | |
| 371 | *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff | |
| 372 | *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff | |
| 373 | *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff | |
| 374 | *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff | |
| 375 | *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff | |
| 376 | *| rootfs | 300.000 MiB | 0x 360000..0x12f5ffff | |
| 377 | *| mtdoops | 512.000 KiB | 0x12f60000..0x12fdffff | |
| 378 | *|configuration | 104.125 MiB | 0x12fe0000..0x1fffffff | |
| 379 | *------------------------------------------------------- |
Heiko Schocher | 578056c | 2015-06-15 14:56:41 +0200 | [diff] [blame] | 380 | |
Tom Rini | 43ede0b | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 381 | "mtdparts=omap2-nand.0:" \ |
Heiko Schocher | 578056c | 2015-06-15 14:56:41 +0200 | [diff] [blame] | 382 | "128k(spl)," \ |
| 383 | "128k(spl.backup1)," \ |
| 384 | "128k(spl.backup2)," \ |
| 385 | "128k(spl.backup3)," \ |
| 386 | "1920k(u-boot)," \ |
| 387 | "512k(u-boot.env0)," \ |
| 388 | "512k(u-boot.env1)," \ |
| 389 | "300m(rootfs)," \ |
| 390 | "512k(mtdoops)," \ |
| 391 | "-(configuration)" |
| 392 | |
Tom Rini | 43ede0b | 2017-10-22 17:55:07 -0400 | [diff] [blame] | 393 | */ |
| 394 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 395 | #define CONFIG_SYS_NAND_BASE (0x08000000) /* physical address */ |
| 396 | /* to access nand at */ |
| 397 | /* CS0 */ |
| 398 | #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND |
| 399 | devices */ |
| 400 | #if !defined(CONFIG_SPI_BOOT) |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 401 | #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */ |
| 402 | #endif |
| 403 | #endif |
| 404 | |
Heiko Schocher | c0dcece | 2013-08-19 16:39:01 +0200 | [diff] [blame] | 405 | #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */ |