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