68374cbf167dae14ae789907fa4bd14fb8f0b9c6
[oweals/u-boot.git] / include / configs / nokia_rx51.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * (C) Copyright 2011-2012
4  * Pali Rohár <pali@kernel.org>
5  *
6  * (C) Copyright 2010
7  * Alistair Buxton <a.j.buxton@gmail.com>
8  *
9  * Derived from Beagle Board code:
10  * (C) Copyright 2006-2008
11  * Texas Instruments.
12  * Richard Woodruff <r-woodruff2@ti.com>
13  * Syed Mohammed Khasim <x0khasim@ti.com>
14  *
15  * Configuration settings for the Nokia RX-51 aka N900.
16  */
17
18 #ifndef __CONFIG_H
19 #define __CONFIG_H
20
21 /*
22  * High Level Configuration Options
23  */
24 #define CONFIG_SYS_L2CACHE_OFF          /* pretend there is no L2 CACHE */
25
26 #define CONFIG_MACH_TYPE                MACH_TYPE_NOKIA_RX51
27
28 #include <asm/arch/cpu.h>               /* get chip and board defs */
29 #include <asm/arch/omap.h>
30 #include <asm/arch/mem.h>
31 #include <linux/stringify.h>
32
33 /* Clock Defines */
34 #define V_OSCK                  26000000        /* Clock output from T2 */
35 #define V_SCLK                  (V_OSCK >> 1)
36
37 #define CONFIG_SKIP_LOWLEVEL_INIT               /* X-Loader set everything up */
38
39 #define CONFIG_CMDLINE_TAG      /* enable passing kernel command line string */
40 #define CONFIG_INITRD_TAG                       /* enable passing initrd */
41 #define CONFIG_REVISION_TAG                     /* enable passing revision tag*/
42 #define CONFIG_SETUP_MEMORY_TAGS                /* enable memory tag */
43
44 /*
45  * Size of malloc() pool
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  * Hardware drivers
53  */
54
55 /*
56  * NS16550 Configuration
57  */
58 #define V_NS16550_CLK           48000000                /* 48MHz (APLL96/2) */
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  * select serial console configuration
66  */
67 #define CONFIG_SYS_NS16550_COM3         OMAP34XX_UART3
68
69 /* allow to overwrite serial and ethaddr */
70 #define CONFIG_ENV_OVERWRITE
71 #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
72
73 /* USB device configuration */
74 #define CONFIG_USB_DEVICE
75 #define CONFIG_USBD_VENDORID            0x0421
76 #define CONFIG_USBD_PRODUCTID           0x01c8
77 #define CONFIG_USBD_MANUFACTURER        "Nokia"
78 #define CONFIG_USBD_PRODUCT_NAME        "N900"
79
80 /* commands to include */
81
82 #define CONFIG_SYS_I2C
83
84 /*
85  * TWL4030
86  */
87
88 #define GPIO_SLIDE                      71
89
90 /*
91  * Board ONENAND Info.
92  */
93
94 #define PART1_NAME                      "bootloader"
95 #define PART1_SIZE                      128
96 #define PART1_MULL                      1024
97 #define PART1_SUFF                      "k"
98 #define PART1_OFFS                      0x00000000
99 #define PART1_MASK                      0x00000003
100
101 #define PART2_NAME                      "config"
102 #define PART2_SIZE                      384
103 #define PART2_MULL                      1024
104 #define PART2_SUFF                      "k"
105 #define PART2_OFFS                      0x00020000
106 #define PART2_MASK                      0x00000000
107
108 #define PART3_NAME                      "log"
109 #define PART3_SIZE                      256
110 #define PART3_MULL                      1024
111 #define PART3_SUFF                      "k"
112 #define PART3_OFFS                      0x00080000
113 #define PART3_MASK                      0x00000000
114
115 #define PART4_NAME                      "kernel"
116 #define PART4_SIZE                      2
117 #define PART4_MULL                      1024*1024
118 #define PART4_SUFF                      "m"
119 #define PART4_OFFS                      0x000c0000
120 #define PART4_MASK                      0x00000000
121
122 #define PART5_NAME                      "initfs"
123 #define PART5_SIZE                      2
124 #define PART5_MULL                      1024*1024
125 #define PART5_SUFF                      "m"
126 #define PART5_OFFS                      0x002c0000
127 #define PART5_MASK                      0x00000000
128
129 #define PART6_NAME                      "rootfs"
130 #define PART6_SIZE                      257280
131 #define PART6_MULL                      1024
132 #define PART6_SUFF                      "k"
133 #define PART6_OFFS                      0x004c0000
134 #define PART6_MASK                      0x00000000
135
136 #define CONFIG_SYS_ONENAND_BASE         ONENAND_MAP
137
138 /* Watchdog support */
139 #define CONFIG_HW_WATCHDOG
140
141 /*
142  * Framebuffer
143  */
144 /* Video console */
145 #define CONFIG_VIDEO_LOGO
146 #define VIDEO_FB_16BPP_PIXEL_SWAP
147 #define VIDEO_FB_16BPP_WORD_SWAP
148 #define CONFIG_SPLASH_SCREEN
149
150 /* functions for cfb_console */
151 #define VIDEO_KBD_INIT_FCT              rx51_kp_init()
152 #define VIDEO_TSTC_FCT                  rx51_kp_tstc
153 #define VIDEO_GETC_FCT                  rx51_kp_getc
154 #ifndef __ASSEMBLY__
155 struct stdio_dev;
156 int rx51_kp_init(void);
157 int rx51_kp_tstc(struct stdio_dev *sdev);
158 int rx51_kp_getc(struct stdio_dev *sdev);
159 #endif
160
161 /* Environment information */
162 #define CONFIG_EXTRA_ENV_SETTINGS \
163         "usbtty=cdc_acm\0" \
164         "stdin=vga\0" \
165         "stdout=vga\0" \
166         "stderr=vga\0" \
167         "setcon=setenv stdin ${con};" \
168                 "setenv stdout ${con};" \
169                 "setenv stderr ${con}\0" \
170         "sercon=setenv con serial; run setcon\0" \
171         "usbcon=setenv con usbtty; run setcon\0" \
172         "vgacon=setenv con vga; run setcon\0" \
173         "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
174         "switchmmc=mmc dev ${mmcnum}\0" \
175         "kernaddr=0x82008000\0" \
176         "initrdaddr=0x84008000\0" \
177         "scriptaddr=0x86008000\0" \
178         "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
179                 "${loadaddr} ${mmcfile}\0" \
180         "kernload=setenv loadaddr ${kernaddr};" \
181                 "setenv mmcfile ${mmckernfile};" \
182                 "run fileload\0" \
183         "initrdload=setenv loadaddr ${initrdaddr};" \
184                 "setenv mmcfile ${mmcinitrdfile};" \
185                 "run fileload\0" \
186         "scriptload=setenv loadaddr ${scriptaddr};" \
187                 "setenv mmcfile ${mmcscriptfile};" \
188                 "run fileload\0" \
189         "scriptboot=echo Running ${mmcscriptfile} from mmc " \
190                 "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
191         "kernboot=echo Booting ${mmckernfile} from mmc " \
192                 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
193         "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
194                 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
195         "attachboot=echo Booting attached kernel image ...;" \
196                 "setenv setup_omap_atag 1;" \
197                 "bootm ${attkernaddr};" \
198                 "setenv setup_omap_atag\0" \
199         "trymmcscriptboot=if run switchmmc; then " \
200                         "if run scriptload; then " \
201                                 "run scriptboot;" \
202                         "fi;" \
203                 "fi\0" \
204         "trymmckernboot=if run switchmmc; then " \
205                         "if run kernload; then " \
206                                 "run kernboot;" \
207                         "fi;" \
208                 "fi\0" \
209         "trymmckerninitrdboot=if run switchmmc; then " \
210                         "if run initrdload; then " \
211                                 "if run kernload; then " \
212                                         "run kerninitrdboot;" \
213                                 "fi;" \
214                         "fi; " \
215                 "fi\0" \
216         "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
217                 "setenv mmckernfile uImage; run trymmckernboot\0" \
218         "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
219                 "setenv mmcpart 2; run trymmcpartboot;" \
220                 "setenv mmcpart 3; run trymmcpartboot;" \
221                 "setenv mmcpart 4; run trymmcpartboot\0" \
222         "trymmcboot=if run switchmmc; then " \
223                         "setenv mmctype fat;" \
224                         "run trymmcallpartboot;" \
225                         "setenv mmctype ext2;" \
226                         "run trymmcallpartboot;" \
227                         "setenv mmctype ext4;" \
228                         "run trymmcallpartboot;" \
229                 "fi\0" \
230         "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
231         "sdboot=setenv mmcnum 0; run trymmcboot\0" \
232         "preboot=setenv mmcnum 1; setenv mmcpart 1;" \
233                 "setenv mmcscriptfile bootmenu.scr;" \
234                 "if run switchmmc; then " \
235                         "setenv mmcdone true;" \
236                         "setenv mmctype fat;" \
237                         "if run scriptload; then true; else " \
238                                 "setenv mmctype ext2;" \
239                                 "if run scriptload; then true; else " \
240                                         "setenv mmctype ext4;" \
241                                         "if run scriptload; then true; else " \
242                                                 "setenv mmcdone false;" \
243                                         "fi;" \
244                                 "fi;" \
245                         "fi;" \
246                         "if ${mmcdone}; then " \
247                                 "run scriptboot;" \
248                         "fi;" \
249                 "fi;" \
250                 "if run slide; then true; else " \
251                         "setenv bootmenu_delay 0;" \
252                         "setenv bootdelay 0;" \
253                 "fi\0" \
254         "menucmd=bootmenu\0" \
255         "bootmenu_0=Attached kernel=run attachboot\0" \
256         "bootmenu_1=Internal eMMC=run emmcboot\0" \
257         "bootmenu_2=External SD card=run sdboot\0" \
258         "bootmenu_3=U-Boot boot order=boot\0" \
259         "bootmenu_delay=30\0" \
260         ""
261
262 #define CONFIG_POSTBOOTMENU \
263         "echo;" \
264         "echo Extra commands:;" \
265         "echo run sercon - Use serial port for control.;" \
266         "echo run usbcon - Use usbtty for control.;" \
267         "echo run vgacon - Use framebuffer/keyboard.;" \
268         "echo run sdboot - Boot from SD card slot.;" \
269         "echo run emmcboot - Boot internal eMMC memory.;" \
270         "echo run attachboot - Boot attached kernel image.;" \
271         "echo"
272
273 #define CONFIG_BOOTCOMMAND \
274         "run sdboot;" \
275         "run emmcboot;" \
276         "run attachboot;" \
277         "echo"
278
279 /*
280  * Miscellaneous configurable options
281  */
282
283 /* default load address */
284 #define CONFIG_SYS_LOAD_ADDR            (OMAP34XX_SDRC_CS0)
285
286 /*
287  * OMAP3 has 12 GP timers, they can be driven by the system clock
288  * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
289  * This rate is divided by a local divisor.
290  */
291 #define CONFIG_SYS_TIMERBASE            (OMAP34XX_GPT2)
292 #define CONFIG_SYS_PTV                  2       /* Divisor: 2^(PTV+1) => 8 */
293
294 /*
295  * Physical Memory Map
296  */
297 #define PHYS_SDRAM_1                    OMAP34XX_SDRC_CS0
298
299 /*
300  * FLASH and environment organization
301  */
302
303 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
304 #define CONFIG_SYS_INIT_RAM_ADDR        0x4020f800
305 #define CONFIG_SYS_INIT_RAM_SIZE        0x800
306 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_INIT_RAM_ADDR + \
307                         CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
308
309 /*
310  * Attached kernel image
311  */
312
313 #define SDRAM_SIZE                      0x10000000      /* 256 MB */
314 #define SDRAM_END                       (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
315
316 #define IMAGE_MAXSIZE                   0x1FF800        /* 2 MB - 2 kB */
317 #define KERNEL_OFFSET                   0x40000         /* 256 kB */
318 #define KERNEL_MAXSIZE                  (IMAGE_MAXSIZE-KERNEL_OFFSET)
319 #define KERNEL_ADDRESS                  (SDRAM_END-KERNEL_MAXSIZE)
320
321 /* Reserve protected RAM for attached kernel */
322 #define CONFIG_PRAM                     ((KERNEL_MAXSIZE >> 10)+1)
323
324 #endif /* __CONFIG_H */