omap3_overo.h 8 KB
Newer Older
Dirk Behme's avatar
Dirk Behme committed
1 2 3
/*
 * Configuration settings for the Gumstix Overo board.
 *
4
 * SPDX-License-Identifier:	GPL-2.0+
Dirk Behme's avatar
Dirk Behme committed
5 6 7 8 9
 */

#ifndef __CONFIG_H
#define __CONFIG_H

10 11
#define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
#define CONFIG_NAND
12

13
#include <configs/ti_omap3_common.h>
14 15 16 17 18 19
#undef CONFIG_SPL_MAX_SIZE
#define CONFIG_SPL_MAX_SIZE	(64*1024)
#undef CONFIG_SPL_TEXT_BASE
#define CONFIG_SPL_TEXT_BASE	0x40200000

#define CONFIG_BCH
Dirk Behme's avatar
Dirk Behme committed
20

21
/* Display CPU and Board information */
22 23
#define CONFIG_DISPLAY_CPUINFO
#define CONFIG_DISPLAY_BOARDINFO
24

25
/* call misc_init_r */
Dirk Behme's avatar
Dirk Behme committed
26 27
#define CONFIG_MISC_INIT_R

28
/* pass the revision tag */
29
#define CONFIG_REVISION_TAG
Dirk Behme's avatar
Dirk Behme committed
30

31 32
/* override size of malloc() pool */
#undef CONFIG_SYS_MALLOC_LEN
33 34 35 36
#define CONFIG_ENV_SIZE		(128 << 10)	/* 128 KiB sector */
/* Shift 128 << 15 provides 4 MiB heap to support UBI commands.
 * Shift 128 << 10 provides 128 KiB heap for limited-memory devices. */
#define CONFIG_SYS_MALLOC_LEN	(CONFIG_ENV_SIZE + (128 << 15))
Dirk Behme's avatar
Dirk Behme committed
37

38 39
/* I2C Support */
#define CONFIG_SYS_I2C_OMAP34XX
Dirk Behme's avatar
Dirk Behme committed
40

41 42
/* TWL4030 LED */
#define CONFIG_TWL4030_LED
Dirk Behme's avatar
Dirk Behme committed
43

44 45 46 47 48 49 50
/* USB EHCI */
#define CONFIG_USB_EHCI
#define CONFIG_USB_EHCI_OMAP
#define CONFIG_USB_STORAGE
#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO	183
#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS	3

51
/* Initialize GPIOs by default */
52 53 54 55 56 57
#define CONFIG_OMAP3_GPIO_2	/* GPIO32..63 is in GPIO Bank 2 */
#define CONFIG_OMAP3_GPIO_3	/* GPIO64..95 is in GPIO Bank 3 */
#define CONFIG_OMAP3_GPIO_4	/* GPIO96..127 is in GPIO Bank 4 */
#define CONFIG_OMAP3_GPIO_5	/* GPIO128..159 is in GPIO Bank 5 */
#define CONFIG_OMAP3_GPIO_6	/* GPIO160..191 is in GPIO Bank 6 */

Dirk Behme's avatar
Dirk Behme committed
58
/* commands to include */
59
#define CONFIG_CMD_CACHE
60
#define CONFIG_CMD_USB
Dirk Behme's avatar
Dirk Behme committed
61 62 63
#undef CONFIG_CMD_FPGA		/* FPGA configuration Support	*/
#undef CONFIG_CMD_IMI		/* iminfo			*/
#undef CONFIG_CMD_NFS		/* NFS support			*/
64

65
#ifdef CONFIG_NAND
66 67 68 69 70 71 72 73 74 75 76 77 78
#define CONFIG_CMD_UBI		/* UBI-formated MTD partition support */
#define CONFIG_CMD_UBIFS	/* Read-only UBI volume operations */

#define CONFIG_RBTREE		/* required by CONFIG_CMD_UBI */
#define CONFIG_LZO		/* required by CONFIG_CMD_UBIFS */

#define CONFIG_MTD_PARTITIONS	/* required for UBI partition support */

/* NAND block size is 128 KiB.  Synchronize these values with
 * overo_nand_partitions in mach-omap2/board-overo.c in Linux:
 *  xloader              4 * NAND_BLOCK_SIZE = 512 KiB
 *  uboot               14 * NAND_BLOCK_SIZE = 1792 KiB
 *  uboot environtment   2 * NAND_BLOCK_SIZE = 256 KiB
79
 *  linux               64 * NAND_BLOCK_SIZE = 8 MiB
80 81 82 83 84 85 86
 *  rootfs              remainder
 */
#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:"	\
	"512k(xloader),"				\
	"1792k(u-boot),"				\
	"256k(environ),"				\
87
	"8m(linux),"					\
88
	"-(rootfs)"
89
#else /* CONFIG_NAND */
90
#define MTDPARTS_DEFAULT
91
#endif /* CONFIG_NAND */
92

93
/* Board NAND Info. */
94
#define CONFIG_SYS_NAND_QUIET_TEST
Dirk Behme's avatar
Dirk Behme committed
95 96 97 98
#define CONFIG_SYS_NAND_ADDR		NAND_BASE	/* physical address */
							/* to access nand */
/* Environment information */
#define CONFIG_EXTRA_ENV_SETTINGS \
99
	DEFAULT_LINUX_BOOT_ENV \
100 101 102
	"bootdir=/boot\0" \
	"bootfile=zImage\0" \
	"usbtty=cdc_acm\0" \
103
	"console=ttyO2,115200n8\0" \
104
	"mpurate=auto\0" \
105
	"optargs=\0" \
106 107 108
	"vram=12M\0" \
	"dvimode=1024x768MR-16@60\0" \
	"defaultdisplay=dvi\0" \
109
	"mmcdev=0\0" \
110 111
	"mmcroot=/dev/mmcblk0p2 rw\0" \
	"mmcrootfstype=ext3 rootwait\0" \
112 113
	"nandroot=ubi0:rootfs ubi.mtd=4\0" \
	"nandrootfstype=ubifs\0" \
114
	"mtdparts=" MTDPARTS_DEFAULT "\0" \
Dirk Behme's avatar
Dirk Behme committed
115
	"mmcargs=setenv bootargs console=${console} " \
116
		"${optargs} " \
117
		"mpurate=${mpurate} " \
118 119 120 121 122
		"vram=${vram} " \
		"omapfb.mode=dvi:${dvimode} " \
		"omapdss.def_disp=${defaultdisplay} " \
		"root=${mmcroot} " \
		"rootfstype=${mmcrootfstype}\0" \
Dirk Behme's avatar
Dirk Behme committed
123
	"nandargs=setenv bootargs console=${console} " \
124
		"${optargs} " \
125
		"mpurate=${mpurate} " \
126 127 128 129 130
		"vram=${vram} " \
		"omapfb.mode=dvi:${dvimode} " \
		"omapdss.def_disp=${defaultdisplay} " \
		"root=${nandroot} " \
		"rootfstype=${nandrootfstype}\0" \
131 132
	"loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
	"bootscript=echo Running boot script from mmc ...; " \
133
		"source ${loadaddr}\0" \
134 135
	"loadbootenv=load mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
	"importbootenv=echo Importing environment from mmc ...; " \
136
		"env import -t ${loadaddr} ${filesize}\0" \
137 138
	"loaduimage=load mmc ${mmcdev} ${loadaddr} uImage\0" \
	"mmcboot=echo Booting from mmc...; " \
Dirk Behme's avatar
Dirk Behme committed
139 140
		"run mmcargs; " \
		"bootm ${loadaddr}\0" \
141
	"loadzimage=load mmc ${mmcdev}:2 ${loadaddr} ${bootdir}/${bootfile}\0" \
142
	"loadfdt=load mmc ${mmcdev}:2 ${fdtaddr} ${bootdir}/${fdtfile}\0" \
143 144
	"loadubizimage=ubifsload ${loadaddr} ${bootdir}/${bootfile}\0" \
	"loadubifdt=ubifsload ${fdtaddr} ${bootdir}/${fdtfile}\0" \
145 146
	"mmcbootfdt=echo Booting with DT from mmc ...; " \
		"run mmcargs; " \
147
		"bootz ${loadaddr} - ${fdtaddr}\0" \
Dirk Behme's avatar
Dirk Behme committed
148 149
	"nandboot=echo Booting from nand ...; " \
		"run nandargs; " \
150 151 152
		"if nand read ${loadaddr} linux; then " \
			"bootm ${loadaddr};" \
		"fi;\0" \
153 154 155 156 157 158 159
	"nanddtsboot=echo Booting from nand with DTS...; " \
		"run nandargs; " \
		"ubi part rootfs; "\
		"ubifsmount ubi0:rootfs; "\
		"run loadubifdt; "\
		"run loadubizimage; "\
		"bootz ${loadaddr} - ${fdtaddr}\0" \
Dirk Behme's avatar
Dirk Behme committed
160 161

#define CONFIG_BOOTCOMMAND \
162
	"mmc dev ${mmcdev}; if mmc rescan; then " \
Dirk Behme's avatar
Dirk Behme committed
163 164
		"if run loadbootscript; then " \
			"run bootscript; " \
165 166 167 168 169 170 171 172 173 174 175 176 177
		"fi;" \
		"if run loadbootenv; then " \
			"echo Loaded environment from ${bootenv};" \
			"run importbootenv;" \
		"fi;" \
		"if test -n $uenvcmd; then " \
			"echo Running uenvcmd ...;" \
			"run uenvcmd;" \
		"fi;" \
		"if run loaduimage; then " \
			"run mmcboot;" \
		"fi;" \
		"if run loadzimage; then " \
178
			"if test -z \"${fdtfile}\"; then " \
179 180 181 182
				"setenv fdtfile omap3-${boardname}-${expansionname}.dtb;" \
			"fi;" \
			"if run loadfdt; then " \
				"run mmcbootfdt;" \
183
			"fi;" \
184 185 186
		"fi;" \
	"fi;" \
	"run nandboot; " \
187 188 189 190
	"if test -z \"${fdtfile}\"; then "\
		"setenv fdtfile omap3-${boardname}-${expansionname}.dtb;" \
	"fi;" \
	"run nanddtsboot; " \
Dirk Behme's avatar
Dirk Behme committed
191 192 193 194

/*
 * Miscellaneous configurable options
 */
195
#undef CONFIG_SYS_PROMPT
196
#define CONFIG_SYS_PROMPT		"Overo # "
197

Dirk Behme's avatar
Dirk Behme committed
198 199 200 201 202
/* memtest works on */
#define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)
#define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
					0x01F00000) /* 31MB */

203 204
/* FLASH and environment organization */
#if defined(CONFIG_NAND)
205
#define CONFIG_SYS_FLASH_BASE		NAND_BASE
206
#endif
Dirk Behme's avatar
Dirk Behme committed
207 208 209 210 211

/* Monitor at start of flash */
#define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
#define CONFIG_SYS_ONENAND_BASE		ONENAND_MAP

212
#define CONFIG_ENV_IS_IN_NAND
Dirk Behme's avatar
Dirk Behme committed
213 214 215
#define ONENAND_ENV_OFFSET		0x240000 /* environment starts here */
#define SMNAND_ENV_OFFSET		0x240000 /* environment starts here */

216 217
#define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
#define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
Dirk Behme's avatar
Dirk Behme committed
218 219
#define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET

220
/* Configure SMSC9211 ethernet */
221
#if defined(CONFIG_CMD_NET)
222
#define CONFIG_SMC911X
223
#define CONFIG_SMC911X_32_BIT
224
#define CONFIG_SMC911X_BASE		0x2C000000
225 226
#endif /* (CONFIG_CMD_NET) */

227
/* Initial RAM setup */
228 229
#define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
#define CONFIG_SYS_INIT_RAM_SIZE	0x800
230 231
#define CONFIG_SYS_CACHELINE_SIZE	64

Andreas Müller's avatar
Andreas Müller committed
232
/* NAND boot config */
233
#define CONFIG_SYS_NAND_BUSWIDTH_16BIT	16
234
#define CONFIG_SYS_NAND_MAX_ECCPOS  56
Andreas Müller's avatar
Andreas Müller committed
235 236 237 238 239 240
#define CONFIG_SYS_NAND_5_ADDR_CYCLE
#define CONFIG_SYS_NAND_PAGE_COUNT	64
#define CONFIG_SYS_NAND_PAGE_SIZE	2048
#define CONFIG_SYS_NAND_OOBSIZE		64
#define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
#define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
241 242 243 244 245 246
#define CONFIG_SYS_NAND_ECCPOS      {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
					13, 14, 16, 17, 18, 19, 20, 21, 22, \
					23, 24, 25, 26, 27, 28, 30, 31, 32, \
					33, 34, 35, 36, 37, 38, 39, 40, 41, \
					42, 44, 45, 46, 47, 48, 49, 50, 51, \
					52, 53, 54, 55, 56}
Andreas Müller's avatar
Andreas Müller committed
247
#define CONFIG_SYS_NAND_ECCSIZE		512
248 249
#define CONFIG_SYS_NAND_ECCBYTES	13
#define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
Andreas Müller's avatar
Andreas Müller committed
250 251
#define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
252 253 254 255 256 257
/* NAND: SPL falcon mode configs */
#ifdef CONFIG_SPL_OS_BOOT
#define CONFIG_CMD_SPL_NAND_OFS		0x240000
#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x280000
#define CONFIG_CMD_SPL_WRITE_SIZE	0x2000
#endif
Andreas Müller's avatar
Andreas Müller committed
258

Dirk Behme's avatar
Dirk Behme committed
259
#endif				/* __CONFIG_H */