1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2011 Logic Product Development <www.logicpd.com>
4  *	Peter Barada <peter.barada@logicpd.com>
5  *
6  * Configuration settings for the Logic OMAP35x/DM37x SOM LV/Torpedo
7  * reference boards.
8  */
9 
10 #ifndef __CONFIG_H
11 #define __CONFIG_H
12 
13 /* High Level Configuration Options */
14 
15 #define CONFIG_NR_DRAM_BANKS	2	/* CS1 may or may not be populated */
16 
17 #include <configs/ti_omap3_common.h>
18 
19 /*
20  * We are only ever GP parts and will utilize all of the "downloaded image"
21  * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB) in
22  * order to allow for BCH8 to fit in.
23  */
24 #undef CONFIG_SPL_TEXT_BASE
25 #define CONFIG_SPL_TEXT_BASE		0x40200000
26 
27 #define CONFIG_MISC_INIT_R		/* misc_init_r dumps the die id */
28 #define CONFIG_CMDLINE_TAG		/* enable passing of ATAGs */
29 #define CONFIG_SETUP_MEMORY_TAGS
30 #define CONFIG_INITRD_TAG
31 #define CONFIG_REVISION_TAG
32 
33 /* Hardware drivers */
34 
35 /* I2C */
36 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* EEPROM AT24C64      */
37 
38 /* Board NAND Info. */
39 #ifdef CONFIG_NAND
40 #define CONFIG_SYS_NAND_ADDR		NAND_BASE /* physical address */
41 						  /* to access nand */
42 #define CONFIG_SYS_MAX_NAND_DEVICE	1	  /* Max number of */
43 						  /* NAND devices */
44 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
45 #define CONFIG_SYS_NAND_PAGE_COUNT	64
46 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
47 #define CONFIG_SYS_NAND_OOBSIZE		64
48 #define CONFIG_SYS_NAND_BLOCK_SIZE	(128 * 1024)
49 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
50 #define CONFIG_SYS_NAND_ECCPOS		{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, \
51 					 13, 14, 16, 17, 18, 19, 20, 21, 22, \
52 					 23, 24, 25, 26, 27, 28, 30, 31, 32, \
53 					 33, 34, 35, 36, 37, 38, 39, 40, 41, \
54 					 42, 44, 45, 46, 47, 48, 49, 50, 51, \
55 					 52, 53, 54, 55, 56}
56 
57 #define CONFIG_SYS_NAND_ECCSIZE		512
58 #define CONFIG_SYS_NAND_ECCBYTES	13
59 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW_DETECTION_SW
60 #define CONFIG_SYS_NAND_MAX_OOBFREE	2
61 #define CONFIG_SYS_NAND_MAX_ECCPOS	56
62 #endif
63 
64 /* Environment information */
65 
66 #define CONFIG_PREBOOT \
67 	"setenv preboot;"						\
68 	"saveenv;"
69 
70 #define CONFIG_EXTRA_ENV_SETTINGS \
71 	DEFAULT_LINUX_BOOT_ENV \
72 	"mtdids=" CONFIG_MTDIDS_DEFAULT "\0"	\
73 	"mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
74 	"mmcdev=0\0" \
75 	"mmcroot=/dev/mmcblk0p2 rw\0" \
76 	"mmcrootfstype=ext4 rootwait\0" \
77 	"nandroot=ubi0:rootfs rw ubi.mtd=fs noinitrd\0" \
78 	"nandrootfstype=ubifs rootwait\0" \
79 	"autoboot=mmc dev ${mmcdev}; if mmc rescan; then " \
80 			"if run loadbootscript; then " \
81 				"run bootscript; " \
82 			"else " \
83 				"run defaultboot;" \
84 			"fi; " \
85 		"else run defaultboot; fi\0" \
86 	"defaultboot=run mmcramboot\0" \
87 	"consoledevice=ttyS0\0" \
88 	"setconsole=setenv console ${consoledevice},${baudrate}n8\0" \
89 	"dump_bootargs=echo 'Bootargs: '; echo $bootargs\0" \
90 	"rotation=0\0" \
91 	"vrfb_arg=if itest ${rotation} -ne 0; then " \
92 		"setenv bootargs ${bootargs} omapfb.vrfb=y " \
93 		"omapfb.rotate=${rotation}; " \
94 		"fi\0" \
95 	"optargs=ignore_loglevel early_printk no_console_suspend\0" \
96 	"common_bootargs=run setconsole; setenv bootargs " \
97 		"${bootargs} "\
98 		"console=${console} " \
99 		"${mtdparts} "\
100 		"${optargs}; " \
101 		"run vrfb_arg\0" \
102 	"loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
103 	"bootscript=echo 'Running bootscript from mmc ...'; " \
104 		"source ${loadaddr}\0" \
105 	"loadimage=mmc rescan; " \
106 		"load mmc ${mmcdev} ${loadaddr} ${bootfile}\0" \
107 	"ramdisksize=64000\0" \
108 	"ramdiskimage=rootfs.ext2.gz.uboot\0" \
109 	"loadramdisk=mmc rescan; " \
110 		"load mmc ${mmcdev} ${rdaddr} ${ramdiskimage}\0" \
111 	"ramargs=setenv bootargs "\
112 		"root=/dev/ram rw ramdisk_size=${ramdisksize}\0" \
113 	"mmcargs=setenv bootargs "\
114 		"root=${mmcroot} rootfstype=${mmcrootfstype}\0" \
115 	"nandargs=setenv bootargs "\
116 		"root=${nandroot} " \
117 		"rootfstype=${nandrootfstype}\0" \
118 	"nfsargs=setenv serverip ${tftpserver}; " \
119 		"setenv bootargs root=/dev/nfs " \
120 		"nfsroot=${nfsrootpath} " \
121 		"ip=${ipaddr}:${tftpserver}:${gatewayip}:${netmask}::eth0:off\0" \
122 	"nfsrootpath=/opt/nfs-exports/omap\0" \
123 	"autoload=no\0" \
124 	"loadfdt=mmc rescan; " \
125 		"load mmc ${mmcdev} ${fdtaddr} ${fdtimage}\0" \
126 	"mmcbootcommon=echo Booting with DT from mmc${mmcdev} ...; " \
127 		"run mmcargs; " \
128 		"run common_bootargs; " \
129 		"run dump_bootargs; " \
130 		"run loadimage; " \
131 		"run loadfdt;\0 " \
132 	"mmcbootz=setenv bootfile zImage; " \
133 		"run mmcbootcommon; "\
134 		"bootz ${loadaddr} - ${fdtaddr}\0" \
135 	"mmcboot=setenv bootfile uImage; "\
136 		"run mmcbootcommon; "\
137 		"bootm ${loadaddr} - ${fdtaddr}\0" \
138 	"mmcrambootcommon=echo 'Booting kernel from MMC w/ramdisk...'; " \
139 		"run ramargs; " \
140 		"run common_bootargs; " \
141 		"run dump_bootargs; " \
142 		"run loadimage; " \
143 		"run loadfdt; " \
144 		"run loadramdisk\0" \
145 	"mmcramboot=setenv bootfile uImage; " \
146 		"run mmcrambootcommon; " \
147 		"bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
148 	"mmcrambootz=setenv bootfile zImage; " \
149 		"run mmcrambootcommon; " \
150 		"bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
151 	"tftpboot=echo 'Booting kernel/ramdisk rootfs from tftp...'; " \
152 		"run ramargs; " \
153 		"run common_bootargs; " \
154 		"run dump_bootargs; " \
155 		"tftpboot ${loadaddr} ${zimage}; " \
156 		"tftpboot ${rdaddr} ${ramdiskimage}; " \
157 		"bootm ${loadaddr} ${rdaddr}\0" \
158 	"tftpbootz=echo 'Booting kernel NFS rootfs...'; " \
159 		"dhcp;" \
160 		"run nfsargs;" \
161 		"run common_bootargs;" \
162 		"run dump_bootargs;" \
163 		"tftpboot $loadaddr zImage;" \
164 		"bootz $loadaddr\0" \
165 	"nandbootcommon=echo 'Booting kernel from NAND...';" \
166 		"run nandargs;" \
167 		"run common_bootargs;" \
168 		"run dump_bootargs;" \
169 		"nand read ${loadaddr} kernel;" \
170 		"nand read ${fdtaddr} spl-os;\0" \
171 	"nandbootz=run nandbootcommon; "\
172 		"bootz ${loadaddr} - ${fdtaddr}\0"\
173 	"nandboot=run nandbootcommon; "\
174 		"bootm ${loadaddr} - ${fdtaddr}\0"\
175 
176 #define CONFIG_BOOTCOMMAND \
177 	"run autoboot"
178 
179 /* Miscellaneous configurable options */
180 
181 /* memtest works on */
182 #define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)
183 #define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + \
184 					0x01F00000) /* 31MB */
185 
186 /* FLASH and environment organization */
187 
188 /* **** PISMO SUPPORT *** */
189 #if defined(CONFIG_CMD_NAND)
190 #define CONFIG_SYS_FLASH_BASE		NAND_BASE
191 #endif
192 
193 /* Monitor at start of flash */
194 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
195 
196 #define CONFIG_ENV_SIZE			(128 << 10)	/* 128 KiB */
197 
198 #define CONFIG_SYS_ENV_SECT_SIZE	(128 << 10)	/* 128 KiB */
199 #define CONFIG_ENV_OFFSET		0x260000
200 #define CONFIG_ENV_ADDR			0x260000
201 
202 /* Defines for SPL */
203 
204 /* NAND: SPL falcon mode configs */
205 #ifdef CONFIG_SPL_OS_BOOT
206 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x280000
207 #endif
208 
209 #endif /* __CONFIG_H */
210