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