mips: add an option to support initialize SRAM for initial stack
[oweals/u-boot.git] / arch / mips / Kconfig
1 menu "MIPS architecture"
2         depends on MIPS
3
4 config SYS_ARCH
5         default "mips"
6
7 config SYS_CPU
8         default "mips32" if CPU_MIPS32
9         default "mips64" if CPU_MIPS64
10
11 choice
12         prompt "Target select"
13         optional
14
15 config TARGET_QEMU_MIPS
16         bool "Support qemu-mips"
17         select ROM_EXCEPTION_VECTORS
18         select SUPPORTS_BIG_ENDIAN
19         select SUPPORTS_CPU_MIPS32_R1
20         select SUPPORTS_CPU_MIPS32_R2
21         select SUPPORTS_CPU_MIPS64_R1
22         select SUPPORTS_CPU_MIPS64_R2
23         select SUPPORTS_LITTLE_ENDIAN
24
25 config TARGET_MALTA
26         bool "Support malta"
27         select DM
28         select DM_SERIAL
29         select DYNAMIC_IO_PORT_BASE
30         select MIPS_CM
31         select MIPS_INSERT_BOOT_CONFIG
32         select MIPS_L1_CACHE_SHIFT_6
33         select MIPS_L2_CACHE
34         select OF_CONTROL
35         select OF_ISA_BUS
36         select ROM_EXCEPTION_VECTORS
37         select SUPPORTS_BIG_ENDIAN
38         select SUPPORTS_CPU_MIPS32_R1
39         select SUPPORTS_CPU_MIPS32_R2
40         select SUPPORTS_CPU_MIPS32_R6
41         select SUPPORTS_CPU_MIPS64_R1
42         select SUPPORTS_CPU_MIPS64_R2
43         select SUPPORTS_CPU_MIPS64_R6
44         select SUPPORTS_LITTLE_ENDIAN
45         select SWAP_IO_SPACE
46         imply CMD_DM
47
48 config TARGET_VCT
49         bool "Support vct"
50         select ROM_EXCEPTION_VECTORS
51         select SUPPORTS_BIG_ENDIAN
52         select SUPPORTS_CPU_MIPS32_R1
53         select SUPPORTS_CPU_MIPS32_R2
54         select SYS_MIPS_CACHE_INIT_RAM_LOAD
55
56 config ARCH_ATH79
57         bool "Support QCA/Atheros ath79"
58         select DM
59         select OF_CONTROL
60         imply CMD_DM
61
62 config ARCH_MSCC
63         bool "Support MSCC VCore-III"
64         select OF_CONTROL
65         select DM
66
67 config ARCH_BMIPS
68         bool "Support BMIPS SoCs"
69         select CLK
70         select CPU
71         select DM
72         select OF_CONTROL
73         select RAM
74         select SYSRESET
75         imply CMD_DM
76
77 config ARCH_MTMIPS
78         bool "Support MediaTek MIPS platforms"
79         select CLK
80         imply CMD_DM
81         select DISPLAY_CPUINFO
82         select DM
83         imply DM_ETH
84         imply DM_GPIO
85         select DM_RESET
86         select DM_SERIAL
87         select PINCTRL
88         select PINMUX
89         select PINCONF
90         select RESET_MTMIPS
91         imply DM_SPI
92         imply DM_SPI_FLASH
93         select LAST_STAGE_INIT
94         select MIPS_TUNE_24KC
95         select OF_CONTROL
96         select ROM_EXCEPTION_VECTORS
97         select SUPPORTS_CPU_MIPS32_R1
98         select SUPPORTS_CPU_MIPS32_R2
99         select SUPPORTS_LITTLE_ENDIAN
100         select SYSRESET
101
102 config ARCH_JZ47XX
103         bool "Support Ingenic JZ47xx"
104         select SUPPORT_SPL
105         select OF_CONTROL
106         select DM
107
108 config MACH_PIC32
109         bool "Support Microchip PIC32"
110         select DM
111         select OF_CONTROL
112         imply CMD_DM
113
114 config TARGET_BOSTON
115         bool "Support Boston"
116         select DM
117         select DM_SERIAL
118         select MIPS_CM
119         select MIPS_L1_CACHE_SHIFT_6
120         select MIPS_L2_CACHE
121         select OF_BOARD_SETUP
122         select OF_CONTROL
123         select ROM_EXCEPTION_VECTORS
124         select SUPPORTS_BIG_ENDIAN
125         select SUPPORTS_CPU_MIPS32_R1
126         select SUPPORTS_CPU_MIPS32_R2
127         select SUPPORTS_CPU_MIPS32_R6
128         select SUPPORTS_CPU_MIPS64_R1
129         select SUPPORTS_CPU_MIPS64_R2
130         select SUPPORTS_CPU_MIPS64_R6
131         select SUPPORTS_LITTLE_ENDIAN
132         imply CMD_DM
133
134 config TARGET_XILFPGA
135         bool "Support Imagination Xilfpga"
136         select DM
137         select DM_ETH
138         select DM_GPIO
139         select DM_SERIAL
140         select MIPS_L1_CACHE_SHIFT_4
141         select OF_CONTROL
142         select ROM_EXCEPTION_VECTORS
143         select SUPPORTS_CPU_MIPS32_R1
144         select SUPPORTS_CPU_MIPS32_R2
145         select SUPPORTS_LITTLE_ENDIAN
146         imply CMD_DM
147         help
148           This supports IMGTEC MIPSfpga platform
149
150 endchoice
151
152 source "board/imgtec/boston/Kconfig"
153 source "board/imgtec/malta/Kconfig"
154 source "board/imgtec/xilfpga/Kconfig"
155 source "board/qemu-mips/Kconfig"
156 source "arch/mips/mach-ath79/Kconfig"
157 source "arch/mips/mach-mscc/Kconfig"
158 source "arch/mips/mach-bmips/Kconfig"
159 source "arch/mips/mach-jz47xx/Kconfig"
160 source "arch/mips/mach-pic32/Kconfig"
161 source "arch/mips/mach-mtmips/Kconfig"
162
163 if MIPS
164
165 choice
166         prompt "Endianness selection"
167         help
168           Some MIPS boards can be configured for either little or big endian
169           byte order. These modes require different U-Boot images. In general there
170           is one preferred byteorder for a particular system but some systems are
171           just as commonly used in the one or the other endianness.
172
173 config SYS_BIG_ENDIAN
174         bool "Big endian"
175         depends on SUPPORTS_BIG_ENDIAN
176
177 config SYS_LITTLE_ENDIAN
178         bool "Little endian"
179         depends on SUPPORTS_LITTLE_ENDIAN
180
181 endchoice
182
183 choice
184         prompt "CPU selection"
185         default CPU_MIPS32_R2
186
187 config CPU_MIPS32_R1
188         bool "MIPS32 Release 1"
189         depends on SUPPORTS_CPU_MIPS32_R1
190         select 32BIT
191         help
192           Choose this option to build an U-Boot for release 1 through 5 of the
193           MIPS32 architecture.
194
195 config CPU_MIPS32_R2
196         bool "MIPS32 Release 2"
197         depends on SUPPORTS_CPU_MIPS32_R2
198         select 32BIT
199         help
200           Choose this option to build an U-Boot for release 2 through 5 of the
201           MIPS32 architecture.
202
203 config CPU_MIPS32_R6
204         bool "MIPS32 Release 6"
205         depends on SUPPORTS_CPU_MIPS32_R6
206         select 32BIT
207         help
208           Choose this option to build an U-Boot for release 6 or later of the
209           MIPS32 architecture.
210
211 config CPU_MIPS64_R1
212         bool "MIPS64 Release 1"
213         depends on SUPPORTS_CPU_MIPS64_R1
214         select 64BIT
215         help
216           Choose this option to build a kernel for release 1 through 5 of the
217           MIPS64 architecture.
218
219 config CPU_MIPS64_R2
220         bool "MIPS64 Release 2"
221         depends on SUPPORTS_CPU_MIPS64_R2
222         select 64BIT
223         help
224           Choose this option to build a kernel for release 2 through 5 of the
225           MIPS64 architecture.
226
227 config CPU_MIPS64_R6
228         bool "MIPS64 Release 6"
229         depends on SUPPORTS_CPU_MIPS64_R6
230         select 64BIT
231         help
232           Choose this option to build a kernel for release 6 or later of the
233           MIPS64 architecture.
234
235 endchoice
236
237 menu "General setup"
238
239 config ROM_EXCEPTION_VECTORS
240         bool "Build U-Boot image with exception vectors"
241         help
242           Enable this to include exception vectors in the U-Boot image. This is
243           required if the U-Boot entry point is equal to the address of the
244           CPU reset exception vector (e.g. U-Boot as ROM loader in Qemu,
245           U-Boot booted from parallel NOR flash).
246           Disable this, if the U-Boot image is booted from DRAM (e.g. by SPL).
247           In that case the image size will be reduced by 0x500 bytes.
248
249 config MIPS_CM_BASE
250         hex "MIPS CM GCR Base Address"
251         depends on MIPS_CM
252         default 0x16100000 if TARGET_BOSTON
253         default 0x1fbf8000
254         help
255           The physical base address at which to map the MIPS Coherence Manager
256           Global Configuration Registers (GCRs). This should be set such that
257           the GCRs occupy a region of the physical address space which is
258           otherwise unused, or at minimum that software doesn't need to access.
259
260 config MIPS_CACHE_INDEX_BASE
261         hex "Index base address for cache initialisation"
262         default 0x80000000 if CPU_MIPS32
263         default 0xffffffff80000000 if CPU_MIPS64
264         help
265           This is the base address for a memory block, which is used for
266           initialising the cache lines. This is also the base address of a memory
267           block which is used for loading and filling cache lines when
268           SYS_MIPS_CACHE_INIT_RAM_LOAD is selected.
269           Normally this is CKSEG0. If the MIPS system needs to move this block
270           to some SRAM or ScratchPad RAM, adapt this option accordingly.
271
272 config MIPS_RELOCATION_TABLE_SIZE
273         hex "Relocation table size"
274         range 0x100 0x10000
275         default "0x8000"
276         ---help---
277           A table of relocation data will be appended to the U-Boot binary
278           and parsed in relocate_code() to fix up all offsets in the relocated
279           U-Boot.
280
281           This option allows the amount of space reserved for the table to be
282           adjusted in a range from 256 up to 64k. The default is 32k and should
283           be ok in most cases. Reduce this value to shrink the size of U-Boot
284           binary.
285
286           The build will fail and a valid size suggested if this is too small.
287
288           If unsure, leave at the default value.
289
290 config RESTORE_EXCEPTION_VECTOR_BASE
291         bool "Restore exception vector base before booting linux kernel"
292         default n
293         help
294           In U-Boot the exception vector base will be moved to top of memory,
295           to be used to display register dump when exception occurs.
296           But some old linux kernel does not honor the base set in CP0_EBASE.
297           A modified exception vector base will cause kernel crash.
298
299           This option will restore the exception vector base to its previous
300           value.
301
302           If unsure, say N.
303
304 config OVERRIDE_EXCEPTION_VECTOR_BASE
305         bool "Override the exception vector base to be restored"
306         depends on RESTORE_EXCEPTION_VECTOR_BASE
307         default n
308         help
309           Enable this option if you want to use a different exception vector
310           base rather than the previously saved one.
311
312 config NEW_EXCEPTION_VECTOR_BASE
313         hex "New exception vector base"
314         depends on OVERRIDE_EXCEPTION_VECTOR_BASE
315         range 0x80000000 0xbffff000
316         default 0x80000000
317         help
318           The exception vector base to be restored before booting linux kernel
319
320 config SPL_LOADER_SUPPORT
321         bool
322         default n
323         help
324           Enable this option if you want to use SPL loaders without DM enabled.
325
326 endmenu
327
328 menu "OS boot interface"
329
330 config MIPS_BOOT_CMDLINE_LEGACY
331         bool "Hand over legacy command line to Linux kernel"
332         default y
333         help
334           Enable this option if you want U-Boot to hand over the Yamon-style
335           command line to the kernel. All bootargs will be prepared as argc/argv
336           compatible list. The argument count (argc) is stored in register $a0.
337           The address of the argument list (argv) is stored in register $a1.
338
339 config MIPS_BOOT_ENV_LEGACY
340         bool "Hand over legacy environment to Linux kernel"
341         default y
342         help
343           Enable this option if you want U-Boot to hand over the Yamon-style
344           environment to the kernel. Information like memory size, initrd
345           address and size will be prepared as zero-terminated key/value list.
346           The address of the environment is stored in register $a2.
347
348 config MIPS_BOOT_FDT
349         bool "Hand over a flattened device tree to Linux kernel"
350         default n
351         help
352           Enable this option if you want U-Boot to hand over a flattened
353           device tree to the kernel. According to UHI register $a0 will be set
354           to -2 and the FDT address is stored in $a1.
355
356 endmenu
357
358 config SUPPORTS_BIG_ENDIAN
359         bool
360
361 config SUPPORTS_LITTLE_ENDIAN
362         bool
363
364 config SUPPORTS_CPU_MIPS32_R1
365         bool
366
367 config SUPPORTS_CPU_MIPS32_R2
368         bool
369
370 config SUPPORTS_CPU_MIPS32_R6
371         bool
372
373 config SUPPORTS_CPU_MIPS64_R1
374         bool
375
376 config SUPPORTS_CPU_MIPS64_R2
377         bool
378
379 config SUPPORTS_CPU_MIPS64_R6
380         bool
381
382 config CPU_MIPS32
383         bool
384         default y if CPU_MIPS32_R1 || CPU_MIPS32_R2 || CPU_MIPS32_R6
385
386 config CPU_MIPS64
387         bool
388         default y if CPU_MIPS64_R1 || CPU_MIPS64_R2 || CPU_MIPS64_R6
389
390 config MIPS_TUNE_4KC
391         bool
392
393 config MIPS_TUNE_14KC
394         bool
395
396 config MIPS_TUNE_24KC
397         bool
398
399 config MIPS_TUNE_34KC
400         bool
401
402 config MIPS_TUNE_74KC
403         bool
404
405 config 32BIT
406         bool
407
408 config 64BIT
409         bool
410
411 config SWAP_IO_SPACE
412         bool
413
414 config SYS_MIPS_CACHE_INIT_RAM_LOAD
415         bool
416
417 config MIPS_INIT_STACK_IN_SRAM
418         bool
419         default n
420         help
421           Select this if the initial stack frame could be setup in SRAM.
422           Normally the initial stack frame is set up in DRAM which is often
423           only available after lowlevel_init. With this option the initial
424           stack frame and the early C environment is set up before
425           lowlevel_init. Thus lowlevel_init does not need to be implemented
426           in assembler.
427
428 config MIPS_SRAM_INIT
429         bool
430         default n
431         depends on MIPS_INIT_STACK_IN_SRAM
432         help
433           Select this if the SRAM for initial stack needs to be initialized
434           before it can be used. If enabled, a function mips_sram_init() will
435           be called just before setup_stack_gd.
436
437 config SYS_DCACHE_SIZE
438         int
439         default 0
440         help
441           The total size of the L1 Dcache, if known at compile time.
442
443 config SYS_DCACHE_LINE_SIZE
444         int
445         default 0
446         help
447           The size of L1 Dcache lines, if known at compile time.
448
449 config SYS_ICACHE_SIZE
450         int
451         default 0
452         help
453           The total size of the L1 ICache, if known at compile time.
454
455 config SYS_ICACHE_LINE_SIZE
456         int
457         default 0
458         help
459           The size of L1 Icache lines, if known at compile time.
460
461 config SYS_SCACHE_LINE_SIZE
462         int
463         default 0
464         help
465           The size of L2 cache lines, if known at compile time.
466
467
468 config SYS_CACHE_SIZE_AUTO
469         def_bool y if SYS_DCACHE_SIZE = 0 && SYS_ICACHE_SIZE = 0 && \
470                 SYS_DCACHE_LINE_SIZE = 0 && SYS_ICACHE_LINE_SIZE = 0 && \
471                 SYS_SCACHE_LINE_SIZE = 0
472         help
473           Select this (or let it be auto-selected by not defining any cache
474           sizes) in order to allow U-Boot to automatically detect the sizes
475           of caches at runtime. This has a small cost in code size & runtime
476           so if you know the cache configuration for your system at compile
477           time it would be beneficial to configure it.
478
479 config MIPS_L1_CACHE_SHIFT_4
480         bool
481
482 config MIPS_L1_CACHE_SHIFT_5
483         bool
484
485 config MIPS_L1_CACHE_SHIFT_6
486         bool
487
488 config MIPS_L1_CACHE_SHIFT_7
489         bool
490
491 config MIPS_L1_CACHE_SHIFT
492         int
493         default "7" if MIPS_L1_CACHE_SHIFT_7
494         default "6" if MIPS_L1_CACHE_SHIFT_6
495         default "5" if MIPS_L1_CACHE_SHIFT_5
496         default "4" if MIPS_L1_CACHE_SHIFT_4
497         default "5"
498
499 config MIPS_L2_CACHE
500         bool
501         help
502           Select this if your system includes an L2 cache and you want U-Boot
503           to initialise & maintain it.
504
505 config DYNAMIC_IO_PORT_BASE
506         bool
507
508 config MIPS_CM
509         bool
510         help
511           Select this if your system contains a MIPS Coherence Manager and you
512           wish U-Boot to configure it or make use of it to retrieve system
513           information such as cache configuration.
514
515 config MIPS_INSERT_BOOT_CONFIG
516         bool
517         default n
518         help
519           Enable this to insert some board-specific boot configuration in
520           the U-Boot binary at offset 0x10.
521
522 config MIPS_BOOT_CONFIG_WORD0
523         hex
524         depends on MIPS_INSERT_BOOT_CONFIG
525         default 0x420 if TARGET_MALTA
526         default 0x0
527         help
528           Value which is inserted as boot config word 0.
529
530 config MIPS_BOOT_CONFIG_WORD1
531         hex
532         depends on MIPS_INSERT_BOOT_CONFIG
533         default 0x0
534         help
535           Value which is inserted as boot config word 1.
536
537 endif
538
539 endmenu