aboutsummaryrefslogtreecommitdiffstats
path: root/arch/unicore32
diff options
context:
space:
mode:
authorGuanXuetao <gxt@mprc.pku.edu.cn>2011-02-26 05:24:56 -0500
committerGuanXuetao <gxt@mprc.pku.edu.cn>2011-03-16 21:19:05 -0400
commit790edb61c0d87d1f1daafcaaa8f7c66b7b82bdad (patch)
treef3e3a4f1a182692dfa07e85010fca23eb951442b /arch/unicore32
parent7f509a9ef7af0d6ac852d49eb87ed2b9857821cc (diff)
unicore32 core architecture: build infrastructure
This patch implements build infrastructure. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/unicore32')
-rw-r--r--arch/unicore32/.gitignore21
-rw-r--r--arch/unicore32/Kconfig246
-rw-r--r--arch/unicore32/Kconfig.debug68
-rw-r--r--arch/unicore32/Makefile95
-rw-r--r--arch/unicore32/configs/debug_defconfig210
-rw-r--r--arch/unicore32/include/asm/Kbuild2
-rw-r--r--arch/unicore32/include/asm/linkage.h22
-rw-r--r--arch/unicore32/kernel/Makefile33
-rw-r--r--arch/unicore32/kernel/vmlinux.lds.S61
9 files changed, 758 insertions, 0 deletions
diff --git a/arch/unicore32/.gitignore b/arch/unicore32/.gitignore
new file mode 100644
index 000000000000..947e99c2a957
--- /dev/null
+++ b/arch/unicore32/.gitignore
@@ -0,0 +1,21 @@
1#
2# Generated include files
3#
4include/generated
5#
6# Generated ld script file
7#
8kernel/vmlinux.lds
9#
10# Generated images in boot
11#
12boot/Image
13boot/zImage
14boot/uImage
15#
16# Generated files in boot/compressed
17#
18boot/compressed/piggy.S
19boot/compressed/piggy.gzip
20boot/compressed/vmlinux
21boot/compressed/vmlinux.lds
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
new file mode 100644
index 000000000000..cc6a83215881
--- /dev/null
+++ b/arch/unicore32/Kconfig
@@ -0,0 +1,246 @@
1config UNICORE32
2 def_bool y
3 select HAVE_MEMBLOCK
4 select HAVE_GENERIC_DMA_COHERENT
5 select HAVE_GENERIC_HARDIRQS
6 select HAVE_DMA_ATTRS
7 select HAVE_KERNEL_GZIP
8 select HAVE_KERNEL_BZIP2
9 select HAVE_KERNEL_LZO
10 select HAVE_KERNEL_LZMA
11 select GENERIC_FIND_FIRST_BIT
12 select GENERIC_IRQ_PROBE
13 select ARCH_WANT_FRAME_POINTERS
14 help
15 UniCore-32 is 32-bit Instruction Set Architecture,
16 including a series of low-power-consumption RISC chip
17 designs licensed by PKUnity Ltd.
18 Please see web page at <http://www.pkunity.com/>.
19
20config HAVE_PWM
21 bool
22
23config GENERIC_GPIO
24 def_bool y
25
26config GENERIC_CLOCKEVENTS
27 bool
28
29config GENERIC_CSUM
30 def_bool y
31
32config NO_IOPORT
33 bool
34
35config STACKTRACE_SUPPORT
36 def_bool y
37
38config HAVE_LATENCYTOP_SUPPORT
39 def_bool y
40
41config LOCKDEP_SUPPORT
42 def_bool y
43
44config RWSEM_GENERIC_SPINLOCK
45 def_bool y
46
47config RWSEM_XCHGADD_ALGORITHM
48 bool
49
50config ARCH_HAS_ILOG2_U32
51 bool
52
53config ARCH_HAS_ILOG2_U64
54 bool
55
56config ARCH_HAS_CPUFREQ
57 bool
58
59config GENERIC_HWEIGHT
60 def_bool y
61
62config GENERIC_CALIBRATE_DELAY
63 def_bool y
64
65config ARCH_MAY_HAVE_PC_FDC
66 bool
67
68config NEED_DMA_MAP_STATE
69 def_bool y
70
71source "init/Kconfig"
72
73source "kernel/Kconfig.freezer"
74
75menu "System Type"
76
77config MMU
78 def_bool y
79
80config ARCH_FPGA
81 bool
82
83config ARCH_PUV3
84 def_bool y
85 select CPU_UCV2
86 select GENERIC_CLOCKEVENTS
87 select HAVE_CLK
88 select ARCH_REQUIRE_GPIOLIB
89 select ARCH_HAS_CPUFREQ
90
91# CONFIGs for ARCH_PUV3
92
93if ARCH_PUV3
94
95choice
96 prompt "Board Selection"
97 default PUV3_DB0913
98
99config PUV3_FPGA_DLX200
100 select ARCH_FPGA
101 bool "FPGA board"
102
103config PUV3_DB0913
104 bool "DEBUG board (0913)"
105
106config PUV3_NB0916
107 bool "NetBook board (0916)"
108 select HAVE_PWM
109
110config PUV3_SMW0919
111 bool "Security Mini-Workstation board (0919)"
112
113endchoice
114
115config PUV3_PM
116 def_bool y if !ARCH_FPGA
117
118endif
119
120source "arch/unicore32/mm/Kconfig"
121
122comment "Floating poing support"
123
124config UNICORE_FPU_F64
125 def_bool y if !ARCH_FPGA
126
127endmenu
128
129menu "Bus support"
130
131config PCI
132 bool "PCI Support"
133 help
134 Find out whether you have a PCI motherboard. PCI is the name of a
135 bus system, i.e. the way the CPU talks to the other stuff inside
136 your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or
137 VESA. If you have PCI, say Y, otherwise N.
138
139source "drivers/pci/Kconfig"
140
141source "drivers/pcmcia/Kconfig"
142
143endmenu
144
145menu "Kernel Features"
146
147source "kernel/time/Kconfig"
148
149source "kernel/Kconfig.preempt"
150
151source "kernel/Kconfig.hz"
152
153source "mm/Kconfig"
154
155config LEDS
156 def_bool y
157 depends on GENERIC_GPIO
158
159config ALIGNMENT_TRAP
160 def_bool y
161 help
162 Unicore processors can not fetch/store information which is not
163 naturally aligned on the bus, i.e., a 4 byte fetch must start at an
164 address divisible by 4. On 32-bit Unicore processors, these non-aligned
165 fetch/store instructions will be emulated in software if you say
166 here, which has a severe performance impact. This is necessary for
167 correct operation of some network protocols. With an IP-only
168 configuration it is safe to say N, otherwise say Y.
169
170endmenu
171
172menu "Boot options"
173
174config CMDLINE
175 string "Default kernel command string"
176 default ""
177
178config CMDLINE_FORCE
179 bool "Always use the default kernel command string"
180 depends on CMDLINE != ""
181 help
182 Always use the default kernel command string, even if the boot
183 loader passes other arguments to the kernel.
184 This is useful if you cannot or don't want to change the
185 command-line options your boot loader passes to the kernel.
186
187 If unsure, say N.
188
189endmenu
190
191menu "Userspace binary formats"
192
193source "fs/Kconfig.binfmt"
194
195endmenu
196
197menu "Power management options"
198
199source "kernel/power/Kconfig"
200
201if ARCH_HAS_CPUFREQ
202source "drivers/cpufreq/Kconfig"
203endif
204
205config ARCH_SUSPEND_POSSIBLE
206 def_bool y if !ARCH_FPGA
207
208config ARCH_HIBERNATION_POSSIBLE
209 def_bool y if !ARCH_FPGA
210
211endmenu
212
213source "net/Kconfig"
214
215if ARCH_PUV3
216
217config PUV3_GPIO
218 bool
219 depends on !ARCH_FPGA
220 select GENERIC_GPIO
221 select GPIO_SYSFS if EXPERIMENTAL
222 default y
223
224config PUV3_PWM
225 tristate
226 default BACKLIGHT_PWM
227 help
228 Enable support for NB0916 PWM controllers
229
230config PUV3_RTC
231 tristate "PKUnity v3 RTC Support"
232 depends on !ARCH_FPGA
233
234endif
235
236source "drivers/Kconfig"
237
238source "fs/Kconfig"
239
240source "arch/unicore32/Kconfig.debug"
241
242source "security/Kconfig"
243
244source "crypto/Kconfig"
245
246source "lib/Kconfig"
diff --git a/arch/unicore32/Kconfig.debug b/arch/unicore32/Kconfig.debug
new file mode 100644
index 000000000000..3140151ede45
--- /dev/null
+++ b/arch/unicore32/Kconfig.debug
@@ -0,0 +1,68 @@
1menu "Kernel hacking"
2
3source "lib/Kconfig.debug"
4
5config STRICT_DEVMEM
6 bool "Filter access to /dev/mem"
7 depends on MMU
8 ---help---
9 If this option is disabled, you allow userspace (root) access to all
10 of memory, including kernel and userspace memory. Accidental
11 access to this is obviously disastrous, but specific access can
12 be used by people debugging the kernel.
13
14 If this option is switched on, the /dev/mem file only allows
15 userspace access to memory mapped peripherals.
16
17 If in doubt, say Y.
18
19config EARLY_PRINTK
20 def_bool DEBUG_OCD
21 help
22 Write kernel log output directly into the ocd or to a serial port.
23
24 This is useful for kernel debugging when your machine crashes very
25 early before the console code is initialized. For normal operation
26 it is not recommended because it looks ugly and doesn't cooperate
27 with klogd/syslogd or the X server. You should normally N here,
28 unless you want to debug such a crash.
29
30config DEBUG_STACK_USAGE
31 bool "Enable stack utilization instrumentation"
32 depends on DEBUG_KERNEL
33 help
34 Enables the display of the minimum amount of free stack which each
35 task has ever had available in the sysrq-T output.
36
37# These options are only for real kernel hackers who want to get their hands dirty.
38config DEBUG_LL
39 bool "Kernel low-level debugging functions"
40 depends on DEBUG_KERNEL
41 help
42 Say Y here to include definitions of printascii, printch, printhex
43 in the kernel. This is helpful if you are debugging code that
44 executes before the console is initialized.
45
46config DEBUG_OCD
47 bool "Kernel low-level debugging via On-Chip-Debugger"
48 depends on DEBUG_LL
49 default y
50 help
51 Say Y here if you want the debug print routines to direct their
52 output to the UniCore On-Chip-Debugger channel using CP #1.
53
54config DEBUG_OCD_BREAKPOINT
55 bool "Breakpoint support via On-Chip-Debugger"
56 depends on DEBUG_OCD
57
58config DEBUG_UART
59 int "Kernel low-level debugging messages via serial port"
60 depends on DEBUG_LL
61 range 0 1
62 default "0"
63 help
64 Choice for UART for kernel low-level using PKUnity UARTS,
65 should be between zero and one. The port must have been
66 initialised by the boot-loader before use.
67
68endmenu
diff --git a/arch/unicore32/Makefile b/arch/unicore32/Makefile
new file mode 100644
index 000000000000..e08d6d370a8a
--- /dev/null
+++ b/arch/unicore32/Makefile
@@ -0,0 +1,95 @@
1#
2# arch/unicore32/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies.
6#
7# This file is subject to the terms and conditions of the GNU General Public
8# License. See the file "COPYING" in the main directory of this archive
9# for more details.
10#
11# Copyright (C) 2002~2010 by Guan Xue-tao
12#
13ifneq ($(SUBARCH),$(ARCH))
14 ifeq ($(CROSS_COMPILE),)
15 CROSS_COMPILE := $(call cc-cross-prefix, unicore32-linux-)
16 endif
17endif
18
19LDFLAGS_vmlinux := -p --no-undefined -X
20
21OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S
22
23# Never generate .eh_frame
24KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
25
26# Never use hard float in kernel
27KBUILD_CFLAGS += -msoft-float
28
29ifeq ($(CONFIG_FRAME_POINTER),y)
30KBUILD_CFLAGS += -mno-sched-prolog
31endif
32
33CHECKFLAGS += -D__unicore32__
34
35head-y := arch/unicore32/kernel/head.o
36head-y += arch/unicore32/kernel/init_task.o
37
38core-y += arch/unicore32/kernel/
39core-y += arch/unicore32/mm/
40
41libs-y += arch/unicore32/lib/
42
43ASM_GENERATED_DIR := $(srctree)/arch/unicore32/include/generated
44LINUXINCLUDE += -I$(ASM_GENERATED_DIR)
45
46ASM_GENERIC_HEADERS := atomic.h auxvec.h
47ASM_GENERIC_HEADERS += bitsperlong.h bug.h bugs.h
48ASM_GENERIC_HEADERS += cputime.h current.h
49ASM_GENERIC_HEADERS += device.h div64.h
50ASM_GENERIC_HEADERS += emergency-restart.h errno.h
51ASM_GENERIC_HEADERS += fb.h fcntl.h ftrace.h
52ASM_GENERIC_HEADERS += hardirq.h hw_irq.h
53ASM_GENERIC_HEADERS += ioctl.h ioctls.h ipcbuf.h irq_regs.h
54ASM_GENERIC_HEADERS += kdebug.h kmap_types.h
55ASM_GENERIC_HEADERS += local.h
56ASM_GENERIC_HEADERS += mman.h module.h msgbuf.h
57ASM_GENERIC_HEADERS += param.h parport.h percpu.h poll.h posix_types.h
58ASM_GENERIC_HEADERS += resource.h
59ASM_GENERIC_HEADERS += scatterlist.h sections.h segment.h sembuf.h serial.h
60ASM_GENERIC_HEADERS += setup.h shmbuf.h shmparam.h
61ASM_GENERIC_HEADERS += siginfo.h signal.h sizes.h
62ASM_GENERIC_HEADERS += socket.h sockios.h stat.h statfs.h swab.h syscalls.h
63ASM_GENERIC_HEADERS += termbits.h termios.h topology.h types.h
64ASM_GENERIC_HEADERS += ucontext.h unaligned.h user.h
65ASM_GENERIC_HEADERS += vga.h
66ASM_GENERIC_HEADERS += xor.h
67
68archprepare:
69ifneq ($(ASM_GENERATED_DIR), $(wildcard $(ASM_GENERATED_DIR)))
70 $(Q)mkdir -p $(ASM_GENERATED_DIR)/asm
71 $(Q)$(foreach a, $(ASM_GENERIC_HEADERS), \
72 echo '#include <asm-generic/$a>' \
73 > $(ASM_GENERATED_DIR)/asm/$a; )
74endif
75
76boot := arch/unicore32/boot
77
78# Default target when executing plain make
79KBUILD_IMAGE := zImage
80
81all: $(KBUILD_IMAGE)
82
83zImage Image uImage: vmlinux
84 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
85
86MRPROPER_DIRS += $(ASM_GENERATED_DIR)
87
88archclean:
89 $(Q)$(MAKE) $(clean)=$(boot)
90
91define archhelp
92 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
93 echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
94 echo ' uImage - U-Boot wrapped zImage'
95endef
diff --git a/arch/unicore32/configs/debug_defconfig b/arch/unicore32/configs/debug_defconfig
new file mode 100644
index 000000000000..3647f68147da
--- /dev/null
+++ b/arch/unicore32/configs/debug_defconfig
@@ -0,0 +1,210 @@
1### General setup
2CONFIG_EXPERIMENTAL=y
3CONFIG_LOCALVERSION="-debug"
4CONFIG_SWAP=y
5CONFIG_SYSVIPC=y
6CONFIG_POSIX_MQUEUE=y
7CONFIG_HOTPLUG=y
8# Initial RAM filesystem and RAM disk (initramfs/initrd) support
9#CONFIG_BLK_DEV_INITRD=y
10#CONFIG_INITRAMFS_SOURCE="arch/unicore/ramfs/ramfs_config"
11
12### Enable loadable module support
13CONFIG_MODULES=n
14CONFIG_MODULE_UNLOAD=y
15
16### System Type
17CONFIG_ARCH_PUV3=y
18# Board Selection
19CONFIG_PUV3_NB0916=y
20# Processor Features
21CONFIG_CPU_DCACHE_LINE_DISABLE=y
22CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE=n
23
24### Bus support
25CONFIG_PCI=y
26CONFIG_PCI_LEGACY=n
27
28### Boot options
29# for debug, adding: earlyprintk=ocd,keep initcall_debug
30# others support: test_suspend=mem root=/dev/sda
31# hibernate support: resume=/dev/sda3
32CONFIG_CMDLINE="earlyprintk=ocd,keep ignore_loglevel"
33# TODO: mem=512M video=unifb:1024x600-16@75
34# for nfs: root=/dev/nfs rw nfsroot=192.168.10.88:/home/udb/nfs/,rsize=1024,wsize=1024
35# ip=192.168.10.83:192.168.10.88:192.168.10.1:255.255.255.0::eth0:off
36CONFIG_CMDLINE_FORCE=y
37
38### Power management options
39CONFIG_PM=y
40CONFIG_HIBERNATION=y
41CONFIG_PM_STD_PARTITION="/dev/sda3"
42CONFIG_CPU_FREQ=n
43CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
44
45### Networking support
46CONFIG_NET=y
47# Networking options
48CONFIG_PACKET=m
49CONFIG_UNIX=m
50# TCP/IP networking
51CONFIG_INET=y
52CONFIG_IP_MULTICAST=y
53CONFIG_IP_PNP=y
54CONFIG_IPV6=n
55# Wireless
56CONFIG_WIRELESS=y
57CONFIG_WIRELESS_EXT=y
58CONFIG_MAC80211=m
59
60### PKUnity SoC Features
61CONFIG_USB_WLAN_HED_AQ3=n
62CONFIG_USB_CMMB_INNOFIDEI=n
63CONFIG_I2C_BATTERY_BQ27200=n
64CONFIG_I2C_EEPROM_AT24=n
65CONFIG_LCD_BACKLIGHT=n
66
67CONFIG_PUV3_RTC=y
68CONFIG_PUV3_UMAL=y
69CONFIG_PUV3_UNIGFX=y
70CONFIG_PUV3_MUSB=n
71CONFIG_PUV3_AC97=n
72CONFIG_PUV3_NAND=n
73CONFIG_PUV3_MMC=n
74CONFIG_PUV3_UART=n
75
76### Device Drivers
77# Memory Technology Device (MTD) support
78CONFIG_MTD=m
79CONFIG_MTD_UBI=m
80CONFIG_MTD_PARTITIONS=y
81CONFIG_MTD_CHAR=m
82CONFIG_MTD_BLKDEVS=m
83# RAM/ROM/Flash chip drivers
84CONFIG_MTD_CFI=m
85CONFIG_MTD_JEDECPROBE=m
86CONFIG_MTD_CFI_AMDSTD=m
87# Mapping drivers for chip access
88CONFIG_MTD_PHYSMAP=m
89
90# Block devices
91CONFIG_BLK_DEV_LOOP=m
92
93# SCSI device support
94CONFIG_SCSI=y
95CONFIG_BLK_DEV_SD=y
96CONFIG_BLK_DEV_SR=m
97CONFIG_CHR_DEV_SG=m
98
99# Serial ATA (prod) and Parallel ATA (experimental) drivers
100CONFIG_ATA=y
101CONFIG_SATA_VIA=y
102
103# Network device support
104CONFIG_NETDEVICES=y
105CONFIG_NET_ETHERNET=y
106CONFIG_NETDEV_1000=y
107# Wireless LAN
108CONFIG_WLAN_80211=n
109CONFIG_RT2X00=n
110CONFIG_RT73USB=n
111
112# Input device support
113CONFIG_INPUT_EVDEV=m
114# Keyboards
115CONFIG_KEYBOARD_GPIO=m
116
117# Hardware Monitoring support
118#CONFIG_SENSORS_LM75=m
119# Generic Thermal sysfs driver
120#CONFIG_THERMAL=m
121#CONFIG_THERMAL_HWMON=y
122
123# Multimedia support
124CONFIG_MEDIA_SUPPORT=n
125CONFIG_VIDEO_DEV=n
126CONFIG_USB_VIDEO_CLASS=n
127
128# Graphics support
129# Console display driver support
130CONFIG_VGA_CONSOLE=n
131CONFIG_FRAMEBUFFER_CONSOLE=y
132CONFIG_FONTS=y
133CONFIG_FONT_8x8=y
134CONFIG_FONT_8x16=y
135# Bootup logo
136CONFIG_LOGO=n
137
138# Sound card support
139CONFIG_SOUND=m
140# Advanced Linux Sound Architecture
141CONFIG_SND=m
142CONFIG_SND_MIXER_OSS=m
143CONFIG_SND_PCM_OSS=m
144
145# USB support
146CONFIG_USB_ARCH_HAS_HCD=n
147CONFIG_USB=n
148CONFIG_USB_DEVICEFS=n
149CONFIG_USB_PRINTER=n
150CONFIG_USB_STORAGE=n
151# Inventra Highspeed Dual Role Controller
152CONFIG_USB_MUSB_HDRC=n
153
154# LED Support
155CONFIG_NEW_LEDS=y
156CONFIG_LEDS_CLASS=y
157CONFIG_LEDS_GPIO=y
158# LED Triggers
159CONFIG_LEDS_TRIGGERS=y
160CONFIG_LEDS_TRIGGER_TIMER=y
161CONFIG_LEDS_TRIGGER_IDE_DISK=y
162CONFIG_LEDS_TRIGGER_HEARTBEAT=y
163
164# Real Time Clock
165CONFIG_RTC_LIB=m
166CONFIG_RTC_CLASS=m
167
168### File systems
169CONFIG_EXT2_FS=m
170CONFIG_EXT3_FS=y
171CONFIG_EXT4_FS=y
172CONFIG_FUSE_FS=m
173# CD-ROM/DVD Filesystems
174CONFIG_ISO9660_FS=m
175CONFIG_JOLIET=y
176CONFIG_UDF_FS=m
177# DOS/FAT/NT Filesystems
178CONFIG_VFAT_FS=m
179# Pseudo filesystems
180CONFIG_PROC_FS=y
181CONFIG_SYSFS=y
182CONFIG_TMPFS=y
183# Miscellaneous filesystems
184CONFIG_MISC_FILESYSTEMS=y
185CONFIG_JFFS2_FS=m
186CONFIG_UBIFS_FS=m
187# Network File Systems
188CONFIG_NETWORK_FILESYSTEMS=y
189CONFIG_NFS_FS=y
190CONFIG_NFS_V3=y
191CONFIG_ROOT_NFS=y
192# Partition Types
193CONFIG_PARTITION_ADVANCED=y
194CONFIG_MSDOS_PARTITION=y
195# Native language support
196CONFIG_NLS=y
197CONFIG_NLS_CODEPAGE_437=m
198CONFIG_NLS_CODEPAGE_936=m
199CONFIG_NLS_ISO8859_1=m
200CONFIG_NLS_UTF8=m
201
202### Kernel hacking
203CONFIG_FRAME_WARN=8096
204CONFIG_MAGIC_SYSRQ=y
205CONFIG_DEBUG_KERNEL=y
206CONFIG_PROVE_LOCKING=n
207CONFIG_DEBUG_BUGVERBOSE=y
208CONFIG_FRAME_POINTER=y
209CONFIG_DEBUG_LL=y
210
diff --git a/arch/unicore32/include/asm/Kbuild b/arch/unicore32/include/asm/Kbuild
new file mode 100644
index 000000000000..b200fdaca44d
--- /dev/null
+++ b/arch/unicore32/include/asm/Kbuild
@@ -0,0 +1,2 @@
1include include/asm-generic/Kbuild.asm
2
diff --git a/arch/unicore32/include/asm/linkage.h b/arch/unicore32/include/asm/linkage.h
new file mode 100644
index 000000000000..d1618bd35b67
--- /dev/null
+++ b/arch/unicore32/include/asm/linkage.h
@@ -0,0 +1,22 @@
1/*
2 * linux/arch/unicore32/include/asm/linkage.h
3 *
4 * Code specific to PKUnity SoC and UniCore ISA
5 *
6 * Copyright (C) 2001-2010 GUAN Xue-tao
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __UNICORE_LINKAGE_H__
13#define __UNICORE_LINKAGE_H__
14
15#define __ALIGN .align 0
16#define __ALIGN_STR ".align 0"
17
18#define ENDPROC(name) \
19 .type name, %function; \
20 END(name)
21
22#endif
diff --git a/arch/unicore32/kernel/Makefile b/arch/unicore32/kernel/Makefile
new file mode 100644
index 000000000000..ec23a2fb2f50
--- /dev/null
+++ b/arch/unicore32/kernel/Makefile
@@ -0,0 +1,33 @@
1#
2# Makefile for the linux kernel.
3#
4
5# Object file lists.
6obj-y := dma.o elf.o entry.o process.o ptrace.o
7obj-y += setup.o signal.o sys.o stacktrace.o traps.o
8
9obj-$(CONFIG_MODULES) += ksyms.o module.o
10obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
11
12obj-$(CONFIG_CPU_FREQ) += cpu-ucv2.o
13obj-$(CONFIG_UNICORE_FPU_F64) += fpu-ucf64.o
14
15# obj-y for architecture PKUnity v3
16obj-$(CONFIG_ARCH_PUV3) += clock.o irq.o time.o
17
18obj-$(CONFIG_PUV3_GPIO) += gpio.o
19obj-$(CONFIG_PUV3_RTC) += rtc.o
20obj-$(CONFIG_PUV3_PWM) += pwm.o
21obj-$(CONFIG_PUV3_PM) += pm.o sleep.o
22obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate_asm.o
23
24obj-$(CONFIG_PCI) += pci.o
25
26# obj-y for specific machines
27obj-$(CONFIG_ARCH_PUV3) += puv3-core.o
28obj-$(CONFIG_PUV3_NB0916) += puv3-nb0916.o
29
30head-y := head.o
31obj-$(CONFIG_DEBUG_LL) += debug.o
32
33extra-y := $(head-y) init_task.o vmlinux.lds
diff --git a/arch/unicore32/kernel/vmlinux.lds.S b/arch/unicore32/kernel/vmlinux.lds.S
new file mode 100644
index 000000000000..0b4eb89729e7
--- /dev/null
+++ b/arch/unicore32/kernel/vmlinux.lds.S
@@ -0,0 +1,61 @@
1/*
2 * linux/arch/unicore32/kernel/vmlinux.lds.S
3 *
4 * Code specific to PKUnity SoC and UniCore ISA
5 *
6 * Copyright (C) 2001-2010 GUAN Xue-tao
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <asm-generic/vmlinux.lds.h>
14#include <asm/thread_info.h>
15#include <asm/memory.h>
16#include <asm/page.h>
17
18OUTPUT_ARCH(unicore32)
19ENTRY(stext)
20
21jiffies = jiffies_64;
22
23SECTIONS
24{
25 . = PAGE_OFFSET + KERNEL_IMAGE_START;
26
27 _text = .;
28 __init_begin = .;
29 HEAD_TEXT_SECTION
30 INIT_TEXT_SECTION(PAGE_SIZE)
31 INIT_DATA_SECTION(16)
32 PERCPU(PAGE_SIZE)
33 __init_end = .;
34
35 _stext = .;
36 .text : { /* Real text segment */
37 TEXT_TEXT
38 SCHED_TEXT
39 LOCK_TEXT
40
41 *(.fixup)
42 *(.gnu.warning)
43 }
44 _etext = .;
45
46 _sdata = .;
47 RO_DATA_SECTION(PAGE_SIZE)
48 RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
49 _edata = .;
50
51 EXCEPTION_TABLE(32)
52 NOTES
53
54 BSS_SECTION(0, 0, 0)
55 _end = .;
56
57 STABS_DEBUG
58 DWARF_DEBUG
59
60 DISCARDS /* Exit code and data */
61}