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 /* Platform/Board specific defs */
42 #define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
44 /* NS16550 Configuration */
45 #define CONFIG_SYS_NS16550_SERIAL
46 #define CONFIG_SYS_NS16550_CLK (48000000)
47 #define CONFIG_SYS_NS16550_COM1 0x44e09000
48 #define CONFIG_SYS_NS16550_COM4 0x481a6000
51 /* I2C Configuration */
55 #define CONFIG_SPL_BSS_START_ADDR 0x80000000
57 #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
58 10, 11, 12, 13, 14, 15, 16, 17, \
59 18, 19, 20, 21, 22, 23, 24, 25, \
60 26, 27, 28, 29, 30, 31, 32, 33, \
61 34, 35, 36, 37, 38, 39, 40, 41, \
62 42, 43, 44, 45, 46, 47, 48, 49, \
63 50, 51, 52, 53, 54, 55, 56, 57, }
65 #define CONFIG_SYS_NAND_ECCSIZE 512
66 #define CONFIG_SYS_NAND_ECCBYTES 14
68 #define CONFIG_SYS_NAND_ECCSTEPS 4
69 #define CONFIG_SYS_NAND_ECCTOTAL (CONFIG_SYS_NAND_ECCBYTES * \
70 CONFIG_SYS_NAND_ECCSTEPS)
72 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
75 * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
76 * 64 bytes before this address should be set aside for u-boot.img's
77 * header. That is 0x800FFFC0--0x80100000 should not be used for any
80 #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
81 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
84 * Since SPL did pll and ddr initialization for us,
85 * we don't need to do it twice.
88 #ifndef CONFIG_SPL_BUILD
90 /* USB DRACO ID as default */
91 #define CONFIG_USBD_HS
93 /* USB Device Firmware Update support */
94 #define DFU_MANIFEST_POLL_TIMEOUT 25000
96 #endif /* CONFIG_SPL_BUILD */
99 * Default to using SPI for environment, etc. We have multiple copies
100 * of SPL as the ROM will check these locations.
101 * 0x0 - 0x20000 : First copy of SPL
102 * 0x20000 - 0x40000 : Second copy of SPL
103 * 0x40000 - 0x60000 : Third copy of SPL
104 * 0x60000 - 0x80000 : Fourth copy of SPL
105 * 0x80000 - 0xDF000 : U-Boot
106 * 0xDF000 - 0xE0000 : U-Boot Environment
107 * 0xE0000 - 0x442000 : Linux Kernel
108 * 0x442000 - 0x800000 : Userland
112 #ifdef CONFIG_MTD_RAW_NAND
115 /* Commen environment */
116 #define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \
117 "setenv bootargs ${bootargs};" \
118 "mtdparts default;" \
123 #define COMMON_ENV_NAND_BOOT \
124 "nand_boot=echo Booting from nand; " \
125 "if test ${upgrade_available} -eq 1; then " \
126 "if test ${bootcount} -gt ${bootlimit}; " \
128 "setenv upgrade_available 0;" \
129 "setenv ${partitionset_active} true;" \
130 "if test -n ${A}; then " \
131 "setenv partitionset_active B; " \
134 "if test -n ${B}; then " \
135 "setenv partitionset_active A; " \
141 "echo set ${partitionset_active}...;" \
144 #define COMMON_ENV_NAND_CMDS "flash_self=run nand_boot\0" \
145 "flash_self_test=setenv testargs test; " \
147 "dfu_start=echo Preparing for dfu mode ...; " \
150 #define COMMON_ENV_SETTINGS \
152 "project_dir=targetdir\0" \
153 "upgrade_available=0\0" \
154 "altbootcmd=run bootcmd\0" \
155 "partitionset_active=A\0" \
156 "loadaddr=0x82000000\0" \
157 "kloadaddr=0x81000000\0" \
158 "script_addr=0x81900000\0" \
159 "console=console=ttyMTD,mtdoops console=ttyO0,115200n8 panic=5\0" \
160 "nfsopts=nolock rw\0" \
162 "bootenv=uEnv.txt\0" \
163 "bootargs_defaults=setenv bootargs " \
164 "console=${console} " \
167 "siemens_help=echo; "\
168 "echo Type 'run flash_self' to use kernel and root " \
169 "filesystem on memory; echo Type 'run flash_self_test' to " \
170 "use kernel and root filesystem on memory, boot in test " \
171 "mode; echo Not ready yet: 'run flash_nfs' to use kernel " \
172 "from memory and root filesystem over NFS; echo Type " \
173 "'run net_nfs' to get Kernel over TFTP and mount root " \
174 "filesystem over NFS; " \
175 "echo Set partitionset_active variable to 'A' " \
176 "or 'B' to select kernel and rootfs partition; " \
181 * Variant 1 partition layout
183 *| name | size | address area |
184 *-------------------------------------------------------
185 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
186 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
187 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
188 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
189 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
190 *| uboot.env | 128.000 KiB | 0x 260000..0x 27ffff |
191 *| kernel_a | 5.000 MiB | 0x 280000..0x 77ffff |
192 *| kernel_b | 5.000 MiB | 0x 780000..0x c7ffff |
193 *| mtdoops | 8.000 MiB | 0x c80000..0x 147ffff |
194 *| rootfs | 235.500 MiB | 0x 1480000..0x fffffff |
195 *-------------------------------------------------------
197 "mtdparts=omap2-nand.0:" \
199 "128k(spl.backup1)," \
200 "128k(spl.backup2)," \
201 "128k(spl.backup3)," \
210 #define DFU_ALT_INFO_NAND_V1 \
212 "spl.backup1 part 0 2;" \
213 "spl.backup2 part 0 3;" \
214 "spl.backup3 part 0 4;" \
216 "u-boot.env part 0 6;" \
217 "kernel_a part 0 7;" \
218 "kernel_b part 0 8;" \
219 "rootfs partubi 0 10"
221 #define CONFIG_ENV_SETTINGS_NAND_V1 \
222 "nand_active_ubi_vol=rootfs_a\0" \
223 "nand_active_ubi_vol_A=rootfs_a\0" \
224 "nand_active_ubi_vol_B=rootfs_b\0" \
225 "nand_root_fs_type=ubifs rootwait=1\0" \
226 "nand_src_addr=0x280000\0" \
227 "nand_src_addr_A=0x280000\0" \
228 "nand_src_addr_B=0x780000\0" \
229 "nand_args=run bootargs_defaults;" \
230 "mtdparts default;" \
231 "setenv ${partitionset_active} true;" \
232 "if test -n ${A}; then " \
233 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \
234 "setenv nand_src_addr ${nand_src_addr_A};" \
236 "if test -n ${B}; then " \
237 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \
238 "setenv nand_src_addr ${nand_src_addr_B};" \
240 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
241 "ubi.mtd=9,${ubi_off};" \
242 "setenv bootargs ${bootargs} " \
243 "root=${nand_root} noinitrd ${mtdparts} " \
244 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
245 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
247 COMMON_ENV_DFU_ARGS \
248 "dfu_alt_info=" DFU_ALT_INFO_NAND_V1 "\0" \
249 COMMON_ENV_NAND_BOOT \
250 "nand read.i ${kloadaddr} ${nand_src_addr} " \
251 "${nand_img_size}; bootm ${kloadaddr}\0" \
254 #define CONFIG_ENV_SETTINGS_V1 \
255 COMMON_ENV_SETTINGS \
256 "net_args=run bootargs_defaults;" \
257 "mtdparts default;" \
258 "setenv bootfile ${project_dir}/kernel/uImage;" \
259 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
260 "setenv bootargs ${bootargs} " \
261 "root=/dev/nfs ${mtdparts} " \
262 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
263 "ip=${ipaddr}:${serverip}:" \
264 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
265 "net_nfs=echo Booting from network ...; " \
267 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
268 "bootm ${kloadaddr}\0"
271 * Variant 2 partition layout (default)
272 * chip-size = 256MiB or 512 MiB
273 *| name | size | address area |
274 *-------------------------------------------------------
275 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
276 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
277 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
278 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
279 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
280 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
281 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
282 *| mtdoops | 512.000 KiB | 0x 360000..0x 3dffff |
283 *| (256) rootfs | 252.125 MiB | 0x 3E0000..0x fffffff |
284 *| (512) rootfs | 508.125 MiB | 0x 3E0000..0x1fffffff |
285 *-------------------------------------------------------
288 #define DFU_ALT_INFO_NAND_V2 \
290 "spl.backup1 part 0 2;" \
291 "spl.backup2 part 0 3;" \
292 "spl.backup3 part 0 4;" \
294 "u-boot.env0 part 0 6;" \
295 "u-boot.env1 part 0 7;" \
296 "rootfs partubi 0 9" \
298 #define CONFIG_ENV_SETTINGS_NAND_V2 \
299 "nand_active_ubi_vol=rootfs_a\0" \
300 "rootfs_name=rootfs\0" \
301 "kernel_name=uImage\0"\
302 "nand_root_fs_type=ubifs rootwait=1\0" \
303 "nand_args=run bootargs_defaults;" \
304 "mtdparts default;" \
305 "setenv ${partitionset_active} true;" \
306 "if test -n ${A}; then " \
307 "setenv nand_active_ubi_vol ${rootfs_name}_a;" \
309 "if test -n ${B}; then " \
310 "setenv nand_active_ubi_vol ${rootfs_name}_b;" \
312 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
313 "ubi.mtd=rootfs,2048;" \
314 "setenv bootargs ${bootargs} " \
315 "root=${nand_root} noinitrd ${mtdparts} " \
316 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
317 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
319 COMMON_ENV_DFU_ARGS \
320 "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \
321 COMMON_ENV_NAND_BOOT \
322 "ubi part rootfs ${ubi_off};" \
323 "ubifsmount ubi0:${nand_active_ubi_vol};" \
324 "ubifsload ${kloadaddr} boot/${kernel_name};" \
325 "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \
326 "bootm ${kloadaddr} - ${loadaddr}\0" \
327 "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \
328 "bootm ${kloadaddr} - ${loadaddr}\0" \
331 #define CONFIG_ENV_SETTINGS_V2 \
332 COMMON_ENV_SETTINGS \
333 "net_args=run bootargs_defaults;" \
334 "mtdparts default;" \
335 "setenv bootfile ${project_dir}/kernel/uImage;" \
336 "setenv bootdtb ${project_dir}/kernel/dtb;" \
337 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
338 "setenv bootargs ${bootargs} " \
339 "root=/dev/nfs ${mtdparts} " \
340 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
341 "ip=${ipaddr}:${serverip}:" \
342 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
343 "net_nfs=echo Booting from network ...; " \
345 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
346 "tftpboot ${loadaddr} ${serverip}:${bootdtb}; " \
347 "bootm ${kloadaddr} - ${loadaddr}\0"
350 * Variant 3 partition layout
352 *| name | size | address area |
353 *-------------------------------------------------------
354 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
355 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
356 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
357 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
358 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
359 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
360 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
361 *| rootfs | 300.000 MiB | 0x 360000..0x12f5ffff |
362 *| mtdoops | 512.000 KiB | 0x12f60000..0x12fdffff |
363 *|configuration | 104.125 MiB | 0x12fe0000..0x1fffffff |
364 *-------------------------------------------------------
366 "mtdparts=omap2-nand.0:" \
368 "128k(spl.backup1)," \
369 "128k(spl.backup2)," \
370 "128k(spl.backup3)," \
372 "512k(u-boot.env0)," \
373 "512k(u-boot.env1)," \
380 #define CONFIG_SYS_NAND_BASE (0x08000000) /* physical address */
381 /* to access nand at */
383 #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND
385 #if !defined(CONFIG_SPI_BOOT)
386 #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
390 #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */