1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * (C) Copyright 2011-2012
4 * Pali Rohár <pali@kernel.org>
7 * Alistair Buxton <a.j.buxton@gmail.com>
9 * Derived from Beagle Board code:
10 * (C) Copyright 2006-2008
12 * Richard Woodruff <r-woodruff2@ti.com>
13 * Syed Mohammed Khasim <x0khasim@ti.com>
15 * Configuration settings for the Nokia RX-51 aka N900.
22 * High Level Configuration Options
24 #define CONFIG_SYS_L2CACHE_OFF /* pretend there is no L2 CACHE */
26 #define CONFIG_MACH_TYPE MACH_TYPE_NOKIA_RX51
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>
34 #define V_OSCK 26000000 /* Clock output from T2 */
35 #define V_SCLK (V_OSCK >> 1)
37 #define CONFIG_SKIP_LOWLEVEL_INIT /* X-Loader set everything up */
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 */
45 * Size of malloc() pool
47 #define CONFIG_UBI_SIZE (512 << 10)
48 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + CONFIG_UBI_SIZE + \
56 * NS16550 Configuration
58 #define V_NS16550_CLK 48000000 /* 48MHz (APLL96/2) */
60 #define CONFIG_SYS_NS16550_SERIAL
61 #define CONFIG_SYS_NS16550_REG_SIZE (-4)
62 #define CONFIG_SYS_NS16550_CLK V_NS16550_CLK
65 * select serial console configuration
67 #define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
69 /* allow to overwrite serial and ethaddr */
70 #define CONFIG_ENV_OVERWRITE
71 #define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
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"
80 /* commands to include */
82 #define CONFIG_SYS_I2C
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
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
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
115 #define PART4_NAME "kernel"
117 #define PART4_MULL 1024*1024
118 #define PART4_SUFF "m"
119 #define PART4_OFFS 0x000c0000
120 #define PART4_MASK 0x00000000
122 #define PART5_NAME "initfs"
124 #define PART5_MULL 1024*1024
125 #define PART5_SUFF "m"
126 #define PART5_OFFS 0x002c0000
127 #define PART5_MASK 0x00000000
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
136 #ifdef ONENAND_SUPPORT
138 #define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
142 /* Watchdog support */
143 #define CONFIG_HW_WATCHDOG
149 #define CONFIG_VIDEO_LOGO
150 #define VIDEO_FB_16BPP_PIXEL_SWAP
151 #define VIDEO_FB_16BPP_WORD_SWAP
152 #define CONFIG_SPLASH_SCREEN
154 /* functions for cfb_console */
155 #define VIDEO_KBD_INIT_FCT rx51_kp_init()
156 #define VIDEO_TSTC_FCT rx51_kp_tstc
157 #define VIDEO_GETC_FCT rx51_kp_getc
160 int rx51_kp_init(void);
161 int rx51_kp_tstc(struct stdio_dev *sdev);
162 int rx51_kp_getc(struct stdio_dev *sdev);
165 /* Environment information */
166 #ifdef CONFIG_MTDPARTS_DEFAULT
167 #define MTDPARTS "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0"
171 #define CONFIG_EXTRA_ENV_SETTINGS \
177 "setcon=setenv stdin ${con};" \
178 "setenv stdout ${con};" \
179 "setenv stderr ${con}\0" \
180 "sercon=setenv con serial; run setcon\0" \
181 "usbcon=setenv con usbtty; run setcon\0" \
182 "vgacon=setenv con vga; run setcon\0" \
183 "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
184 "switchmmc=mmc dev ${mmcnum}\0" \
185 "kernaddr=0x82008000\0" \
186 "initrdaddr=0x84008000\0" \
187 "scriptaddr=0x86008000\0" \
188 "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
189 "${loadaddr} ${mmcfile}\0" \
190 "kernload=setenv loadaddr ${kernaddr};" \
191 "setenv mmcfile ${mmckernfile};" \
193 "initrdload=setenv loadaddr ${initrdaddr};" \
194 "setenv mmcfile ${mmcinitrdfile};" \
196 "scriptload=setenv loadaddr ${scriptaddr};" \
197 "setenv mmcfile ${mmcscriptfile};" \
199 "scriptboot=echo Running ${mmcscriptfile} from mmc " \
200 "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
201 "kernboot=echo Booting ${mmckernfile} from mmc " \
202 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
203 "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
204 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
205 "attachboot=echo Booting attached kernel image ...;" \
206 "setenv setup_omap_atag 1;" \
207 "bootm ${attkernaddr};" \
208 "setenv setup_omap_atag\0" \
209 "trymmcscriptboot=if run switchmmc; then " \
210 "if run scriptload; then " \
214 "trymmckernboot=if run switchmmc; then " \
215 "if run kernload; then " \
219 "trymmckerninitrdboot=if run switchmmc; then " \
220 "if run initrdload; then " \
221 "if run kernload; then " \
222 "run kerninitrdboot;" \
226 "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
227 "setenv mmckernfile uImage; run trymmckernboot\0" \
228 "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
229 "setenv mmcpart 2; run trymmcpartboot;" \
230 "setenv mmcpart 3; run trymmcpartboot;" \
231 "setenv mmcpart 4; run trymmcpartboot\0" \
232 "trymmcboot=if run switchmmc; then " \
233 "setenv mmctype fat;" \
234 "run trymmcallpartboot;" \
235 "setenv mmctype ext2;" \
236 "run trymmcallpartboot;" \
237 "setenv mmctype ext4;" \
238 "run trymmcallpartboot;" \
240 "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
241 "sdboot=setenv mmcnum 0; run trymmcboot\0" \
242 "preboot=setenv mmcnum 1; setenv mmcpart 1;" \
243 "setenv mmcscriptfile bootmenu.scr;" \
244 "if run switchmmc; then " \
245 "setenv mmcdone true;" \
246 "setenv mmctype fat;" \
247 "if run scriptload; then true; else " \
248 "setenv mmctype ext2;" \
249 "if run scriptload; then true; else " \
250 "setenv mmctype ext4;" \
251 "if run scriptload; then true; else " \
252 "setenv mmcdone false;" \
256 "if ${mmcdone}; then " \
260 "if run slide; then true; else " \
261 "setenv bootmenu_delay 0;" \
262 "setenv bootdelay 0;" \
264 "menucmd=bootmenu\0" \
265 "bootmenu_0=Attached kernel=run attachboot\0" \
266 "bootmenu_1=Internal eMMC=run emmcboot\0" \
267 "bootmenu_2=External SD card=run sdboot\0" \
268 "bootmenu_3=U-Boot boot order=boot\0" \
269 "bootmenu_delay=30\0" \
272 #define CONFIG_POSTBOOTMENU \
274 "echo Extra commands:;" \
275 "echo run sercon - Use serial port for control.;" \
276 "echo run usbcon - Use usbtty for control.;" \
277 "echo run vgacon - Use framebuffer/keyboard.;" \
278 "echo run sdboot - Boot from SD card slot.;" \
279 "echo run emmcboot - Boot internal eMMC memory.;" \
280 "echo run attachboot - Boot attached kernel image.;" \
283 #define CONFIG_BOOTCOMMAND \
290 * Miscellaneous configurable options
293 /* default load address */
294 #define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)
297 * OMAP3 has 12 GP timers, they can be driven by the system clock
298 * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
299 * This rate is divided by a local divisor.
301 #define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
302 #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
305 * Physical Memory Map
307 #define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
310 * FLASH and environment organization
313 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
314 #define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
315 #define CONFIG_SYS_INIT_RAM_SIZE 0x800
316 #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
317 CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
320 * Attached kernel image
323 #define SDRAM_SIZE 0x10000000 /* 256 MB */
324 #define SDRAM_END (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
326 #define IMAGE_MAXSIZE 0x1FF800 /* 2 MB - 2 kB */
327 #define KERNEL_OFFSET 0x40000 /* 256 kB */
328 #define KERNEL_MAXSIZE (IMAGE_MAXSIZE-KERNEL_OFFSET)
329 #define KERNEL_ADDRESS (SDRAM_END-KERNEL_MAXSIZE)
331 /* Reserve protected RAM for attached kernel */
332 #define CONFIG_PRAM ((KERNEL_MAXSIZE >> 10)+1)
334 #endif /* __CONFIG_H */