xref: /openbmc/u-boot/include/configs/omap3_evm.h (revision 8ccf98b1cfd2811e3121c719e294bdd8ebab1c45)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
2ad9bc8e5SDirk Behme /*
3741de266SSanjeev Premi  * Configuration settings for the TI OMAP3 EVM board.
4741de266SSanjeev Premi  *
5741de266SSanjeev Premi  * Copyright (C) 2006-2011 Texas Instruments Incorporated - http://www.ti.com/
6741de266SSanjeev Premi  *
7ad9bc8e5SDirk Behme  * Author :
8ad9bc8e5SDirk Behme  *	Manikandan Pillai <mani.pillai@ti.com>
9ad9bc8e5SDirk Behme  * Derived from Beagle Board and 3430 SDP code by
10ad9bc8e5SDirk Behme  *	Richard Woodruff <r-woodruff2@ti.com>
11ad9bc8e5SDirk Behme  *	Syed Mohammed Khasim <khasim@ti.com>
12ad9bc8e5SDirk Behme  *
13ad9bc8e5SDirk Behme  * Manikandan Pillai <mani.pillai@ti.com>
14ad9bc8e5SDirk Behme  */
15ad9bc8e5SDirk Behme 
160d43fdedSDerald D. Woods #ifndef __CONFIG_H
170d43fdedSDerald D. Woods #define __CONFIG_H
18741de266SSanjeev Premi 
190d43fdedSDerald D. Woods #include <configs/ti_omap3_common.h>
200d43fdedSDerald D. Woods 
210d43fdedSDerald D. Woods /*
220d43fdedSDerald D. Woods  * We are only ever GP parts and will utilize all of the "downloaded image"
230d43fdedSDerald D. Woods  * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB).
24741de266SSanjeev Premi  */
250d43fdedSDerald D. Woods #undef CONFIG_SPL_TEXT_BASE
260d43fdedSDerald D. Woods #define CONFIG_SPL_TEXT_BASE            0x40200000
27741de266SSanjeev Premi 
280d43fdedSDerald D. Woods #define CONFIG_CMDLINE_TAG
290d43fdedSDerald D. Woods #define CONFIG_SETUP_MEMORY_TAGS
300d43fdedSDerald D. Woods #define CONFIG_INITRD_TAG
310d43fdedSDerald D. Woods #define CONFIG_REVISION_TAG
32741de266SSanjeev Premi 
330d43fdedSDerald D. Woods /* NAND */
340d43fdedSDerald D. Woods #if defined(CONFIG_NAND)
350d43fdedSDerald D. Woods #define CONFIG_SYS_FLASH_BASE		NAND_BASE
360d43fdedSDerald D. Woods #define CONFIG_SYS_MAX_NAND_DEVICE      1
37673283f3STom Rini #define CONFIG_SYS_NAND_5_ADDR_CYCLE
38673283f3STom Rini #define CONFIG_SYS_NAND_PAGE_COUNT      64
39673283f3STom Rini #define CONFIG_SYS_NAND_PAGE_SIZE       2048
40673283f3STom Rini #define CONFIG_SYS_NAND_OOBSIZE         64
41673283f3STom Rini #define CONFIG_SYS_NAND_BLOCK_SIZE      (128*1024)
420d43fdedSDerald D. Woods #define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
43673283f3STom Rini #define CONFIG_SYS_NAND_ECCPOS          {2, 3, 4, 5, 6, 7, 8, 9,\
44673283f3STom Rini                                          10, 11, 12, 13}
45673283f3STom Rini #define CONFIG_SYS_NAND_ECCSIZE         512
46673283f3STom Rini #define CONFIG_SYS_NAND_ECCBYTES        3
470d43fdedSDerald D. Woods #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
48b6e2543cSDerald D. Woods #define CONFIG_SYS_ENV_SECT_SIZE        SZ_128K
497672d9d5SAdam Ford #define CONFIG_ENV_OFFSET               0x260000
507672d9d5SAdam Ford #define CONFIG_ENV_ADDR                 0x260000
510d43fdedSDerald D. Woods #define CONFIG_ENV_OVERWRITE
52c257c96dSDerald D. Woods /* NAND: SPL falcon mode configs */
53c257c96dSDerald D. Woods #if defined(CONFIG_SPL_OS_BOOT)
54b6e2543cSDerald D. Woods #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x2a0000
55c257c96dSDerald D. Woods #endif /* CONFIG_SPL_OS_BOOT */
560d43fdedSDerald D. Woods #endif /* CONFIG_NAND */
57584550d7STom Rini 
580d43fdedSDerald D. Woods /* Environment */
59b6e2543cSDerald D. Woods #define CONFIG_ENV_SIZE                 SZ_128K
60b6e2543cSDerald D. Woods 
610d43fdedSDerald D. Woods #define CONFIG_PREBOOT                  "usb start"
62136cf92dSSanjeev Premi 
638a3556edSDerald D. Woods #define MEM_LAYOUT_ENV_SETTINGS \
648a3556edSDerald D. Woods 	DEFAULT_LINUX_BOOT_ENV
658a3556edSDerald D. Woods 
6656d1ddedSDerald D. Woods #define BOOTENV_DEV_LEGACY_MMC(devtypeu, devtypel, instance) \
678a3556edSDerald D. Woods 	"bootcmd_" #devtypel #instance "=" \
688a3556edSDerald D. Woods 	"setenv mmcdev " #instance "; " \
698a3556edSDerald D. Woods 	"run mmcboot\0"
7056d1ddedSDerald D. Woods #define BOOTENV_DEV_NAME_LEGACY_MMC(devtypeu, devtypel, instance) \
718a3556edSDerald D. Woods 	#devtypel #instance " "
728a3556edSDerald D. Woods 
73b6e2543cSDerald D. Woods #if defined(CONFIG_NAND)
74b6e2543cSDerald D. Woods 
75b6e2543cSDerald D. Woods #define BOOTENV_DEV_NAND(devtypeu, devtypel, instance) \
76b6e2543cSDerald D. Woods 	"bootcmd_" #devtypel #instance "=" \
77b6e2543cSDerald D. Woods 	"if test ${mtdids} = '' || test ${mtdparts} = '' ; then " \
78b6e2543cSDerald D. Woods 		"echo NAND boot disabled: No mtdids and/or mtdparts; " \
79b6e2543cSDerald D. Woods 	"else " \
80b6e2543cSDerald D. Woods 		"run nandboot; " \
81b6e2543cSDerald D. Woods 	"fi\0"
82b6e2543cSDerald D. Woods #define BOOTENV_DEV_NAME_NAND(devtypeu, devtypel, instance) \
83b6e2543cSDerald D. Woods 	#devtypel #instance " "
84b6e2543cSDerald D. Woods 
858a3556edSDerald D. Woods #define BOOT_TARGET_DEVICES(func) \
868a3556edSDerald D. Woods 	func(MMC, mmc, 0) \
8756d1ddedSDerald D. Woods 	func(LEGACY_MMC, legacy_mmc, 0) \
8856d1ddedSDerald D. Woods 	func(UBIFS, ubifs, 0) \
898a3556edSDerald D. Woods 	func(NAND, nand, 0)
908a3556edSDerald D. Woods 
91b6e2543cSDerald D. Woods #else /* !CONFIG_NAND */
92b6e2543cSDerald D. Woods 
93b6e2543cSDerald D. Woods #define BOOT_TARGET_DEVICES(func) \
94b6e2543cSDerald D. Woods 	func(MMC, mmc, 0) \
95b6e2543cSDerald D. Woods 	func(LEGACY_MMC, legacy_mmc, 0)
96b6e2543cSDerald D. Woods 
97b6e2543cSDerald D. Woods #endif /* CONFIG_NAND */
98b6e2543cSDerald D. Woods 
998a3556edSDerald D. Woods #include <config_distro_bootcmd.h>
1008a3556edSDerald D. Woods 
101ad9bc8e5SDirk Behme #define CONFIG_EXTRA_ENV_SETTINGS \
1028a3556edSDerald D. Woods 	MEM_LAYOUT_ENV_SETTINGS \
1038a3556edSDerald D. Woods 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
1040d43fdedSDerald D. Woods 	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
1050d43fdedSDerald D. Woods 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
1062d28ba18SDerald D. Woods 	"fdt_high=0xffffffff\0" \
107b6e2543cSDerald D. Woods 	"console=ttyO0,115200n8\0" \
108a47ca2cfSDerald D. Woods 	"bootdir=/boot\0" \
109c257c96dSDerald D. Woods 	"bootenv=uEnv.txt\0" \
11056d1ddedSDerald D. Woods 	"bootfile=zImage\0" \
111b6e2543cSDerald D. Woods 	"bootpart=0:2\0" \
11256d1ddedSDerald D. Woods 	"bootubivol=rootfs\0" \
11356d1ddedSDerald D. Woods 	"bootubipart=rootfs\0" \
114c257c96dSDerald D. Woods 	"optargs=\0" \
115dcc4f38bSVaibhav Hiremath 	"mmcdev=0\0" \
116a47ca2cfSDerald D. Woods 	"mmcpart=2\0" \
117b6e2543cSDerald D. Woods 	"mmcroot=/dev/mmcblk0p2 rw\0" \
118b6e2543cSDerald D. Woods 	"mmcrootfstype=ext4 rootwait\0" \
119ad9bc8e5SDirk Behme 	"mmcargs=setenv bootargs console=${console} " \
120c257c96dSDerald D. Woods 		"${mtdparts} " \
1210d43fdedSDerald D. Woods 		"${optargs} " \
122b6e2543cSDerald D. Woods 		"root=${mmcroot} " \
123b6e2543cSDerald D. Woods 		"rootfstype=${mmcrootfstype}\0" \
124c257c96dSDerald D. Woods 	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
12556d1ddedSDerald D. Woods 	"ext4bootenv=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootenv}\0" \
126b6e2543cSDerald D. Woods 	"importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
127c257c96dSDerald D. Woods 		"env import -t ${loadaddr} ${filesize}\0" \
128b6e2543cSDerald D. Woods 	"mmcbootenv=setenv bootpart ${mmcdev}:${mmcpart}; " \
129b6e2543cSDerald D. Woods 		"mmc dev ${mmcdev}; " \
130a47ca2cfSDerald D. Woods 		"if mmc rescan; then " \
131a47ca2cfSDerald D. Woods 			"run loadbootenv && run importbootenv; " \
132a47ca2cfSDerald D. Woods 			"run ext4bootenv && run importbootenv; " \
133c257c96dSDerald D. Woods 			"if test -n $uenvcmd; then " \
134c257c96dSDerald D. Woods 				"echo Running uenvcmd ...; " \
135c257c96dSDerald D. Woods 				"run uenvcmd; " \
136c257c96dSDerald D. Woods 			"fi; " \
1378a3556edSDerald D. Woods 		"fi\0" \
13856d1ddedSDerald D. Woods 	"loadimage=ext4load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
13956d1ddedSDerald D. Woods 	"loaddtb=ext4load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
1408a3556edSDerald D. Woods 	"mmcboot=run mmcbootenv; " \
14156d1ddedSDerald D. Woods 		"if run loadimage && run loaddtb; then " \
14256d1ddedSDerald D. Woods 			"echo Booting ${bootdir}/${bootfile} from mmc ${bootpart} ...; " \
1438a3556edSDerald D. Woods 			"run mmcargs; " \
14456d1ddedSDerald D. Woods 			"if test ${bootfile} = uImage; then " \
1458a3556edSDerald D. Woods 				"bootm ${loadaddr} - ${fdtaddr}; " \
14656d1ddedSDerald D. Woods 			"fi; " \
14756d1ddedSDerald D. Woods 			"if test ${bootfile} = zImage; then " \
1488a3556edSDerald D. Woods 				"bootz ${loadaddr} - ${fdtaddr}; " \
14956d1ddedSDerald D. Woods 			"fi; " \
1508a3556edSDerald D. Woods 		"fi\0" \
151b6e2543cSDerald D. Woods 	"nandroot=ubi0:rootfs ubi.mtd=rootfs rw noinitrd\0" \
152b6e2543cSDerald D. Woods 	"nandrootfstype=ubifs rootwait\0" \
153b6e2543cSDerald D. Woods 	"nandargs=setenv bootargs console=${console} " \
154b6e2543cSDerald D. Woods 		"${mtdparts} " \
155b6e2543cSDerald D. Woods 		"${optargs} " \
156b6e2543cSDerald D. Woods 		"root=${nandroot} " \
157b6e2543cSDerald D. Woods 		"rootfstype=${nandrootfstype}\0" \
158b6e2543cSDerald D. Woods 	"nandboot=if nand read ${loadaddr} kernel && nand read ${fdtaddr} dtb; then " \
159a47ca2cfSDerald D. Woods 			"echo Booting uImage from NAND MTD 'kernel' partition ...; " \
160a47ca2cfSDerald D. Woods 			"run nandargs; " \
16156d1ddedSDerald D. Woods 			"bootm ${loadaddr} - ${fdtaddr}; " \
162a47ca2cfSDerald D. Woods 		"fi\0" \
1638a3556edSDerald D. Woods 	BOOTENV
1648a3556edSDerald D. Woods 
1650d43fdedSDerald D. Woods #endif /* __CONFIG_H */
166