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