xref: /openbmc/u-boot/include/configs/nokia_rx51.h (revision 33b78476)
1 /*
2  * (C) Copyright 2011-2012
3  * Pali Rohár <pali.rohar@gmail.com>
4  *
5  * (C) Copyright 2010
6  * Alistair Buxton <a.j.buxton@gmail.com>
7  *
8  * Derived from Beagle Board code:
9  * (C) Copyright 2006-2008
10  * Texas Instruments.
11  * Richard Woodruff <r-woodruff2@ti.com>
12  * Syed Mohammed Khasim <x0khasim@ti.com>
13  *
14  * Configuration settings for the Nokia RX-51 aka N900.
15  *
16  * SPDX-License-Identifier:	GPL-2.0+
17  */
18 
19 #ifndef __CONFIG_H
20 #define __CONFIG_H
21 
22 /*
23  * High Level Configuration Options
24  */
25 
26 #define CONFIG_OMAP			/* in a TI OMAP core */
27 #define CONFIG_OMAP3430			/* which is in a 3430 */
28 #define CONFIG_OMAP3_RX51		/* working with RX51 */
29 #define CONFIG_SYS_L2CACHE_OFF		/* pretend there is no L2 CACHE */
30 
31 #define CONFIG_MACH_TYPE		MACH_TYPE_NOKIA_RX51
32 
33 /*
34  * Nokia X-Loader loading secondary image to address 0x80400000
35  * NOLO loading boot image to random place, so it doesn't really
36  * matter what we set this to. We have to copy u-boot to this address
37  */
38 #define CONFIG_SYS_TEXT_BASE	0x80008000
39 
40 #define CONFIG_SDRC			/* The chip has SDRC controller */
41 
42 #include <asm/arch/cpu.h>		/* get chip and board defs */
43 #include <asm/arch/omap.h>
44 #include <asm/arch/mem.h>
45 #include <linux/stringify.h>
46 
47 /* Clock Defines */
48 #define V_OSCK			26000000	/* Clock output from T2 */
49 #define V_SCLK			(V_OSCK >> 1)
50 
51 #define CONFIG_MISC_INIT_R
52 #define CONFIG_SKIP_LOWLEVEL_INIT		/* X-Loader set everything up */
53 
54 #define CONFIG_CMDLINE_TAG	/* enable passing kernel command line string */
55 #define CONFIG_INITRD_TAG			/* enable passing initrd */
56 #define CONFIG_REVISION_TAG			/* enable passing revision tag*/
57 #define CONFIG_SETUP_MEMORY_TAGS		/* enable memory tag */
58 
59 /*
60  * Size of malloc() pool
61  */
62 #define CONFIG_ENV_SIZE			(128 << 10)
63 #define CONFIG_UBI_SIZE			(512 << 10)
64 #define CONFIG_SYS_MALLOC_LEN		(CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
65 					(128 << 10))
66 
67 /*
68  * Hardware drivers
69  */
70 
71 /*
72  * NS16550 Configuration
73  */
74 #define V_NS16550_CLK		48000000		/* 48MHz (APLL96/2) */
75 
76 #define CONFIG_SYS_NS16550_SERIAL
77 #define CONFIG_SYS_NS16550_REG_SIZE	(-4)
78 #define CONFIG_SYS_NS16550_CLK		V_NS16550_CLK
79 
80 /*
81  * select serial console configuration
82  */
83 #define CONFIG_CONS_INDEX		3
84 #define CONFIG_SYS_NS16550_COM3		OMAP34XX_UART3
85 #define CONFIG_SERIAL3			3		/* UART3 on RX-51 */
86 
87 /* allow to overwrite serial and ethaddr */
88 #define CONFIG_ENV_OVERWRITE
89 #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
90 
91 /* USB */
92 #define CONFIG_USB_MUSB_UDC
93 #define CONFIG_USB_MUSB_HCD
94 #define CONFIG_USB_OMAP3
95 #define CONFIG_TWL4030_USB
96 
97 /* USB device configuration */
98 #define CONFIG_USB_DEVICE
99 #define CONFIG_USBD_VENDORID		0x0421
100 #define CONFIG_USBD_PRODUCTID		0x01c8
101 #define CONFIG_USBD_MANUFACTURER	"Nokia"
102 #define CONFIG_USBD_PRODUCT_NAME	"N900"
103 
104 /* commands to include */
105 
106 #define CONFIG_CMDLINE_EDITING		/* add command line history */
107 #define CONFIG_AUTO_COMPLETE		/* add autocompletion support */
108 
109 #ifdef ONENAND_SUPPORT
110 
111 #define CONFIG_CMD_ONENAND		/* ONENAND support */
112 #define CONFIG_CMD_MTDPARTS		/* mtd parts support */
113 
114 #ifdef UBIFS_SUPPORT
115 #define CONFIG_CMD_UBIFS		/* UBIFS Support */
116 #endif
117 
118 #endif
119 
120 #define CONFIG_OMAP3_SPI
121 #define CONFIG_SYS_I2C
122 #define CONFIG_SYS_OMAP24_I2C_SPEED	100000
123 #define CONFIG_SYS_OMAP24_I2C_SLAVE	1
124 #define CONFIG_SYS_I2C_OMAP34XX
125 
126 /*
127  * TWL4030
128  */
129 #define CONFIG_TWL4030_LED
130 #define CONFIG_TWL4030_KEYPAD
131 
132 #define CONFIG_OMAP_GPIO
133 #define GPIO_SLIDE			71
134 
135 /*
136  * Board ONENAND Info.
137  */
138 
139 #define PART1_NAME			"bootloader"
140 #define PART1_SIZE			128
141 #define PART1_MULL			1024
142 #define PART1_SUFF			"k"
143 #define PART1_OFFS			0x00000000
144 #define PART1_MASK			0x00000003
145 
146 #define PART2_NAME			"config"
147 #define PART2_SIZE			384
148 #define PART2_MULL			1024
149 #define PART2_SUFF			"k"
150 #define PART2_OFFS			0x00020000
151 #define PART2_MASK			0x00000000
152 
153 #define PART3_NAME			"log"
154 #define PART3_SIZE			256
155 #define PART3_MULL			1024
156 #define PART3_SUFF			"k"
157 #define PART3_OFFS			0x00080000
158 #define PART3_MASK			0x00000000
159 
160 #define PART4_NAME			"kernel"
161 #define PART4_SIZE			2
162 #define PART4_MULL			1024*1024
163 #define PART4_SUFF			"m"
164 #define PART4_OFFS			0x000c0000
165 #define PART4_MASK			0x00000000
166 
167 #define PART5_NAME			"initfs"
168 #define PART5_SIZE			2
169 #define PART5_MULL			1024*1024
170 #define PART5_SUFF			"m"
171 #define PART5_OFFS			0x002c0000
172 #define PART5_MASK			0x00000000
173 
174 #define PART6_NAME			"rootfs"
175 #define PART6_SIZE			257280
176 #define PART6_MULL			1024
177 #define PART6_SUFF			"k"
178 #define PART6_OFFS			0x004c0000
179 #define PART6_MASK			0x00000000
180 
181 #ifdef ONENAND_SUPPORT
182 
183 #define CONFIG_SYS_ONENAND_BASE		ONENAND_MAP
184 #define CONFIG_MTD_DEVICE
185 #define CONFIG_MTD_PARTITIONS
186 
187 #ifdef UBIFS_SUPPORT
188 #define CONFIG_RBTREE
189 #define CONFIG_LZO
190 #endif
191 
192 #define MTDIDS_DEFAULT			"onenand0=onenand"
193 #define MTDPARTS_DEFAULT		"mtdparts=onenand:" \
194 		__stringify(PART1_SIZE) PART1_SUFF "(" PART1_NAME ")ro," \
195 		__stringify(PART2_SIZE) PART2_SUFF "(" PART2_NAME ")," \
196 		__stringify(PART3_SIZE) PART3_SUFF "(" PART3_NAME ")," \
197 		__stringify(PART4_SIZE) PART4_SUFF "(" PART4_NAME ")," \
198 		__stringify(PART5_SIZE) PART5_SUFF "(" PART5_NAME ")," \
199 		"-(" PART6_NAME ")"
200 
201 #endif
202 
203 /* Watchdog support */
204 #define CONFIG_HW_WATCHDOG
205 
206 /*
207  * Framebuffer
208  */
209 /* Video console */
210 #define CONFIG_VIDEO_LOGO
211 #define VIDEO_FB_16BPP_PIXEL_SWAP
212 #define VIDEO_FB_16BPP_WORD_SWAP
213 #define CONFIG_SPLASH_SCREEN
214 
215 /* functions for cfb_console */
216 #define VIDEO_KBD_INIT_FCT		rx51_kp_init()
217 #define VIDEO_TSTC_FCT			rx51_kp_tstc
218 #define VIDEO_GETC_FCT			rx51_kp_getc
219 #ifndef __ASSEMBLY__
220 struct stdio_dev;
221 int rx51_kp_init(void);
222 int rx51_kp_tstc(struct stdio_dev *sdev);
223 int rx51_kp_getc(struct stdio_dev *sdev);
224 #endif
225 
226 #ifndef MTDPARTS_DEFAULT
227 #define MTDPARTS_DEFAULT
228 #endif
229 
230 /* Environment information */
231 #define CONFIG_EXTRA_ENV_SETTINGS \
232 	"mtdparts=" MTDPARTS_DEFAULT "\0" \
233 	"usbtty=cdc_acm\0" \
234 	"stdin=vga\0" \
235 	"stdout=vga\0" \
236 	"stderr=vga\0" \
237 	"setcon=setenv stdin ${con};" \
238 		"setenv stdout ${con};" \
239 		"setenv stderr ${con}\0" \
240 	"sercon=setenv con serial; run setcon\0" \
241 	"usbcon=setenv con usbtty; run setcon\0" \
242 	"vgacon=setenv con vga; run setcon\0" \
243 	"slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
244 	"switchmmc=mmc dev ${mmcnum}\0" \
245 	"kernaddr=0x82008000\0" \
246 	"initrdaddr=0x84008000\0" \
247 	"scriptaddr=0x86008000\0" \
248 	"fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
249 		"${loadaddr} ${mmcfile}\0" \
250 	"kernload=setenv loadaddr ${kernaddr};" \
251 		"setenv mmcfile ${mmckernfile};" \
252 		"run fileload\0" \
253 	"initrdload=setenv loadaddr ${initrdaddr};" \
254 		"setenv mmcfile ${mmcinitrdfile};" \
255 		"run fileload\0" \
256 	"scriptload=setenv loadaddr ${scriptaddr};" \
257 		"setenv mmcfile ${mmcscriptfile};" \
258 		"run fileload\0" \
259 	"scriptboot=echo Running ${mmcscriptfile} from mmc " \
260 		"${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
261 	"kernboot=echo Booting ${mmckernfile} from mmc " \
262 		"${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
263 	"kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
264 		"${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
265 	"attachboot=echo Booting attached kernel image ...;" \
266 		"setenv setup_omap_atag 1;" \
267 		"bootm ${attkernaddr};" \
268 		"setenv setup_omap_atag\0" \
269 	"trymmcscriptboot=if run switchmmc; then " \
270 			"if run scriptload; then " \
271 				"run scriptboot;" \
272 			"fi;" \
273 		"fi\0" \
274 	"trymmckernboot=if run switchmmc; then " \
275 			"if run kernload; then " \
276 				"run kernboot;" \
277 			"fi;" \
278 		"fi\0" \
279 	"trymmckerninitrdboot=if run switchmmc; then " \
280 			"if run initrdload; then " \
281 				"if run kernload; then " \
282 					"run kerninitrdboot;" \
283 				"fi;" \
284 			"fi; " \
285 		"fi\0" \
286 	"trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
287 		"setenv mmckernfile uImage; run trymmckernboot\0" \
288 	"trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
289 		"setenv mmcpart 2; run trymmcpartboot;" \
290 		"setenv mmcpart 3; run trymmcpartboot;" \
291 		"setenv mmcpart 4; run trymmcpartboot\0" \
292 	"trymmcboot=if run switchmmc; then " \
293 			"setenv mmctype fat;" \
294 			"run trymmcallpartboot;" \
295 			"setenv mmctype ext2;" \
296 			"run trymmcallpartboot;" \
297 			"setenv mmctype ext4;" \
298 			"run trymmcallpartboot;" \
299 		"fi\0" \
300 	"emmcboot=setenv mmcnum 1; run trymmcboot\0" \
301 	"sdboot=setenv mmcnum 0; run trymmcboot\0" \
302 	"menucmd=bootmenu\0" \
303 	"bootmenu_0=Attached kernel=run attachboot\0" \
304 	"bootmenu_1=Internal eMMC=run emmcboot\0" \
305 	"bootmenu_2=External SD card=run sdboot\0" \
306 	"bootmenu_3=U-Boot boot order=boot\0" \
307 	"bootmenu_delay=30\0" \
308 	""
309 
310 #define CONFIG_PREBOOT \
311 	"setenv mmcnum 1; setenv mmcpart 1;" \
312 	"setenv mmcscriptfile bootmenu.scr;" \
313 	"if run switchmmc; then " \
314 		"setenv mmcdone true;" \
315 		"setenv mmctype fat;" \
316 		"if run scriptload; then true; else " \
317 			"setenv mmctype ext2;" \
318 			"if run scriptload; then true; else " \
319 				"setenv mmctype ext4;" \
320 				"if run scriptload; then true; else " \
321 					"setenv mmcdone false;" \
322 				"fi;" \
323 			"fi;" \
324 		"fi;" \
325 		"if ${mmcdone}; then " \
326 			"run scriptboot;" \
327 		"fi;" \
328 	"fi;" \
329 	"if run slide; then true; else " \
330 		"setenv bootmenu_delay 0;" \
331 		"setenv bootdelay 0;" \
332 	"fi"
333 
334 #define CONFIG_POSTBOOTMENU \
335 	"echo;" \
336 	"echo Extra commands:;" \
337 	"echo run sercon - Use serial port for control.;" \
338 	"echo run usbcon - Use usbtty for control.;" \
339 	"echo run vgacon - Use framebuffer/keyboard.;" \
340 	"echo run sdboot - Boot from SD card slot.;" \
341 	"echo run emmcboot - Boot internal eMMC memory.;" \
342 	"echo run attachboot - Boot attached kernel image.;" \
343 	"echo"
344 
345 #define CONFIG_BOOTCOMMAND \
346 	"run sdboot;" \
347 	"run emmcboot;" \
348 	"run attachboot;" \
349 	"echo"
350 
351 #define CONFIG_MENU_SHOW
352 
353 /*
354  * Miscellaneous configurable options
355  */
356 #define CONFIG_SYS_LONGHELP			/* undef to save memory */
357 #define CONFIG_SYS_CBSIZE		256	/* Console I/O Buffer Size */
358 /* Print Buffer Size */
359 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + \
360 						sizeof(CONFIG_SYS_PROMPT) + 16)
361 #define CONFIG_SYS_MAXARGS		16	/* max number of command args */
362 /* Boot Argument Buffer Size */
363 #define CONFIG_SYS_BARGSIZE		(CONFIG_SYS_CBSIZE)
364 
365 #define CONFIG_SYS_MEMTEST_START	(OMAP34XX_SDRC_CS0)
366 #define CONFIG_SYS_MEMTEST_END		(OMAP34XX_SDRC_CS0 + 0x01F00000)/*31MB*/
367 
368 /* default load address */
369 #define CONFIG_SYS_LOAD_ADDR		(OMAP34XX_SDRC_CS0)
370 
371 /*
372  * OMAP3 has 12 GP timers, they can be driven by the system clock
373  * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
374  * This rate is divided by a local divisor.
375  */
376 #define CONFIG_SYS_TIMERBASE		(OMAP34XX_GPT2)
377 #define CONFIG_SYS_PTV			2	/* Divisor: 2^(PTV+1) => 8 */
378 
379 /*
380  * Physical Memory Map
381  */
382 #define CONFIG_NR_DRAM_BANKS		2
383 #define PHYS_SDRAM_1			OMAP34XX_SDRC_CS0
384 
385 /*
386  * FLASH and environment organization
387  */
388 
389 #define CONFIG_ENV_IS_NOWHERE
390 
391 #define CONFIG_SYS_SDRAM_BASE		PHYS_SDRAM_1
392 #define CONFIG_SYS_INIT_RAM_ADDR	0x4020f800
393 #define CONFIG_SYS_INIT_RAM_SIZE	0x800
394 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_INIT_RAM_ADDR + \
395 			CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
396 
397 /*
398  * Attached kernel image
399  */
400 
401 #define SDRAM_SIZE			0x10000000	/* 256 MB */
402 #define SDRAM_END			(CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
403 
404 #define IMAGE_MAXSIZE			0x1FF800	/* 2 MB - 2 kB */
405 #define KERNEL_OFFSET			0x40000		/* 256 kB */
406 #define KERNEL_MAXSIZE			(IMAGE_MAXSIZE-KERNEL_OFFSET)
407 #define KERNEL_ADDRESS			(SDRAM_END-KERNEL_MAXSIZE)
408 
409 /* Reserve protected RAM for attached kernel */
410 #define CONFIG_PRAM			((KERNEL_MAXSIZE >> 10)+1)
411 
412 #endif /* __CONFIG_H */
413