Skip to content

Commit f8c4a27

Browse files
author
Jonas Bonn
committed
OpenRISC: Build infrastructure
Signed-off-by: Jonas Bonn <jonas@southpole.se> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
1 parent ac689eb commit f8c4a27

9 files changed

Lines changed: 545 additions & 0 deletions

File tree

‎arch/openrisc/Kconfig‎

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
#
2+
# For a description of the syntax of this configuration file,
3+
# see Documentation/kbuild/config-language.txt.
4+
#
5+
6+
config OPENRISC
7+
def_bool y
8+
select OF
9+
select OF_EARLY_FLATTREE
10+
select HAVE_MEMBLOCK
11+
select ARCH_WANT_OPTIONAL_GPIOLIB
12+
select HAVE_ARCH_TRACEHOOK
13+
select HAVE_GENERIC_HARDIRQS
14+
select GENERIC_IRQ_CHIP
15+
select GENERIC_IRQ_PROBE
16+
select GENERIC_IRQ_SHOW
17+
select GENERIC_IOMAP
18+
19+
config MMU
20+
def_bool y
21+
22+
config WISHBONE_BUS_BIG_ENDIAN
23+
def_bool y
24+
25+
config SYMBOL_PREFIX
26+
string
27+
default ""
28+
29+
config HAVE_DMA_ATTRS
30+
def_bool y
31+
32+
config UID16
33+
def_bool y
34+
35+
config RWSEM_GENERIC_SPINLOCK
36+
def_bool y
37+
38+
config RWSEM_XCHGADD_ALGORITHM
39+
def_bool n
40+
41+
config GENERIC_HWEIGHT
42+
def_bool y
43+
44+
config GENERIC_IOMAP
45+
def_bool y
46+
47+
config NO_IOPORT
48+
def_bool y
49+
50+
config GENERIC_GPIO
51+
def_bool y
52+
53+
config GENERIC_CLOCKEVENTS
54+
def_bool y
55+
56+
config TRACE_IRQFLAGS_SUPPORT
57+
def_bool y
58+
59+
# For now, use generic checksum functions
60+
#These can be reimplemented in assembly later if so inclined
61+
config GENERIC_CSUM
62+
def_bool y
63+
64+
config GENERIC_FIND_NEXT_BIT
65+
def_bool y
66+
67+
source "init/Kconfig"
68+
69+
70+
menu "Processor type and features"
71+
72+
choice
73+
prompt "Subarchitecture"
74+
default OR1K_1200
75+
76+
config OR1K_1200
77+
bool "OR1200"
78+
help
79+
Generic OpenRISC 1200 architecture
80+
81+
endchoice
82+
83+
config OPENRISC_BUILTIN_DTB
84+
string "Builtin DTB"
85+
default ""
86+
87+
menu "Class II Instructions"
88+
89+
config OPENRISC_HAVE_INST_FF1
90+
bool "Have instruction l.ff1"
91+
default y
92+
help
93+
Select this if your implementation has the Class II instruction l.ff1
94+
95+
config OPENRISC_HAVE_INST_FL1
96+
bool "Have instruction l.fl1"
97+
default y
98+
help
99+
Select this if your implementation has the Class II instruction l.fl1
100+
101+
config OPENRISC_HAVE_INST_MUL
102+
bool "Have instruction l.mul for hardware multiply"
103+
default y
104+
help
105+
Select this if your implementation has a hardware multiply instruction
106+
107+
config OPENRISC_HAVE_INST_DIV
108+
bool "Have instruction l.div for hardware divide"
109+
default y
110+
help
111+
Select this if your implementation has a hardware divide instruction
112+
endmenu
113+
114+
115+
source "kernel/time/Kconfig"
116+
source kernel/Kconfig.hz
117+
source kernel/Kconfig.preempt
118+
source "mm/Kconfig"
119+
120+
config OPENRISC_NO_SPR_SR_DSX
121+
bool "use SPR_SR_DSX software emulation" if OR1K_1200
122+
default y
123+
help
124+
SPR_SR_DSX bit is status register bit indicating whether
125+
the last exception has happened in delay slot.
126+
127+
OpenRISC architecture makes it optional to have it implemented
128+
in hardware and the OR1200 does not have it.
129+
130+
Say N here if you know that your OpenRISC processor has
131+
SPR_SR_DSX bit implemented. Say Y if you are unsure.
132+
133+
config CMDLINE
134+
string "Default kernel command string"
135+
default ""
136+
help
137+
On some architectures there is currently no way for the boot loader
138+
to pass arguments to the kernel. For these architectures, you should
139+
supply some command-line options at build time by entering them
140+
here.
141+
142+
menu "Debugging options"
143+
144+
config DEBUG_STACKOVERFLOW
145+
bool "Check for kernel stack overflow"
146+
default y
147+
help
148+
Make extra checks for space avaliable on stack in some
149+
critical functions. This will cause kernel to run a bit slower,
150+
but will catch most of kernel stack overruns and exit gracefuly.
151+
152+
Say Y if you are unsure.
153+
154+
config JUMP_UPON_UNHANDLED_EXCEPTION
155+
bool "Try to die gracefully"
156+
default y
157+
help
158+
Now this puts kernel into infinite loop after first oops. Till
159+
your kernel crashes this doesn't have any influence.
160+
161+
Say Y if you are unsure.
162+
163+
config OPENRISC_EXCEPTION_DEBUG
164+
bool "Print processor state at each exception"
165+
default n
166+
help
167+
This option will make your kernel unusable for all but kernel
168+
debugging.
169+
170+
Say N if you are unsure.
171+
172+
config OPENRISC_ESR_EXCEPTION_BUG_CHECK
173+
bool "Check for possible ESR exception bug"
174+
default n
175+
help
176+
This option enables some checks that might expose some problems
177+
in kernel.
178+
179+
Say N if you are unsure.
180+
181+
endmenu
182+
183+
endmenu
184+
185+
menu "Executable file formats"
186+
187+
source "fs/Kconfig.binfmt"
188+
189+
endmenu
190+
191+
source "net/Kconfig"
192+
193+
source "drivers/Kconfig"
194+
195+
source "fs/Kconfig"
196+
197+
source "security/Kconfig"
198+
199+
source "crypto/Kconfig"
200+
201+
source "lib/Kconfig"
202+
203+
menu "Kernel hacking"
204+
205+
source "lib/Kconfig.debug"
206+
207+
endmenu

‎arch/openrisc/Makefile‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# BK Id: %F% %I% %G% %U% %#%
2+
#
3+
# This file is included by the global makefile so that you can add your own
4+
# architecture-specific flags and dependencies. Remember to do have actions
5+
# for "archclean" and "archdep" for cleaning up and making dependencies for
6+
# 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+
# Modifications for the OpenRISC architecture:
14+
# Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
15+
# Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
16+
#
17+
# Based on:
18+
# arch/i386/Makefile
19+
20+
KBUILD_DEFCONFIG := or1ksim_defconfig
21+
22+
LDFLAGS :=
23+
OBJCOPYFLAGS := -O binary -R .note -R .comment -S
24+
LDFLAGS_vmlinux :=
25+
LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
26+
27+
KBUILD_CFLAGS += -pipe -ffixed-r10
28+
29+
ifeq ($(CONFIG_OPENRISC_HAVE_INST_MUL),y)
30+
KBUILD_CFLAGS += $(call cc-option,-mhard-mul)
31+
else
32+
KBUILD_CFLAGS += $(call cc-option,-msoft-mul)
33+
endif
34+
35+
ifeq ($(CONFIG_OPENRISC_HAVE_INST_DIV),y)
36+
KBUILD_CFLAGS += $(call cc-option,-mhard-div)
37+
else
38+
KBUILD_CFLAGS += $(call cc-option,-msoft-div)
39+
endif
40+
41+
head-y := arch/openrisc/kernel/head.o arch/openrisc/kernel/init_task.o
42+
43+
core-y += arch/openrisc/lib/ \
44+
arch/openrisc/kernel/ \
45+
arch/openrisc/mm/
46+
libs-y += $(LIBGCC)
47+
48+
ifneq '$(CONFIG_OPENRISC_BUILTIN_DTB)' '""'
49+
BUILTIN_DTB := y
50+
else
51+
BUILTIN_DTB := n
52+
endif
53+
core-$(BUILTIN_DTB) += arch/openrisc/boot/
54+
55+
all: vmlinux

‎arch/openrisc/boot/Makefile‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
3+
ifneq '$(CONFIG_OPENRISC_BUILTIN_DTB)' '""'
4+
BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_OPENRISC_BUILTIN_DTB)).dtb.o
5+
else
6+
BUILTIN_DTB :=
7+
endif
8+
obj-y += $(BUILTIN_DTB)
9+
10+
clean-files := *.dtb.S
11+
12+
#DTC_FLAGS ?= -p 1024
13+
14+
$(obj)/%.dtb: $(src)/dts/%.dts
15+
$(call cmd,dtc)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
CONFIG_CROSS_COMPILE="or32-linux-"
2+
CONFIG_LOG_BUF_SHIFT=14
3+
CONFIG_BLK_DEV_INITRD=y
4+
# CONFIG_RD_GZIP is not set
5+
CONFIG_EXPERT=y
6+
# CONFIG_SYSCTL_SYSCALL is not set
7+
# CONFIG_KALLSYMS is not set
8+
# CONFIG_EPOLL is not set
9+
# CONFIG_TIMERFD is not set
10+
# CONFIG_EVENTFD is not set
11+
# CONFIG_AIO is not set
12+
# CONFIG_VM_EVENT_COUNTERS is not set
13+
# CONFIG_COMPAT_BRK is not set
14+
CONFIG_SLOB=y
15+
CONFIG_MODULES=y
16+
# CONFIG_BLOCK is not set
17+
CONFIG_OPENRISC_BUILTIN_DTB="or1ksim"
18+
CONFIG_NO_HZ=y
19+
CONFIG_HZ_100=y
20+
CONFIG_NET=y
21+
CONFIG_PACKET=y
22+
CONFIG_UNIX=y
23+
CONFIG_INET=y
24+
# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25+
# CONFIG_INET_XFRM_MODE_TUNNEL is not set
26+
# CONFIG_INET_XFRM_MODE_BEET is not set
27+
# CONFIG_INET_LRO is not set
28+
# CONFIG_INET_DIAG is not set
29+
CONFIG_TCP_CONG_ADVANCED=y
30+
# CONFIG_TCP_CONG_BIC is not set
31+
# CONFIG_TCP_CONG_CUBIC is not set
32+
# CONFIG_TCP_CONG_WESTWOOD is not set
33+
# CONFIG_TCP_CONG_HTCP is not set
34+
# CONFIG_IPV6 is not set
35+
# CONFIG_WIRELESS is not set
36+
CONFIG_DEVTMPFS=y
37+
CONFIG_DEVTMPFS_MOUNT=y
38+
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
39+
# CONFIG_FW_LOADER is not set
40+
CONFIG_PROC_DEVICETREE=y
41+
CONFIG_NETDEVICES=y
42+
CONFIG_MICREL_PHY=y
43+
CONFIG_NET_ETHERNET=y
44+
CONFIG_ETHOC=y
45+
# CONFIG_NETDEV_1000 is not set
46+
# CONFIG_NETDEV_10000 is not set
47+
# CONFIG_WLAN is not set
48+
# CONFIG_INPUT is not set
49+
# CONFIG_SERIO is not set
50+
# CONFIG_VT is not set
51+
# CONFIG_LEGACY_PTYS is not set
52+
# CONFIG_DEVKMEM is not set
53+
CONFIG_SERIAL_8250=y
54+
CONFIG_SERIAL_8250_CONSOLE=y
55+
CONFIG_SERIAL_OF_PLATFORM=y
56+
# CONFIG_HW_RANDOM is not set
57+
# CONFIG_HWMON is not set
58+
# CONFIG_MFD_SUPPORT is not set
59+
# CONFIG_USB_SUPPORT is not set
60+
# CONFIG_DNOTIFY is not set
61+
CONFIG_TMPFS=y
62+
CONFIG_NFS_FS=y
63+
CONFIG_NFS_V3=y
64+
# CONFIG_ENABLE_WARN_DEPRECATED is not set
65+
# CONFIG_ENABLE_MUST_CHECK is not set

0 commit comments

Comments
 (0)