]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/configs/siemens-am33x-common.h
configs: Re-sync CONFIG_USB_MUSB_HOST
[people/ms/u-boot.git] / include / configs / siemens-am33x-common.h
CommitLineData
c0dcece7
HS
1/*
2 * siemens am33x common board options
3 * (C) Copyright 2013 Siemens Schweiz AG
4 * (C) Heiko Schocher, DENX Software Engineering, hs@denx.de.
5 *
6 * Based on:
7 * U-Boot file:/include/configs/am335x_evm.h
8 *
9 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * SPDX-License-Identifier: GPL-2.0+
12 */
13
14#ifndef __CONFIG_SIEMENS_AM33X_COMMON_H
15#define __CONFIG_SIEMENS_AM33X_COMMON_H
16
17#define CONFIG_AM33XX
18#define CONFIG_OMAP
19#define CONFIG_OMAP_COMMON
20
21#include <asm/arch/omap.h>
22
23#define CONFIG_DMA_COHERENT
24#define CONFIG_DMA_COHERENT_SIZE (1 << 20)
25
26#define CONFIG_ENV_SIZE (0x2000)
27#define CONFIG_SYS_MALLOC_LEN (16 * 1024 * 1024)
28#define CONFIG_SYS_LONGHELP /* undef to save memory */
c0dcece7
HS
29#define CONFIG_BOARD_LATE_INIT
30#define CONFIG_SYS_NO_FLASH
578056c3 31#ifdef CONFIG_SIEMENS_MACH_TYPE
c0dcece7 32#define CONFIG_MACH_TYPE CONFIG_SIEMENS_MACH_TYPE
578056c3 33#endif
c0dcece7
HS
34
35#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
36#define CONFIG_SETUP_MEMORY_TAGS
37#define CONFIG_INITRD_TAG
38
39#define CONFIG_SYS_CACHELINE_SIZE 64
40
41/* commands to include */
c0dcece7 42#define CONFIG_CMD_ASKENV
c0dcece7 43#define CONFIG_CMD_CACHE
61159b76 44#define CONFIG_CMD_TIME
c0dcece7 45
d14c6335 46
c0dcece7
HS
47#define CONFIG_ENV_VARS_UBOOT_CONFIG
48#ifndef CONFIG_SPL_BUILD
49#define CONFIG_ROOTPATH "/opt/eldk"
50#endif
51
52#define CONFIG_ENV_OVERWRITE 1
53#define CONFIG_ENV_IS_NOWHERE
54
55#define CONFIG_SYS_LONGHELP
56#define CONFIG_CMDLINE_EDITING
57#define CONFIG_AUTO_COMPLETE
58#define CONFIG_SYS_AUTOLOAD "yes"
59
60/* Clock Defines */
61#define V_OSCK 24000000 /* Clock output from T2 */
62#define V_SCLK (V_OSCK)
63
64/* We set the max number of command args high to avoid HUSH bugs. */
65#define CONFIG_SYS_MAXARGS 32
66
67/* Console I/O Buffer Size */
61159b76 68#define CONFIG_SYS_CBSIZE 1024
c0dcece7
HS
69
70/* Print Buffer Size */
71#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \
72 + sizeof(CONFIG_SYS_PROMPT) + 16)
73
74/* Boot Argument Buffer Size */
75#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
76
77/*
78 * memtest works on 8 MB in DRAM after skipping 32MB from
79 * start addr of ram disk
80 */
81#define CONFIG_SYS_MEMTEST_START (PHYS_DRAM_1 + (64 * 1024 * 1024))
82#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START \
83 + (8 * 1024 * 1024))
84
85#define CONFIG_SYS_LOAD_ADDR 0x81000000 /* Default load address */
c0dcece7
HS
86
87#define CONFIG_MMC
88#define CONFIG_GENERIC_MMC
89#define CONFIG_OMAP_HSMMC
90#define CONFIG_CMD_MMC
91#define CONFIG_DOS_PARTITION
92#define CONFIG_CMD_FAT
93#define CONFIG_CMD_EXT2
94
95#define CONFIG_SPI
96#define CONFIG_OMAP3_SPI
97#define CONFIG_MTD_DEVICE
c0dcece7
HS
98#define CONFIG_CMD_SF
99#define CONFIG_SF_DEFAULT_SPEED (75000000)
100
101 /* Physical Memory Map */
102#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
103#define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
104
105#define CONFIG_SYS_SDRAM_BASE PHYS_DRAM_1
106#define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \
107 GENERATED_GBL_DATA_SIZE)
108 /* Platform/Board specific defs */
109#define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
110#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
c0dcece7
HS
111
112/* NS16550 Configuration */
c0dcece7 113#define CONFIG_SYS_NS16550_SERIAL
c0dcece7
HS
114#define CONFIG_SYS_NS16550_REG_SIZE (-4)
115#define CONFIG_SYS_NS16550_CLK (48000000)
116#define CONFIG_SYS_NS16550_COM1 0x44e09000
117#define CONFIG_SYS_NS16550_COM4 0x481a6000
118
119#define CONFIG_BAUDRATE 115200
120
121#define CONFIG_SYS_CONSOLE_INFO_QUIET
122#define CONFIG_SERIAL1 1
123#define CONFIG_CONS_INDEX 1
124
125/* I2C Configuration */
126#define CONFIG_I2C
127#define CONFIG_CMD_I2C
6789e84e 128#define CONFIG_SYS_I2C
2cb81b6b 129#define CONFIG_SYS_OMAP24_I2C_SPEED 100000
6789e84e
HS
130#define CONFIG_SYS_OMAP24_I2C_SLAVE 1
131#define CONFIG_SYS_I2C_OMAP24XX
c0dcece7
HS
132
133/* Defines for SPL */
c0dcece7
HS
134#define CONFIG_SPL_FRAMEWORK
135#define CONFIG_SPL_TEXT_BASE 0x402F0400
136#define CONFIG_SPL_MAX_SIZE (101 * 1024)
c0dcece7
HS
137
138#define CONFIG_SPL_BSS_START_ADDR 0x80000000
139#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
140
141#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
e2ccdf89 142#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
205b4f33 143#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
c0dcece7
HS
144#define CONFIG_SPL_MMC_SUPPORT
145#define CONFIG_SPL_FAT_SUPPORT
146#define CONFIG_FS_FAT
147#define CONFIG_SPL_I2C_SUPPORT
148
149#define CONFIG_SPL_LIBCOMMON_SUPPORT
150#define CONFIG_SPL_LIBDISK_SUPPORT
151#define CONFIG_SPL_LIBGENERIC_SUPPORT
152#define CONFIG_SPL_SERIAL_SUPPORT
153#define CONFIG_SPL_YMODEM_SUPPORT
154
155#define CONFIG_SPL_GPIO_SUPPORT
156#define CONFIG_SPL_WATCHDOG_SUPPORT
157
158#define CONFIG_SPL_SPI_SUPPORT
159#define CONFIG_SPL_SPI_FLASH_SUPPORT
160#define CONFIG_SPL_SPI_LOAD
c0dcece7
HS
161#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
162
163#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
164
165#define CONFIG_SPL_BOARD_INIT
166#define CONFIG_SPL_NAND_AM33XX_BCH
167#define CONFIG_SPL_NAND_SUPPORT
168#define CONFIG_SPL_NAND_BASE
169#define CONFIG_SPL_NAND_DRIVERS
170#define CONFIG_SPL_NAND_ECC
171#define CONFIG_SYS_NAND_5_ADDR_CYCLE
172#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
173 CONFIG_SYS_NAND_PAGE_SIZE)
174#define CONFIG_SYS_NAND_PAGE_SIZE 2048
175#define CONFIG_SYS_NAND_OOBSIZE 64
176#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
177#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
178#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
179 10, 11, 12, 13, 14, 15, 16, 17, \
180 18, 19, 20, 21, 22, 23, 24, 25, \
181 26, 27, 28, 29, 30, 31, 32, 33, \
182 34, 35, 36, 37, 38, 39, 40, 41, \
183 42, 43, 44, 45, 46, 47, 48, 49, \
184 50, 51, 52, 53, 54, 55, 56, 57, }
185
186#define CONFIG_SYS_NAND_ECCSIZE 512
187#define CONFIG_SYS_NAND_ECCBYTES 14
3f719069 188#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
c0dcece7
HS
189
190#define CONFIG_SYS_NAND_ECCSTEPS 4
191#define CONFIG_SYS_NAND_ECCTOTAL (CONFIG_SYS_NAND_ECCBYTES * \
192 CONFIG_SYS_NAND_ECCSTEPS)
193
194#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
195
196#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
197
198/*
199 * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
200 * 64 bytes before this address should be set aside for u-boot.img's
201 * header. That is 0x800FFFC0--0x80100000 should not be used for any
202 * other needs.
203 */
204#define CONFIG_SYS_TEXT_BASE 0x80100000
205#define CONFIG_SYS_SPL_MALLOC_START 0x80208000
206#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
207
208/*
209 * Since SPL did pll and ddr initialization for us,
210 * we don't need to do it twice.
211 */
212#ifndef CONFIG_SPL_BUILD
213#define CONFIG_SKIP_LOWLEVEL_INIT
214#endif
215
216#ifndef CONFIG_SPL_BUILD
217/*
218 * USB configuration
219 */
220#define CONFIG_USB_MUSB_DSPS
221#define CONFIG_ARCH_MISC_INIT
95de1e2f
PK
222#define CONFIG_USB_MUSB_PIO_ONLY
223#define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
ece91016 224#undef CONFIG_USB_GADGET_DUALSPEED
c0dcece7
HS
225
226#define CONFIG_AM335X_USB0
227#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
228#define CONFIG_AM335X_USB1
229#define CONFIG_AM335X_USB1_MODE MUSB_HOST
95de1e2f 230#ifdef CONFIG_USB_MUSB_HOST
c0dcece7
HS
231#define CONFIG_CMD_USB
232#define CONFIG_USB_STORAGE
233#endif
234
95de1e2f 235#ifdef CONFIG_USB_MUSB_GADGET
c0dcece7
HS
236#define CONFIG_USB_ETHER
237#define CONFIG_USB_ETH_RNDIS
238#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
95de1e2f 239#endif /* CONFIG_USB_MUSB_GADGET */
c0dcece7 240
56eb3da4 241/* USB DRACO ID as default */
c0dcece7 242#define CONFIG_USBD_HS
c0dcece7
HS
243
244/* USB Device Firmware Update support */
01acd6ab 245#define CONFIG_USB_FUNCTION_DFU
c0dcece7
HS
246#define CONFIG_DFU_NAND
247#define CONFIG_CMD_DFU
248#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 << 20)
401341d6 249#define DFU_MANIFEST_POLL_TIMEOUT 25000
c0dcece7
HS
250
251#endif /* CONFIG_SPL_BUILD */
252
253/*
254 * Default to using SPI for environment, etc. We have multiple copies
255 * of SPL as the ROM will check these locations.
256 * 0x0 - 0x20000 : First copy of SPL
257 * 0x20000 - 0x40000 : Second copy of SPL
258 * 0x40000 - 0x60000 : Third copy of SPL
259 * 0x60000 - 0x80000 : Fourth copy of SPL
260 * 0x80000 - 0xDF000 : U-Boot
261 * 0xDF000 - 0xE0000 : U-Boot Environment
262 * 0xE0000 - 0x442000 : Linux Kernel
263 * 0x442000 - 0x800000 : Userland
264 */
265#if defined(CONFIG_SPI_BOOT)
266# undef CONFIG_ENV_IS_NOWHERE
267# define CONFIG_ENV_IS_IN_SPI_FLASH
268# define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
269# define CONFIG_ENV_OFFSET (892 << 10) /* 892 KiB in */
270# define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
271#endif /* SPI support */
272
273/* Unsupported features */
274#undef CONFIG_USE_IRQ
275
c0dcece7
HS
276#define CONFIG_CMD_DHCP
277#define CONFIG_CMD_PING
278#define CONFIG_DRIVER_TI_CPSW
279#define CONFIG_MII
280#define CONFIG_PHY_GIGE
281#define CONFIG_PHYLIB
282#define CONFIG_CMD_MII
283#define CONFIG_BOOTP_DEFAULT
284#define CONFIG_BOOTP_DNS
285#define CONFIG_BOOTP_DNS2
286#define CONFIG_BOOTP_SEND_HOSTNAME
287#define CONFIG_BOOTP_GATEWAY
288#define CONFIG_BOOTP_SUBNETMASK
289#define CONFIG_NET_RETRY_COUNT 10
c0dcece7
HS
290
291#define CONFIG_NAND
292/* NAND support */
293#ifdef CONFIG_NAND
294#define CONFIG_CMD_NAND
61159b76
HS
295
296/* UBI Support */
297#ifndef CONFIG_SPL_BUILD
c0dcece7 298#define CONFIG_CMD_MTDPARTS
61159b76
HS
299#define CONFIG_MTD_PARTITIONS
300#define CONFIG_MTD_DEVICE
301#define CONFIG_RBTREE
302#define CONFIG_LZO
303#define CONFIG_CMD_UBI
304#define CONFIG_CMD_UBIFS
305#endif
306
307/* Commen environment */
308#define CONFIG_PREBOOT
309#define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \
310 "setenv bootargs ${bootargs};" \
311 "mtdparts default;" \
312 "draco_led 1;" \
313 "dfu 0 nand 0;" \
314 "draco_led 0;\0" \
315
316#define COMMON_ENV_NAND_BOOT \
317 "nand_boot=echo Booting from nand; " \
318 "if test ${upgrade_available} -eq 1; then " \
319 "if test ${bootcount} -gt ${bootlimit}; " \
320 "then " \
321 "setenv upgrade_available 0;" \
322 "setenv ${partitionset_active} true;" \
323 "if test -n ${A}; then " \
324 "setenv partitionset_active B; " \
325 "env delete A; " \
326 "fi;" \
327 "if test -n ${B}; then " \
328 "setenv partitionset_active A; " \
329 "env delete B; " \
330 "fi;" \
331 "saveenv; " \
332 "fi;" \
333 "fi;" \
334 "echo set ${partitionset_active}...;" \
335 "run nand_args; "
336
337#define COMMON_ENV_NAND_CMDS "flash_self=run nand_boot\0" \
338 "flash_self_test=setenv testargs test; " \
339 "run nand_boot\0" \
340 "dfu_start=echo Preparing for dfu mode ...; " \
341 "run dfu_args; \0"
342
343#define COMMON_ENV_SETTINGS \
344 "verify=no \0" \
345 "project_dir=targetdir\0" \
346 "upgrade_available=0\0" \
347 "altbootcmd=run bootcmd\0" \
348 "bootlimit=3\0" \
349 "partitionset_active=A\0" \
350 "loadaddr=0x82000000\0" \
351 "kloadaddr=0x81000000\0" \
352 "script_addr=0x81900000\0" \
353 "console=console=ttyMTD,mtdoops console=ttyO0,115200n8 panic=5\0" \
354 "nfsopts=nolock rw\0" \
355 "ip_method=none\0" \
356 "bootenv=uEnv.txt\0" \
357 "bootargs_defaults=setenv bootargs " \
358 "console=${console} " \
359 "${testargs} " \
360 "${optargs}\0" \
361 "siemens_help=echo; "\
362 "echo Type 'run flash_self' to use kernel and root " \
363 "filesystem on memory; echo Type 'run flash_self_test' to " \
364 "use kernel and root filesystem on memory, boot in test " \
365 "mode; echo Not ready yet: 'run flash_nfs' to use kernel " \
366 "from memory and root filesystem over NFS; echo Type " \
367 "'run net_nfs' to get Kernel over TFTP and mount root " \
368 "filesystem over NFS; " \
369 "echo Set partitionset_active variable to 'A' " \
370 "or 'B' to select kernel and rootfs partition; " \
371 "echo" \
372 "\0"
c0dcece7 373
c0dcece7 374/*
61159b76 375 * Variant 1 partition layout
c0dcece7
HS
376 * chip-size = 256MiB
377 *| name | size | address area |
378 *-------------------------------------------------------
379 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
380 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
381 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
382 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
383 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
384 *| uboot.env | 128.000 KiB | 0x 260000..0x 27ffff |
385 *| kernel_a | 5.000 MiB | 0x 280000..0x 77ffff |
386 *| kernel_b | 5.000 MiB | 0x 780000..0x c7ffff |
387 *| mtdoops | 8.000 MiB | 0x c80000..0x 147ffff |
388 *| rootfs | 235.500 MiB | 0x 1480000..0x fffffff |
389 *-------------------------------------------------------
390 */
61159b76
HS
391#define MTDIDS_NAME_STR "omap2-nand.0"
392#define MTDIDS_DEFAULT "nand0=" MTDIDS_NAME_STR
393#define MTDPARTS_DEFAULT_V1 "mtdparts=" MTDIDS_NAME_STR ":" \
394 "128k(spl)," \
395 "128k(spl.backup1)," \
396 "128k(spl.backup2)," \
397 "128k(spl.backup3)," \
398 "1920k(u-boot)," \
399 "128k(uboot.env)," \
400 "5120k(kernel_a)," \
401 "5120k(kernel_b)," \
402 "8192k(mtdoops)," \
403 "-(rootfs)"
c0dcece7 404
61159b76 405#define DFU_ALT_INFO_NAND_V1 \
c0dcece7
HS
406 "spl part 0 1;" \
407 "spl.backup1 part 0 2;" \
408 "spl.backup2 part 0 3;" \
409 "spl.backup3 part 0 4;" \
410 "u-boot part 0 5;" \
411 "u-boot.env part 0 6;" \
412 "kernel_a part 0 7;" \
413 "kernel_b part 0 8;" \
414 "rootfs partubi 0 10"
415
61159b76 416#define CONFIG_ENV_SETTINGS_NAND_V1 \
c0dcece7 417 "nand_active_ubi_vol=rootfs_a\0" \
56eb3da4
SE
418 "nand_active_ubi_vol_A=rootfs_a\0" \
419 "nand_active_ubi_vol_B=rootfs_b\0" \
c0dcece7
HS
420 "nand_root_fs_type=ubifs rootwait=1\0" \
421 "nand_src_addr=0x280000\0" \
56eb3da4
SE
422 "nand_src_addr_A=0x280000\0" \
423 "nand_src_addr_B=0x780000\0" \
c0dcece7
HS
424 "nand_args=run bootargs_defaults;" \
425 "mtdparts default;" \
56eb3da4
SE
426 "setenv ${partitionset_active} true;" \
427 "if test -n ${A}; then " \
428 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \
429 "setenv nand_src_addr ${nand_src_addr_A};" \
c0dcece7 430 "fi;" \
56eb3da4
SE
431 "if test -n ${B}; then " \
432 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \
433 "setenv nand_src_addr ${nand_src_addr_B};" \
c0dcece7
HS
434 "fi;" \
435 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
436 "ubi.mtd=9,2048;" \
437 "setenv bootargs ${bootargs} " \
438 "root=${nand_root} noinitrd ${mtdparts} " \
439 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
440 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
441 "=mtdoops\0" \
61159b76
HS
442 COMMON_ENV_DFU_ARGS \
443 "dfu_alt_info=" DFU_ALT_INFO_NAND_V1 "\0" \
444 COMMON_ENV_NAND_BOOT \
445 "nand read.i ${kloadaddr} ${nand_src_addr} " \
446 "${nand_img_size}; bootm ${kloadaddr}\0" \
447 COMMON_ENV_NAND_CMDS
448
449#define CONFIG_ENV_SETTINGS_V1 \
450 COMMON_ENV_SETTINGS \
c0dcece7
HS
451 "net_args=run bootargs_defaults;" \
452 "mtdparts default;" \
453 "setenv bootfile ${project_dir}/kernel/uImage;" \
454 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
455 "setenv bootargs ${bootargs} " \
456 "root=/dev/nfs ${mtdparts} " \
457 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
56eb3da4 458 "ip=${ipaddr}:${serverip}:" \
c0dcece7 459 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
61159b76
HS
460 "net_nfs=echo Booting from network ...; " \
461 "run net_args; " \
462 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
463 "bootm ${kloadaddr}\0"
464
465/*
466 * Variant 2 partition layout
0dd1c31d 467 * chip-size = 256MiB or 512 MiB
61159b76
HS
468 *| name | size | address area |
469 *-------------------------------------------------------
470 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
471 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
472 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
473 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
474 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
475 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
476 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
0dd1c31d
ES
477 *| mtdoops | 512.000 KiB | 0x 360000..0x 3dffff |
478 *| (256) rootfs | 252.125 MiB | 0x 3E0000..0x fffffff |
479 *| (512) rootfs | 508.125 MiB | 0x 3E0000..0x1fffffff |
61159b76
HS
480 *-------------------------------------------------------
481 */
482
483#define MTDPARTS_DEFAULT_V2 "mtdparts=" MTDIDS_NAME_STR ":" \
0dd1c31d
ES
484 "128k(spl)," \
485 "128k(spl.backup1)," \
486 "128k(spl.backup2)," \
487 "128k(spl.backup3)," \
488 "1920k(u-boot)," \
489 "512k(u-boot.env0)," \
490 "512k(u-boot.env1)," \
491 "512k(mtdoops)," \
492 "-(rootfs)"
493
61159b76
HS
494
495#define DFU_ALT_INFO_NAND_V2 \
496 "spl part 0 1;" \
497 "spl.backup1 part 0 2;" \
498 "spl.backup2 part 0 3;" \
499 "spl.backup3 part 0 4;" \
500 "u-boot part 0 5;" \
501 "u-boot.env0 part 0 6;" \
502 "u-boot.env1 part 0 7;" \
0dd1c31d 503 "rootfs partubi 0 9" \
61159b76
HS
504
505#define CONFIG_ENV_SETTINGS_NAND_V2 \
506 "nand_active_ubi_vol=rootfs_a\0" \
507 "rootfs_name=rootfs\0" \
508 "kernel_name=uImage\0"\
509 "nand_root_fs_type=ubifs rootwait=1\0" \
510 "nand_args=run bootargs_defaults;" \
511 "mtdparts default;" \
512 "setenv ${partitionset_active} true;" \
513 "if test -n ${A}; then " \
514 "setenv nand_active_ubi_vol ${rootfs_name}_a;" \
56eb3da4 515 "fi;" \
61159b76
HS
516 "if test -n ${B}; then " \
517 "setenv nand_active_ubi_vol ${rootfs_name}_b;" \
518 "fi;" \
519 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
0dd1c31d 520 "ubi.mtd=rootfs,2048;" \
61159b76
HS
521 "setenv bootargs ${bootargs} " \
522 "root=${nand_root} noinitrd ${mtdparts} " \
523 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
524 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
525 "=mtdoops\0" \
526 COMMON_ENV_DFU_ARGS \
527 "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \
528 COMMON_ENV_NAND_BOOT \
529 "ubi part rootfs 2048;" \
530 "ubifsmount ubi0:${nand_active_ubi_vol};" \
531 "ubifsload ${kloadaddr} boot/${kernel_name};" \
532 "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \
533 "bootm ${kloadaddr} - ${loadaddr}\0" \
534 "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \
535 "bootm ${kloadaddr} - ${loadaddr}\0" \
536 COMMON_ENV_NAND_CMDS
537
538#define CONFIG_ENV_SETTINGS_V2 \
539 COMMON_ENV_SETTINGS \
540 "net_args=run bootargs_defaults;" \
541 "mtdparts default;" \
542 "setenv bootfile ${project_dir}/kernel/uImage;" \
543 "setenv bootdtb ${project_dir}/kernel/dtb;" \
544 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
545 "setenv bootargs ${bootargs} " \
546 "root=/dev/nfs ${mtdparts} " \
547 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
548 "ip=${ipaddr}:${serverip}:" \
549 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
c0dcece7
HS
550 "net_nfs=echo Booting from network ...; " \
551 "run net_args; " \
552 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
61159b76
HS
553 "tftpboot ${loadaddr} ${serverip}:${bootdtb}; " \
554 "bootm ${kloadaddr} - ${loadaddr}\0"
555
578056c3
HS
556/*
557 * Variant 3 partition layout
558 * chip-size = 512MiB
559 *| name | size | address area |
560 *-------------------------------------------------------
561 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
562 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
563 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
564 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
565 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
566 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
567 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
568 *| rootfs | 300.000 MiB | 0x 360000..0x12f5ffff |
569 *| mtdoops | 512.000 KiB | 0x12f60000..0x12fdffff |
570 *|configuration | 104.125 MiB | 0x12fe0000..0x1fffffff |
571 *-------------------------------------------------------
572 */
573
574#define MTDPARTS_DEFAULT_V3 "mtdparts=" MTDIDS_NAME_STR ":" \
575 "128k(spl)," \
576 "128k(spl.backup1)," \
577 "128k(spl.backup2)," \
578 "128k(spl.backup3)," \
579 "1920k(u-boot)," \
580 "512k(u-boot.env0)," \
581 "512k(u-boot.env1)," \
582 "300m(rootfs)," \
583 "512k(mtdoops)," \
584 "-(configuration)"
585
c0dcece7
HS
586
587#define CONFIG_NAND_OMAP_GPMC
beba5f04 588#define CONFIG_NAND_OMAP_ELM
c0dcece7
HS
589#define CONFIG_SYS_NAND_BASE (0x08000000) /* physical address */
590 /* to access nand at */
591 /* CS0 */
592#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND
593 devices */
594#if !defined(CONFIG_SPI_BOOT)
595#undef CONFIG_ENV_IS_NOWHERE
596#define CONFIG_ENV_IS_IN_NAND
597#define CONFIG_ENV_OFFSET 0x260000 /* environment starts here */
598#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
599#endif
600#endif
601
c0dcece7 602#define CONFIG_OMAP_GPIO
c0dcece7 603
61159b76 604/* Gpio cmd support */
61159b76 605
c0dcece7
HS
606/* Watchdog */
607#define CONFIG_HW_WATCHDOG
608
56eb3da4
SE
609/* Reboot after 60 sec if bootcmd fails */
610#define CONFIG_RESET_TO_RETRY
611#define CONFIG_BOOT_RETRY_TIME 60
612
613#define CONFIG_BOOTCOUNT_LIMIT
614#define CONFIG_BOOTCOUNT_ENV
9167fc81 615
c0dcece7 616#endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */