blob: eab665c2866b66702593bd0feed04f85cdbe872a [file] [log] [blame]
Heiko Schocherc0dcece2013-08-19 16:39:01 +02001/*
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 */
Heiko Schocherc0dcece2013-08-19 16:39:01 +020029#define CONFIG_BOARD_LATE_INIT
30#define CONFIG_SYS_NO_FLASH
Heiko Schocher578056c2015-06-15 14:56:41 +020031#ifdef CONFIG_SIEMENS_MACH_TYPE
Heiko Schocherc0dcece2013-08-19 16:39:01 +020032#define CONFIG_MACH_TYPE CONFIG_SIEMENS_MACH_TYPE
Heiko Schocher578056c2015-06-15 14:56:41 +020033#endif
Heiko Schocherc0dcece2013-08-19 16:39:01 +020034
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 */
Heiko Schocherc0dcece2013-08-19 16:39:01 +020042
43#define CONFIG_ENV_VARS_UBOOT_CONFIG
44#ifndef CONFIG_SPL_BUILD
45#define CONFIG_ROOTPATH "/opt/eldk"
46#endif
47
48#define CONFIG_ENV_OVERWRITE 1
49#define CONFIG_ENV_IS_NOWHERE
50
51#define CONFIG_SYS_LONGHELP
52#define CONFIG_CMDLINE_EDITING
53#define CONFIG_AUTO_COMPLETE
54#define CONFIG_SYS_AUTOLOAD "yes"
55
56/* Clock Defines */
57#define V_OSCK 24000000 /* Clock output from T2 */
58#define V_SCLK (V_OSCK)
59
60/* We set the max number of command args high to avoid HUSH bugs. */
61#define CONFIG_SYS_MAXARGS 32
62
63/* Console I/O Buffer Size */
Heiko Schocher61159b72015-06-16 14:59:34 +020064#define CONFIG_SYS_CBSIZE 1024
Heiko Schocherc0dcece2013-08-19 16:39:01 +020065
66/* Print Buffer Size */
67#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \
68 + sizeof(CONFIG_SYS_PROMPT) + 16)
69
70/* Boot Argument Buffer Size */
71#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
72
73/*
74 * memtest works on 8 MB in DRAM after skipping 32MB from
75 * start addr of ram disk
76 */
77#define CONFIG_SYS_MEMTEST_START (PHYS_DRAM_1 + (64 * 1024 * 1024))
78#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START \
79 + (8 * 1024 * 1024))
80
81#define CONFIG_SYS_LOAD_ADDR 0x81000000 /* Default load address */
Heiko Schocherc0dcece2013-08-19 16:39:01 +020082
83#define CONFIG_MMC
84#define CONFIG_GENERIC_MMC
85#define CONFIG_OMAP_HSMMC
Heiko Schocherc0dcece2013-08-19 16:39:01 +020086#define CONFIG_DOS_PARTITION
Heiko Schocherc0dcece2013-08-19 16:39:01 +020087
88#define CONFIG_SPI
89#define CONFIG_OMAP3_SPI
90#define CONFIG_MTD_DEVICE
Heiko Schocherc0dcece2013-08-19 16:39:01 +020091#define CONFIG_SF_DEFAULT_SPEED (75000000)
92
93 /* Physical Memory Map */
94#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
95#define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
96
97#define CONFIG_SYS_SDRAM_BASE PHYS_DRAM_1
98#define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \
99 GENERATED_GBL_DATA_SIZE)
100 /* Platform/Board specific defs */
101#define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
102#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200103
104/* NS16550 Configuration */
Heiko Schocher71423432016-06-13 15:16:01 +0200105#ifdef CONFIG_SPL_BUILD
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200106#define CONFIG_SYS_NS16550_SERIAL
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200107#define CONFIG_SYS_NS16550_REG_SIZE (-4)
Heiko Schocher71423432016-06-13 15:16:01 +0200108#endif
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200109#define CONFIG_SYS_NS16550_CLK (48000000)
110#define CONFIG_SYS_NS16550_COM1 0x44e09000
111#define CONFIG_SYS_NS16550_COM4 0x481a6000
112
113#define CONFIG_BAUDRATE 115200
114
115#define CONFIG_SYS_CONSOLE_INFO_QUIET
116#define CONFIG_SERIAL1 1
117#define CONFIG_CONS_INDEX 1
118
119/* I2C Configuration */
120#define CONFIG_I2C
Heiko Schocher6789e842013-10-22 11:03:18 +0200121#define CONFIG_SYS_I2C
Paul Kocialkowski2cb81b6b2015-07-15 16:02:22 +0200122#define CONFIG_SYS_OMAP24_I2C_SPEED 100000
Heiko Schocher6789e842013-10-22 11:03:18 +0200123#define CONFIG_SYS_OMAP24_I2C_SLAVE 1
124#define CONFIG_SYS_I2C_OMAP24XX
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200125
126/* Defines for SPL */
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200127#define CONFIG_SPL_FRAMEWORK
128#define CONFIG_SPL_TEXT_BASE 0x402F0400
129#define CONFIG_SPL_MAX_SIZE (101 * 1024)
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200130
131#define CONFIG_SPL_BSS_START_ADDR 0x80000000
132#define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
133
134#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
Paul Kocialkowskie2ccdf82014-11-08 23:14:55 +0100135#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
Guillaume GARDET205b4f32014-10-15 17:53:11 +0200136#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.img"
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200137#define CONFIG_SPL_MMC_SUPPORT
138#define CONFIG_SPL_FAT_SUPPORT
139#define CONFIG_FS_FAT
140#define CONFIG_SPL_I2C_SUPPORT
141
142#define CONFIG_SPL_LIBCOMMON_SUPPORT
143#define CONFIG_SPL_LIBDISK_SUPPORT
144#define CONFIG_SPL_LIBGENERIC_SUPPORT
145#define CONFIG_SPL_SERIAL_SUPPORT
146#define CONFIG_SPL_YMODEM_SUPPORT
147
148#define CONFIG_SPL_GPIO_SUPPORT
149#define CONFIG_SPL_WATCHDOG_SUPPORT
150
151#define CONFIG_SPL_SPI_SUPPORT
152#define CONFIG_SPL_SPI_FLASH_SUPPORT
153#define CONFIG_SPL_SPI_LOAD
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200154#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
155
156#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
157
158#define CONFIG_SPL_BOARD_INIT
159#define CONFIG_SPL_NAND_AM33XX_BCH
160#define CONFIG_SPL_NAND_SUPPORT
161#define CONFIG_SPL_NAND_BASE
162#define CONFIG_SPL_NAND_DRIVERS
163#define CONFIG_SPL_NAND_ECC
Heiko Schocher6b3943f2016-06-07 08:55:45 +0200164#define CONFIG_SYS_NAND_ONFI_DETECTION
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200165#define CONFIG_SYS_NAND_5_ADDR_CYCLE
166#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
167 CONFIG_SYS_NAND_PAGE_SIZE)
168#define CONFIG_SYS_NAND_PAGE_SIZE 2048
169#define CONFIG_SYS_NAND_OOBSIZE 64
170#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
171#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
172#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
173 10, 11, 12, 13, 14, 15, 16, 17, \
174 18, 19, 20, 21, 22, 23, 24, 25, \
175 26, 27, 28, 29, 30, 31, 32, 33, \
176 34, 35, 36, 37, 38, 39, 40, 41, \
177 42, 43, 44, 45, 46, 47, 48, 49, \
178 50, 51, 52, 53, 54, 55, 56, 57, }
179
180#define CONFIG_SYS_NAND_ECCSIZE 512
181#define CONFIG_SYS_NAND_ECCBYTES 14
pekon gupta3f719062013-11-18 19:03:01 +0530182#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200183
184#define CONFIG_SYS_NAND_ECCSTEPS 4
185#define CONFIG_SYS_NAND_ECCTOTAL (CONFIG_SYS_NAND_ECCBYTES * \
186 CONFIG_SYS_NAND_ECCSTEPS)
187
188#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
189
190#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
191
192/*
193 * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
194 * 64 bytes before this address should be set aside for u-boot.img's
195 * header. That is 0x800FFFC0--0x80100000 should not be used for any
196 * other needs.
197 */
198#define CONFIG_SYS_TEXT_BASE 0x80100000
199#define CONFIG_SYS_SPL_MALLOC_START 0x80208000
200#define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
201
202/*
203 * Since SPL did pll and ddr initialization for us,
204 * we don't need to do it twice.
205 */
206#ifndef CONFIG_SPL_BUILD
207#define CONFIG_SKIP_LOWLEVEL_INIT
208#endif
209
210#ifndef CONFIG_SPL_BUILD
211/*
212 * USB configuration
213 */
214#define CONFIG_USB_MUSB_DSPS
215#define CONFIG_ARCH_MISC_INIT
Paul Kocialkowski95de1e22015-08-04 17:04:06 +0200216#define CONFIG_USB_MUSB_PIO_ONLY
217#define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
Heiko Schocherece91012014-09-10 08:55:01 +0200218#undef CONFIG_USB_GADGET_DUALSPEED
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200219
220#define CONFIG_AM335X_USB0
221#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
222#define CONFIG_AM335X_USB1
223#define CONFIG_AM335X_USB1_MODE MUSB_HOST
Paul Kocialkowski95de1e22015-08-04 17:04:06 +0200224#ifdef CONFIG_USB_MUSB_HOST
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200225#define CONFIG_USB_STORAGE
226#endif
227
Paul Kocialkowski95de1e22015-08-04 17:04:06 +0200228#ifdef CONFIG_USB_MUSB_GADGET
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200229#define CONFIG_USB_ETHER
230#define CONFIG_USB_ETH_RNDIS
231#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
Paul Kocialkowski95de1e22015-08-04 17:04:06 +0200232#endif /* CONFIG_USB_MUSB_GADGET */
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200233
Samuel Egli56eb3da2013-11-04 14:05:03 +0100234/* USB DRACO ID as default */
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200235#define CONFIG_USBD_HS
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200236
237/* USB Device Firmware Update support */
Paul Kocialkowski01acd6a2015-06-12 19:56:58 +0200238#define CONFIG_USB_FUNCTION_DFU
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200239#define CONFIG_DFU_NAND
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200240#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 << 20)
Heiko Schocher401341d2014-03-18 08:09:57 +0100241#define DFU_MANIFEST_POLL_TIMEOUT 25000
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200242
243#endif /* CONFIG_SPL_BUILD */
244
245/*
246 * Default to using SPI for environment, etc. We have multiple copies
247 * of SPL as the ROM will check these locations.
248 * 0x0 - 0x20000 : First copy of SPL
249 * 0x20000 - 0x40000 : Second copy of SPL
250 * 0x40000 - 0x60000 : Third copy of SPL
251 * 0x60000 - 0x80000 : Fourth copy of SPL
252 * 0x80000 - 0xDF000 : U-Boot
253 * 0xDF000 - 0xE0000 : U-Boot Environment
254 * 0xE0000 - 0x442000 : Linux Kernel
255 * 0x442000 - 0x800000 : Userland
256 */
257#if defined(CONFIG_SPI_BOOT)
258# undef CONFIG_ENV_IS_NOWHERE
259# define CONFIG_ENV_IS_IN_SPI_FLASH
260# define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
261# define CONFIG_ENV_OFFSET (892 << 10) /* 892 KiB in */
262# define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
263#endif /* SPI support */
264
265/* Unsupported features */
266#undef CONFIG_USE_IRQ
267
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200268#define CONFIG_DRIVER_TI_CPSW
269#define CONFIG_MII
270#define CONFIG_PHY_GIGE
271#define CONFIG_PHYLIB
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200272#define CONFIG_BOOTP_DEFAULT
273#define CONFIG_BOOTP_DNS
274#define CONFIG_BOOTP_DNS2
275#define CONFIG_BOOTP_SEND_HOSTNAME
276#define CONFIG_BOOTP_GATEWAY
277#define CONFIG_BOOTP_SUBNETMASK
278#define CONFIG_NET_RETRY_COUNT 10
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200279
280#define CONFIG_NAND
281/* NAND support */
282#ifdef CONFIG_NAND
283#define CONFIG_CMD_NAND
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200284
Heiko Schocher61159b72015-06-16 14:59:34 +0200285/* UBI Support */
286#ifndef CONFIG_SPL_BUILD
287#define CONFIG_CMD_MTDPARTS
288#define CONFIG_MTD_PARTITIONS
289#define CONFIG_MTD_DEVICE
290#define CONFIG_RBTREE
291#define CONFIG_LZO
292#define CONFIG_CMD_UBI
293#define CONFIG_CMD_UBIFS
Samuel Egli3c5d51f2016-06-07 08:55:39 +0200294#define CONFIG_MTD_UBI_FASTMAP
295#define CONFIG_MTD_UBI_FASTMAP_AUTOCONVERT 1
Heiko Schocher61159b72015-06-16 14:59:34 +0200296#endif
297
298/* Commen environment */
299#define CONFIG_PREBOOT
300#define COMMON_ENV_DFU_ARGS "dfu_args=run bootargs_defaults;" \
301 "setenv bootargs ${bootargs};" \
302 "mtdparts default;" \
303 "draco_led 1;" \
304 "dfu 0 nand 0;" \
305 "draco_led 0;\0" \
306
307#define COMMON_ENV_NAND_BOOT \
308 "nand_boot=echo Booting from nand; " \
309 "if test ${upgrade_available} -eq 1; then " \
310 "if test ${bootcount} -gt ${bootlimit}; " \
311 "then " \
312 "setenv upgrade_available 0;" \
313 "setenv ${partitionset_active} true;" \
314 "if test -n ${A}; then " \
315 "setenv partitionset_active B; " \
316 "env delete A; " \
317 "fi;" \
318 "if test -n ${B}; then " \
319 "setenv partitionset_active A; " \
320 "env delete B; " \
321 "fi;" \
322 "saveenv; " \
323 "fi;" \
324 "fi;" \
325 "echo set ${partitionset_active}...;" \
326 "run nand_args; "
327
328#define COMMON_ENV_NAND_CMDS "flash_self=run nand_boot\0" \
329 "flash_self_test=setenv testargs test; " \
330 "run nand_boot\0" \
331 "dfu_start=echo Preparing for dfu mode ...; " \
332 "run dfu_args; \0"
333
334#define COMMON_ENV_SETTINGS \
335 "verify=no \0" \
336 "project_dir=targetdir\0" \
337 "upgrade_available=0\0" \
338 "altbootcmd=run bootcmd\0" \
339 "bootlimit=3\0" \
340 "partitionset_active=A\0" \
341 "loadaddr=0x82000000\0" \
342 "kloadaddr=0x81000000\0" \
343 "script_addr=0x81900000\0" \
344 "console=console=ttyMTD,mtdoops console=ttyO0,115200n8 panic=5\0" \
345 "nfsopts=nolock rw\0" \
346 "ip_method=none\0" \
347 "bootenv=uEnv.txt\0" \
348 "bootargs_defaults=setenv bootargs " \
349 "console=${console} " \
350 "${testargs} " \
351 "${optargs}\0" \
352 "siemens_help=echo; "\
353 "echo Type 'run flash_self' to use kernel and root " \
354 "filesystem on memory; echo Type 'run flash_self_test' to " \
355 "use kernel and root filesystem on memory, boot in test " \
356 "mode; echo Not ready yet: 'run flash_nfs' to use kernel " \
357 "from memory and root filesystem over NFS; echo Type " \
358 "'run net_nfs' to get Kernel over TFTP and mount root " \
359 "filesystem over NFS; " \
360 "echo Set partitionset_active variable to 'A' " \
361 "or 'B' to select kernel and rootfs partition; " \
362 "echo" \
363 "\0"
364
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200365/*
Heiko Schocher61159b72015-06-16 14:59:34 +0200366 * Variant 1 partition layout
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200367 * chip-size = 256MiB
368 *| name | size | address area |
369 *-------------------------------------------------------
370 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
371 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
372 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
373 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
374 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
375 *| uboot.env | 128.000 KiB | 0x 260000..0x 27ffff |
376 *| kernel_a | 5.000 MiB | 0x 280000..0x 77ffff |
377 *| kernel_b | 5.000 MiB | 0x 780000..0x c7ffff |
378 *| mtdoops | 8.000 MiB | 0x c80000..0x 147ffff |
379 *| rootfs | 235.500 MiB | 0x 1480000..0x fffffff |
380 *-------------------------------------------------------
381 */
Heiko Schocher61159b72015-06-16 14:59:34 +0200382#define MTDIDS_NAME_STR "omap2-nand.0"
383#define MTDIDS_DEFAULT "nand0=" MTDIDS_NAME_STR
384#define MTDPARTS_DEFAULT_V1 "mtdparts=" MTDIDS_NAME_STR ":" \
385 "128k(spl)," \
386 "128k(spl.backup1)," \
387 "128k(spl.backup2)," \
388 "128k(spl.backup3)," \
389 "1920k(u-boot)," \
390 "128k(uboot.env)," \
391 "5120k(kernel_a)," \
392 "5120k(kernel_b)," \
393 "8192k(mtdoops)," \
394 "-(rootfs)"
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200395
Heiko Schocher61159b72015-06-16 14:59:34 +0200396#define DFU_ALT_INFO_NAND_V1 \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200397 "spl part 0 1;" \
398 "spl.backup1 part 0 2;" \
399 "spl.backup2 part 0 3;" \
400 "spl.backup3 part 0 4;" \
401 "u-boot part 0 5;" \
402 "u-boot.env part 0 6;" \
403 "kernel_a part 0 7;" \
404 "kernel_b part 0 8;" \
405 "rootfs partubi 0 10"
406
Heiko Schocher61159b72015-06-16 14:59:34 +0200407#define CONFIG_ENV_SETTINGS_NAND_V1 \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200408 "nand_active_ubi_vol=rootfs_a\0" \
Samuel Egli56eb3da2013-11-04 14:05:03 +0100409 "nand_active_ubi_vol_A=rootfs_a\0" \
410 "nand_active_ubi_vol_B=rootfs_b\0" \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200411 "nand_root_fs_type=ubifs rootwait=1\0" \
412 "nand_src_addr=0x280000\0" \
Samuel Egli56eb3da2013-11-04 14:05:03 +0100413 "nand_src_addr_A=0x280000\0" \
414 "nand_src_addr_B=0x780000\0" \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200415 "nand_args=run bootargs_defaults;" \
416 "mtdparts default;" \
Samuel Egli56eb3da2013-11-04 14:05:03 +0100417 "setenv ${partitionset_active} true;" \
418 "if test -n ${A}; then " \
419 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_A};" \
420 "setenv nand_src_addr ${nand_src_addr_A};" \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200421 "fi;" \
Samuel Egli56eb3da2013-11-04 14:05:03 +0100422 "if test -n ${B}; then " \
423 "setenv nand_active_ubi_vol ${nand_active_ubi_vol_B};" \
424 "setenv nand_src_addr ${nand_src_addr_B};" \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200425 "fi;" \
426 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
Heiko Schocher6b3943f2016-06-07 08:55:45 +0200427 "ubi.mtd=9,${ubi_off};" \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200428 "setenv bootargs ${bootargs} " \
429 "root=${nand_root} noinitrd ${mtdparts} " \
430 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
431 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
432 "=mtdoops\0" \
Heiko Schocher61159b72015-06-16 14:59:34 +0200433 COMMON_ENV_DFU_ARGS \
434 "dfu_alt_info=" DFU_ALT_INFO_NAND_V1 "\0" \
435 COMMON_ENV_NAND_BOOT \
436 "nand read.i ${kloadaddr} ${nand_src_addr} " \
437 "${nand_img_size}; bootm ${kloadaddr}\0" \
438 COMMON_ENV_NAND_CMDS
439
440#define CONFIG_ENV_SETTINGS_V1 \
441 COMMON_ENV_SETTINGS \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200442 "net_args=run bootargs_defaults;" \
443 "mtdparts default;" \
444 "setenv bootfile ${project_dir}/kernel/uImage;" \
445 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
446 "setenv bootargs ${bootargs} " \
447 "root=/dev/nfs ${mtdparts} " \
448 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
Samuel Egli56eb3da2013-11-04 14:05:03 +0100449 "ip=${ipaddr}:${serverip}:" \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200450 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200451 "net_nfs=echo Booting from network ...; " \
452 "run net_args; " \
453 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
Heiko Schocher61159b72015-06-16 14:59:34 +0200454 "bootm ${kloadaddr}\0"
455
456/*
457 * Variant 2 partition layout
Egli, Samuel0dd1c312015-07-01 17:57:39 +0200458 * chip-size = 256MiB or 512 MiB
Heiko Schocher61159b72015-06-16 14:59:34 +0200459 *| name | size | address area |
460 *-------------------------------------------------------
461 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
462 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
463 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
464 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
465 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
466 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
467 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
Egli, Samuel0dd1c312015-07-01 17:57:39 +0200468 *| mtdoops | 512.000 KiB | 0x 360000..0x 3dffff |
469 *| (256) rootfs | 252.125 MiB | 0x 3E0000..0x fffffff |
470 *| (512) rootfs | 508.125 MiB | 0x 3E0000..0x1fffffff |
Heiko Schocher61159b72015-06-16 14:59:34 +0200471 *-------------------------------------------------------
472 */
473
474#define MTDPARTS_DEFAULT_V2 "mtdparts=" MTDIDS_NAME_STR ":" \
Egli, Samuel0dd1c312015-07-01 17:57:39 +0200475 "128k(spl)," \
476 "128k(spl.backup1)," \
477 "128k(spl.backup2)," \
478 "128k(spl.backup3)," \
479 "1920k(u-boot)," \
480 "512k(u-boot.env0)," \
481 "512k(u-boot.env1)," \
482 "512k(mtdoops)," \
483 "-(rootfs)"
484
Heiko Schocher61159b72015-06-16 14:59:34 +0200485#define DFU_ALT_INFO_NAND_V2 \
486 "spl part 0 1;" \
487 "spl.backup1 part 0 2;" \
488 "spl.backup2 part 0 3;" \
489 "spl.backup3 part 0 4;" \
490 "u-boot part 0 5;" \
491 "u-boot.env0 part 0 6;" \
492 "u-boot.env1 part 0 7;" \
Egli, Samuel0dd1c312015-07-01 17:57:39 +0200493 "rootfs partubi 0 9" \
Heiko Schocher61159b72015-06-16 14:59:34 +0200494
495#define CONFIG_ENV_SETTINGS_NAND_V2 \
496 "nand_active_ubi_vol=rootfs_a\0" \
497 "rootfs_name=rootfs\0" \
498 "kernel_name=uImage\0"\
499 "nand_root_fs_type=ubifs rootwait=1\0" \
500 "nand_args=run bootargs_defaults;" \
501 "mtdparts default;" \
502 "setenv ${partitionset_active} true;" \
503 "if test -n ${A}; then " \
504 "setenv nand_active_ubi_vol ${rootfs_name}_a;" \
505 "fi;" \
506 "if test -n ${B}; then " \
507 "setenv nand_active_ubi_vol ${rootfs_name}_b;" \
508 "fi;" \
509 "setenv nand_root ubi0:${nand_active_ubi_vol} rw " \
Egli, Samuel0dd1c312015-07-01 17:57:39 +0200510 "ubi.mtd=rootfs,2048;" \
Heiko Schocher61159b72015-06-16 14:59:34 +0200511 "setenv bootargs ${bootargs} " \
512 "root=${nand_root} noinitrd ${mtdparts} " \
513 "rootfstype=${nand_root_fs_type} ip=${ip_method} " \
514 "console=ttyMTD,mtdoops console=ttyO0,115200n8 mtdoops.mtddev" \
515 "=mtdoops\0" \
516 COMMON_ENV_DFU_ARGS \
517 "dfu_alt_info=" DFU_ALT_INFO_NAND_V2 "\0" \
518 COMMON_ENV_NAND_BOOT \
Heiko Schocher6b3943f2016-06-07 08:55:45 +0200519 "ubi part rootfs ${ubi_off};" \
Heiko Schocher61159b72015-06-16 14:59:34 +0200520 "ubifsmount ubi0:${nand_active_ubi_vol};" \
521 "ubifsload ${kloadaddr} boot/${kernel_name};" \
522 "ubifsload ${loadaddr} boot/${dtb_name}.dtb;" \
523 "bootm ${kloadaddr} - ${loadaddr}\0" \
524 "nand_boot_backup=ubifsload ${loadaddr} boot/am335x-draco.dtb;" \
525 "bootm ${kloadaddr} - ${loadaddr}\0" \
526 COMMON_ENV_NAND_CMDS
527
528#define CONFIG_ENV_SETTINGS_V2 \
529 COMMON_ENV_SETTINGS \
530 "net_args=run bootargs_defaults;" \
531 "mtdparts default;" \
532 "setenv bootfile ${project_dir}/kernel/uImage;" \
533 "setenv bootdtb ${project_dir}/kernel/dtb;" \
534 "setenv rootpath /home/projects/${project_dir}/rootfs;" \
535 "setenv bootargs ${bootargs} " \
536 "root=/dev/nfs ${mtdparts} " \
537 "nfsroot=${serverip}:${rootpath},${nfsopts} " \
538 "ip=${ipaddr}:${serverip}:" \
539 "${gatewayip}:${netmask}:${hostname}:eth0:off\0" \
540 "net_nfs=echo Booting from network ...; " \
541 "run net_args; " \
542 "tftpboot ${kloadaddr} ${serverip}:${bootfile}; " \
543 "tftpboot ${loadaddr} ${serverip}:${bootdtb}; " \
544 "bootm ${kloadaddr} - ${loadaddr}\0"
545
Heiko Schocher578056c2015-06-15 14:56:41 +0200546/*
547 * Variant 3 partition layout
548 * chip-size = 512MiB
549 *| name | size | address area |
550 *-------------------------------------------------------
551 *| spl | 128.000 KiB | 0x 0..0x 1ffff |
552 *| spl.backup1 | 128.000 KiB | 0x 20000..0x 3ffff |
553 *| spl.backup2 | 128.000 KiB | 0x 40000..0x 5ffff |
554 *| spl.backup3 | 128.000 KiB | 0x 60000..0x 7ffff |
555 *| u-boot | 1.875 MiB | 0x 80000..0x 25ffff |
556 *| uboot.env0 | 512.000 KiB | 0x 260000..0x 2Dffff |
557 *| uboot.env1 | 512.000 KiB | 0x 2E0000..0x 35ffff |
558 *| rootfs | 300.000 MiB | 0x 360000..0x12f5ffff |
559 *| mtdoops | 512.000 KiB | 0x12f60000..0x12fdffff |
560 *|configuration | 104.125 MiB | 0x12fe0000..0x1fffffff |
561 *-------------------------------------------------------
562 */
563
564#define MTDPARTS_DEFAULT_V3 "mtdparts=" MTDIDS_NAME_STR ":" \
565 "128k(spl)," \
566 "128k(spl.backup1)," \
567 "128k(spl.backup2)," \
568 "128k(spl.backup3)," \
569 "1920k(u-boot)," \
570 "512k(u-boot.env0)," \
571 "512k(u-boot.env1)," \
572 "300m(rootfs)," \
573 "512k(mtdoops)," \
574 "-(configuration)"
575
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200576#define CONFIG_NAND_OMAP_GPMC
pekon guptabeba5f02013-11-18 19:02:59 +0530577#define CONFIG_NAND_OMAP_ELM
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200578#define CONFIG_SYS_NAND_BASE (0x08000000) /* physical address */
579 /* to access nand at */
580 /* CS0 */
581#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND
582 devices */
583#if !defined(CONFIG_SPI_BOOT)
584#undef CONFIG_ENV_IS_NOWHERE
585#define CONFIG_ENV_IS_IN_NAND
586#define CONFIG_ENV_OFFSET 0x260000 /* environment starts here */
587#define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
588#endif
589#endif
590
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200591#define CONFIG_OMAP_GPIO
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200592
Heiko Schocher61159b72015-06-16 14:59:34 +0200593/* Gpio cmd support */
Heiko Schocher61159b72015-06-16 14:59:34 +0200594
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200595/* Watchdog */
596#define CONFIG_HW_WATCHDOG
597
Samuel Egli56eb3da2013-11-04 14:05:03 +0100598/* Reboot after 60 sec if bootcmd fails */
599#define CONFIG_RESET_TO_RETRY
600#define CONFIG_BOOT_RETRY_TIME 60
601
602#define CONFIG_BOOTCOUNT_LIMIT
603#define CONFIG_BOOTCOUNT_ENV
Stefan Roese9167fc82013-11-22 12:56:29 +0100604
Heiko Schocherc0dcece2013-08-19 16:39:01 +0200605#endif /* ! __CONFIG_SIEMENS_AM33X_COMMON_H */