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 #define CONFIG_ROOTPATH "/opt/eldk"
22 #define CONFIG_SYS_AUTOLOAD "yes"
25 #define V_OSCK 24000000 /* Clock output from T2 */
26 #define V_SCLK (V_OSCK)
28 /* Console I/O Buffer Size */
31 * memtest works on 8 MB in DRAM after skipping 32MB from
32 * start addr of ram disk
35 /* Physical Memory Map */
36 #define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
38 #define CONFIG_SYS_SDRAM_BASE PHYS_DRAM_1
39 /* Platform/Board specific defs */
40 #define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
42 /* NS16550 Configuration */
43 #define CONFIG_SYS_NS16550_SERIAL
44 #define CONFIG_SYS_NS16550_CLK (48000000)
45 #define CONFIG_SYS_NS16550_COM1 0x44e09000
46 #define CONFIG_SYS_NS16550_COM4 0x481a6000
49 /* I2C Configuration */
53 #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
54 10, 11, 12, 13, 14, 15, 16, 17, \
55 18, 19, 20, 21, 22, 23, 24, 25, \
56 26, 27, 28, 29, 30, 31, 32, 33, \
57 34, 35, 36, 37, 38, 39, 40, 41, \
58 42, 43, 44, 45, 46, 47, 48, 49, \
59 50, 51, 52, 53, 54, 55, 56, 57, }
61 #define CONFIG_SYS_NAND_ECCSIZE 512
62 #define CONFIG_SYS_NAND_ECCBYTES 14
64 #define CONFIG_SYS_NAND_ECCSTEPS 4
65 #define CONFIG_SYS_NAND_ECCTOTAL (CONFIG_SYS_NAND_ECCBYTES * \
66 CONFIG_SYS_NAND_ECCSTEPS)
68 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
71 * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
72 * 64 bytes before this address should be set aside for u-boot.img's
73 * header. That is 0x800FFFC0--0x80100000 should not be used for any
78 * Since SPL did pll and ddr initialization for us,
79 * we don't need to do it twice.
82 /* USB DRACO ID as default */
83 #define CONFIG_USBD_HS
85 /* USB Device Firmware Update support */
86 #define DFU_MANIFEST_POLL_TIMEOUT 25000
89 * Default to using SPI for environment, etc. We have multiple copies
90 * of SPL as the ROM will check these locations.
91 * 0x0 - 0x20000 : First copy of SPL
92 * 0x20000 - 0x40000 : Second copy of SPL
93 * 0x40000 - 0x60000 : Third copy of SPL
94 * 0x60000 - 0x80000 : Fourth copy of SPL
95 * 0x80000 - 0xDF000 : U-Boot
96 * 0xDF000 - 0xE0000 : U-Boot Environment
97 * 0xE0000 - 0x442000 : Linux Kernel
98 * 0x442000 - 0x800000 : Userland
102 #ifdef CONFIG_MTD_RAW_NAND
105 /* Commen environment */
106 #define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \
107 "setenv bootargs ${bootargs};" \
108 "mtdparts default;" \
113 #define COMMON_ENV_NAND_BOOT \
114 "nand_boot=echo Booting from nand; " \
115 "if test ${upgrade_available} -eq 1; then " \
116 "if test ${bootcount} -gt ${bootlimit}; " \
118 "setenv upgrade_available 0;" \
119 "setenv ${partitionset_active} true;" \
120 "if test -n ${A}; then " \
121 "setenv partitionset_active B; " \
124 "if test -n ${B}; then " \
125 "setenv partitionset_active A; " \
131 "echo set ${partitionset_active}...;" \
134 #define COMMON_ENV_NAND_CMDS "flash_self=run nand_boot\0" \
135 "flash_self_test=setenv testargs test; " \
137 "dfu_start=echo Preparing for dfu mode ...; " \
140 #define COMMON_ENV_SETTINGS \
142 "project_dir=targetdir\0" \
143 "upgrade_available=0\0" \
144 "altbootcmd=run bootcmd\0" \
145 "partitionset_active=A\0" \
146 "loadaddr=0x82000000\0" \
147 "kloadaddr=0x81000000\0" \
148 "script_addr=0x81900000\0" \
149 "console=console=ttyMTD,mtdoops console=ttyO0,115200n8 panic=5\0" \
150 "nfsopts=nolock rw\0" \
152 "bootenv=uEnv.txt\0" \
153 "bootargs_defaults=setenv bootargs " \
154 "console=${console} " \
157 "siemens_help=echo; "\
158 "echo Type 'run flash_self' to use kernel and root " \
159 "filesystem on memory; echo Type 'run flash_self_test' to " \
160 "use kernel and root filesystem on memory, boot in test " \
161 "mode; echo Not ready yet: 'run flash_nfs' to use kernel " \
162 "from memory and root filesystem over NFS; echo Type " \
163 "'run net_nfs' to get Kernel over TFTP and mount root " \
164 "filesystem over NFS; " \
165 "echo Set partitionset_active variable to 'A' " \
166 "or 'B' to select kernel and rootfs partition; " \
171 * Variant 1 partition layout
173 *| name | size | address area |
174 *-------------------------------------------------------
175 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
176 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
177 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
178 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
179 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
180 *| uboot.env | 128.000 KiB | 0x 260000..0x 27ffff |
181 *| kernel_a | 5.000 MiB | 0x 280000..0x 77ffff |
182 *| kernel_b | 5.000 MiB | 0x 780000..0x c7ffff |
183 *| mtdoops | 8.000 MiB | 0x c80000..0x 147ffff |
184 *| rootfs | 235.500 MiB | 0x 1480000..0x fffffff |
185 *-------------------------------------------------------
187 "mtdparts=omap2-nand.0:" \
189 "128k(spl.backup1)," \
190 "128k(spl.backup2)," \
191 "128k(spl.backup3)," \
200 #define DFU_ALT_INFO_NAND_V1 \
202 "spl.backup1 part 0 2;" \
203 "spl.backup2 part 0 3;" \
204 "spl.backup3 part 0 4;" \
206 "u-boot.env part 0 6;" \
207 "kernel_a part 0 7;" \
208 "kernel_b part 0 8;" \
209 "rootfs partubi 0 10"
211 #define CONFIG_ENV_SETTINGS_NAND_V1 \
212 "nand_active_ubi_vol=rootfs_a\0" \
213 "nand_active_ubi_vol_A=rootfs_a\0" \
214 "nand_active_ubi_vol_B=rootfs_b\0" \
215 "nand_root_fs_type=ubifs rootwait\0" \
216 "nand_src_addr=0x280000\0" \
217 "nand_src_addr_A=0x280000\0" \
218 "nand_src_addr_B=0x780000\0" \
219 "nand_args=run bootargs_defaults;" \
220 "mtdparts default;" \
221 "setenv ${partitionset_active} true;" \
222 "if test -n ${A}; then " \
223 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \
224 "setenv nand_src_addr ${nand_src_addr_A};" \
226 "if test -n ${B}; then " \
227 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \
228 "setenv nand_src_addr ${nand_src_addr_B};" \
230 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
231 "ubi.mtd=9,${ubi_off};" \
232 "setenv bootargs ${bootargs} " \
233 "root=${nand_root} noinitrd ${mtdparts} " \
234 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
235 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
237 COMMON_ENV_DFU_ARGS \
238 "dfu_alt_info=" DFU_ALT_INFO_NAND_V1 "\0" \
239 COMMON_ENV_NAND_BOOT \
240 "nand read.i ${kloadaddr} ${nand_src_addr} " \
241 "${nand_img_size}; bootm ${kloadaddr}\0" \
244 #define CONFIG_ENV_SETTINGS_V1 \
245 COMMON_ENV_SETTINGS \
246 "net_args=run bootargs_defaults;" \
247 "mtdparts default;" \
248 "setenv bootfile ${project_dir}/kernel/uImage;" \
249 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
250 "setenv bootargs ${bootargs} " \
251 "root=/dev/nfs ${mtdparts} " \
252 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
253 "ip=${ipaddr}:${serverip}:" \
254 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
255 "net_nfs=echo Booting from network ...; " \
257 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
258 "bootm ${kloadaddr}\0"
261 * Variant 2 partition layout (default)
262 * chip-size = 256MiB or 512 MiB
263 *| name | size | address area |
264 *-------------------------------------------------------
265 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
266 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
267 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
268 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
269 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
270 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
271 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
272 *| mtdoops | 512.000 KiB | 0x 360000..0x 3dffff |
273 *| (256) rootfs | 252.125 MiB | 0x 3E0000..0x fffffff |
274 *| (512) rootfs | 508.125 MiB | 0x 3E0000..0x1fffffff |
275 *-------------------------------------------------------
278 #define DFU_ALT_INFO_NAND_V2 \
280 "spl.backup1 part 0 2;" \
281 "spl.backup2 part 0 3;" \
282 "spl.backup3 part 0 4;" \
284 "u-boot.env0 part 0 6;" \
285 "u-boot.env1 part 0 7;" \
286 "rootfs partubi 0 9" \
288 #define CONFIG_ENV_SETTINGS_NAND_V2 \
289 "nand_active_ubi_vol=rootfs_a\0" \
290 "rootfs_name=rootfs\0" \
291 "kernel_name=uImage\0"\
292 "nand_root_fs_type=ubifs rootwait\0" \
293 "nand_args=run bootargs_defaults;" \
294 "mtdparts default;" \
295 "setenv ${partitionset_active} true;" \
296 "if test -n ${A}; then " \
297 "setenv nand_active_ubi_vol ${rootfs_name}_a;" \
299 "if test -n ${B}; then " \
300 "setenv nand_active_ubi_vol ${rootfs_name}_b;" \
302 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
303 "ubi.mtd=rootfs,2048;" \
304 "setenv bootargs ${bootargs} " \
305 "root=${nand_root} noinitrd ${mtdparts} " \
306 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
307 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
309 COMMON_ENV_DFU_ARGS \
310 "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \
311 COMMON_ENV_NAND_BOOT \
312 "ubi part rootfs ${ubi_off};" \
313 "ubifsmount ubi0:${nand_active_ubi_vol};" \
314 "ubifsload ${kloadaddr} boot/${kernel_name};" \
315 "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \
316 "bootm ${kloadaddr} - ${loadaddr}\0" \
317 "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \
318 "bootm ${kloadaddr} - ${loadaddr}\0" \
321 #define CONFIG_ENV_SETTINGS_V2 \
322 COMMON_ENV_SETTINGS \
323 "net_args=run bootargs_defaults;" \
324 "mtdparts default;" \
325 "setenv bootfile ${project_dir}/kernel/uImage;" \
326 "setenv bootdtb ${project_dir}/kernel/dtb;" \
327 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
328 "setenv bootargs ${bootargs} " \
329 "root=/dev/nfs ${mtdparts} " \
330 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
331 "ip=${ipaddr}:${serverip}:" \
332 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
333 "net_nfs=echo Booting from network ...; " \
335 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
336 "tftpboot ${loadaddr} ${serverip}:${bootdtb}; " \
337 "bootm ${kloadaddr} - ${loadaddr}\0"
340 * Variant 3 partition layout
342 *| name | size | address area |
343 *-------------------------------------------------------
344 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
345 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
346 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
347 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
348 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
349 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
350 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
351 *| rootfs | 300.000 MiB | 0x 360000..0x12f5ffff |
352 *| mtdoops | 512.000 KiB | 0x12f60000..0x12fdffff |
353 *|configuration | 104.125 MiB | 0x12fe0000..0x1fffffff |
354 *-------------------------------------------------------
356 "mtdparts=omap2-nand.0:" \
358 "128k(spl.backup1)," \
359 "128k(spl.backup2)," \
360 "128k(spl.backup3)," \
362 "512k(u-boot.env0)," \
363 "512k(u-boot.env1)," \
370 #define CONFIG_SYS_NAND_BASE (0x08000000) /* physical address */
371 /* to access nand at */
373 #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND
375 #if !defined(CONFIG_SPI_BOOT)
376 #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
380 #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */