Skip to content

Commit cfdbc2e

Browse files
committed
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>
1 parent 79a033c commit cfdbc2e

14 files changed

Lines changed: 816 additions & 0 deletions

File tree

‎arch/arc/Kbuild‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
obj-y += kernel/
2+
obj-y += mm/

‎arch/arc/Kconfig‎

Lines changed: 328 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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"

‎arch/arc/Kconfig.debug‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

0 commit comments

Comments
 (0)