cc55777ec050c0ac8e519113bd52fabc667a8f4f
[platform/kernel/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 #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
70
71 /* USB device configuration */
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 /* commands to include */
79
80 #define CONFIG_SYS_I2C
81
82 /*
83  * TWL4030
84  */
85
86 #define GPIO_SLIDE                      71
87
88 /*
89  * Board ONENAND Info.
90  */
91
92 #define CONFIG_SYS_ONENAND_BASE         ONENAND_MAP
93
94 /* Watchdog support */
95 #define CONFIG_HW_WATCHDOG
96
97 /*
98  * Framebuffer
99  */
100 /* Video console */
101 #define CONFIG_VIDEO_LOGO
102 #define VIDEO_FB_16BPP_PIXEL_SWAP
103 #define VIDEO_FB_16BPP_WORD_SWAP
104 #define CONFIG_SPLASH_SCREEN
105
106 /* functions for cfb_console */
107 #define VIDEO_KBD_INIT_FCT              rx51_kp_init()
108 #define VIDEO_TSTC_FCT                  rx51_kp_tstc
109 #define VIDEO_GETC_FCT                  rx51_kp_getc
110 #ifndef __ASSEMBLY__
111 struct stdio_dev;
112 int rx51_kp_init(void);
113 int rx51_kp_tstc(struct stdio_dev *sdev);
114 int rx51_kp_getc(struct stdio_dev *sdev);
115 #endif
116
117 /* Environment information */
118 #define CONFIG_EXTRA_ENV_SETTINGS \
119         "usbtty=cdc_acm\0" \
120         "stdin=serial,vga\0" \
121         "stdout=serial,vga\0" \
122         "stderr=serial,vga\0" \
123         "setcon=setenv stdin ${con};" \
124                 "setenv stdout ${con};" \
125                 "setenv stderr ${con}\0" \
126         "sercon=setenv con serial; run setcon\0" \
127         "usbcon=setenv con usbtty; run setcon\0" \
128         "vgacon=setenv con vga; run setcon\0" \
129         "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
130         "switchmmc=mmc dev ${mmcnum}\0" \
131         "kernaddr=0x82008000\0" \
132         "initrdaddr=0x84008000\0" \
133         "scriptaddr=0x86008000\0" \
134         "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
135                 "${loadaddr} ${mmcfile}\0" \
136         "kernload=setenv loadaddr ${kernaddr};" \
137                 "setenv mmcfile ${mmckernfile};" \
138                 "run fileload\0" \
139         "initrdload=setenv loadaddr ${initrdaddr};" \
140                 "setenv mmcfile ${mmcinitrdfile};" \
141                 "run fileload\0" \
142         "scriptload=setenv loadaddr ${scriptaddr};" \
143                 "setenv mmcfile ${mmcscriptfile};" \
144                 "run fileload\0" \
145         "scriptboot=echo Running ${mmcscriptfile} from mmc " \
146                 "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
147         "kernboot=echo Booting ${mmckernfile} from mmc " \
148                 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
149         "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
150                 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
151         "attachboot=echo Booting attached kernel image ...;" \
152                 "setenv setup_omap_atag 1;" \
153                 "bootm ${attkernaddr};" \
154                 "setenv setup_omap_atag\0" \
155         "trymmcscriptboot=if run switchmmc; then " \
156                         "if run scriptload; then " \
157                                 "run scriptboot;" \
158                         "fi;" \
159                 "fi\0" \
160         "trymmckernboot=if run switchmmc; then " \
161                         "if run kernload; then " \
162                                 "run kernboot;" \
163                         "fi;" \
164                 "fi\0" \
165         "trymmckerninitrdboot=if run switchmmc; then " \
166                         "if run initrdload; then " \
167                                 "if run kernload; then " \
168                                         "run kerninitrdboot;" \
169                                 "fi;" \
170                         "fi; " \
171                 "fi\0" \
172         "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
173                 "setenv mmckernfile uImage; run trymmckernboot\0" \
174         "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
175                 "setenv mmcpart 2; run trymmcpartboot;" \
176                 "setenv mmcpart 3; run trymmcpartboot;" \
177                 "setenv mmcpart 4; run trymmcpartboot\0" \
178         "trymmcboot=if run switchmmc; then " \
179                         "setenv mmctype fat;" \
180                         "run trymmcallpartboot;" \
181                         "setenv mmctype ext2;" \
182                         "run trymmcallpartboot;" \
183                         "setenv mmctype ext4;" \
184                         "run trymmcallpartboot;" \
185                 "fi\0" \
186         "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
187         "sdboot=setenv mmcnum 0; run trymmcboot\0" \
188         "preboot=setenv mmcnum 1; setenv mmcpart 1;" \
189                 "setenv mmcscriptfile bootmenu.scr;" \
190                 "if run switchmmc; then " \
191                         "setenv mmcdone true;" \
192                         "setenv mmctype fat;" \
193                         "if run scriptload; then true; else " \
194                                 "setenv mmctype ext2;" \
195                                 "if run scriptload; then true; else " \
196                                         "setenv mmctype ext4;" \
197                                         "if run scriptload; then true; else " \
198                                                 "setenv mmcdone false;" \
199                                         "fi;" \
200                                 "fi;" \
201                         "fi;" \
202                         "if ${mmcdone}; then " \
203                                 "run scriptboot;" \
204                         "fi;" \
205                 "fi;" \
206                 "if run slide; then true; else " \
207                         "setenv bootmenu_delay 0;" \
208                         "setenv bootdelay 0;" \
209                 "fi\0" \
210         "menucmd=bootmenu\0" \
211         "bootmenu_0=Attached kernel=run attachboot\0" \
212         "bootmenu_1=Internal eMMC=run emmcboot\0" \
213         "bootmenu_2=External SD card=run sdboot\0" \
214         "bootmenu_3=U-Boot boot order=boot\0" \
215         "bootmenu_delay=30\0" \
216         ""
217
218 #define CONFIG_POSTBOOTMENU \
219         "echo;" \
220         "echo Extra commands:;" \
221         "echo run sercon - Use serial port for control.;" \
222         "echo run usbcon - Use usbtty for control.;" \
223         "echo run vgacon - Use framebuffer/keyboard.;" \
224         "echo run sdboot - Boot from SD card slot.;" \
225         "echo run emmcboot - Boot internal eMMC memory.;" \
226         "echo run attachboot - Boot attached kernel image.;" \
227         "echo"
228
229 #define CONFIG_BOOTCOMMAND \
230         "run sdboot;" \
231         "run emmcboot;" \
232         "run attachboot;" \
233         "echo"
234
235 /*
236  * Miscellaneous configurable options
237  */
238
239 /* default load address */
240 #define CONFIG_SYS_LOAD_ADDR            (OMAP34XX_SDRC_CS0)
241
242 /*
243  * OMAP3 has 12 GP timers, they can be driven by the system clock
244  * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
245  * This rate is divided by a local divisor.
246  */
247 #define CONFIG_SYS_TIMERBASE            (OMAP34XX_GPT2)
248 #define CONFIG_SYS_PTV                  2       /* Divisor: 2^(PTV+1) => 8 */
249
250 /*
251  * Physical Memory Map
252  */
253 #define PHYS_SDRAM_1                    OMAP34XX_SDRC_CS0
254
255 /*
256  * FLASH and environment organization
257  */
258
259 #define CONFIG_SYS_SDRAM_BASE           PHYS_SDRAM_1
260 #define CONFIG_SYS_INIT_RAM_ADDR        0x4020f800
261 #define CONFIG_SYS_INIT_RAM_SIZE        0x800
262 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SYS_INIT_RAM_ADDR + \
263                         CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
264
265 /*
266  * Attached kernel image
267  */
268
269 #define SDRAM_SIZE                      0x10000000      /* 256 MB */
270 #define SDRAM_END                       (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
271
272 #define IMAGE_MAXSIZE                   0x1FF800        /* 2 MB - 2 kB */
273 #define KERNEL_OFFSET                   0x40000         /* 256 kB */
274 #define KERNEL_MAXSIZE                  (IMAGE_MAXSIZE-KERNEL_OFFSET)
275 #define KERNEL_ADDRESS                  (SDRAM_END-KERNEL_MAXSIZE)
276
277 /* Reserve protected RAM for attached kernel */
278 #define CONFIG_PRAM                     ((KERNEL_MAXSIZE >> 10)+1)
279
280 #endif /* __CONFIG_H */