aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-01-18 04:42:20 -0500
committerVineet Gupta <vgupta@synopsys.com>2013-02-11 09:30:25 -0500
commitcfdbc2e16e65c1ec1c23057640607cee98d1a1bd (patch)
tree8954eab255b91ae91ac474bb187a64810a14a917 /arch
parent79a033c6b946c252c5217907d244cdb37b1114b5 (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/Kbuild2
-rw-r--r--arch/arc/Kconfig328
-rw-r--r--arch/arc/Kconfig.debug34
-rw-r--r--arch/arc/Makefile115
-rw-r--r--arch/arc/boot/Makefile26
-rw-r--r--arch/arc/include/asm/Kbuild1
-rw-r--r--arch/arc/kernel/Makefile16
-rw-r--r--arch/arc/kernel/arcksyms.c56
-rw-r--r--arch/arc/kernel/asm-offsets.c61
-rw-r--r--arch/arc/kernel/vmlinux.lds.S116
-rw-r--r--arch/arc/lib/Makefile9
-rw-r--r--arch/arc/mm/Makefile10
-rw-r--r--arch/arc/plat-arcfpga/Kconfig33
-rw-r--r--arch/arc/plat-arcfpga/Makefile9
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 @@
1obj-y += kernel/
2obj-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
9config 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
24config SCHED_OMIT_FRAME_POINTER
25 def_bool y
26
27config GENERIC_CSUM
28 def_bool y
29
30config RWSEM_GENERIC_SPINLOCK
31 def_bool y
32
33config ARCH_FLATMEM_ENABLE
34 def_bool y
35
36config MMU
37 def_bool y
38
39config NO_IOPORT
40 def_bool y
41
42config GENERIC_CALIBRATE_DELAY
43 def_bool y
44
45config GENERIC_HWEIGHT
46 def_bool y
47
48config BINFMT_ELF
49 def_bool y
50
51config HAVE_LATENCYTOP_SUPPORT
52 def_bool y
53
54config NO_DMA
55 def_bool n
56
57source "init/Kconfig"
58source "kernel/Kconfig.freezer"
59
60menu "ARC Architecture Configuration"
61
62choice
63 prompt "ARC Platform"
64 default ARC_PLAT_FPGA_LEGACY
65
66config 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
76endchoice
77
78menu "ARC CPU Configuration"
79
80choice
81 prompt "ARC Core"
82 default ARC_CPU_770
83
84config ARC_CPU_750D
85 bool "ARC750D"
86 help
87 Support for ARC750 core
88
89config 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
100endchoice
101
102config 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
108menuconfig ARC_CACHE
109 bool "Enable Cache Support"
110 default y
111
112if ARC_CACHE
113
114config 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
124config ARC_HAS_ICACHE
125 bool "Use Instruction Cache"
126 default y
127
128config ARC_HAS_DCACHE
129 bool "Use Data Cache"
130 default y
131
132config 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
144endif #ARC_CACHE
145
146config 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
154choice
155 prompt "ARC700 MMU Version"
156 default ARC_MMU_V3 if ARC_CPU_770
157 default ARC_MMU_V2 if ARC_CPU_750D
158
159config ARC_MMU_V1
160 bool "MMU v1"
161 help
162 Orig ARC700 MMU
163
164config 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
170config 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
178endchoice
179
180
181choice
182 prompt "MMU Page Size"
183 default ARC_PAGE_SIZE_8K
184
185config ARC_PAGE_SIZE_8K
186 bool "8KB"
187 help
188 Choose between 8k vs 16k
189
190config ARC_PAGE_SIZE_16K
191 bool "16KB"
192 depends on ARC_MMU_V3
193
194config ARC_PAGE_SIZE_4K
195 bool "4KB"
196 depends on ARC_MMU_V3
197
198endchoice
199
200config 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
211menuconfig 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
218config 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
225config ARC_HAS_SWAPE
226 bool "Insn: SWAPE (endian-swap)"
227 default y
228 depends on ARC_CPU_REL_4_10
229
230config 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
235endmenu # "ARC CPU Configuration"
236
237menu "Platform Board Configuration"
238
239source "arch/arc/plat-arcfpga/Kconfig"
240
241#New platform adds here
242
243config ARC_PLAT_CLK
244 int "Clk speed in Hz"
245 default "80000000"
246
247config 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
260config 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
268endmenu # "Platform Board Configuration"
269
270config 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
277config HZ
278 int "Timer Frequency"
279 default 100
280
281menuconfig ARC_DBG
282 bool "ARC debugging"
283 default y
284
285config ARC_DBG_TLB_PARANOIA
286 bool "Paranoia Checks in Low Level TLB Handlers"
287 depends on ARC_DBG
288 default n
289
290config 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
299config 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
306config 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
317source "kernel/Kconfig.preempt"
318
319endmenu # "ARC Architecture Configuration"
320
321source "mm/Kconfig"
322source "net/Kconfig"
323source "drivers/Kconfig"
324source "fs/Kconfig"
325source "arch/arc/Kconfig.debug"
326source "security/Kconfig"
327source "crypto/Kconfig"
328source "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 @@
1menu "Kernel hacking"
2
3source "lib/Kconfig.debug"
4
5config 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
18config 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
25config 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
34endmenu
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
9UTS_MACHINE := arc
10
11KBUILD_DEFCONFIG := fpga_defconfig
12
13# For ARC FPGA Platforms
14platform-$(CONFIG_ARC_PLAT_FPGA_LEGACY) := arcfpga
15#New platform adds here
16
17PLATFORM := $(platform-y)
18export PLATFORM
19
20cflags-y += -Iarch/arc/plat-$(PLATFORM)/include
21cflags-y += -mA7 -fno-common -pipe -fno-builtin -D__linux__
22
23atleast_gcc44 := $(call cc-ifversion, -gt, 0402, y)
24cflags-$(atleast_gcc44) += -fsection-anchors
25
26cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock
27cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape
28cflags-$(CONFIG_ARC_HAS_RTSC) += -mrtsc
29cflags-$(CONFIG_ARC_DW2_UNWIND) += -fasynchronous-unwind-tables
30
31ifndef CONFIG_CC_OPTIMIZE_FOR_SIZE
32# Generic build system uses -O2, we want -O3
33cflags-y += -O3
34endif
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
38disable_small_data := y
39cflags-$(disable_small_data) += -mno-sdata -fcall-used-gp
40
41cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mbig-endian
42ldflags-$(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
48ldflags-y += -marclinux
49
50ARC_LIBGCC := -mA7
51cflags-$(CONFIG_ARC_HAS_HW_MPY) += -multcost=16
52
53ifndef 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
66endif
67
68LIBGCC := $(shell $(CC) $(ARC_LIBGCC) $(cflags-y) --print-libgcc-file-name)
69
70# Modules with short calls might break for calls into builtin-kernel
71KBUILD_CFLAGS_MODULE += -mlong-calls
72
73# Finally dump eveything into kernel build system
74KBUILD_CFLAGS += $(cflags-y)
75KBUILD_AFLAGS += $(KBUILD_CFLAGS)
76LDFLAGS += $(ldflags-y)
77
78# Needed for Linker script preprocessing
79KBUILD_CPPFLAGS += -Iarch/arc/plat-$(PLATFORM)/include
80
81head-y := arch/arc/kernel/head.o
82
83# See arch/arc/Kbuild for content of core part of the kernel
84core-y += arch/arc/
85
86# w/o this ifneq, make ARCH=arc clean was crapping out
87ifneq ($(platform-y),)
88core-y += arch/arc/plat-$(PLATFORM)/
89endif
90
91libs-y += arch/arc/lib/ $(LIBGCC)
92
93#default target for make without any arguements.
94KBUILD_IMAGE := bootpImage
95
96all: $(KBUILD_IMAGE)
97boot := arch/arc/boot
98
99bootpImage: vmlinux
100
101uImage: vmlinux
102 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
103
104archclean:
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
114export CFLAGS_decompress_inflate.o = -mmedium-calls
115export 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 @@
1targets := 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
6MKIMAGE := $(srctree)/scripts/mkuboot.sh
7
8OBJCOPYFLAGS= -O binary -R .note -R .note.gnu.build-id -R .comment -S
9
10LINUX_START_TEXT = $$(readelf -h vmlinux | \
11 grep "Entry point address" | grep -o 0x.*)
12
13UIMAGE_LOADADDR = $(CONFIG_LINUX_LINK_BASE)
14UIMAGE_ENTRYADDR = $(LINUX_START_TEXT)
15UIMAGE_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
26PHONY += 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
33generic-y += msgbuf.h 33generic-y += msgbuf.h
34generic-y += param.h 34generic-y += param.h
35generic-y += parport.h 35generic-y += parport.h
36generic-y += pci.h
36generic-y += percpu.h 37generic-y += percpu.h
37generic-y += poll.h 38generic-y += poll.h
38generic-y += posix_types.h 39generic-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
8obj-y := arcksyms.o setup.o irq.o time.o reset.o ptrace.o entry.o process.o
9obj-y += signal.o traps.o sys.o troubleshoot.o stacktrace.o clk.o
10
11obj-$(CONFIG_ARC_FPU_SAVE_RESTORE) += fpu.o
12CFLAGS_fpu.o += -mdpfp
13
14obj-y += ctx_sw_asm.o
15
16extra-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 */
15extern void __ashldi3(void);
16extern void __ashrdi3(void);
17extern void __divsi3(void);
18extern void __divsf3(void);
19extern void __lshrdi3(void);
20extern void __modsi3(void);
21extern void __muldi3(void);
22extern void __ucmpdi2(void);
23extern void __udivsi3(void);
24extern void __umodsi3(void);
25extern void __cmpdi2(void);
26extern void __fixunsdfsi(void);
27extern void __muldf3(void);
28extern void __divdf3(void);
29extern void __floatunsidf(void);
30extern void __floatunsisf(void);
31
32EXPORT_SYMBOL(__ashldi3);
33EXPORT_SYMBOL(__ashrdi3);
34EXPORT_SYMBOL(__divsi3);
35EXPORT_SYMBOL(__divsf3);
36EXPORT_SYMBOL(__lshrdi3);
37EXPORT_SYMBOL(__modsi3);
38EXPORT_SYMBOL(__muldi3);
39EXPORT_SYMBOL(__ucmpdi2);
40EXPORT_SYMBOL(__udivsi3);
41EXPORT_SYMBOL(__umodsi3);
42EXPORT_SYMBOL(__cmpdi2);
43EXPORT_SYMBOL(__fixunsdfsi);
44EXPORT_SYMBOL(__muldf3);
45EXPORT_SYMBOL(__divdf3);
46EXPORT_SYMBOL(__floatunsidf);
47EXPORT_SYMBOL(__floatunsisf);
48
49/* ARC optimised assembler routines */
50EXPORT_SYMBOL(memset);
51EXPORT_SYMBOL(memcpy);
52EXPORT_SYMBOL(memcmp);
53EXPORT_SYMBOL(strchr);
54EXPORT_SYMBOL(strcpy);
55EXPORT_SYMBOL(strcmp);
56EXPORT_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
18int 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
15OUTPUT_ARCH(arc)
16ENTRY(_stext)
17
18#ifdef CONFIG_CPU_BIG_ENDIAN
19jiffies = jiffies_64 + 4;
20#else
21jiffies = jiffies_64;
22#endif
23
24SECTIONS
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
8lib-y := strchr-700.o strcmp.o strcpy-700.o strlen.o
9lib-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
9obj-y := extable.o ioremap.o dma.o fault.o init.o
10obj-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
9if ARC_PLAT_FPGA_LEGACY
10
11choice
12 prompt "FPGA Board"
13
14config ARC_BOARD_ANGEL4
15 bool "ARC Angel4"
16 help
17 ARC Angel4 FPGA Ref Platform (Xilinx Virtex Based)
18
19config ARC_BOARD_ML509
20 bool "ML509"
21 help
22 ARC ML509 FPGA Ref Platform (Xilinx Virtex-5 Based)
23
24endchoice
25
26config 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
33endif
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
9obj-y := platform.o irq.o