diff options
author | James Hogan <james.hogan@imgtec.com> | 2012-10-09 05:54:32 -0400 |
---|---|---|
committer | James Hogan <james.hogan@imgtec.com> | 2013-03-02 15:09:54 -0500 |
commit | 5633004cc2498ff50a5b88d415d3746ff0c301f2 (patch) | |
tree | b60265906c89e68022b8013e2aa2a19127fe3a24 /arch | |
parent | 79f83c02944ccb3dffbc5852e63e966ea34ed63e (diff) |
metag: Build infrastructure
Add metag build infrastructure.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/metag/Kconfig | 277 | ||||
-rw-r--r-- | arch/metag/Kconfig.debug | 40 | ||||
-rw-r--r-- | arch/metag/Kconfig.soc | 55 | ||||
-rw-r--r-- | arch/metag/Makefile | 87 | ||||
-rw-r--r-- | arch/metag/boot/Makefile | 68 | ||||
-rw-r--r-- | arch/metag/configs/meta1_defconfig | 38 | ||||
-rw-r--r-- | arch/metag/configs/meta2_defconfig | 39 | ||||
-rw-r--r-- | arch/metag/configs/meta2_smp_defconfig | 40 | ||||
-rw-r--r-- | arch/metag/include/asm/Kbuild | 55 | ||||
-rw-r--r-- | arch/metag/include/uapi/asm/Kbuild | 13 | ||||
-rw-r--r-- | arch/metag/kernel/.gitignore | 1 | ||||
-rw-r--r-- | arch/metag/kernel/Makefile | 36 | ||||
-rw-r--r-- | arch/metag/kernel/asm-offsets.c | 14 | ||||
-rw-r--r-- | arch/metag/kernel/metag_ksyms.c | 75 | ||||
-rw-r--r-- | arch/metag/kernel/vmlinux.lds.S | 71 | ||||
-rw-r--r-- | arch/metag/lib/Makefile | 22 | ||||
-rw-r--r-- | arch/metag/mm/Kconfig | 153 | ||||
-rw-r--r-- | arch/metag/mm/Makefile | 19 | ||||
-rw-r--r-- | arch/metag/tbx/Makefile | 21 |
19 files changed, 1124 insertions, 0 deletions
diff --git a/arch/metag/Kconfig b/arch/metag/Kconfig new file mode 100644 index 000000000000..f786e6e09700 --- /dev/null +++ b/arch/metag/Kconfig | |||
@@ -0,0 +1,277 @@ | |||
1 | config SYMBOL_PREFIX | ||
2 | string | ||
3 | default "_" | ||
4 | |||
5 | config METAG | ||
6 | def_bool y | ||
7 | select EMBEDDED | ||
8 | select GENERIC_ATOMIC64 | ||
9 | select GENERIC_CLOCKEVENTS | ||
10 | select GENERIC_IRQ_SHOW | ||
11 | select GENERIC_SIGALTSTACK | ||
12 | select GENERIC_SMP_IDLE_THREAD | ||
13 | select HAVE_64BIT_ALIGNED_ACCESS | ||
14 | select HAVE_ARCH_TRACEHOOK | ||
15 | select HAVE_DEBUG_KMEMLEAK | ||
16 | select HAVE_GENERIC_HARDIRQS | ||
17 | select HAVE_IRQ_WORK | ||
18 | select HAVE_KERNEL_BZIP2 | ||
19 | select HAVE_KERNEL_GZIP | ||
20 | select HAVE_KERNEL_LZO | ||
21 | select HAVE_KERNEL_XZ | ||
22 | select HAVE_MEMBLOCK | ||
23 | select HAVE_MEMBLOCK_NODE_MAP | ||
24 | select HAVE_MOD_ARCH_SPECIFIC | ||
25 | select HAVE_SYSCALL_TRACEPOINTS | ||
26 | select IRQ_DOMAIN | ||
27 | select MODULES_USE_ELF_RELA | ||
28 | select OF | ||
29 | select OF_EARLY_FLATTREE | ||
30 | select SPARSE_IRQ | ||
31 | |||
32 | config ARCH_NO_VIRT_TO_BUS | ||
33 | def_bool y | ||
34 | |||
35 | config STACKTRACE_SUPPORT | ||
36 | def_bool y | ||
37 | |||
38 | config LOCKDEP_SUPPORT | ||
39 | def_bool y | ||
40 | |||
41 | config HAVE_LATENCYTOP_SUPPORT | ||
42 | def_bool y | ||
43 | |||
44 | config RWSEM_GENERIC_SPINLOCK | ||
45 | def_bool y | ||
46 | |||
47 | config RWSEM_XCHGADD_ALGORITHM | ||
48 | bool | ||
49 | |||
50 | config GENERIC_HWEIGHT | ||
51 | def_bool y | ||
52 | |||
53 | config GENERIC_CALIBRATE_DELAY | ||
54 | def_bool y | ||
55 | |||
56 | config GENERIC_GPIO | ||
57 | def_bool n | ||
58 | |||
59 | config NO_IOPORT | ||
60 | def_bool y | ||
61 | |||
62 | source "init/Kconfig" | ||
63 | |||
64 | source "kernel/Kconfig.freezer" | ||
65 | |||
66 | menu "Processor type and features" | ||
67 | |||
68 | config MMU | ||
69 | def_bool y | ||
70 | |||
71 | config STACK_GROWSUP | ||
72 | def_bool y | ||
73 | |||
74 | config HOTPLUG_CPU | ||
75 | bool "Enable CPU hotplug support" | ||
76 | depends on SMP | ||
77 | help | ||
78 | Say Y here to allow turning CPUs off and on. CPUs can be | ||
79 | controlled through /sys/devices/system/cpu. | ||
80 | |||
81 | Say N if you want to disable CPU hotplug. | ||
82 | |||
83 | config HIGHMEM | ||
84 | bool "High Memory Support" | ||
85 | help | ||
86 | The address space of Meta processors is only 4 Gigabytes large | ||
87 | and it has to accommodate user address space, kernel address | ||
88 | space as well as some memory mapped IO. That means that, if you | ||
89 | have a large amount of physical memory and/or IO, not all of the | ||
90 | memory can be "permanently mapped" by the kernel. The physical | ||
91 | memory that is not permanently mapped is called "high memory". | ||
92 | |||
93 | Depending on the selected kernel/user memory split, minimum | ||
94 | vmalloc space and actual amount of RAM, you may not need this | ||
95 | option which should result in a slightly faster kernel. | ||
96 | |||
97 | If unsure, say n. | ||
98 | |||
99 | source "arch/metag/mm/Kconfig" | ||
100 | |||
101 | source "arch/metag/Kconfig.soc" | ||
102 | |||
103 | config METAG_META12 | ||
104 | bool | ||
105 | help | ||
106 | Select this from the SoC config symbol to indicate that it contains a | ||
107 | Meta 1.2 core. | ||
108 | |||
109 | config METAG_META21 | ||
110 | bool | ||
111 | help | ||
112 | Select this from the SoC config symbol to indicate that it contains a | ||
113 | Meta 2.1 core. | ||
114 | |||
115 | config SMP | ||
116 | bool "Symmetric multi-processing support" | ||
117 | depends on METAG_META21 && METAG_META21_MMU | ||
118 | select USE_GENERIC_SMP_HELPERS | ||
119 | help | ||
120 | This enables support for systems with more than one thread running | ||
121 | Linux. If you have a system with only one thread running Linux, | ||
122 | say N. Otherwise, say Y. | ||
123 | |||
124 | config NR_CPUS | ||
125 | int "Maximum number of CPUs (2-4)" if SMP | ||
126 | range 2 4 if SMP | ||
127 | default "1" if !SMP | ||
128 | default "4" if SMP | ||
129 | |||
130 | config METAG_SMP_WRITE_REORDERING | ||
131 | bool | ||
132 | help | ||
133 | This attempts to prevent cache-memory incoherence due to external | ||
134 | reordering of writes from different hardware threads when SMP is | ||
135 | enabled. It adds fences (system event 0) to smp_mb and smp_rmb in an | ||
136 | attempt to catch some of the cases, and also before writes to shared | ||
137 | memory in LOCK1 protected atomics and spinlocks. | ||
138 | This will not completely prevent cache incoherency on affected cores. | ||
139 | |||
140 | config METAG_LNKGET_AROUND_CACHE | ||
141 | bool | ||
142 | depends on METAG_META21 | ||
143 | help | ||
144 | This indicates that the LNKGET/LNKSET instructions go around the | ||
145 | cache, which requires some extra cache flushes when the memory needs | ||
146 | to be accessed by normal GET/SET instructions too. | ||
147 | |||
148 | choice | ||
149 | prompt "Atomicity primitive" | ||
150 | default METAG_ATOMICITY_LNKGET | ||
151 | help | ||
152 | This option selects the mechanism for performing atomic operations. | ||
153 | |||
154 | config METAG_ATOMICITY_IRQSOFF | ||
155 | depends on !SMP | ||
156 | bool "irqsoff" | ||
157 | help | ||
158 | This option disables interrupts to achieve atomicity. This mechanism | ||
159 | is not SMP-safe. | ||
160 | |||
161 | config METAG_ATOMICITY_LNKGET | ||
162 | depends on METAG_META21 | ||
163 | bool "lnkget/lnkset" | ||
164 | help | ||
165 | This option uses the LNKGET and LNKSET instructions to achieve | ||
166 | atomicity. LNKGET/LNKSET are load-link/store-conditional instructions. | ||
167 | Choose this option if your system requires low latency. | ||
168 | |||
169 | config METAG_ATOMICITY_LOCK1 | ||
170 | depends on SMP | ||
171 | bool "lock1" | ||
172 | help | ||
173 | This option uses the LOCK1 instruction for atomicity. This is mainly | ||
174 | provided as a debugging aid if the lnkget/lnkset atomicity primitive | ||
175 | isn't working properly. | ||
176 | |||
177 | endchoice | ||
178 | |||
179 | config METAG_FPU | ||
180 | bool "FPU Support" | ||
181 | depends on METAG_META21 | ||
182 | default y | ||
183 | help | ||
184 | This option allows processes to use FPU hardware available with this | ||
185 | CPU. If this option is not enabled FPU registers will not be saved | ||
186 | and restored on context-switch. | ||
187 | |||
188 | If you plan on running programs which are compiled to use hard floats | ||
189 | say Y here. | ||
190 | |||
191 | config METAG_DSP | ||
192 | bool "DSP Support" | ||
193 | help | ||
194 | This option allows processes to use DSP hardware available | ||
195 | with this CPU. If this option is not enabled DSP registers | ||
196 | will not be saved and restored on context-switch. | ||
197 | |||
198 | If you plan on running DSP programs say Y here. | ||
199 | |||
200 | config METAG_PERFCOUNTER_IRQS | ||
201 | bool "PerfCounters interrupt support" | ||
202 | depends on METAG_META21 | ||
203 | help | ||
204 | This option enables using interrupts to collect information from | ||
205 | Performance Counters. This option is supported in new META21 | ||
206 | (starting from HTP265). | ||
207 | |||
208 | When disabled, Performance Counters information will be collected | ||
209 | based on Timer Interrupt. | ||
210 | |||
211 | menu "Boot options" | ||
212 | |||
213 | config METAG_BUILTIN_DTB | ||
214 | bool "Embed DTB in kernel image" | ||
215 | default y | ||
216 | help | ||
217 | Embeds a device tree binary in the kernel image. | ||
218 | |||
219 | config METAG_BUILTIN_DTB_NAME | ||
220 | string "Built in DTB" | ||
221 | depends on METAG_BUILTIN_DTB | ||
222 | help | ||
223 | Set the name of the DTB to embed (leave blank to pick one | ||
224 | automatically based on kernel configuration). | ||
225 | |||
226 | config CMDLINE_BOOL | ||
227 | bool "Default bootloader kernel arguments" | ||
228 | |||
229 | config CMDLINE | ||
230 | string "Kernel command line" | ||
231 | depends on CMDLINE_BOOL | ||
232 | help | ||
233 | On some architectures there is currently no way for the boot loader | ||
234 | to pass arguments to the kernel. For these architectures, you should | ||
235 | supply some command-line options at build time by entering them | ||
236 | here. | ||
237 | |||
238 | config CMDLINE_FORCE | ||
239 | bool "Force default kernel command string" | ||
240 | depends on CMDLINE_BOOL | ||
241 | help | ||
242 | Set this to have arguments from the default kernel command string | ||
243 | override those passed by the boot loader. | ||
244 | |||
245 | endmenu | ||
246 | |||
247 | source "kernel/Kconfig.preempt" | ||
248 | |||
249 | source kernel/Kconfig.hz | ||
250 | |||
251 | endmenu | ||
252 | |||
253 | menu "Power management options" | ||
254 | |||
255 | source kernel/power/Kconfig | ||
256 | |||
257 | endmenu | ||
258 | |||
259 | menu "Executable file formats" | ||
260 | |||
261 | source "fs/Kconfig.binfmt" | ||
262 | |||
263 | endmenu | ||
264 | |||
265 | source "net/Kconfig" | ||
266 | |||
267 | source "drivers/Kconfig" | ||
268 | |||
269 | source "fs/Kconfig" | ||
270 | |||
271 | source "arch/metag/Kconfig.debug" | ||
272 | |||
273 | source "security/Kconfig" | ||
274 | |||
275 | source "crypto/Kconfig" | ||
276 | |||
277 | source "lib/Kconfig" | ||
diff --git a/arch/metag/Kconfig.debug b/arch/metag/Kconfig.debug new file mode 100644 index 000000000000..e45bbf6a7a5d --- /dev/null +++ b/arch/metag/Kconfig.debug | |||
@@ -0,0 +1,40 @@ | |||
1 | menu "Kernel hacking" | ||
2 | |||
3 | config TRACE_IRQFLAGS_SUPPORT | ||
4 | bool | ||
5 | default y | ||
6 | |||
7 | source "lib/Kconfig.debug" | ||
8 | |||
9 | config DEBUG_STACKOVERFLOW | ||
10 | bool "Check for stack overflows" | ||
11 | depends on DEBUG_KERNEL | ||
12 | help | ||
13 | This option will cause messages to be printed if free stack space | ||
14 | drops below a certain limit. | ||
15 | |||
16 | config 4KSTACKS | ||
17 | bool "Use 4Kb for kernel stacks instead of 8Kb" | ||
18 | depends on DEBUG_KERNEL | ||
19 | help | ||
20 | If you say Y here the kernel will use a 4Kb stacksize for the | ||
21 | kernel stack attached to each process/thread. This facilitates | ||
22 | running more threads on a system and also reduces the pressure | ||
23 | on the VM subsystem for higher order allocations. This option | ||
24 | will also use IRQ stacks to compensate for the reduced stackspace. | ||
25 | |||
26 | config METAG_FUNCTION_TRACE | ||
27 | bool "Output Meta real-time trace data for function entry/exit" | ||
28 | help | ||
29 | If you say Y here the kernel will use the Meta hardware trace | ||
30 | unit to output information about function entry and exit that | ||
31 | can be used by a debugger for profiling and call-graphs. | ||
32 | |||
33 | config METAG_POISON_CATCH_BUFFERS | ||
34 | bool "Poison catch buffer contents on kernel entry" | ||
35 | help | ||
36 | If you say Y here the kernel will write poison data to the | ||
37 | catch buffer registers on kernel entry. This will make any | ||
38 | problem with catch buffer handling much more apparent. | ||
39 | |||
40 | endmenu | ||
diff --git a/arch/metag/Kconfig.soc b/arch/metag/Kconfig.soc new file mode 100644 index 000000000000..ec079cfb7c6a --- /dev/null +++ b/arch/metag/Kconfig.soc | |||
@@ -0,0 +1,55 @@ | |||
1 | choice | ||
2 | prompt "SoC Type" | ||
3 | default META21_FPGA | ||
4 | |||
5 | config META12_FPGA | ||
6 | bool "Meta 1.2 FPGA" | ||
7 | select METAG_META12 | ||
8 | help | ||
9 | This is a Meta 1.2 FPGA bitstream, just a bare CPU. | ||
10 | |||
11 | config META21_FPGA | ||
12 | bool "Meta 2.1 FPGA" | ||
13 | select METAG_META21 | ||
14 | help | ||
15 | This is a Meta 2.1 FPGA bitstream, just a bare CPU. | ||
16 | |||
17 | endchoice | ||
18 | |||
19 | menu "SoC configuration" | ||
20 | |||
21 | if METAG_META21 | ||
22 | |||
23 | # Meta 2.x specific options | ||
24 | |||
25 | config METAG_META21_MMU | ||
26 | bool "Meta 2.x MMU mode" | ||
27 | default y | ||
28 | help | ||
29 | Use the Meta 2.x MMU in extended mode. | ||
30 | |||
31 | config METAG_UNALIGNED | ||
32 | bool "Meta 2.x unaligned access checking" | ||
33 | default y | ||
34 | help | ||
35 | All memory accesses will be checked for alignment and an exception | ||
36 | raised on unaligned accesses. This feature does cost performance | ||
37 | but without it there will be no notification of this type of error. | ||
38 | |||
39 | config METAG_USER_TCM | ||
40 | bool "Meta on-chip memory support for userland" | ||
41 | select GENERIC_ALLOCATOR | ||
42 | default y | ||
43 | help | ||
44 | Allow the on-chip memories of Meta SoCs to be used by user | ||
45 | applications. | ||
46 | |||
47 | endif | ||
48 | |||
49 | config METAG_HALT_ON_PANIC | ||
50 | bool "Halt the core on panic" | ||
51 | help | ||
52 | Halt the core when a panic occurs. This is useful when running | ||
53 | pre-production silicon or in an FPGA environment. | ||
54 | |||
55 | endmenu | ||
diff --git a/arch/metag/Makefile b/arch/metag/Makefile new file mode 100644 index 000000000000..81bd6a1c7483 --- /dev/null +++ b/arch/metag/Makefile | |||
@@ -0,0 +1,87 @@ | |||
1 | # | ||
2 | # metag/Makefile | ||
3 | # | ||
4 | # This file is included by the global makefile so that you can add your own | ||
5 | # architecture-specific flags and dependencies. Remember to do have actions | ||
6 | # for "archclean" cleaning up for this architecture. | ||
7 | # | ||
8 | # This file is subject to the terms and conditions of the GNU General Public | ||
9 | # License. See the file "COPYING" in the main directory of this archive | ||
10 | # for more details. | ||
11 | # | ||
12 | # Copyright (C) 1994 by Linus Torvalds | ||
13 | # 2007,2008,2012 by Imagination Technologies Ltd. | ||
14 | # | ||
15 | |||
16 | LDFLAGS := | ||
17 | OBJCOPYFLAGS := -O binary -R .note -R .comment -S | ||
18 | |||
19 | checkflags-$(CONFIG_METAG_META12) += -DMETAC_1_2 | ||
20 | checkflags-$(CONFIG_METAG_META21) += -DMETAC_2_1 | ||
21 | CHECKFLAGS += -D__metag__ $(checkflags-y) | ||
22 | |||
23 | KBUILD_DEFCONFIG := meta2_defconfig | ||
24 | |||
25 | sflags-$(CONFIG_METAG_META12) += -mmetac=1.2 | ||
26 | ifeq ($(CONFIG_METAG_META12),y) | ||
27 | # Only use TBI API 1.4 if DSP is enabled for META12 cores | ||
28 | sflags-$(CONFIG_METAG_DSP) += -DTBI_1_4 | ||
29 | endif | ||
30 | sflags-$(CONFIG_METAG_META21) += -mmetac=2.1 -DTBI_1_4 | ||
31 | |||
32 | cflags-$(CONFIG_METAG_FUNCTION_TRACE) += -mhwtrace-leaf -mhwtrace-retpc | ||
33 | cflags-$(CONFIG_METAG_META21) += -mextensions=bex | ||
34 | |||
35 | KBUILD_CFLAGS += -pipe | ||
36 | KBUILD_CFLAGS += -ffunction-sections | ||
37 | |||
38 | KBUILD_CFLAGS += $(sflags-y) $(cflags-y) | ||
39 | KBUILD_AFLAGS += $(sflags-y) | ||
40 | |||
41 | LDFLAGS_vmlinux := $(ldflags-y) | ||
42 | |||
43 | head-y := arch/metag/kernel/head.o | ||
44 | |||
45 | core-y += arch/metag/boot/dts/ | ||
46 | core-y += arch/metag/kernel/ | ||
47 | core-y += arch/metag/mm/ | ||
48 | |||
49 | libs-y += arch/metag/lib/ | ||
50 | libs-y += arch/metag/tbx/ | ||
51 | |||
52 | boot := arch/metag/boot | ||
53 | |||
54 | boot_targets += uImage | ||
55 | boot_targets += uImage.gz | ||
56 | boot_targets += uImage.bz2 | ||
57 | boot_targets += uImage.xz | ||
58 | boot_targets += uImage.lzo | ||
59 | boot_targets += uImage.bin | ||
60 | boot_targets += vmlinux.bin | ||
61 | |||
62 | PHONY += $(boot_targets) | ||
63 | |||
64 | all: vmlinux.bin | ||
65 | |||
66 | $(boot_targets): vmlinux | ||
67 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | ||
68 | |||
69 | %.dtb %.dtb.S %.dtb.o: scripts | ||
70 | $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ | ||
71 | |||
72 | dtbs: scripts | ||
73 | $(Q)$(MAKE) $(build)=$(boot)/dts dtbs | ||
74 | |||
75 | archclean: | ||
76 | $(Q)$(MAKE) $(clean)=$(boot) | ||
77 | |||
78 | define archhelp | ||
79 | echo '* vmlinux.bin - Binary kernel image (arch/$(ARCH)/boot/vmlinux.bin)' | ||
80 | @echo ' uImage - Alias to bootable U-Boot image' | ||
81 | @echo ' uImage.bin - Kernel-only image for U-Boot (bin)' | ||
82 | @echo ' uImage.gz - Kernel-only image for U-Boot (gzip)' | ||
83 | @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' | ||
84 | @echo ' uImage.xz - Kernel-only image for U-Boot (xz)' | ||
85 | @echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)' | ||
86 | @echo ' dtbs - Build device tree blobs for enabled boards' | ||
87 | endef | ||
diff --git a/arch/metag/boot/Makefile b/arch/metag/boot/Makefile new file mode 100644 index 000000000000..5a1f88cf91e3 --- /dev/null +++ b/arch/metag/boot/Makefile | |||
@@ -0,0 +1,68 @@ | |||
1 | # | ||
2 | # This file is subject to the terms and conditions of the GNU General Public | ||
3 | # License. See the file "COPYING" in the main directory of this archive | ||
4 | # for more details. | ||
5 | # | ||
6 | # Copyright (C) 2007,2012 Imagination Technologies Ltd. | ||
7 | # | ||
8 | |||
9 | suffix-y := bin | ||
10 | suffix-$(CONFIG_KERNEL_GZIP) := gz | ||
11 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 | ||
12 | suffix-$(CONFIG_KERNEL_XZ) := xz | ||
13 | suffix-$(CONFIG_KERNEL_LZO) := lzo | ||
14 | |||
15 | targets += vmlinux.bin | ||
16 | targets += uImage | ||
17 | targets += uImage.gz | ||
18 | targets += uImage.bz2 | ||
19 | targets += uImage.xz | ||
20 | targets += uImage.lzo | ||
21 | targets += uImage.bin | ||
22 | |||
23 | extra-y += vmlinux.bin | ||
24 | extra-y += vmlinux.bin.gz | ||
25 | extra-y += vmlinux.bin.bz2 | ||
26 | extra-y += vmlinux.bin.xz | ||
27 | extra-y += vmlinux.bin.lzo | ||
28 | |||
29 | UIMAGE_LOADADDR = $(CONFIG_PAGE_OFFSET) | ||
30 | |||
31 | ifeq ($(CONFIG_FUNCTION_TRACER),y) | ||
32 | orig_cflags := $(KBUILD_CFLAGS) | ||
33 | KBUILD_CFLAGS = $(subst -pg, , $(orig_cflags)) | ||
34 | endif | ||
35 | |||
36 | $(obj)/vmlinux.bin: vmlinux FORCE | ||
37 | $(call if_changed,objcopy) | ||
38 | |||
39 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | ||
40 | $(call if_changed,gzip) | ||
41 | |||
42 | $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE | ||
43 | $(call if_changed,bzip2) | ||
44 | |||
45 | $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE | ||
46 | $(call if_changed,xzkern) | ||
47 | |||
48 | $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE | ||
49 | $(call if_changed,lzo) | ||
50 | |||
51 | $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE | ||
52 | $(call if_changed,uimage,gzip) | ||
53 | |||
54 | $(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORCE | ||
55 | $(call if_changed,uimage,bzip2) | ||
56 | |||
57 | $(obj)/uImage.xz: $(obj)/vmlinux.bin.xz FORCE | ||
58 | $(call if_changed,uimage,xz) | ||
59 | |||
60 | $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORCE | ||
61 | $(call if_changed,uimage,lzo) | ||
62 | |||
63 | $(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE | ||
64 | $(call if_changed,uimage,none) | ||
65 | |||
66 | $(obj)/uImage: $(obj)/uImage.$(suffix-y) | ||
67 | @ln -sf $(notdir $<) $@ | ||
68 | @echo ' Image $@ is ready' | ||
diff --git a/arch/metag/configs/meta1_defconfig b/arch/metag/configs/meta1_defconfig new file mode 100644 index 000000000000..837c235ab67a --- /dev/null +++ b/arch/metag/configs/meta1_defconfig | |||
@@ -0,0 +1,38 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | ||
2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
3 | # CONFIG_SWAP is not set | ||
4 | CONFIG_LOG_BUF_SHIFT=13 | ||
5 | CONFIG_SYSFS_DEPRECATED=y | ||
6 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
7 | CONFIG_KALLSYMS_ALL=y | ||
8 | # CONFIG_ELF_CORE is not set | ||
9 | CONFIG_SLAB=y | ||
10 | # CONFIG_BLK_DEV_BSG is not set | ||
11 | CONFIG_PARTITION_ADVANCED=y | ||
12 | # CONFIG_MSDOS_PARTITION is not set | ||
13 | # CONFIG_IOSCHED_DEADLINE is not set | ||
14 | # CONFIG_IOSCHED_CFQ is not set | ||
15 | CONFIG_FLATMEM_MANUAL=y | ||
16 | CONFIG_META12_FPGA=y | ||
17 | CONFIG_HZ_100=y | ||
18 | CONFIG_DEVTMPFS=y | ||
19 | CONFIG_DEVTMPFS_MOUNT=y | ||
20 | # CONFIG_STANDALONE is not set | ||
21 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | ||
22 | # CONFIG_FW_LOADER is not set | ||
23 | CONFIG_BLK_DEV_RAM=y | ||
24 | CONFIG_BLK_DEV_RAM_COUNT=1 | ||
25 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
26 | # CONFIG_INPUT is not set | ||
27 | # CONFIG_SERIO is not set | ||
28 | # CONFIG_VT is not set | ||
29 | # CONFIG_LEGACY_PTYS is not set | ||
30 | # CONFIG_DEVKMEM is not set | ||
31 | # CONFIG_HW_RANDOM is not set | ||
32 | # CONFIG_HWMON is not set | ||
33 | # CONFIG_USB_SUPPORT is not set | ||
34 | # CONFIG_DNOTIFY is not set | ||
35 | CONFIG_TMPFS=y | ||
36 | # CONFIG_MISC_FILESYSTEMS is not set | ||
37 | # CONFIG_SCHED_DEBUG is not set | ||
38 | CONFIG_DEBUG_INFO=y | ||
diff --git a/arch/metag/configs/meta2_defconfig b/arch/metag/configs/meta2_defconfig new file mode 100644 index 000000000000..e5bada83dd76 --- /dev/null +++ b/arch/metag/configs/meta2_defconfig | |||
@@ -0,0 +1,39 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | ||
2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
3 | # CONFIG_SWAP is not set | ||
4 | CONFIG_SYSVIPC=y | ||
5 | CONFIG_LOG_BUF_SHIFT=13 | ||
6 | CONFIG_SYSFS_DEPRECATED=y | ||
7 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
8 | CONFIG_KALLSYMS_ALL=y | ||
9 | # CONFIG_ELF_CORE is not set | ||
10 | CONFIG_SLAB=y | ||
11 | # CONFIG_BLK_DEV_BSG is not set | ||
12 | CONFIG_PARTITION_ADVANCED=y | ||
13 | # CONFIG_MSDOS_PARTITION is not set | ||
14 | # CONFIG_IOSCHED_DEADLINE is not set | ||
15 | # CONFIG_IOSCHED_CFQ is not set | ||
16 | CONFIG_METAG_L2C=y | ||
17 | CONFIG_FLATMEM_MANUAL=y | ||
18 | CONFIG_METAG_HALT_ON_PANIC=y | ||
19 | CONFIG_HZ_100=y | ||
20 | CONFIG_DEVTMPFS=y | ||
21 | # CONFIG_STANDALONE is not set | ||
22 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | ||
23 | # CONFIG_FW_LOADER is not set | ||
24 | CONFIG_BLK_DEV_RAM=y | ||
25 | CONFIG_BLK_DEV_RAM_COUNT=1 | ||
26 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
27 | # CONFIG_INPUT is not set | ||
28 | # CONFIG_SERIO is not set | ||
29 | # CONFIG_VT is not set | ||
30 | # CONFIG_LEGACY_PTYS is not set | ||
31 | # CONFIG_DEVKMEM is not set | ||
32 | # CONFIG_HW_RANDOM is not set | ||
33 | # CONFIG_HWMON is not set | ||
34 | # CONFIG_USB_SUPPORT is not set | ||
35 | # CONFIG_DNOTIFY is not set | ||
36 | CONFIG_TMPFS=y | ||
37 | # CONFIG_MISC_FILESYSTEMS is not set | ||
38 | # CONFIG_SCHED_DEBUG is not set | ||
39 | CONFIG_DEBUG_INFO=y | ||
diff --git a/arch/metag/configs/meta2_smp_defconfig b/arch/metag/configs/meta2_smp_defconfig new file mode 100644 index 000000000000..41983a20db72 --- /dev/null +++ b/arch/metag/configs/meta2_smp_defconfig | |||
@@ -0,0 +1,40 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | ||
2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
3 | # CONFIG_SWAP is not set | ||
4 | CONFIG_SYSVIPC=y | ||
5 | CONFIG_LOG_BUF_SHIFT=13 | ||
6 | CONFIG_SYSFS_DEPRECATED=y | ||
7 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
8 | CONFIG_KALLSYMS_ALL=y | ||
9 | # CONFIG_ELF_CORE is not set | ||
10 | CONFIG_SLAB=y | ||
11 | # CONFIG_BLK_DEV_BSG is not set | ||
12 | CONFIG_PARTITION_ADVANCED=y | ||
13 | # CONFIG_MSDOS_PARTITION is not set | ||
14 | # CONFIG_IOSCHED_DEADLINE is not set | ||
15 | # CONFIG_IOSCHED_CFQ is not set | ||
16 | CONFIG_METAG_L2C=y | ||
17 | CONFIG_FLATMEM_MANUAL=y | ||
18 | CONFIG_METAG_HALT_ON_PANIC=y | ||
19 | CONFIG_SMP=y | ||
20 | CONFIG_HZ_100=y | ||
21 | CONFIG_DEVTMPFS=y | ||
22 | # CONFIG_STANDALONE is not set | ||
23 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | ||
24 | # CONFIG_FW_LOADER is not set | ||
25 | CONFIG_BLK_DEV_RAM=y | ||
26 | CONFIG_BLK_DEV_RAM_COUNT=1 | ||
27 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
28 | # CONFIG_INPUT is not set | ||
29 | # CONFIG_SERIO is not set | ||
30 | # CONFIG_VT is not set | ||
31 | # CONFIG_LEGACY_PTYS is not set | ||
32 | # CONFIG_DEVKMEM is not set | ||
33 | # CONFIG_HW_RANDOM is not set | ||
34 | # CONFIG_HWMON is not set | ||
35 | # CONFIG_USB_SUPPORT is not set | ||
36 | # CONFIG_DNOTIFY is not set | ||
37 | CONFIG_TMPFS=y | ||
38 | # CONFIG_MISC_FILESYSTEMS is not set | ||
39 | # CONFIG_SCHED_DEBUG is not set | ||
40 | CONFIG_DEBUG_INFO=y | ||
diff --git a/arch/metag/include/asm/Kbuild b/arch/metag/include/asm/Kbuild new file mode 100644 index 000000000000..3a139810559e --- /dev/null +++ b/arch/metag/include/asm/Kbuild | |||
@@ -0,0 +1,55 @@ | |||
1 | generic-y += auxvec.h | ||
2 | generic-y += bitsperlong.h | ||
3 | generic-y += bugs.h | ||
4 | generic-y += clkdev.h | ||
5 | generic-y += cputime.h | ||
6 | generic-y += current.h | ||
7 | generic-y += device.h | ||
8 | generic-y += dma.h | ||
9 | generic-y += emergency-restart.h | ||
10 | generic-y += errno.h | ||
11 | generic-y += exec.h | ||
12 | generic-y += fb.h | ||
13 | generic-y += fcntl.h | ||
14 | generic-y += ftrace.h | ||
15 | generic-y += futex.h | ||
16 | generic-y += hardirq.h | ||
17 | generic-y += hw_irq.h | ||
18 | generic-y += ioctl.h | ||
19 | generic-y += ioctls.h | ||
20 | generic-y += ipcbuf.h | ||
21 | generic-y += irq_regs.h | ||
22 | generic-y += kdebug.h | ||
23 | generic-y += kmap_types.h | ||
24 | generic-y += kvm_para.h | ||
25 | generic-y += local.h | ||
26 | generic-y += local64.h | ||
27 | generic-y += msgbuf.h | ||
28 | generic-y += mutex.h | ||
29 | generic-y += param.h | ||
30 | generic-y += pci.h | ||
31 | generic-y += percpu.h | ||
32 | generic-y += poll.h | ||
33 | generic-y += posix_types.h | ||
34 | generic-y += scatterlist.h | ||
35 | generic-y += sections.h | ||
36 | generic-y += sembuf.h | ||
37 | generic-y += serial.h | ||
38 | generic-y += shmbuf.h | ||
39 | generic-y += shmparam.h | ||
40 | generic-y += signal.h | ||
41 | generic-y += socket.h | ||
42 | generic-y += sockios.h | ||
43 | generic-y += stat.h | ||
44 | generic-y += statfs.h | ||
45 | generic-y += switch_to.h | ||
46 | generic-y += termbits.h | ||
47 | generic-y += termios.h | ||
48 | generic-y += timex.h | ||
49 | generic-y += trace_clock.h | ||
50 | generic-y += types.h | ||
51 | generic-y += ucontext.h | ||
52 | generic-y += unaligned.h | ||
53 | generic-y += user.h | ||
54 | generic-y += vga.h | ||
55 | generic-y += xor.h | ||
diff --git a/arch/metag/include/uapi/asm/Kbuild b/arch/metag/include/uapi/asm/Kbuild new file mode 100644 index 000000000000..876c71f866de --- /dev/null +++ b/arch/metag/include/uapi/asm/Kbuild | |||
@@ -0,0 +1,13 @@ | |||
1 | # UAPI Header export list | ||
2 | include include/uapi/asm-generic/Kbuild.asm | ||
3 | |||
4 | header-y += byteorder.h | ||
5 | header-y += ptrace.h | ||
6 | header-y += resource.h | ||
7 | header-y += sigcontext.h | ||
8 | header-y += siginfo.h | ||
9 | header-y += swab.h | ||
10 | header-y += unistd.h | ||
11 | |||
12 | generic-y += mman.h | ||
13 | generic-y += setup.h | ||
diff --git a/arch/metag/kernel/.gitignore b/arch/metag/kernel/.gitignore new file mode 100644 index 000000000000..c5f676c3c224 --- /dev/null +++ b/arch/metag/kernel/.gitignore | |||
@@ -0,0 +1 @@ | |||
vmlinux.lds | |||
diff --git a/arch/metag/kernel/Makefile b/arch/metag/kernel/Makefile new file mode 100644 index 000000000000..e985d0ca618c --- /dev/null +++ b/arch/metag/kernel/Makefile | |||
@@ -0,0 +1,36 @@ | |||
1 | # | ||
2 | # Makefile for the Linux/Meta kernel. | ||
3 | # | ||
4 | |||
5 | extra-y += head.o | ||
6 | extra-y += vmlinux.lds | ||
7 | |||
8 | obj-y += cachepart.o | ||
9 | obj-y += clock.o | ||
10 | obj-y += core_reg.o | ||
11 | obj-y += devtree.o | ||
12 | obj-y += dma.o | ||
13 | obj-y += irq.o | ||
14 | obj-y += kick.o | ||
15 | obj-y += machines.o | ||
16 | obj-y += process.o | ||
17 | obj-y += ptrace.o | ||
18 | obj-y += setup.o | ||
19 | obj-y += signal.o | ||
20 | obj-y += stacktrace.o | ||
21 | obj-y += sys_metag.o | ||
22 | obj-y += tbiunexp.o | ||
23 | obj-y += time.o | ||
24 | obj-y += topology.o | ||
25 | obj-y += traps.o | ||
26 | obj-y += user_gateway.o | ||
27 | |||
28 | obj-$(CONFIG_METAG_COREMEM) += coremem.o | ||
29 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | ||
30 | obj-$(CONFIG_FUNCTION_TRACER) += ftrace_stub.o | ||
31 | obj-$(CONFIG_MODULES) += metag_ksyms.o | ||
32 | obj-$(CONFIG_MODULES) += module.o | ||
33 | obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o | ||
34 | obj-$(CONFIG_SMP) += smp.o | ||
35 | obj-$(CONFIG_METAG_SUSPEND_MEM) += suspend.o | ||
36 | obj-$(CONFIG_METAG_USER_TCM) += tcm.o | ||
diff --git a/arch/metag/kernel/asm-offsets.c b/arch/metag/kernel/asm-offsets.c new file mode 100644 index 000000000000..bfc9205f9647 --- /dev/null +++ b/arch/metag/kernel/asm-offsets.c | |||
@@ -0,0 +1,14 @@ | |||
1 | /* | ||
2 | * This program is used to generate definitions needed by | ||
3 | * assembly language modules. | ||
4 | * | ||
5 | */ | ||
6 | |||
7 | #include <linux/kbuild.h> | ||
8 | #include <linux/thread_info.h> | ||
9 | |||
10 | int main(void) | ||
11 | { | ||
12 | DEFINE(THREAD_INFO_SIZE, sizeof(struct thread_info)); | ||
13 | return 0; | ||
14 | } | ||
diff --git a/arch/metag/kernel/metag_ksyms.c b/arch/metag/kernel/metag_ksyms.c new file mode 100644 index 000000000000..c73ebd3db417 --- /dev/null +++ b/arch/metag/kernel/metag_ksyms.c | |||
@@ -0,0 +1,75 @@ | |||
1 | #include <linux/export.h> | ||
2 | #include <linux/linkage.h> | ||
3 | #include <linux/string.h> | ||
4 | #include <linux/mm.h> | ||
5 | #include <linux/user.h> | ||
6 | #include <linux/interrupt.h> | ||
7 | #include <linux/hardirq.h> | ||
8 | |||
9 | #include <asm/setup.h> | ||
10 | #include <asm/checksum.h> | ||
11 | #include <asm/uaccess.h> | ||
12 | #include <asm/traps.h> | ||
13 | #include <asm/tbx.h> | ||
14 | |||
15 | /* uaccess symbols */ | ||
16 | EXPORT_SYMBOL(__copy_user_zeroing); | ||
17 | EXPORT_SYMBOL(__copy_user); | ||
18 | EXPORT_SYMBOL(__get_user_asm_b); | ||
19 | EXPORT_SYMBOL(__get_user_asm_w); | ||
20 | EXPORT_SYMBOL(__get_user_asm_d); | ||
21 | EXPORT_SYMBOL(__put_user_asm_b); | ||
22 | EXPORT_SYMBOL(__put_user_asm_w); | ||
23 | EXPORT_SYMBOL(__put_user_asm_d); | ||
24 | EXPORT_SYMBOL(__put_user_asm_l); | ||
25 | EXPORT_SYMBOL(__strncpy_from_user); | ||
26 | EXPORT_SYMBOL(strnlen_user); | ||
27 | EXPORT_SYMBOL(__do_clear_user); | ||
28 | |||
29 | EXPORT_SYMBOL(pTBI_get); | ||
30 | EXPORT_SYMBOL(meta_memoffset); | ||
31 | EXPORT_SYMBOL(kick_register_func); | ||
32 | EXPORT_SYMBOL(kick_unregister_func); | ||
33 | #ifdef CONFIG_SMP | ||
34 | EXPORT_SYMBOL(get_trigger_mask); | ||
35 | #else | ||
36 | EXPORT_SYMBOL(global_trigger_mask); | ||
37 | #endif | ||
38 | |||
39 | EXPORT_SYMBOL(empty_zero_page); | ||
40 | |||
41 | EXPORT_SYMBOL(pfn_base); | ||
42 | #ifdef CONFIG_FLATMEM | ||
43 | /* needed for the pfn_valid macro */ | ||
44 | EXPORT_SYMBOL(max_pfn); | ||
45 | EXPORT_SYMBOL(min_low_pfn); | ||
46 | #endif | ||
47 | |||
48 | /* TBI symbols */ | ||
49 | EXPORT_SYMBOL(__TBI); | ||
50 | EXPORT_SYMBOL(__TBIFindSeg); | ||
51 | EXPORT_SYMBOL(__TBIPoll); | ||
52 | EXPORT_SYMBOL(__TBITimeStamp); | ||
53 | |||
54 | #define DECLARE_EXPORT(name) extern void name(void); EXPORT_SYMBOL(name) | ||
55 | |||
56 | /* libgcc functions */ | ||
57 | DECLARE_EXPORT(__ashldi3); | ||
58 | DECLARE_EXPORT(__ashrdi3); | ||
59 | DECLARE_EXPORT(__lshrdi3); | ||
60 | DECLARE_EXPORT(__udivsi3); | ||
61 | DECLARE_EXPORT(__divsi3); | ||
62 | DECLARE_EXPORT(__umodsi3); | ||
63 | DECLARE_EXPORT(__modsi3); | ||
64 | DECLARE_EXPORT(__muldi3); | ||
65 | DECLARE_EXPORT(__cmpdi2); | ||
66 | DECLARE_EXPORT(__ucmpdi2); | ||
67 | |||
68 | /* Maths functions */ | ||
69 | EXPORT_SYMBOL(div_u64); | ||
70 | EXPORT_SYMBOL(div_s64); | ||
71 | |||
72 | /* String functions */ | ||
73 | EXPORT_SYMBOL(memcpy); | ||
74 | EXPORT_SYMBOL(memset); | ||
75 | EXPORT_SYMBOL(memmove); | ||
diff --git a/arch/metag/kernel/vmlinux.lds.S b/arch/metag/kernel/vmlinux.lds.S new file mode 100644 index 000000000000..e12055e88bfe --- /dev/null +++ b/arch/metag/kernel/vmlinux.lds.S | |||
@@ -0,0 +1,71 @@ | |||
1 | /* ld script to make Meta Linux kernel */ | ||
2 | |||
3 | #include <asm/thread_info.h> | ||
4 | #include <asm/page.h> | ||
5 | #include <asm/cache.h> | ||
6 | |||
7 | #include <asm-generic/vmlinux.lds.h> | ||
8 | |||
9 | OUTPUT_FORMAT("elf32-metag", "elf32-metag", "elf32-metag") | ||
10 | OUTPUT_ARCH(metag) | ||
11 | ENTRY(__start) | ||
12 | |||
13 | _jiffies = _jiffies_64; | ||
14 | SECTIONS | ||
15 | { | ||
16 | . = CONFIG_PAGE_OFFSET; | ||
17 | _text = .; | ||
18 | __text = .; | ||
19 | __stext = .; | ||
20 | HEAD_TEXT_SECTION | ||
21 | .text : { | ||
22 | TEXT_TEXT | ||
23 | SCHED_TEXT | ||
24 | LOCK_TEXT | ||
25 | KPROBES_TEXT | ||
26 | IRQENTRY_TEXT | ||
27 | *(.text.*) | ||
28 | *(.gnu.warning) | ||
29 | } | ||
30 | |||
31 | __etext = .; /* End of text section */ | ||
32 | |||
33 | __sdata = .; | ||
34 | RO_DATA_SECTION(PAGE_SIZE) | ||
35 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) | ||
36 | __edata = .; /* End of data section */ | ||
37 | |||
38 | EXCEPTION_TABLE(16) | ||
39 | NOTES | ||
40 | |||
41 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | ||
42 | ___init_begin = .; | ||
43 | INIT_TEXT_SECTION(PAGE_SIZE) | ||
44 | INIT_DATA_SECTION(16) | ||
45 | |||
46 | .init.arch.info : { | ||
47 | ___arch_info_begin = .; | ||
48 | *(.arch.info.init) | ||
49 | ___arch_info_end = .; | ||
50 | } | ||
51 | |||
52 | PERCPU_SECTION(L1_CACHE_BYTES) | ||
53 | |||
54 | ___init_end = .; | ||
55 | |||
56 | BSS_SECTION(0, PAGE_SIZE, 0) | ||
57 | |||
58 | __end = .; | ||
59 | |||
60 | . = ALIGN(PAGE_SIZE); | ||
61 | __heap_start = .; | ||
62 | |||
63 | DWARF_DEBUG | ||
64 | |||
65 | /* When something in the kernel is NOT compiled as a module, the | ||
66 | * module cleanup code and data are put into these segments. Both | ||
67 | * can then be thrown away, as cleanup code is never called unless | ||
68 | * it's a module. | ||
69 | */ | ||
70 | DISCARDS | ||
71 | } | ||
diff --git a/arch/metag/lib/Makefile b/arch/metag/lib/Makefile new file mode 100644 index 000000000000..a41d24e270e6 --- /dev/null +++ b/arch/metag/lib/Makefile | |||
@@ -0,0 +1,22 @@ | |||
1 | # | ||
2 | # Makefile for Meta-specific library files. | ||
3 | # | ||
4 | |||
5 | lib-y += usercopy.o | ||
6 | lib-y += copy_page.o | ||
7 | lib-y += clear_page.o | ||
8 | lib-y += memcpy.o | ||
9 | lib-y += memmove.o | ||
10 | lib-y += memset.o | ||
11 | lib-y += delay.o | ||
12 | lib-y += div64.o | ||
13 | lib-y += muldi3.o | ||
14 | lib-y += ashrdi3.o | ||
15 | lib-y += ashldi3.o | ||
16 | lib-y += lshrdi3.o | ||
17 | lib-y += divsi3.o | ||
18 | lib-y += modsi3.o | ||
19 | lib-y += cmpdi2.o | ||
20 | lib-y += ucmpdi2.o | ||
21 | lib-y += ip_fast_csum.o | ||
22 | lib-y += checksum.o | ||
diff --git a/arch/metag/mm/Kconfig b/arch/metag/mm/Kconfig new file mode 100644 index 000000000000..cd7f2f2ad416 --- /dev/null +++ b/arch/metag/mm/Kconfig | |||
@@ -0,0 +1,153 @@ | |||
1 | menu "Memory management options" | ||
2 | |||
3 | config PAGE_OFFSET | ||
4 | hex "Kernel page offset address" | ||
5 | default "0x40000000" | ||
6 | help | ||
7 | This option allows you to set the virtual address at which the | ||
8 | kernel will be mapped to. | ||
9 | endmenu | ||
10 | |||
11 | config KERNEL_4M_PAGES | ||
12 | bool "Map kernel with 4MB pages" | ||
13 | depends on METAG_META21_MMU | ||
14 | default y | ||
15 | help | ||
16 | Map the kernel with large pages to reduce TLB pressure. | ||
17 | |||
18 | choice | ||
19 | prompt "User page size" | ||
20 | default PAGE_SIZE_4K | ||
21 | |||
22 | config PAGE_SIZE_4K | ||
23 | bool "4kB" | ||
24 | help | ||
25 | This is the default page size used by all Meta cores. | ||
26 | |||
27 | config PAGE_SIZE_8K | ||
28 | bool "8kB" | ||
29 | depends on METAG_META21_MMU | ||
30 | help | ||
31 | This enables 8kB pages as supported by Meta 2.x and later MMUs. | ||
32 | |||
33 | config PAGE_SIZE_16K | ||
34 | bool "16kB" | ||
35 | depends on METAG_META21_MMU | ||
36 | help | ||
37 | This enables 16kB pages as supported by Meta 2.x and later MMUs. | ||
38 | |||
39 | endchoice | ||
40 | |||
41 | config NUMA | ||
42 | bool "Non Uniform Memory Access (NUMA) Support" | ||
43 | help | ||
44 | Some Meta systems have MMU-mappable on-chip memories with | ||
45 | lower latencies than main memory. This enables support for | ||
46 | these blocks by binding them to nodes and allowing | ||
47 | memory policies to be used for prioritizing and controlling | ||
48 | allocation behaviour. | ||
49 | |||
50 | config FORCE_MAX_ZONEORDER | ||
51 | int "Maximum zone order" | ||
52 | range 10 32 | ||
53 | default "10" | ||
54 | help | ||
55 | The kernel memory allocator divides physically contiguous memory | ||
56 | blocks into "zones", where each zone is a power of two number of | ||
57 | pages. This option selects the largest power of two that the kernel | ||
58 | keeps in the memory allocator. If you need to allocate very large | ||
59 | blocks of physically contiguous memory, then you may need to | ||
60 | increase this value. | ||
61 | |||
62 | This config option is actually maximum order plus one. For example, | ||
63 | a value of 11 means that the largest free memory block is 2^10 pages. | ||
64 | |||
65 | The page size is not necessarily 4KB. Keep this in mind | ||
66 | when choosing a value for this option. | ||
67 | |||
68 | config METAG_L2C | ||
69 | bool "Level 2 Cache Support" | ||
70 | depends on METAG_META21 | ||
71 | help | ||
72 | Press y here to enable support for the Meta Level 2 (L2) cache. This | ||
73 | will enable the cache at start up if it hasn't already been enabled | ||
74 | by the bootloader. | ||
75 | |||
76 | If the bootloader enables the L2 you must press y here to ensure the | ||
77 | kernel takes the appropriate actions to keep the cache coherent. | ||
78 | |||
79 | config NODES_SHIFT | ||
80 | int | ||
81 | default "1" | ||
82 | depends on NEED_MULTIPLE_NODES | ||
83 | |||
84 | config ARCH_FLATMEM_ENABLE | ||
85 | def_bool y | ||
86 | depends on !NUMA | ||
87 | |||
88 | config ARCH_SPARSEMEM_ENABLE | ||
89 | def_bool y | ||
90 | select SPARSEMEM_STATIC | ||
91 | |||
92 | config ARCH_SPARSEMEM_DEFAULT | ||
93 | def_bool y | ||
94 | |||
95 | config MAX_ACTIVE_REGIONS | ||
96 | int | ||
97 | default "2" if SPARSEMEM | ||
98 | default "1" | ||
99 | |||
100 | config ARCH_POPULATES_NODE_MAP | ||
101 | def_bool y | ||
102 | |||
103 | config ARCH_SELECT_MEMORY_MODEL | ||
104 | def_bool y | ||
105 | |||
106 | config SYS_SUPPORTS_HUGETLBFS | ||
107 | def_bool y | ||
108 | depends on METAG_META21_MMU | ||
109 | |||
110 | choice | ||
111 | prompt "HugeTLB page size" | ||
112 | depends on METAG_META21_MMU && HUGETLB_PAGE | ||
113 | default HUGETLB_PAGE_SIZE_1M | ||
114 | |||
115 | config HUGETLB_PAGE_SIZE_8K | ||
116 | bool "8kB" | ||
117 | depends on PAGE_SIZE_4K | ||
118 | |||
119 | config HUGETLB_PAGE_SIZE_16K | ||
120 | bool "16kB" | ||
121 | depends on PAGE_SIZE_4K || PAGE_SIZE_8K | ||
122 | |||
123 | config HUGETLB_PAGE_SIZE_32K | ||
124 | bool "32kB" | ||
125 | |||
126 | config HUGETLB_PAGE_SIZE_64K | ||
127 | bool "64kB" | ||
128 | |||
129 | config HUGETLB_PAGE_SIZE_128K | ||
130 | bool "128kB" | ||
131 | |||
132 | config HUGETLB_PAGE_SIZE_256K | ||
133 | bool "256kB" | ||
134 | |||
135 | config HUGETLB_PAGE_SIZE_512K | ||
136 | bool "512kB" | ||
137 | |||
138 | config HUGETLB_PAGE_SIZE_1M | ||
139 | bool "1MB" | ||
140 | |||
141 | config HUGETLB_PAGE_SIZE_2M | ||
142 | bool "2MB" | ||
143 | |||
144 | config HUGETLB_PAGE_SIZE_4M | ||
145 | bool "4MB" | ||
146 | |||
147 | endchoice | ||
148 | |||
149 | config METAG_COREMEM | ||
150 | bool | ||
151 | default y if SUSPEND | ||
152 | |||
153 | source "mm/Kconfig" | ||
diff --git a/arch/metag/mm/Makefile b/arch/metag/mm/Makefile new file mode 100644 index 000000000000..994331164125 --- /dev/null +++ b/arch/metag/mm/Makefile | |||
@@ -0,0 +1,19 @@ | |||
1 | # | ||
2 | # Makefile for the linux Meta-specific parts of the memory manager. | ||
3 | # | ||
4 | |||
5 | obj-y += cache.o | ||
6 | obj-y += extable.o | ||
7 | obj-y += fault.o | ||
8 | obj-y += init.o | ||
9 | obj-y += ioremap.o | ||
10 | obj-y += maccess.o | ||
11 | |||
12 | mmu-y := mmu-meta1.o | ||
13 | mmu-$(CONFIG_METAG_META21_MMU) := mmu-meta2.o | ||
14 | obj-y += $(mmu-y) | ||
15 | |||
16 | obj-$(CONFIG_HIGHMEM) += highmem.o | ||
17 | obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o | ||
18 | obj-$(CONFIG_METAG_L2C) += l2cache.o | ||
19 | obj-$(CONFIG_NUMA) += numa.o | ||
diff --git a/arch/metag/tbx/Makefile b/arch/metag/tbx/Makefile new file mode 100644 index 000000000000..e994239e518c --- /dev/null +++ b/arch/metag/tbx/Makefile | |||
@@ -0,0 +1,21 @@ | |||
1 | # | ||
2 | # Makefile for TBX library files.. | ||
3 | # | ||
4 | |||
5 | asflags-y += -mmetac=2.1 -Wa,-mfpu=metac21 -mdsp | ||
6 | asflags-$(CONFIG_SMP) += -DTBX_PERCPU_SP_SAVE | ||
7 | |||
8 | ccflags-y += -mmetac=2.1 | ||
9 | |||
10 | lib-y += tbicore.o | ||
11 | lib-y += tbictx.o | ||
12 | lib-y += tbidefr.o | ||
13 | lib-y += tbilogf.o | ||
14 | lib-y += tbipcx.o | ||
15 | lib-y += tbiroot.o | ||
16 | lib-y += tbisoft.o | ||
17 | lib-y += tbistring.o | ||
18 | lib-y += tbitimer.o | ||
19 | |||
20 | lib-$(CONFIG_METAG_DSP) += tbidspram.o | ||
21 | lib-$(CONFIG_METAG_FPU) += tbictxfpu.o | ||