blob: c86c4294137f6ccde6f81b661eda207991c86873 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Pali Roháred407be2012-10-29 07:54:01 +00002/*
3 * (C) Copyright 2011-2012
Pali Rohár53086652020-04-01 00:35:08 +02004 * Pali Rohár <pali@kernel.org>
Pali Roháred407be2012-10-29 07:54:01 +00005 *
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.
Pali Roháred407be2012-10-29 07:54:01 +000016 */
17
18#ifndef __CONFIG_H
19#define __CONFIG_H
20
21/*
22 * High Level Configuration Options
23 */
Pali Roháred407be2012-10-29 07:54:01 +000024#define CONFIG_SYS_L2CACHE_OFF /* pretend there is no L2 CACHE */
25
26#define CONFIG_MACH_TYPE MACH_TYPE_NOKIA_RX51
27
Pali Roháred407be2012-10-29 07:54:01 +000028#include <asm/arch/cpu.h> /* get chip and board defs */
Nishanth Menon987ec582015-03-09 17:12:04 -050029#include <asm/arch/omap.h>
Pali Roháred407be2012-10-29 07:54:01 +000030#include <asm/arch/mem.h>
31#include <linux/stringify.h>
32
Pali Roháred407be2012-10-29 07:54:01 +000033/* Clock Defines */
34#define V_OSCK 26000000 /* Clock output from T2 */
35#define V_SCLK (V_OSCK >> 1)
36
Pali Roháred407be2012-10-29 07:54:01 +000037#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 */
Pali Roháred407be2012-10-29 07:54:01 +000047#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
Pali Roháred407be2012-10-29 07:54:01 +000060#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 */
Pali Roháred407be2012-10-29 07:54:01 +000067#define CONFIG_SYS_NS16550_COM3 OMAP34XX_UART3
Pali Roháred407be2012-10-29 07:54:01 +000068
Pali Roháred407be2012-10-29 07:54:01 +000069#define CONFIG_SYS_BAUDRATE_TABLE { 4800, 9600, 19200, 38400, 57600, 115200 }
Pali Roháred407be2012-10-29 07:54:01 +000070
Pali Roháred407be2012-10-29 07:54:01 +000071/* 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
Pali Roháred407be2012-10-29 07:54:01 +000078/* commands to include */
Pali Roháred407be2012-10-29 07:54:01 +000079
Heiko Schocher6789e842013-10-22 11:03:18 +020080#define CONFIG_SYS_I2C
Pali Roháred407be2012-10-29 07:54:01 +000081
82/*
83 * TWL4030
84 */
Pali Roháred407be2012-10-29 07:54:01 +000085
Pali Roháred407be2012-10-29 07:54:01 +000086#define GPIO_SLIDE 71
87
88/*
89 * Board ONENAND Info.
90 */
91
Pali Roháred407be2012-10-29 07:54:01 +000092#define CONFIG_SYS_ONENAND_BASE ONENAND_MAP
Pali Roháred407be2012-10-29 07:54:01 +000093
Pali Roháred407be2012-10-29 07:54:01 +000094/* Watchdog support */
95#define CONFIG_HW_WATCHDOG
96
97/*
98 * Framebuffer
99 */
100/* Video console */
Pali Roháred407be2012-10-29 07:54:01 +0000101#define CONFIG_VIDEO_LOGO
102#define VIDEO_FB_16BPP_PIXEL_SWAP
103#define VIDEO_FB_16BPP_WORD_SWAP
Pali Roháred407be2012-10-29 07:54:01 +0000104
105/* functions for cfb_console */
106#define VIDEO_KBD_INIT_FCT rx51_kp_init()
107#define VIDEO_TSTC_FCT rx51_kp_tstc
108#define VIDEO_GETC_FCT rx51_kp_getc
109#ifndef __ASSEMBLY__
Simon Glass709ea542014-07-23 06:54:59 -0600110struct stdio_dev;
Pali Roháred407be2012-10-29 07:54:01 +0000111int rx51_kp_init(void);
Simon Glass709ea542014-07-23 06:54:59 -0600112int rx51_kp_tstc(struct stdio_dev *sdev);
113int rx51_kp_getc(struct stdio_dev *sdev);
Pali Roháred407be2012-10-29 07:54:01 +0000114#endif
115
Pali Roháred407be2012-10-29 07:54:01 +0000116/* Environment information */
Pali Roháred407be2012-10-29 07:54:01 +0000117#define CONFIG_EXTRA_ENV_SETTINGS \
Pali Roháred407be2012-10-29 07:54:01 +0000118 "usbtty=cdc_acm\0" \
Pali Rohár07693cc2020-04-01 00:35:15 +0200119 "stdin=serial,vga\0" \
120 "stdout=serial,vga\0" \
121 "stderr=serial,vga\0" \
Pali Roháred407be2012-10-29 07:54:01 +0000122 "setcon=setenv stdin ${con};" \
123 "setenv stdout ${con};" \
124 "setenv stderr ${con}\0" \
125 "sercon=setenv con serial; run setcon\0" \
126 "usbcon=setenv con usbtty; run setcon\0" \
127 "vgacon=setenv con vga; run setcon\0" \
128 "slide=gpio input " __stringify(GPIO_SLIDE) "\0" \
129 "switchmmc=mmc dev ${mmcnum}\0" \
130 "kernaddr=0x82008000\0" \
131 "initrdaddr=0x84008000\0" \
132 "scriptaddr=0x86008000\0" \
133 "fileload=${mmctype}load mmc ${mmcnum}:${mmcpart} " \
134 "${loadaddr} ${mmcfile}\0" \
135 "kernload=setenv loadaddr ${kernaddr};" \
136 "setenv mmcfile ${mmckernfile};" \
137 "run fileload\0" \
138 "initrdload=setenv loadaddr ${initrdaddr};" \
139 "setenv mmcfile ${mmcinitrdfile};" \
140 "run fileload\0" \
141 "scriptload=setenv loadaddr ${scriptaddr};" \
142 "setenv mmcfile ${mmcscriptfile};" \
143 "run fileload\0" \
144 "scriptboot=echo Running ${mmcscriptfile} from mmc " \
145 "${mmcnum}:${mmcpart} ...; source ${scriptaddr}\0" \
146 "kernboot=echo Booting ${mmckernfile} from mmc " \
147 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr}\0" \
148 "kerninitrdboot=echo Booting ${mmckernfile} ${mmcinitrdfile} from mmc "\
149 "${mmcnum}:${mmcpart} ...; bootm ${kernaddr} ${initrdaddr}\0" \
150 "attachboot=echo Booting attached kernel image ...;" \
151 "setenv setup_omap_atag 1;" \
152 "bootm ${attkernaddr};" \
153 "setenv setup_omap_atag\0" \
154 "trymmcscriptboot=if run switchmmc; then " \
155 "if run scriptload; then " \
156 "run scriptboot;" \
157 "fi;" \
158 "fi\0" \
159 "trymmckernboot=if run switchmmc; then " \
160 "if run kernload; then " \
161 "run kernboot;" \
162 "fi;" \
163 "fi\0" \
164 "trymmckerninitrdboot=if run switchmmc; then " \
165 "if run initrdload; then " \
166 "if run kernload; then " \
167 "run kerninitrdboot;" \
168 "fi;" \
169 "fi; " \
170 "fi\0" \
171 "trymmcpartboot=setenv mmcscriptfile boot.scr; run trymmcscriptboot;" \
172 "setenv mmckernfile uImage; run trymmckernboot\0" \
173 "trymmcallpartboot=setenv mmcpart 1; run trymmcpartboot;" \
174 "setenv mmcpart 2; run trymmcpartboot;" \
175 "setenv mmcpart 3; run trymmcpartboot;" \
176 "setenv mmcpart 4; run trymmcpartboot\0" \
177 "trymmcboot=if run switchmmc; then " \
178 "setenv mmctype fat;" \
179 "run trymmcallpartboot;" \
180 "setenv mmctype ext2;" \
181 "run trymmcallpartboot;" \
182 "setenv mmctype ext4;" \
183 "run trymmcallpartboot;" \
184 "fi\0" \
185 "emmcboot=setenv mmcnum 1; run trymmcboot\0" \
186 "sdboot=setenv mmcnum 0; run trymmcboot\0" \
Pali Rohárfca7abf2020-04-01 00:35:11 +0200187 "preboot=setenv mmcnum 1; setenv mmcpart 1;" \
188 "setenv mmcscriptfile bootmenu.scr;" \
189 "if run switchmmc; then " \
190 "setenv mmcdone true;" \
191 "setenv mmctype fat;" \
192 "if run scriptload; then true; else " \
193 "setenv mmctype ext2;" \
194 "if run scriptload; then true; else " \
195 "setenv mmctype ext4;" \
196 "if run scriptload; then true; else " \
197 "setenv mmcdone false;" \
198 "fi;" \
199 "fi;" \
200 "fi;" \
201 "if ${mmcdone}; then " \
202 "run scriptboot;" \
203 "fi;" \
204 "fi;" \
205 "if run slide; then true; else " \
206 "setenv bootmenu_delay 0;" \
207 "setenv bootdelay 0;" \
208 "fi\0" \
Pali Rohárd9993982013-03-07 05:15:19 +0000209 "menucmd=bootmenu\0" \
210 "bootmenu_0=Attached kernel=run attachboot\0" \
211 "bootmenu_1=Internal eMMC=run emmcboot\0" \
212 "bootmenu_2=External SD card=run sdboot\0" \
213 "bootmenu_3=U-Boot boot order=boot\0" \
214 "bootmenu_delay=30\0" \
Pali Roháred407be2012-10-29 07:54:01 +0000215 ""
216
Pali Rohárd9993982013-03-07 05:15:19 +0000217#define CONFIG_POSTBOOTMENU \
218 "echo;" \
Pali Roháred407be2012-10-29 07:54:01 +0000219 "echo Extra commands:;" \
220 "echo run sercon - Use serial port for control.;" \
221 "echo run usbcon - Use usbtty for control.;" \
222 "echo run vgacon - Use framebuffer/keyboard.;" \
223 "echo run sdboot - Boot from SD card slot.;" \
224 "echo run emmcboot - Boot internal eMMC memory.;" \
225 "echo run attachboot - Boot attached kernel image.;" \
226 "echo"
227
228#define CONFIG_BOOTCOMMAND \
229 "run sdboot;" \
230 "run emmcboot;" \
231 "run attachboot;" \
232 "echo"
233
Pali Roháred407be2012-10-29 07:54:01 +0000234/*
235 * Miscellaneous configurable options
236 */
Pali Roháred407be2012-10-29 07:54:01 +0000237
Pali Roháred407be2012-10-29 07:54:01 +0000238/* default load address */
239#define CONFIG_SYS_LOAD_ADDR (OMAP34XX_SDRC_CS0)
240
241/*
242 * OMAP3 has 12 GP timers, they can be driven by the system clock
243 * (12/13/16.8/19.2/38.4MHz) or by 32KHz clock. We use 13MHz (V_SCLK).
244 * This rate is divided by a local divisor.
245 */
246#define CONFIG_SYS_TIMERBASE (OMAP34XX_GPT2)
247#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
Pali Roháred407be2012-10-29 07:54:01 +0000248
249/*
Pali Roháred407be2012-10-29 07:54:01 +0000250 * Physical Memory Map
251 */
Pali Roháred407be2012-10-29 07:54:01 +0000252#define PHYS_SDRAM_1 OMAP34XX_SDRC_CS0
253
254/*
255 * FLASH and environment organization
256 */
257
Pali Roháred407be2012-10-29 07:54:01 +0000258#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
259#define CONFIG_SYS_INIT_RAM_ADDR 0x4020f800
260#define CONFIG_SYS_INIT_RAM_SIZE 0x800
261#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_ADDR + \
262 CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
263
264/*
265 * Attached kernel image
266 */
267
268#define SDRAM_SIZE 0x10000000 /* 256 MB */
269#define SDRAM_END (CONFIG_SYS_SDRAM_BASE + SDRAM_SIZE)
270
271#define IMAGE_MAXSIZE 0x1FF800 /* 2 MB - 2 kB */
272#define KERNEL_OFFSET 0x40000 /* 256 kB */
273#define KERNEL_MAXSIZE (IMAGE_MAXSIZE-KERNEL_OFFSET)
274#define KERNEL_ADDRESS (SDRAM_END-KERNEL_MAXSIZE)
275
276/* Reserve protected RAM for attached kernel */
277#define CONFIG_PRAM ((KERNEL_MAXSIZE >> 10)+1)
278
279#endif /* __CONFIG_H */