1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18#ifndef __CONFIG_H
19#define __CONFIG_H
20
21
22
23
24#define CONFIG_SYS_L2CACHE_OFF
25
26#define CONFIG_MACH_TYPE MACH_TYPE_NOKIA_RX51
27
28#include <asm/arch/cpu.h>
29#include <asm/arch/omap.h>
30#include <asm/arch/mem.h>
31#include <linux/stringify.h>
32
33
34#define V_OSCK 26000000
35#define V_SCLK (V_OSCK >> 1)
36
37#define CONFIG_SKIP_LOWLEVEL_INIT
38
39#define CONFIG_CMDLINE_TAG
40#define CONFIG_INITRD_TAG
41#define CONFIG_REVISION_TAG
42#define CONFIG_SETUP_MEMORY_TAGS
43
44
45
46
47#define CONFIG_UBI_SIZE (512 << 10)
48#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
49 (128 << 10))
50
51
52
53
54
55
56
57
58#define V_NS16550_CLK 48000000
59
60#define CONFIG_SYS_NS16550_SERIAL
61#define CONFIG_SYS_NS16550_REG_SIZE (-4)
62#define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
63
64
65
66
67#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
68
69#define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
70
71
72#define CONFIG_USB_DEVICE
73#define CONFIG_USBD_VENDORID 0x0421
74#define CONFIG_USBD_PRODUCTID 0x01c8
75#define CONFIG_USBD_MANUFACTURER "Nokia"
76#define CONFIG_USBD_PRODUCT_NAME "N900"
77
78#define GPIO_SLIDE 71
79
80
81
82
83
84#define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
85
86
87#define CONFIG_HW_WATCHDOG
88
89
90
91
92
93#define CONFIG_VIDEO_LOGO
94#define VIDEO_FB_16BPP_PIXEL_SWAP
95#define VIDEO_FB_16BPP_WORD_SWAP
96
97
98#define VIDEO_KBD_INIT_FCT rx51_kp_init()
99#define VIDEO_TSTC_FCT rx51_kp_tstc
100#define VIDEO_GETC_FCT rx51_kp_getc
101#ifndef __ASSEMBLY__
102struct stdio_dev;
103int rx51_kp_init(void);
104int rx51_kp_tstc(struct stdio_dev *sdev);
105int rx51_kp_getc(struct stdio_dev *sdev);
106#endif
107
108
109#define CONFIG_EXTRA_ENV_SETTINGS \
110 "usbtty=cdc_acm\0" \
111 "stdin=serial,vga\0" \
112 "stdout=serial,vga\0" \
113 "stderr=serial,vga\0" \
114 "setcon=setenv stdin ${con};" \
115 "setenv stdout ${con};" \
116 "setenv stderr ${con}\0" \
117 "sercon=setenv con serial; run setcon\0" \
118 "usbcon=setenv con usbtty; run setcon\0" \
119 "vgacon=setenv con vga; run setcon\0" \
120 "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
121 "switchmmc=mmc dev ${mmcnum}\0" \
122 "kernaddr=0x82008000\0" \
123 "initrdaddr=0x84008000\0" \
124 "scriptaddr=0x86008000\0" \
125 "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
126 "${loadaddr} ${mmcfile}\0" \
127 "kernload=setenv loadaddr ${kernaddr};" \
128 "setenv mmcfile ${mmckernfile};" \
129 "run fileload\0" \
130 "initrdload=setenv loadaddr ${initrdaddr};" \
131 "setenv mmcfile ${mmcinitrdfile};" \
132 "run fileload\0" \
133 "scriptload=setenv loadaddr ${scriptaddr};" \
134 "setenv mmcfile ${mmcscriptfile};" \
135 "run fileload\0" \
136 "scriptboot=echo Running ${mmcscriptfile} from mmc " \
137 "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
138 "kernboot=echo Booting ${mmckernfile} from mmc " \
139 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
140 "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
141 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
142 "attachboot=echo Booting attached kernel image ...;" \
143 "setenv setup_omap_atag 1;" \
144 "bootm ${attkernaddr};" \
145 "setenv setup_omap_atag\0" \
146 "trymmcscriptboot=if run switchmmc; then " \
147 "if run scriptload; then " \
148 "run scriptboot;" \
149 "fi;" \
150 "fi\0" \
151 "trymmckernboot=if run switchmmc; then " \
152 "if run kernload; then " \
153 "run kernboot;" \
154 "fi;" \
155 "fi\0" \
156 "trymmckerninitrdboot=if run switchmmc; then " \
157 "if run initrdload; then " \
158 "if run kernload; then " \
159 "run kerninitrdboot;" \
160 "fi;" \
161 "fi; " \
162 "fi\0" \
163 "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
164 "setenv mmckernfile uImage; run trymmckernboot\0" \
165 "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
166 "setenv mmcpart 2; run trymmcpartboot;" \
167 "setenv mmcpart 3; run trymmcpartboot;" \
168 "setenv mmcpart 4; run trymmcpartboot\0" \
169 "trymmcboot=if run switchmmc; then " \
170 "setenv mmctype fat;" \
171 "run trymmcallpartboot;" \
172 "setenv mmctype ext2;" \
173 "run trymmcallpartboot;" \
174 "setenv mmctype ext4;" \
175 "run trymmcallpartboot;" \
176 "fi\0" \
177 "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
178 "sdboot=setenv mmcnum 0; run trymmcboot\0" \
179 "preboot=setenv mmcnum 1; setenv mmcpart 1;" \
180 "setenv mmcscriptfile bootmenu.scr;" \
181 "if run switchmmc; then " \
182 "setenv mmcdone true;" \
183 "setenv mmctype fat;" \
184 "if run scriptload; then true; else " \
185 "setenv mmctype ext2;" \
186 "if run scriptload; then true; else " \
187 "setenv mmctype ext4;" \
188 "if run scriptload; then true; else " \
189 "setenv mmcdone false;" \
190 "fi;" \
191 "fi;" \
192 "fi;" \
193 "if ${mmcdone}; then " \
194 "run scriptboot;" \
195 "fi;" \
196 "fi;" \
197 "if run slide; then true; else " \
198 "setenv bootmenu_delay 0;" \
199 "setenv bootdelay 0;" \
200 "fi\0" \
201 "menucmd=bootmenu\0" \
202 "bootmenu_0=Attached kernel=run attachboot\0" \
203 "bootmenu_1=Internal eMMC=run emmcboot\0" \
204 "bootmenu_2=External SD card=run sdboot\0" \
205 "bootmenu_3=U-Boot boot order=boot\0" \
206 "bootmenu_delay=30\0" \
207 ""
208
209#define CONFIG_POSTBOOTMENU \
210 "echo;" \
211 "echo Extra commands:;" \
212 "echo run sercon - Use serial port for control.;" \
213 "echo run usbcon - Use usbtty for control.;" \
214 "echo run vgacon - Use framebuffer/keyboard.;" \
215 "echo run sdboot - Boot from SD card slot.;" \
216 "echo run emmcboot - Boot internal eMMC memory.;" \
217 "echo run attachboot - Boot attached kernel image.;" \
218 "echo"
219
220#define CONFIG_BOOTCOMMAND \
221 "run sdboot;" \
222 "run emmcboot;" \
223 "run attachboot;" \
224 "echo"
225
226
227#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)
228
229
230
231
232
233
234#define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
235#define CONFIG_SYS_PTV 2
236
237
238
239
240#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
241
242
243
244
245
246#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
247#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
248#define CONFIG_SYS_INIT_RAM_SIZE 0x800
249#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
250 CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
251
252
253
254
255
256#define SDRAM_SIZE 0x10000000
257#define SDRAM_END (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
258
259#define IMAGE_MAXSIZE 0x1FF800
260#define KERNEL_OFFSET 0x40000
261#define KERNEL_MAXSIZE (IMAGE_MAXSIZE-KERNEL_OFFSET)
262#define KERNEL_ADDRESS (SDRAM_END-KERNEL_MAXSIZE)
263
264
265#define CONFIG_PRAM ((KERNEL_MAXSIZE >> 10)+1)
266
267#endif
268