diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-01-18 04:42:20 -0500 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-02-11 09:30:25 -0500 |
commit | cfdbc2e16e65c1ec1c23057640607cee98d1a1bd (patch) | |
tree | 8954eab255b91ae91ac474bb187a64810a14a917 /arch | |
parent | 79a033c6b946c252c5217907d244cdb37b1114b5 (diff) |
ARC: Build system: Makefiles, Kconfig, Linker script
Arnd in his review pointed out that arch Kconfig organisation has several
deficiencies:
* Build time entries for things which can be runtime extracted from DT
(e.g. SDRAM size, core clk frequency..)
* Not multi-platform-image-build friendly (choice .. endchoice constructs)
* cpu variants support (750/770) is exclusive.
The first 2 have been fixed in subsequent patches.
Due to the nature of the 750 and 770, it is not possible to build for
both together, w/o special runtime glue code which would hurt
performance.
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arc/Kbuild | 2 | ||||
-rw-r--r-- | arch/arc/Kconfig | 328 | ||||
-rw-r--r-- | arch/arc/Kconfig.debug | 34 | ||||
-rw-r--r-- | arch/arc/Makefile | 115 | ||||
-rw-r--r-- | arch/arc/boot/Makefile | 26 | ||||
-rw-r--r-- | arch/arc/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/arc/kernel/Makefile | 16 | ||||
-rw-r--r-- | arch/arc/kernel/arcksyms.c | 56 | ||||
-rw-r--r-- | arch/arc/kernel/asm-offsets.c | 61 | ||||
-rw-r--r-- | arch/arc/kernel/vmlinux.lds.S | 116 | ||||
-rw-r--r-- | arch/arc/lib/Makefile | 9 | ||||
-rw-r--r-- | arch/arc/mm/Makefile | 10 | ||||
-rw-r--r-- | arch/arc/plat-arcfpga/Kconfig | 33 | ||||
-rw-r--r-- | arch/arc/plat-arcfpga/Makefile | 9 |
14 files changed, 816 insertions, 0 deletions
diff --git a/arch/arc/Kbuild b/arch/arc/Kbuild new file mode 100644 index 000000000000..082d329d3245 --- /dev/null +++ b/arch/arc/Kbuild | |||
@@ -0,0 +1,2 @@ | |||
1 | obj-y += kernel/ | ||
2 | obj-y += mm/ | ||
diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig new file mode 100644 index 000000000000..b0b09aea98ff --- /dev/null +++ b/arch/arc/Kconfig | |||
@@ -0,0 +1,328 @@ | |||
1 | # | ||
2 | # Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License version 2 as | ||
6 | # published by the Free Software Foundation. | ||
7 | # | ||
8 | |||
9 | config ARC | ||
10 | def_bool y | ||
11 | select ARCH_NO_VIRT_TO_BUS | ||
12 | # ARC Busybox based initramfs absolutely relies on DEVTMPFS for /dev | ||
13 | select DEVTMPFS if !INITRAMFS_SOURCE="" | ||
14 | select GENERIC_ATOMIC64 | ||
15 | select GENERIC_CLOCKEVENTS | ||
16 | select GENERIC_FIND_FIRST_BIT | ||
17 | # for now, we don't need GENERIC_IRQ_PROBE, CONFIG_GENERIC_IRQ_CHIP | ||
18 | select GENERIC_IRQ_SHOW | ||
19 | select GENERIC_PENDING_IRQ if SMP | ||
20 | select GENERIC_SMP_IDLE_THREAD | ||
21 | select HAVE_GENERIC_HARDIRQS | ||
22 | select MODULES_USE_ELF_RELA | ||
23 | |||
24 | config SCHED_OMIT_FRAME_POINTER | ||
25 | def_bool y | ||
26 | |||
27 | config GENERIC_CSUM | ||
28 | def_bool y | ||
29 | |||
30 | config RWSEM_GENERIC_SPINLOCK | ||
31 | def_bool y | ||
32 | |||
33 | config ARCH_FLATMEM_ENABLE | ||
34 | def_bool y | ||
35 | |||
36 | config MMU | ||
37 | def_bool y | ||
38 | |||
39 | config NO_IOPORT | ||
40 | def_bool y | ||
41 | |||
42 | config GENERIC_CALIBRATE_DELAY | ||
43 | def_bool y | ||
44 | |||
45 | config GENERIC_HWEIGHT | ||
46 | def_bool y | ||
47 | |||
48 | config BINFMT_ELF | ||
49 | def_bool y | ||
50 | |||
51 | config HAVE_LATENCYTOP_SUPPORT | ||
52 | def_bool y | ||
53 | |||
54 | config NO_DMA | ||
55 | def_bool n | ||
56 | |||
57 | source "init/Kconfig" | ||
58 | source "kernel/Kconfig.freezer" | ||
59 | |||
60 | menu "ARC Architecture Configuration" | ||
61 | |||
62 | choice | ||
63 | prompt "ARC Platform" | ||
64 | default ARC_PLAT_FPGA_LEGACY | ||
65 | |||
66 | config ARC_PLAT_FPGA_LEGACY | ||
67 | bool "\"Legacy\" ARC FPGA dev platform" | ||
68 | help | ||
69 | Support for ARC development platforms, provided by Synopsys. | ||
70 | These are based on FPGA or ISS. e.g. | ||
71 | - ARCAngel4 | ||
72 | - ML509 | ||
73 | - MetaWare ISS | ||
74 | |||
75 | #New platform adds here | ||
76 | endchoice | ||
77 | |||
78 | menu "ARC CPU Configuration" | ||
79 | |||
80 | choice | ||
81 | prompt "ARC Core" | ||
82 | default ARC_CPU_770 | ||
83 | |||
84 | config ARC_CPU_750D | ||
85 | bool "ARC750D" | ||
86 | help | ||
87 | Support for ARC750 core | ||
88 | |||
89 | config ARC_CPU_770 | ||
90 | bool "ARC770" | ||
91 | select ARC_CPU_REL_4_10 | ||
92 | help | ||
93 | Support for ARC770 core introduced with Rel 4.10 (Summer 2011) | ||
94 | This core has a bunch of cool new features: | ||
95 | -MMU-v3: Variable Page Sz (4k, 8k, 16k), bigger J-TLB (128x4) | ||
96 | Shared Address Spaces (for sharing TLB entires in MMU) | ||
97 | -Caches: New Prog Model, Region Flush | ||
98 | -Insns: endian swap, load-locked/store-conditional, time-stamp-ctr | ||
99 | |||
100 | endchoice | ||
101 | |||
102 | config CPU_BIG_ENDIAN | ||
103 | bool "Enable Big Endian Mode" | ||
104 | default n | ||
105 | help | ||
106 | Build kernel for Big Endian Mode of ARC CPU | ||
107 | |||
108 | menuconfig ARC_CACHE | ||
109 | bool "Enable Cache Support" | ||
110 | default y | ||
111 | |||
112 | if ARC_CACHE | ||
113 | |||
114 | config ARC_CACHE_LINE_SHIFT | ||
115 | int "Cache Line Length (as power of 2)" | ||
116 | range 5 7 | ||
117 | default "6" | ||
118 | help | ||
119 | Starting with ARC700 4.9, Cache line length is configurable, | ||
120 | This option specifies "N", with Line-len = 2 power N | ||
121 | So line lengths of 32, 64, 128 are specified by 5,6,7, respectively | ||
122 | Linux only supports same line lengths for I and D caches. | ||
123 | |||
124 | config ARC_HAS_ICACHE | ||
125 | bool "Use Instruction Cache" | ||
126 | default y | ||
127 | |||
128 | config ARC_HAS_DCACHE | ||
129 | bool "Use Data Cache" | ||
130 | default y | ||
131 | |||
132 | config ARC_CACHE_PAGES | ||
133 | bool "Per Page Cache Control" | ||
134 | default y | ||
135 | depends on ARC_HAS_ICACHE || ARC_HAS_DCACHE | ||
136 | help | ||
137 | This can be used to over-ride the global I/D Cache Enable on a | ||
138 | per-page basis (but only for pages accessed via MMU such as | ||
139 | Kernel Virtual address or User Virtual Address) | ||
140 | TLB entries have a per-page Cache Enable Bit. | ||
141 | Note that Global I/D ENABLE + Per Page DISABLE works but corollary | ||
142 | Global DISABLE + Per Page ENABLE won't work | ||
143 | |||
144 | endif #ARC_CACHE | ||
145 | |||
146 | config ARC_HAS_HW_MPY | ||
147 | bool "Use Hardware Multiplier (Normal or Faster XMAC)" | ||
148 | default y | ||
149 | help | ||
150 | Influences how gcc generates code for MPY operations. | ||
151 | If enabled, MPYxx insns are generated, provided by Standard/XMAC | ||
152 | Multipler. Otherwise software multipy lib is used | ||
153 | |||
154 | choice | ||
155 | prompt "ARC700 MMU Version" | ||
156 | default ARC_MMU_V3 if ARC_CPU_770 | ||
157 | default ARC_MMU_V2 if ARC_CPU_750D | ||
158 | |||
159 | config ARC_MMU_V1 | ||
160 | bool "MMU v1" | ||
161 | help | ||
162 | Orig ARC700 MMU | ||
163 | |||
164 | config ARC_MMU_V2 | ||
165 | bool "MMU v2" | ||
166 | help | ||
167 | Fixed the deficiency of v1 - possible thrashing in memcpy sceanrio | ||
168 | when 2 D-TLB and 1 I-TLB entries index into same 2way set. | ||
169 | |||
170 | config ARC_MMU_V3 | ||
171 | bool "MMU v3" | ||
172 | depends on ARC_CPU_770 | ||
173 | help | ||
174 | Introduced with ARC700 4.10: New Features | ||
175 | Variable Page size (1k-16k), var JTLB size 128 x (2 or 4) | ||
176 | Shared Address Spaces (SASID) | ||
177 | |||
178 | endchoice | ||
179 | |||
180 | |||
181 | choice | ||
182 | prompt "MMU Page Size" | ||
183 | default ARC_PAGE_SIZE_8K | ||
184 | |||
185 | config ARC_PAGE_SIZE_8K | ||
186 | bool "8KB" | ||
187 | help | ||
188 | Choose between 8k vs 16k | ||
189 | |||
190 | config ARC_PAGE_SIZE_16K | ||
191 | bool "16KB" | ||
192 | depends on ARC_MMU_V3 | ||
193 | |||
194 | config ARC_PAGE_SIZE_4K | ||
195 | bool "4KB" | ||
196 | depends on ARC_MMU_V3 | ||
197 | |||
198 | endchoice | ||
199 | |||
200 | config ARC_FPU_SAVE_RESTORE | ||
201 | bool "Enable FPU state persistence across context switch" | ||
202 | default n | ||
203 | help | ||
204 | Double Precision Floating Point unit had dedictaed regs which | ||
205 | need to be saved/restored across context-switch. | ||
206 | Note that ARC FPU is overly simplistic, unlike say x86, which has | ||
207 | hardware pieces to allow software to conditionally save/restore, | ||
208 | based on actual usage of FPU by a task. Thus our implemn does | ||
209 | this for all tasks in system. | ||
210 | |||
211 | menuconfig ARC_CPU_REL_4_10 | ||
212 | bool "Enable support for Rel 4.10 features" | ||
213 | default n | ||
214 | help | ||
215 | -ARC770 (and dependent features) enabled | ||
216 | -ARC750 also shares some of the new features with 770 | ||
217 | |||
218 | config ARC_HAS_LLSC | ||
219 | bool "Insn: LLOCK/SCOND (efficient atomic ops)" | ||
220 | default y | ||
221 | depends on ARC_CPU_770 | ||
222 | # if SMP, enable LLSC ONLY if ARC implementation has coherent atomics | ||
223 | depends on !SMP || ARC_HAS_COH_LLSC | ||
224 | |||
225 | config ARC_HAS_SWAPE | ||
226 | bool "Insn: SWAPE (endian-swap)" | ||
227 | default y | ||
228 | depends on ARC_CPU_REL_4_10 | ||
229 | |||
230 | config ARC_HAS_RTSC | ||
231 | bool "Insn: RTSC (64-bit r/o cycle counter)" | ||
232 | default y | ||
233 | depends on ARC_CPU_REL_4_10 | ||
234 | |||
235 | endmenu # "ARC CPU Configuration" | ||
236 | |||
237 | menu "Platform Board Configuration" | ||
238 | |||
239 | source "arch/arc/plat-arcfpga/Kconfig" | ||
240 | |||
241 | #New platform adds here | ||
242 | |||
243 | config ARC_PLAT_CLK | ||
244 | int "Clk speed in Hz" | ||
245 | default "80000000" | ||
246 | |||
247 | config LINUX_LINK_BASE | ||
248 | hex "Linux Link Address" | ||
249 | default "0x80000000" | ||
250 | help | ||
251 | ARC700 divides the 32 bit phy address space into two equal halves | ||
252 | -Lower 2G (0 - 0x7FFF_FFFF ) is user virtual, translated by MMU | ||
253 | -Upper 2G (0x8000_0000 onwards) is untranslated, for kernel | ||
254 | Typically Linux kernel is linked at the start of untransalted addr, | ||
255 | hence the default value of 0x8zs. | ||
256 | However some customers have peripherals mapped at this addr, so | ||
257 | Linux needs to be scooted a bit. | ||
258 | If you don't know what the above means, leave this setting alone. | ||
259 | |||
260 | config ARC_PLAT_SDRAM_SIZE | ||
261 | hex "SD RAM Size" | ||
262 | default "0x10000000" | ||
263 | help | ||
264 | Implies the amount of SDRAM/DRAM Linux is going to claim/own. | ||
265 | The actual memory itself could be larger than this number. But for | ||
266 | all software purposes, this is the amt of memory. | ||
267 | |||
268 | endmenu # "Platform Board Configuration" | ||
269 | |||
270 | config ARC_STACK_NONEXEC | ||
271 | bool "Make stack non-executable" | ||
272 | default n | ||
273 | help | ||
274 | To disable the execute permissions of stack/heap of processes | ||
275 | which are enabled by default. | ||
276 | |||
277 | config HZ | ||
278 | int "Timer Frequency" | ||
279 | default 100 | ||
280 | |||
281 | menuconfig ARC_DBG | ||
282 | bool "ARC debugging" | ||
283 | default y | ||
284 | |||
285 | config ARC_DBG_TLB_PARANOIA | ||
286 | bool "Paranoia Checks in Low Level TLB Handlers" | ||
287 | depends on ARC_DBG | ||
288 | default n | ||
289 | |||
290 | config ARC_DBG_TLB_MISS_COUNT | ||
291 | bool "Profile TLB Misses" | ||
292 | default n | ||
293 | select DEBUG_FS | ||
294 | depends on ARC_DBG | ||
295 | help | ||
296 | Counts number of I and D TLB Misses and exports them via Debugfs | ||
297 | The counters can be cleared via Debugfs as well | ||
298 | |||
299 | config CMDLINE | ||
300 | string "Kernel command line to built-in" | ||
301 | default "print-fatal-signals=1" | ||
302 | help | ||
303 | The default command line which will be appended to the optional | ||
304 | u-boot provided command line (see below) | ||
305 | |||
306 | config CMDLINE_UBOOT | ||
307 | bool "Support U-boot kernel command line passing" | ||
308 | default n | ||
309 | help | ||
310 | If you are using U-boot (www.denx.de) and wish to pass the kernel | ||
311 | command line from the U-boot environment to the Linux kernel then | ||
312 | switch this option on. | ||
313 | ARC U-boot will setup the cmdline in RAM/flash and set r2 to point | ||
314 | to it. kernel startup code will copy the string into cmdline buffer | ||
315 | and also append CONFIG_CMDLINE. | ||
316 | |||
317 | source "kernel/Kconfig.preempt" | ||
318 | |||
319 | endmenu # "ARC Architecture Configuration" | ||
320 | |||
321 | source "mm/Kconfig" | ||
322 | source "net/Kconfig" | ||
323 | source "drivers/Kconfig" | ||
324 | source "fs/Kconfig" | ||
325 | source "arch/arc/Kconfig.debug" | ||
326 | source "security/Kconfig" | ||
327 | source "crypto/Kconfig" | ||
328 | source "lib/Kconfig" | ||
diff --git a/arch/arc/Kconfig.debug b/arch/arc/Kconfig.debug new file mode 100644 index 000000000000..962c6099659e --- /dev/null +++ b/arch/arc/Kconfig.debug | |||
@@ -0,0 +1,34 @@ | |||
1 | menu "Kernel hacking" | ||
2 | |||
3 | source "lib/Kconfig.debug" | ||
4 | |||
5 | config EARLY_PRINTK | ||
6 | bool "Early printk" if EMBEDDED | ||
7 | default y | ||
8 | help | ||
9 | Write kernel log output directly into the VGA buffer or to a serial | ||
10 | port. | ||
11 | |||
12 | This is useful for kernel debugging when your machine crashes very | ||
13 | early before the console code is initialized. For normal operation | ||
14 | it is not recommended because it looks ugly and doesn't cooperate | ||
15 | with klogd/syslogd or the X server. You should normally N here, | ||
16 | unless you want to debug such a crash. | ||
17 | |||
18 | config DEBUG_STACKOVERFLOW | ||
19 | bool "Check for stack overflows" | ||
20 | depends on DEBUG_KERNEL | ||
21 | help | ||
22 | This option will cause messages to be printed if free stack space | ||
23 | drops below a certain limit. | ||
24 | |||
25 | config 16KSTACKS | ||
26 | bool "Use 16Kb for kernel stacks instead of 8Kb" | ||
27 | help | ||
28 | If you say Y here the kernel will use a 16Kb stacksize for the | ||
29 | kernel stack attached to each process/thread. The default is 8K. | ||
30 | This increases the resident kernel footprint and will cause less | ||
31 | threads to run on the system and also increase the pressure | ||
32 | on the VM subsystem for higher order allocations. | ||
33 | |||
34 | endmenu | ||
diff --git a/arch/arc/Makefile b/arch/arc/Makefile new file mode 100644 index 000000000000..4d52a3bb68a0 --- /dev/null +++ b/arch/arc/Makefile | |||
@@ -0,0 +1,115 @@ | |||
1 | # | ||
2 | # Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License version 2 as | ||
6 | # published by the Free Software Foundation. | ||
7 | # | ||
8 | |||
9 | UTS_MACHINE := arc | ||
10 | |||
11 | KBUILD_DEFCONFIG := fpga_defconfig | ||
12 | |||
13 | # For ARC FPGA Platforms | ||
14 | platform-$(CONFIG_ARC_PLAT_FPGA_LEGACY) := arcfpga | ||
15 | #New platform adds here | ||
16 | |||
17 | PLATFORM := $(platform-y) | ||
18 | export PLATFORM | ||
19 | |||
20 | cflags-y += -Iarch/arc/plat-$(PLATFORM)/include | ||
21 | cflags-y += -mA7 -fno-common -pipe -fno-builtin -D__linux__ | ||
22 | |||
23 | atleast_gcc44 := $(call cc-ifversion, -gt, 0402, y) | ||
24 | cflags-$(atleast_gcc44) += -fsection-anchors | ||
25 | |||
26 | cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock | ||
27 | cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape | ||
28 | cflags-$(CONFIG_ARC_HAS_RTSC) += -mrtsc | ||
29 | cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables | ||
30 | |||
31 | ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE | ||
32 | # Generic build system uses -O2, we want -O3 | ||
33 | cflags-y += -O3 | ||
34 | endif | ||
35 | |||
36 | # small data is default for elf32 tool-chain. If not usable, disable it | ||
37 | # This also allows repurposing GP as scratch reg to gcc reg allocator | ||
38 | disable_small_data := y | ||
39 | cflags-$(disable_small_data) += -mno-sdata -fcall-used-gp | ||
40 | |||
41 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian | ||
42 | ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB | ||
43 | |||
44 | # STAR 9000518362: | ||
45 | # arc-linux-uclibc-ld (buildroot) or arceb-elf32-ld (EZChip) don't accept | ||
46 | # --build-id w/o "-marclinux". | ||
47 | # Default arc-elf32-ld is OK | ||
48 | ldflags-y += -marclinux | ||
49 | |||
50 | ARC_LIBGCC := -mA7 | ||
51 | cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16 | ||
52 | |||
53 | ifndef CONFIG_ARC_HAS_HW_MPY | ||
54 | cflags-y += -mno-mpy | ||
55 | |||
56 | # newlib for ARC700 assumes MPY to be always present, which is generally true | ||
57 | # However, if someone really doesn't want MPY, we need to use the 600 ver | ||
58 | # which coupled with -mno-mpy will use mpy emulation | ||
59 | # With gcc 4.4.7, -mno-mpy is enough to make any other related adjustments, | ||
60 | # e.g. increased cost of MPY. With gcc 4.2.1 this had to be explicitly hinted | ||
61 | |||
62 | ARC_LIBGCC := -marc600 | ||
63 | ifneq ($(atleast_gcc44),y) | ||
64 | cflags-y += -multcost=30 | ||
65 | endif | ||
66 | endif | ||
67 | |||
68 | LIBGCC := $(shell $(CC) $(ARC_LIBGCC) $(cflags-y) --print-libgcc-file-name) | ||
69 | |||
70 | # Modules with short calls might break for calls into builtin-kernel | ||
71 | KBUILD_CFLAGS_MODULE += -mlong-calls | ||
72 | |||
73 | # Finally dump eveything into kernel build system | ||
74 | KBUILD_CFLAGS += $(cflags-y) | ||
75 | KBUILD_AFLAGS += $(KBUILD_CFLAGS) | ||
76 | LDFLAGS += $(ldflags-y) | ||
77 | |||
78 | # Needed for Linker script preprocessing | ||
79 | KBUILD_CPPFLAGS += -Iarch/arc/plat-$(PLATFORM)/include | ||
80 | |||
81 | head-y := arch/arc/kernel/head.o | ||
82 | |||
83 | # See arch/arc/Kbuild for content of core part of the kernel | ||
84 | core-y += arch/arc/ | ||
85 | |||
86 | # w/o this ifneq, make ARCH=arc clean was crapping out | ||
87 | ifneq ($(platform-y),) | ||
88 | core-y += arch/arc/plat-$(PLATFORM)/ | ||
89 | endif | ||
90 | |||
91 | libs-y += arch/arc/lib/ $(LIBGCC) | ||
92 | |||
93 | #default target for make without any arguements. | ||
94 | KBUILD_IMAGE := bootpImage | ||
95 | |||
96 | all: $(KBUILD_IMAGE) | ||
97 | boot := arch/arc/boot | ||
98 | |||
99 | bootpImage: vmlinux | ||
100 | |||
101 | uImage: vmlinux | ||
102 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | ||
103 | |||
104 | archclean: | ||
105 | $(Q)$(MAKE) $(clean)=$(boot) | ||
106 | |||
107 | # Hacks to enable final link due to absence of link-time branch relexation | ||
108 | # and gcc choosing optimal(shorter) branches at -O3 | ||
109 | # | ||
110 | # vineetg Feb 2010: -mlong-calls switched off for overall kernel build | ||
111 | # However lib/decompress_inflate.o (.init.text) calls | ||
112 | # zlib_inflate_workspacesize (.text) causing relocation errors. | ||
113 | # Thus forcing all exten calls in this file to be long calls | ||
114 | export CFLAGS_decompress_inflate.o = -mmedium-calls | ||
115 | export CFLAGS_initramfs.o = -mmedium-calls | ||
diff --git a/arch/arc/boot/Makefile b/arch/arc/boot/Makefile new file mode 100644 index 000000000000..7d514c24e095 --- /dev/null +++ b/arch/arc/boot/Makefile | |||
@@ -0,0 +1,26 @@ | |||
1 | targets := vmlinux.bin vmlinux.bin.gz uImage | ||
2 | |||
3 | # uImage build relies on mkimage being availble on your host for ARC target | ||
4 | # You will need to build u-boot for ARC, rename mkimage to arc-elf32-mkimage | ||
5 | # and make sure it's reacable from your PATH | ||
6 | MKIMAGE := $(srctree)/scripts/mkuboot.sh | ||
7 | |||
8 | OBJCOPYFLAGS= -O binary -R .note -R .note.gnu.build-id -R .comment -S | ||
9 | |||
10 | LINUX_START_TEXT = $$(readelf -h vmlinux | \ | ||
11 | grep "Entry point address" | grep -o 0x.*) | ||
12 | |||
13 | UIMAGE_LOADADDR = $(CONFIG_LINUX_LINK_BASE) | ||
14 | UIMAGE_ENTRYADDR = $(LINUX_START_TEXT) | ||
15 | UIMAGE_COMPRESSION = gzip | ||
16 | |||
17 | $(obj)/vmlinux.bin: vmlinux FORCE | ||
18 | $(call if_changed,objcopy) | ||
19 | |||
20 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | ||
21 | $(call if_changed,gzip) | ||
22 | |||
23 | $(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE | ||
24 | $(call if_changed,uimage) | ||
25 | |||
26 | PHONY += FORCE | ||
diff --git a/arch/arc/include/asm/Kbuild b/arch/arc/include/asm/Kbuild index a90a3c6c97e4..105ec1188aaf 100644 --- a/arch/arc/include/asm/Kbuild +++ b/arch/arc/include/asm/Kbuild | |||
@@ -33,6 +33,7 @@ generic-y += mman.h | |||
33 | generic-y += msgbuf.h | 33 | generic-y += msgbuf.h |
34 | generic-y += param.h | 34 | generic-y += param.h |
35 | generic-y += parport.h | 35 | generic-y += parport.h |
36 | generic-y += pci.h | ||
36 | generic-y += percpu.h | 37 | generic-y += percpu.h |
37 | generic-y += poll.h | 38 | generic-y += poll.h |
38 | generic-y += posix_types.h | 39 | generic-y += posix_types.h |
diff --git a/arch/arc/kernel/Makefile b/arch/arc/kernel/Makefile new file mode 100644 index 000000000000..6d834312f755 --- /dev/null +++ b/arch/arc/kernel/Makefile | |||
@@ -0,0 +1,16 @@ | |||
1 | # | ||
2 | # Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License version 2 as | ||
6 | # published by the Free Software Foundation. | ||
7 | |||
8 | obj-y := arcksyms.o setup.o irq.o time.o reset.o ptrace.o entry.o process.o | ||
9 | obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o clk.o | ||
10 | |||
11 | obj-$(CONFIG_ARC_FPU_SAVE_RESTORE) += fpu.o | ||
12 | CFLAGS_fpu.o += -mdpfp | ||
13 | |||
14 | obj-y += ctx_sw_asm.o | ||
15 | |||
16 | extra-y := vmlinux.lds head.o | ||
diff --git a/arch/arc/kernel/arcksyms.c b/arch/arc/kernel/arcksyms.c new file mode 100644 index 000000000000..4d9e77724bed --- /dev/null +++ b/arch/arc/kernel/arcksyms.c | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * arcksyms.c - Exporting symbols not exportable from their own sources | ||
3 | * | ||
4 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | |||
14 | /* libgcc functions, not part of kernel sources */ | ||
15 | extern void __ashldi3(void); | ||
16 | extern void __ashrdi3(void); | ||
17 | extern void __divsi3(void); | ||
18 | extern void __divsf3(void); | ||
19 | extern void __lshrdi3(void); | ||
20 | extern void __modsi3(void); | ||
21 | extern void __muldi3(void); | ||
22 | extern void __ucmpdi2(void); | ||
23 | extern void __udivsi3(void); | ||
24 | extern void __umodsi3(void); | ||
25 | extern void __cmpdi2(void); | ||
26 | extern void __fixunsdfsi(void); | ||
27 | extern void __muldf3(void); | ||
28 | extern void __divdf3(void); | ||
29 | extern void __floatunsidf(void); | ||
30 | extern void __floatunsisf(void); | ||
31 | |||
32 | EXPORT_SYMBOL(__ashldi3); | ||
33 | EXPORT_SYMBOL(__ashrdi3); | ||
34 | EXPORT_SYMBOL(__divsi3); | ||
35 | EXPORT_SYMBOL(__divsf3); | ||
36 | EXPORT_SYMBOL(__lshrdi3); | ||
37 | EXPORT_SYMBOL(__modsi3); | ||
38 | EXPORT_SYMBOL(__muldi3); | ||
39 | EXPORT_SYMBOL(__ucmpdi2); | ||
40 | EXPORT_SYMBOL(__udivsi3); | ||
41 | EXPORT_SYMBOL(__umodsi3); | ||
42 | EXPORT_SYMBOL(__cmpdi2); | ||
43 | EXPORT_SYMBOL(__fixunsdfsi); | ||
44 | EXPORT_SYMBOL(__muldf3); | ||
45 | EXPORT_SYMBOL(__divdf3); | ||
46 | EXPORT_SYMBOL(__floatunsidf); | ||
47 | EXPORT_SYMBOL(__floatunsisf); | ||
48 | |||
49 | /* ARC optimised assembler routines */ | ||
50 | EXPORT_SYMBOL(memset); | ||
51 | EXPORT_SYMBOL(memcpy); | ||
52 | EXPORT_SYMBOL(memcmp); | ||
53 | EXPORT_SYMBOL(strchr); | ||
54 | EXPORT_SYMBOL(strcpy); | ||
55 | EXPORT_SYMBOL(strcmp); | ||
56 | EXPORT_SYMBOL(strlen); | ||
diff --git a/arch/arc/kernel/asm-offsets.c b/arch/arc/kernel/asm-offsets.c new file mode 100644 index 000000000000..64b2c2fa7b54 --- /dev/null +++ b/arch/arc/kernel/asm-offsets.c | |||
@@ -0,0 +1,61 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/sched.h> | ||
10 | #include <linux/mm.h> | ||
11 | #include <linux/interrupt.h> | ||
12 | #include <linux/thread_info.h> | ||
13 | #include <linux/kbuild.h> | ||
14 | #include <asm/hardirq.h> | ||
15 | #include <asm/page.h> | ||
16 | #include <asm/ptrace.h> | ||
17 | |||
18 | int main(void) | ||
19 | { | ||
20 | DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); | ||
21 | DEFINE(TASK_THREAD_INFO, offsetof(struct task_struct, stack)); | ||
22 | |||
23 | BLANK(); | ||
24 | |||
25 | DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); | ||
26 | DEFINE(THREAD_CALLEE_REG, offsetof(struct thread_struct, callee_reg)); | ||
27 | DEFINE(THREAD_FAULT_ADDR, | ||
28 | offsetof(struct thread_struct, fault_address)); | ||
29 | |||
30 | BLANK(); | ||
31 | |||
32 | DEFINE(THREAD_INFO_FLAGS, offsetof(struct thread_info, flags)); | ||
33 | DEFINE(THREAD_INFO_PREEMPT_COUNT, | ||
34 | offsetof(struct thread_info, preempt_count)); | ||
35 | |||
36 | BLANK(); | ||
37 | |||
38 | DEFINE(TASK_ACT_MM, offsetof(struct task_struct, active_mm)); | ||
39 | DEFINE(TASK_TGID, offsetof(struct task_struct, tgid)); | ||
40 | |||
41 | DEFINE(MM_CTXT, offsetof(struct mm_struct, context)); | ||
42 | DEFINE(MM_PGD, offsetof(struct mm_struct, pgd)); | ||
43 | |||
44 | DEFINE(MM_CTXT_ASID, offsetof(mm_context_t, asid)); | ||
45 | |||
46 | BLANK(); | ||
47 | |||
48 | DEFINE(PT_status32, offsetof(struct pt_regs, status32)); | ||
49 | DEFINE(PT_orig_r8, offsetof(struct pt_regs, orig_r8)); | ||
50 | DEFINE(PT_sp, offsetof(struct pt_regs, sp)); | ||
51 | DEFINE(PT_r0, offsetof(struct pt_regs, r0)); | ||
52 | DEFINE(PT_r1, offsetof(struct pt_regs, r1)); | ||
53 | DEFINE(PT_r2, offsetof(struct pt_regs, r2)); | ||
54 | DEFINE(PT_r3, offsetof(struct pt_regs, r3)); | ||
55 | DEFINE(PT_r4, offsetof(struct pt_regs, r4)); | ||
56 | DEFINE(PT_r5, offsetof(struct pt_regs, r5)); | ||
57 | DEFINE(PT_r6, offsetof(struct pt_regs, r6)); | ||
58 | DEFINE(PT_r7, offsetof(struct pt_regs, r7)); | ||
59 | |||
60 | return 0; | ||
61 | } | ||
diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S new file mode 100644 index 000000000000..8c72bc37568b --- /dev/null +++ b/arch/arc/kernel/vmlinux.lds.S | |||
@@ -0,0 +1,116 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <asm-generic/vmlinux.lds.h> | ||
10 | #include <asm/cache.h> | ||
11 | #include <asm/page.h> | ||
12 | #include <asm/thread_info.h> | ||
13 | #include <plat/memmap.h> | ||
14 | |||
15 | OUTPUT_ARCH(arc) | ||
16 | ENTRY(_stext) | ||
17 | |||
18 | #ifdef CONFIG_CPU_BIG_ENDIAN | ||
19 | jiffies = jiffies_64 + 4; | ||
20 | #else | ||
21 | jiffies = jiffies_64; | ||
22 | #endif | ||
23 | |||
24 | SECTIONS | ||
25 | { | ||
26 | . = CONFIG_LINUX_LINK_BASE; | ||
27 | |||
28 | _int_vec_base_lds = .; | ||
29 | .vector : { | ||
30 | *(.vector) | ||
31 | . = ALIGN(PAGE_SIZE); | ||
32 | } | ||
33 | |||
34 | /* | ||
35 | * The reason for having a seperate subsection .init.ramfs is to | ||
36 | * prevent objump from including it in kernel dumps | ||
37 | * | ||
38 | * Reason for having .init.ramfs above .init is to make sure that the | ||
39 | * binary blob is tucked away to one side, reducing the displacement | ||
40 | * between .init.text and .text, avoiding any possible relocation | ||
41 | * errors because of calls from .init.text to .text | ||
42 | * Yes such calls do exist. e.g. | ||
43 | * decompress_inflate.c:gunzip( ) -> zlib_inflate_workspace( ) | ||
44 | */ | ||
45 | |||
46 | __init_begin = .; | ||
47 | |||
48 | .init.ramfs : { INIT_RAM_FS } | ||
49 | |||
50 | . = ALIGN(PAGE_SIZE); | ||
51 | _stext = .; | ||
52 | |||
53 | HEAD_TEXT_SECTION | ||
54 | INIT_TEXT_SECTION(L1_CACHE_BYTES) | ||
55 | |||
56 | /* INIT_DATA_SECTION open-coded: special INIT_RAM_FS handling */ | ||
57 | .init.data : { | ||
58 | INIT_DATA | ||
59 | INIT_SETUP(L1_CACHE_BYTES) | ||
60 | INIT_CALLS | ||
61 | CON_INITCALL | ||
62 | SECURITY_INITCALL | ||
63 | } | ||
64 | |||
65 | PERCPU_SECTION(L1_CACHE_BYTES) | ||
66 | |||
67 | /* | ||
68 | * .exit.text is discard at runtime, not link time, to deal with | ||
69 | * references from .debug_frame | ||
70 | * It will be init freed, being inside [__init_start : __init_end] | ||
71 | */ | ||
72 | .exit.text : { EXIT_TEXT } | ||
73 | .exit.data : { EXIT_DATA } | ||
74 | |||
75 | . = ALIGN(PAGE_SIZE); | ||
76 | __init_end = .; | ||
77 | |||
78 | .text : { | ||
79 | _text = .; | ||
80 | TEXT_TEXT | ||
81 | SCHED_TEXT | ||
82 | LOCK_TEXT | ||
83 | KPROBES_TEXT | ||
84 | *(.fixup) | ||
85 | *(.gnu.warning) | ||
86 | } | ||
87 | EXCEPTION_TABLE(L1_CACHE_BYTES) | ||
88 | _etext = .; | ||
89 | |||
90 | _sdata = .; | ||
91 | RO_DATA_SECTION(PAGE_SIZE) | ||
92 | |||
93 | /* | ||
94 | * 1. this is .data essentially | ||
95 | * 2. THREAD_SIZE for init.task, must be kernel-stk sz aligned | ||
96 | */ | ||
97 | RW_DATA_SECTION(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE) | ||
98 | |||
99 | _edata = .; | ||
100 | |||
101 | BSS_SECTION(0, 0, 0) | ||
102 | |||
103 | NOTES | ||
104 | |||
105 | . = ALIGN(PAGE_SIZE); | ||
106 | _end = . ; | ||
107 | |||
108 | STABS_DEBUG | ||
109 | DWARF_DEBUG | ||
110 | DISCARDS | ||
111 | |||
112 | .arcextmap 0 : { | ||
113 | *(.gnu.linkonce.arcextmap.*) | ||
114 | *(.arcextmap.*) | ||
115 | } | ||
116 | } | ||
diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile new file mode 100644 index 000000000000..db46e200baba --- /dev/null +++ b/arch/arc/lib/Makefile | |||
@@ -0,0 +1,9 @@ | |||
1 | # | ||
2 | # Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License version 2 as | ||
6 | # published by the Free Software Foundation. | ||
7 | |||
8 | lib-y := strchr-700.o strcmp.o strcpy-700.o strlen.o | ||
9 | lib-y += memcmp.o memcpy-700.o memset.o | ||
diff --git a/arch/arc/mm/Makefile b/arch/arc/mm/Makefile new file mode 100644 index 000000000000..168dc146a8f6 --- /dev/null +++ b/arch/arc/mm/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # | ||
2 | # Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License version 2 as | ||
6 | # published by the Free Software Foundation. | ||
7 | # | ||
8 | |||
9 | obj-y := extable.o ioremap.o dma.o fault.o init.o | ||
10 | obj-y += tlb.o tlbex.o cache_arc700.o | ||
diff --git a/arch/arc/plat-arcfpga/Kconfig b/arch/arc/plat-arcfpga/Kconfig new file mode 100644 index 000000000000..7af3a4e7f7d2 --- /dev/null +++ b/arch/arc/plat-arcfpga/Kconfig | |||
@@ -0,0 +1,33 @@ | |||
1 | # | ||
2 | # Copyright (C) 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License version 2 as | ||
6 | # published by the Free Software Foundation. | ||
7 | # | ||
8 | |||
9 | if ARC_PLAT_FPGA_LEGACY | ||
10 | |||
11 | choice | ||
12 | prompt "FPGA Board" | ||
13 | |||
14 | config ARC_BOARD_ANGEL4 | ||
15 | bool "ARC Angel4" | ||
16 | help | ||
17 | ARC Angel4 FPGA Ref Platform (Xilinx Virtex Based) | ||
18 | |||
19 | config ARC_BOARD_ML509 | ||
20 | bool "ML509" | ||
21 | help | ||
22 | ARC ML509 FPGA Ref Platform (Xilinx Virtex-5 Based) | ||
23 | |||
24 | endchoice | ||
25 | |||
26 | config ARC_SERIAL_BAUD | ||
27 | int "UART Baud rate" | ||
28 | default "115200" | ||
29 | depends on SERIAL_ARC || SERIAL_ARC_CONSOLE | ||
30 | help | ||
31 | Baud rate for the ARC UART | ||
32 | |||
33 | endif | ||
diff --git a/arch/arc/plat-arcfpga/Makefile b/arch/arc/plat-arcfpga/Makefile new file mode 100644 index 000000000000..385eb9d83b63 --- /dev/null +++ b/arch/arc/plat-arcfpga/Makefile | |||
@@ -0,0 +1,9 @@ | |||
1 | # | ||
2 | # Copyright (C) 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | # | ||
4 | # This program is free software; you can redistribute it and/or modify | ||
5 | # it under the terms of the GNU General Public License version 2 as | ||
6 | # published by the Free Software Foundation. | ||
7 | # | ||
8 | |||
9 | obj-y := platform.o irq.o | ||