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 #define CONFIG_DMA_COHERENT
19 #define CONFIG_DMA_COHERENT_SIZE (1 << 20)
21 /* commands to include */
23 #ifndef CONFIG_SPL_BUILD
24 #define CONFIG_ROOTPATH "/opt/eldk"
27 #define CONFIG_SYS_AUTOLOAD "yes"
30 #define V_OSCK 24000000 /* Clock output from T2 */
31 #define V_SCLK (V_OSCK)
33 /* We set the max number of command args high to avoid HUSH bugs. */
34 #define CONFIG_SYS_MAXARGS 32
36 /* Console I/O Buffer Size */
37 #define CONFIG_SYS_CBSIZE 1024
39 /* Boot Argument Buffer Size */
40 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
43 * memtest works on 8 MB in DRAM after skipping 32MB from
44 * start addr of ram disk
47 /* Physical Memory Map */
48 #define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
50 #define CONFIG_SYS_SDRAM_BASE PHYS_DRAM_1
51 #define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \
52 GENERATED_GBL_DATA_SIZE)
53 /* Platform/Board specific defs */
54 #define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
55 #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
57 /* NS16550 Configuration */
58 #define CONFIG_SYS_NS16550_SERIAL
59 #define CONFIG_SYS_NS16550_CLK (48000000)
60 #define CONFIG_SYS_NS16550_COM1 0x44e09000
61 #define CONFIG_SYS_NS16550_COM4 0x481a6000
64 /* I2C Configuration */
67 #define CONFIG_SPL_MAX_SIZE (SRAM_SCRATCH_SPACE_ADDR - \
70 #define CONFIG_SPL_BSS_START_ADDR 0x80000000
71 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
73 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
75 #define CONFIG_SYS_NAND_ONFI_DETECTION
76 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
77 #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
78 10, 11, 12, 13, 14, 15, 16, 17, \
79 18, 19, 20, 21, 22, 23, 24, 25, \
80 26, 27, 28, 29, 30, 31, 32, 33, \
81 34, 35, 36, 37, 38, 39, 40, 41, \
82 42, 43, 44, 45, 46, 47, 48, 49, \
83 50, 51, 52, 53, 54, 55, 56, 57, }
85 #define CONFIG_SYS_NAND_ECCSIZE 512
86 #define CONFIG_SYS_NAND_ECCBYTES 14
87 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
89 #define CONFIG_SYS_NAND_ECCSTEPS 4
90 #define CONFIG_SYS_NAND_ECCTOTAL (CONFIG_SYS_NAND_ECCBYTES * \
91 CONFIG_SYS_NAND_ECCSTEPS)
93 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
95 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
98 * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
99 * 64 bytes before this address should be set aside for u-boot.img's
100 * header. That is 0x800FFFC0--0x80100000 should not be used for any
103 #define CONFIG_SYS_SPL_MALLOC_START 0x80208000
104 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
107 * Since SPL did pll and ddr initialization for us,
108 * we don't need to do it twice.
111 #ifndef CONFIG_SPL_BUILD
115 #define CONFIG_AM335X_USB0
116 #define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
117 #define CONFIG_AM335X_USB1
118 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
120 /* USB DRACO ID as default */
121 #define CONFIG_USBD_HS
123 /* USB Device Firmware Update support */
124 #define DFU_MANIFEST_POLL_TIMEOUT 25000
126 #endif /* CONFIG_SPL_BUILD */
129 * Default to using SPI for environment, etc. We have multiple copies
130 * of SPL as the ROM will check these locations.
131 * 0x0 - 0x20000 : First copy of SPL
132 * 0x20000 - 0x40000 : Second copy of SPL
133 * 0x40000 - 0x60000 : Third copy of SPL
134 * 0x60000 - 0x80000 : Fourth copy of SPL
135 * 0x80000 - 0xDF000 : U-Boot
136 * 0xDF000 - 0xE0000 : U-Boot Environment
137 * 0xE0000 - 0x442000 : Linux Kernel
138 * 0x442000 - 0x800000 : Userland
141 #define CONFIG_NET_RETRY_COUNT 10
144 #ifdef CONFIG_MTD_RAW_NAND
147 /* Commen environment */
148 #define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \
149 "setenv bootargs ${bootargs};" \
150 "mtdparts default;" \
155 #define COMMON_ENV_NAND_BOOT \
156 "nand_boot=echo Booting from nand; " \
157 "if test ${upgrade_available} -eq 1; then " \
158 "if test ${bootcount} -gt ${bootlimit}; " \
160 "setenv upgrade_available 0;" \
161 "setenv ${partitionset_active} true;" \
162 "if test -n ${A}; then " \
163 "setenv partitionset_active B; " \
166 "if test -n ${B}; then " \
167 "setenv partitionset_active A; " \
173 "echo set ${partitionset_active}...;" \
176 #define COMMON_ENV_NAND_CMDS "flash_self=run nand_boot\0" \
177 "flash_self_test=setenv testargs test; " \
179 "dfu_start=echo Preparing for dfu mode ...; " \
182 #define COMMON_ENV_SETTINGS \
184 "project_dir=targetdir\0" \
185 "upgrade_available=0\0" \
186 "altbootcmd=run bootcmd\0" \
187 "partitionset_active=A\0" \
188 "loadaddr=0x82000000\0" \
189 "kloadaddr=0x81000000\0" \
190 "script_addr=0x81900000\0" \
191 "console=console=ttyMTD,mtdoops console=ttyO0,115200n8 panic=5\0" \
192 "nfsopts=nolock rw\0" \
194 "bootenv=uEnv.txt\0" \
195 "bootargs_defaults=setenv bootargs " \
196 "console=${console} " \
199 "siemens_help=echo; "\
200 "echo Type 'run flash_self' to use kernel and root " \
201 "filesystem on memory; echo Type 'run flash_self_test' to " \
202 "use kernel and root filesystem on memory, boot in test " \
203 "mode; echo Not ready yet: 'run flash_nfs' to use kernel " \
204 "from memory and root filesystem over NFS; echo Type " \
205 "'run net_nfs' to get Kernel over TFTP and mount root " \
206 "filesystem over NFS; " \
207 "echo Set partitionset_active variable to 'A' " \
208 "or 'B' to select kernel and rootfs partition; " \
213 * Variant 1 partition layout
215 *| name | size | address area |
216 *-------------------------------------------------------
217 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
218 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
219 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
220 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
221 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
222 *| uboot.env | 128.000 KiB | 0x 260000..0x 27ffff |
223 *| kernel_a | 5.000 MiB | 0x 280000..0x 77ffff |
224 *| kernel_b | 5.000 MiB | 0x 780000..0x c7ffff |
225 *| mtdoops | 8.000 MiB | 0x c80000..0x 147ffff |
226 *| rootfs | 235.500 MiB | 0x 1480000..0x fffffff |
227 *-------------------------------------------------------
229 "mtdparts=omap2-nand.0:" \
231 "128k(spl.backup1)," \
232 "128k(spl.backup2)," \
233 "128k(spl.backup3)," \
242 #define DFU_ALT_INFO_NAND_V1 \
244 "spl.backup1 part 0 2;" \
245 "spl.backup2 part 0 3;" \
246 "spl.backup3 part 0 4;" \
248 "u-boot.env part 0 6;" \
249 "kernel_a part 0 7;" \
250 "kernel_b part 0 8;" \
251 "rootfs partubi 0 10"
253 #define CONFIG_ENV_SETTINGS_NAND_V1 \
254 "nand_active_ubi_vol=rootfs_a\0" \
255 "nand_active_ubi_vol_A=rootfs_a\0" \
256 "nand_active_ubi_vol_B=rootfs_b\0" \
257 "nand_root_fs_type=ubifs rootwait=1\0" \
258 "nand_src_addr=0x280000\0" \
259 "nand_src_addr_A=0x280000\0" \
260 "nand_src_addr_B=0x780000\0" \
261 "nand_args=run bootargs_defaults;" \
262 "mtdparts default;" \
263 "setenv ${partitionset_active} true;" \
264 "if test -n ${A}; then " \
265 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \
266 "setenv nand_src_addr ${nand_src_addr_A};" \
268 "if test -n ${B}; then " \
269 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \
270 "setenv nand_src_addr ${nand_src_addr_B};" \
272 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
273 "ubi.mtd=9,${ubi_off};" \
274 "setenv bootargs ${bootargs} " \
275 "root=${nand_root} noinitrd ${mtdparts} " \
276 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
277 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
279 COMMON_ENV_DFU_ARGS \
280 "dfu_alt_info=" DFU_ALT_INFO_NAND_V1 "\0" \
281 COMMON_ENV_NAND_BOOT \
282 "nand read.i ${kloadaddr} ${nand_src_addr} " \
283 "${nand_img_size}; bootm ${kloadaddr}\0" \
286 #define CONFIG_ENV_SETTINGS_V1 \
287 COMMON_ENV_SETTINGS \
288 "net_args=run bootargs_defaults;" \
289 "mtdparts default;" \
290 "setenv bootfile ${project_dir}/kernel/uImage;" \
291 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
292 "setenv bootargs ${bootargs} " \
293 "root=/dev/nfs ${mtdparts} " \
294 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
295 "ip=${ipaddr}:${serverip}:" \
296 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
297 "net_nfs=echo Booting from network ...; " \
299 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
300 "bootm ${kloadaddr}\0"
303 * Variant 2 partition layout (default)
304 * chip-size = 256MiB or 512 MiB
305 *| name | size | address area |
306 *-------------------------------------------------------
307 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
308 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
309 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
310 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
311 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
312 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
313 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
314 *| mtdoops | 512.000 KiB | 0x 360000..0x 3dffff |
315 *| (256) rootfs | 252.125 MiB | 0x 3E0000..0x fffffff |
316 *| (512) rootfs | 508.125 MiB | 0x 3E0000..0x1fffffff |
317 *-------------------------------------------------------
320 #define DFU_ALT_INFO_NAND_V2 \
322 "spl.backup1 part 0 2;" \
323 "spl.backup2 part 0 3;" \
324 "spl.backup3 part 0 4;" \
326 "u-boot.env0 part 0 6;" \
327 "u-boot.env1 part 0 7;" \
328 "rootfs partubi 0 9" \
330 #define CONFIG_ENV_SETTINGS_NAND_V2 \
331 "nand_active_ubi_vol=rootfs_a\0" \
332 "rootfs_name=rootfs\0" \
333 "kernel_name=uImage\0"\
334 "nand_root_fs_type=ubifs rootwait=1\0" \
335 "nand_args=run bootargs_defaults;" \
336 "mtdparts default;" \
337 "setenv ${partitionset_active} true;" \
338 "if test -n ${A}; then " \
339 "setenv nand_active_ubi_vol ${rootfs_name}_a;" \
341 "if test -n ${B}; then " \
342 "setenv nand_active_ubi_vol ${rootfs_name}_b;" \
344 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
345 "ubi.mtd=rootfs,2048;" \
346 "setenv bootargs ${bootargs} " \
347 "root=${nand_root} noinitrd ${mtdparts} " \
348 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
349 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
351 COMMON_ENV_DFU_ARGS \
352 "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \
353 COMMON_ENV_NAND_BOOT \
354 "ubi part rootfs ${ubi_off};" \
355 "ubifsmount ubi0:${nand_active_ubi_vol};" \
356 "ubifsload ${kloadaddr} boot/${kernel_name};" \
357 "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \
358 "bootm ${kloadaddr} - ${loadaddr}\0" \
359 "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \
360 "bootm ${kloadaddr} - ${loadaddr}\0" \
363 #define CONFIG_ENV_SETTINGS_V2 \
364 COMMON_ENV_SETTINGS \
365 "net_args=run bootargs_defaults;" \
366 "mtdparts default;" \
367 "setenv bootfile ${project_dir}/kernel/uImage;" \
368 "setenv bootdtb ${project_dir}/kernel/dtb;" \
369 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
370 "setenv bootargs ${bootargs} " \
371 "root=/dev/nfs ${mtdparts} " \
372 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
373 "ip=${ipaddr}:${serverip}:" \
374 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
375 "net_nfs=echo Booting from network ...; " \
377 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
378 "tftpboot ${loadaddr} ${serverip}:${bootdtb}; " \
379 "bootm ${kloadaddr} - ${loadaddr}\0"
382 * Variant 3 partition layout
384 *| name | size | address area |
385 *-------------------------------------------------------
386 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
387 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
388 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
389 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
390 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
391 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
392 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
393 *| rootfs | 300.000 MiB | 0x 360000..0x12f5ffff |
394 *| mtdoops | 512.000 KiB | 0x12f60000..0x12fdffff |
395 *|configuration | 104.125 MiB | 0x12fe0000..0x1fffffff |
396 *-------------------------------------------------------
398 "mtdparts=omap2-nand.0:" \
400 "128k(spl.backup1)," \
401 "128k(spl.backup2)," \
402 "128k(spl.backup3)," \
404 "512k(u-boot.env0)," \
405 "512k(u-boot.env1)," \
412 #define CONFIG_SYS_NAND_BASE (0x08000000) /* physical address */
413 /* to access nand at */
415 #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND
417 #if !defined(CONFIG_SPI_BOOT)
418 #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
422 /* Reboot after 60 sec if bootcmd fails */
423 #define CONFIG_RESET_TO_RETRY
424 #define CONFIG_BOOT_RETRY_TIME 60
426 #endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */