xref: /rk3399_rockchip-uboot/include/configs/omap3_logic.h (revision 0c2b6dffb7fcd6ef028020587a030b6bef154a0e)
1 /*
2  * (C) Copyright 2011 Logic Product Development <www.logicpd.com>
3  *	Peter Barada <peter.barada@logicpd.com>
4  *
5  * Configuration settings for the Logic OMAP35x/DM37x SOM LV/Torpedo
6  * reference boards.
7  *
8  * SPDX-License-Identifier:	GPL-2.0+
9  */
10 
11 #ifndef __CONFIG_H
12 #define __CONFIG_H
13 
14 /* High Level Configuration Options */
15 
16 #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
17 
18 /*
19  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
20  * 64 bytes before this address should be set aside for u-boot.img's
21  * header. That is 0x800FFFC0--0x80100000 should not be used for any
22  * other needs.  We use this rather than the inherited defines from
23  * ti_armv7_common.h for backwards compatibility.
24  */
25 #define CONFIG_SYS_TEXT_BASE		0x80100000
26 #define CONFIG_SPL_BSS_START_ADDR	0x80000000
27 #define CONFIG_SPL_BSS_MAX_SIZE		(512 << 10)	/* 512 KB */
28 #define CONFIG_SYS_SPL_MALLOC_START	0x80208000
29 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000
30 
31 #include <configs/ti_omap3_common.h>
32 
33 /* Display CPU and Board information */
34 
35 #define CONFIG_DISPLAY_CPUINFO
36 #define CONFIG_DISPLAY_BOARDINFO
37 
38 #define CONFIG_MISC_INIT_R		/* misc_init_r dumps the die id */
39 #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
40 #define CONFIG_SETUP_MEMORY_TAGS
41 #define CONFIG_INITRD_TAG
42 #define CONFIG_REVISION_TAG
43 #define CONFIG_CMDLINE_EDITING		/* cmd line edit/history */
44 #define CONFIG_ZERO_BOOTDELAY_CHECK	/* check keypress w/no delay */
45 
46 /* Hardware drivers */
47 
48 /* GPIO banks */
49 #define CONFIG_OMAP3_GPIO_6		/* GPIO160..191 is in GPIO bank 6 */
50 
51 #define CONFIG_USB_OMAP3
52 
53 /* select serial console configuration */
54 #undef CONFIG_CONS_INDEX
55 #define CONFIG_CONS_INDEX		1
56 #define CONFIG_SYS_NS16550_COM1		OMAP34XX_UART1
57 #define CONFIG_SERIAL1			1	/* UART1 on OMAP Logic boards */
58 
59 /* commands to include */
60 #define CONFIG_CMD_NAND
61 #define CONFIG_CMD_CACHE
62 #define CONFIG_CMD_EXT2
63 #define CONFIG_CMD_FAT
64 #define CONFIG_CMD_MTDPARTS
65 #define CONFIG_CMD_NAND_LOCK_UNLOCK	/* nand (un)lock commands	*/
66 #define CONFIG_CMD_PING
67 #define CONFIG_CMD_DHCP
68 
69 /* I2C */
70 #define CONFIG_SYS_I2C_OMAP34XX
71 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* EEPROM AT24C64      */
72 #define EXPANSION_EEPROM_I2C_BUS	2	/* I2C Bus for AT24C64 */
73 #define CONFIG_OMAP3_LOGIC_USE_NEW_PRODUCT_ID
74 
75 /* USB */
76 #define CONFIG_USB_MUSB_GADGET
77 #define CONFIG_USB_MUSB_OMAP2PLUS
78 #define CONFIG_USB_MUSB_PIO_ONLY
79 #define CONFIG_USB_GADGET_DUALSPEED
80 #define CONFIG_USB_ETHER
81 #define CONFIG_USB_ETHER_RNDIS
82 #define CONFIG_USB_GADGET
83 #define CONFIG_USB_GADGET_VBUS_DRAW	0
84 #define CONFIG_USB_GADGET_DOWNLOAD
85 #define CONFIG_G_DNL_VENDOR_NUM		0x0451
86 #define CONFIG_G_DNL_PRODUCT_NUM	0xd022
87 #define CONFIG_G_DNL_MANUFACTURER	"TI"
88 #define CONFIG_USB_FUNCTION_FASTBOOT
89 #define CONFIG_CMD_FASTBOOT
90 #define CONFIG_ANDROID_BOOT_IMAGE
91 #define CONFIG_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
92 #define CONFIG_FASTBOOT_BUF_SIZE	0x07000000
93 #define CONFIG_SYS_CACHELINE_SIZE	64
94 
95 /* TWL4030 */
96 #define CONFIG_TWL4030_PWM
97 #define CONFIG_TWL4030_USB
98 
99 /* Board NAND Info. */
100 #ifdef CONFIG_NAND
101 #define CONFIG_NAND_OMAP_GPMC
102 
103 #define CONFIG_CMD_UBI			/* UBI-formated MTD partition support */
104 #define CONFIG_CMD_UBIFS		/* Read-only UBI volume operations */
105 #define CONFIG_RBTREE			/* required by CONFIG_CMD_UBI */
106 #define CONFIG_LZO			/* required by CONFIG_CMD_UBIFS */
107 
108 #define CONFIG_SYS_NAND_ADDR		NAND_BASE /* physical address */
109 						  /* to access nand */
110 #define CONFIG_SYS_MAX_NAND_DEVICE	1	  /* Max number of */
111 						  /* NAND devices */
112 #define CONFIG_SYS_NAND_BUSWIDTH_16BIT
113 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
114 #define CONFIG_SYS_NAND_PAGE_COUNT	64
115 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
116 #define CONFIG_SYS_NAND_OOBSIZE		64
117 #define CONFIG_SYS_NAND_BLOCK_SIZE	(128 * 1024)
118 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
119 #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
120 					 13, 14, 16, 17, 18, 19, 20, 21, 22, \
121 					 23, 24, 25, 26, 27, 28, 30, 31, 32, \
122 					 33, 34, 35, 36, 37, 38, 39, 40, 41, \
123 					 42, 44, 45, 46, 47, 48, 49, 50, 51, \
124 					 52, 53, 54, 55, 56}
125 
126 #define CONFIG_SYS_NAND_ECCSIZE		512
127 #define CONFIG_SYS_NAND_ECCBYTES	13
128 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
129 #define CONFIG_BCH
130 #define CONFIG_SYS_NAND_MAX_OOBFREE	2
131 #define CONFIG_SYS_NAND_MAX_ECCPOS	56
132 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x80000
133 #define CONFIG_MTD_DEVICE		/* needed for mtdparts commands */
134 #define CONFIG_MTD_PARTITIONS		/* required for UBI partition support */
135 #define MTDIDS_DEFAULT			"nand0=omap2-nand.0"
136 #define MTDPARTS_DEFAULT		"mtdparts=omap2-nand.0:512k(MLO),"\
137 					"1920k(u-boot),128k(u-boot-env),"\
138 					"4m(kernel),-(fs)"
139 #endif
140 
141 /* Environment information */
142 
143 /*
144  * PREBOOT assumes the 4.3" display is attached.  User can interrupt
145  * and modify display variable to suit their needs.
146  */
147 #define CONFIG_PREBOOT \
148 	"echo ======================NOTICE============================;"\
149 	"echo \"The u-boot environment is not set.\";"			\
150 	"echo \"If using a display a valid display varible for your panel\";" \
151 	"echo \"needs to be set.\";"					\
152 	"echo \"Valid display options are:\";"				\
153 	"echo \"  2 == LQ121S1DG31     TFT SVGA    (12.1)  Sharp\";"	\
154 	"echo \"  3 == LQ036Q1DA01     TFT QVGA    (3.6)   Sharp w/ASIC\";" \
155 	"echo \"  5 == LQ064D343       TFT VGA     (6.4)   Sharp\";"	\
156 	"echo \"  7 == LQ10D368        TFT VGA     (10.4)  Sharp\";"	\
157 	"echo \" 15 == LQ043T1DG01     TFT WQVGA   (4.3)   Sharp (DEFAULT)\";" \
158 	"echo \" vga[-dvi or -hdmi]    LCD VGA     640x480\";"          \
159 	"echo \" svga[-dvi or -hdmi]   LCD SVGA    800x600\";"          \
160 	"echo \" xga[-dvi or -hdmi]    LCD XGA     1024x768\";"         \
161 	"echo \" 720p[-dvi or -hdmi]   LCD 720P    1280x720\";"         \
162 	"echo \"Defaulting to 4.3 LCD panel (display=15).\";"		\
163 	"setenv display 15;"						\
164 	"setenv preboot;"						\
165 	"nand unlock;"							\
166 	"saveenv;"
167 
168 #define CONFIG_EXTRA_ENV_SETTINGS \
169 	"loadaddr=0x81000000\0" \
170 	"uimage=uImage\0" \
171 	"zimage=zImage\0" \
172 	"mtdids=" MTDIDS_DEFAULT "\0"	\
173 	"mtdparts=" MTDPARTS_DEFAULT "\0" \
174 	"mmcdev=0\0" \
175 	"mmcroot=/dev/mmcblk0p2 rw\0" \
176 	"mmcrootfstype=ext4 rootwait\0" \
177 	"autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
178 			"if run loadbootscript; then " \
179 				"run bootscript; " \
180 			"else " \
181 				"run defaultboot;" \
182 			"fi; " \
183 		"else run defaultboot; fi\0" \
184 	"defaultboot=run mmcramboot\0" \
185 	"consoledevice=ttyO0\0" \
186 	"display=15\0" \
187 	"setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
188 	"dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
189 	"rotation=0\0" \
190 	"vrfb_arg=if itest ${rotation} -ne 0; then " \
191 		"setenv bootargs ${bootargs} omapfb.vrfb=y " \
192 		"omapfb.rotate=${rotation}; " \
193 		"fi\0" \
194 	"optargs=ignore_loglevel early_printk no_console_suspend\0" \
195 	"addmtdparts=setenv bootargs ${bootargs} ${mtdparts}\0" \
196 	"common_bootargs=setenv bootargs ${bootargs} display=${display} " \
197 		"${optargs};" \
198 		"run addmtdparts; " \
199 		"run vrfb_arg\0" \
200 	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
201 	"bootscript=echo 'Running bootscript from mmc ...'; " \
202 		"source ${loadaddr}\0" \
203 	"loaduimage=mmc rescan; " \
204 		"fatload mmc ${mmcdev} ${loadaddr} ${uimage}\0" \
205 	"loadzimage=mmc rescan; " \
206 		"fatload mmc ${mmcdev} ${loadaddr} ${zimage}\0" \
207 	"ramdisksize=64000\0" \
208 	"ramdiskaddr=0x82000000\0" \
209 	"ramdiskimage=rootfs.ext2.gz.uboot\0" \
210 	"loadramdisk=mmc rescan; " \
211 		"fatload mmc ${mmcdev} ${ramdiskaddr} ${ramdiskimage}\0" \
212 	"ramargs=run setconsole; setenv bootargs console=${console} " \
213 		"root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
214 	"mmcargs=run setconsole; setenv bootargs console=${console} " \
215 		"${optargs} " \
216 		"root=${mmcroot} " \
217 		"rootfstype=${mmcrootfstype}\0" \
218 	"fdtaddr=0x86000000\0" \
219 	"loadfdtimage=mmc rescan; " \
220 		"fatload mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
221 	"mmcbootz=echo Booting with DT from mmc${mmcdev} ...; " \
222 		"run mmcargs; " \
223 		"run common_bootargs; " \
224 		"run dump_bootargs; " \
225 		"run loadzimage; " \
226 		"run loadfdtimage; " \
227 		"bootz ${loadaddr} - ${fdtaddr}\0" \
228 	"mmcramboot=echo 'Booting uImage kernel from mmc w/ramdisk...'; " \
229 		"run ramargs; " \
230 		"run common_bootargs; " \
231 		"run dump_bootargs; " \
232 		"run loaduimage; " \
233 		"run loadramdisk; " \
234 		"bootm ${loadaddr} ${ramdiskaddr}\0" \
235 	"mmcrambootz=echo 'Booting zImage kernel from mmc w/ramdisk...'; " \
236 		"run ramargs; " \
237 		"run common_bootargs; " \
238 		"run dump_bootargs; " \
239 		"run loadzimage; " \
240 		"run loadramdisk; " \
241 		"run loadfdtimage; " \
242 		"bootz ${loadaddr} ${ramdiskaddr} ${fdtaddr}\0; " \
243 	"tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
244 		"run ramargs; " \
245 		"run common_bootargs; " \
246 		"run dump_bootargs; " \
247 		"tftpboot ${loadaddr} ${uimage}; " \
248 		"tftpboot ${ramdiskaddr} ${ramdiskimage}; " \
249 		"bootm ${loadaddr} ${ramdiskaddr}\0"
250 
251 #define CONFIG_BOOTCOMMAND \
252 	"run autoboot"
253 
254 /* Miscellaneous configurable options */
255 #define CONFIG_AUTO_COMPLETE
256 
257 /* memtest works on */
258 #define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)
259 #define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
260 					0x01F00000) /* 31MB */
261 
262 /* FLASH and environment organization */
263 
264 /* **** PISMO SUPPORT *** */
265 #if defined(CONFIG_CMD_NAND)
266 #define CONFIG_SYS_FLASH_BASE		NAND_BASE
267 #elif defined(CONFIG_CMD_ONENAND)
268 #define CONFIG_SYS_FLASH_BASE		ONENAND_MAP
269 #endif
270 
271 /* Monitor at start of flash */
272 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
273 
274 #define CONFIG_ENV_IS_IN_NAND		1
275 #define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
276 #define ONENAND_ENV_OFFSET		0x260000 /* environment starts here */
277 #define SMNAND_ENV_OFFSET		0x260000 /* environment starts here */
278 
279 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
280 #define CONFIG_ENV_OFFSET		SMNAND_ENV_OFFSET
281 #define CONFIG_ENV_ADDR			SMNAND_ENV_OFFSET
282 
283 
284 /* SMSC922x Ethernet */
285 #if defined(CONFIG_CMD_NET)
286 #define CONFIG_SMC911X
287 #define CONFIG_SMC911X_32_BIT
288 #define CONFIG_SMC911X_BASE	0x08000000
289 #endif /* (CONFIG_CMD_NET) */
290 
291 /* Defines for SPL */
292 
293 #define CONFIG_SPL_OMAP3_ID_NAND
294 
295 /* NAND: SPL falcon mode configs */
296 #ifdef CONFIG_SPL_OS_BOOT
297 #define CONFIG_CMD_SPL_NAND_OFS		0x240000
298 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x280000
299 #define CONFIG_CMD_SPL_WRITE_SIZE	0x2000
300 #endif
301 
302 #endif /* __CONFIG_H */
303