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