aboutsummaryrefslogtreecommitdiffstats
path: root/arch/hexagon
diff options
context:
space:
mode:
authorRichard Kuo <rkuo@codeaurora.org>2011-10-31 19:55:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-01 10:34:21 -0400
commite95bf452a9e22bd1c9ae23fea041989e0603c39d (patch)
treefd18331fe343605c4d751237d191bdd258cd721c /arch/hexagon
parent60e13231561b3a4c5269bfa1ef6c0569ad6f28ec (diff)
Hexagon: Add configuration and makefiles for the Hexagon architecture.
Signed-off-by: Linas Vepstas <linas@codeaurora.org> Signed-off-by: Richard Kuo <rkuo@codeaurora.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/hexagon')
-rw-r--r--arch/hexagon/Kconfig220
-rw-r--r--arch/hexagon/Makefile58
-rw-r--r--arch/hexagon/kernel/Makefile18
-rw-r--r--arch/hexagon/kernel/asm-offsets.c104
-rw-r--r--arch/hexagon/kernel/vmlinux.lds.S88
-rw-r--r--arch/hexagon/lib/Makefile4
-rw-r--r--arch/hexagon/mm/Makefile6
7 files changed, 498 insertions, 0 deletions
diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig
new file mode 100644
index 000000000000..02513c2dd5ec
--- /dev/null
+++ b/arch/hexagon/Kconfig
@@ -0,0 +1,220 @@
1# Hexagon configuration
2comment "Linux Kernel Configuration for Hexagon"
3
4config HEXAGON
5 def_bool y
6 select HAVE_OPROFILE
7 select USE_GENERIC_SMP_HELPERS if SMP
8 # Other pending projects/to-do items.
9 # select HAVE_REGS_AND_STACK_ACCESS_API
10 # select HAVE_HW_BREAKPOINT if PERF_EVENTS
11 # select ARCH_HAS_CPU_IDLE_WAIT
12 # select ARCH_WANT_OPTIONAL_GPIOLIB
13 # select ARCH_REQUIRE_GPIOLIB
14 # select HAVE_CLK
15 # select IRQ_PER_CPU
16 select HAVE_IRQ_WORK
17 # select GENERIC_PENDING_IRQ if SMP
18 select GENERIC_ATOMIC64
19 select HAVE_PERF_EVENTS
20 select HAVE_GENERIC_HARDIRQS
21 select GENERIC_HARDIRQS_NO__DO_IRQ
22 select GENERIC_HARDIRQS_NO_DEPRECATED
23 # GENERIC_ALLOCATOR is used by dma_alloc_coherent()
24 select GENERIC_ALLOCATOR
25 select GENERIC_IRQ_SHOW
26 select HAVE_ARCH_KGDB
27 select HAVE_ARCH_TRACEHOOK
28 select NO_IOPORT
29 # mostly generic routines, with some accelerated ones
30 ---help---
31 Qualcomm Hexagon is a processor architecture designed for high
32 performance and low power across a wide variety of applications.
33
34config HEXAGON_ARCH_V1
35 bool
36
37config HEXAGON_ARCH_V2
38 bool
39
40config HEXAGON_ARCH_V3
41 bool
42
43config HEXAGON_ARCH_V4
44 bool
45
46config FRAME_POINTER
47 def_bool y
48
49config LOCKDEP_SUPPORT
50 def_bool y
51
52config PCI
53 def_bool n
54
55config EARLY_PRINTK
56 def_bool y
57
58config KTIME_SCALAR
59 def_bool y
60
61config MMU
62 def_bool y
63
64config TRACE_IRQFLAGS_SUPPORT
65 def_bool y
66
67config GENERIC_CSUM
68 def_bool y
69
70#
71# Use the generic interrupt handling code in kernel/irq/:
72#
73config GENERIC_IRQ_PROBE
74 def_bool y
75
76config GENERIC_IOMAP
77 def_bool y
78
79#config ZONE_DMA
80# bool
81# default y
82
83config HAS_DMA
84 bool
85 select HAVE_DMA_ATTRS
86 default y
87
88config NEED_SG_DMA_LENGTH
89 def_bool y
90
91config RWSEM_GENERIC_SPINLOCK
92 def_bool n
93
94config RWSEM_XCHGADD_ALGORITHM
95 def_bool y
96
97config GENERIC_FIND_NEXT_BIT
98 def_bool y
99
100config GENERIC_HWEIGHT
101 def_bool y
102
103config GENERIC_TIME
104 def_bool y
105
106config GENERIC_CLOCKEVENTS
107 def_bool y
108
109config GENERIC_CLOCKEVENTS_BROADCAST
110 def_bool y
111
112config STACKTRACE_SUPPORT
113 def_bool y
114 select STACKTRACE
115
116config GENERIC_BUG
117 def_bool y
118 depends on BUG
119
120config BUG
121 def_bool y
122
123menu "Machine selection"
124
125choice
126 prompt "System type"
127 default HEXAGON_ARCH_V2
128
129config HEXAGON_COMET
130 bool "Comet Board"
131 select HEXAGON_ARCH_V2
132 ---help---
133 Support for the Comet platform.
134
135endchoice
136
137config HEXAGON_VM
138 def_bool y
139
140config CMDLINE
141 string "Default kernel command string"
142 default ""
143 help
144 On some platforms, there is currently no way for the boot loader
145 to pass arguments to the kernel. For these, you should supply some
146 command-line options at build time by entering them here. At a
147 minimum, you should specify the memory size and the root device
148 (e.g., mem=64M root=/dev/nfs).
149
150config HEXAGON_ANGEL_TRAPS
151 bool "Use Angel Traps"
152 default n
153 ---help---
154 Enable angel debug traps (for printk's).
155
156config SMP
157 bool "Multi-Processing support"
158 ---help---
159 Enables SMP support in the kernel. If unsure, say "Y"
160
161config NR_CPUS
162 int "Maximum number of CPUs" if SMP
163 range 2 6 if SMP
164 default "1" if !SMP
165 default "6" if SMP
166 ---help---
167 This allows you to specify the maximum number of CPUs which this
168 kernel will support. The maximum supported value is 6 and the
169 minimum value which makes sense is 2.
170
171 This is purely to save memory - each supported CPU adds
172 approximately eight kilobytes to the kernel image.
173
174choice
175 prompt "Kernel page size"
176 default PAGE_SIZE_4KB
177 ---help---
178 Changes the default page size; use with caution.
179
180config PAGE_SIZE_4KB
181 bool "4KB"
182
183config PAGE_SIZE_16KB
184 bool "16KB"
185
186config PAGE_SIZE_64KB
187 bool "64KB"
188
189config PAGE_SIZE_256KB
190 bool "256KB"
191
192endchoice
193
194source "mm/Kconfig"
195
196source "kernel/Kconfig.hz"
197source "kernel/time/Kconfig"
198
199config GENERIC_GPIO
200 bool "Generic GPIO support"
201 default n
202
203endmenu
204
205source "init/Kconfig"
206source "drivers/Kconfig"
207source "fs/Kconfig"
208
209menu "Executable File Formats"
210source "fs/Kconfig.binfmt"
211endmenu
212
213source "net/Kconfig"
214source "security/Kconfig"
215source "crypto/Kconfig"
216source "lib/Kconfig"
217
218menu "Kernel hacking"
219source "lib/Kconfig.debug"
220endmenu
diff --git a/arch/hexagon/Makefile b/arch/hexagon/Makefile
new file mode 100644
index 000000000000..0c4de8790fd5
--- /dev/null
+++ b/arch/hexagon/Makefile
@@ -0,0 +1,58 @@
1# Makefile for the Hexagon arch
2
3KBUILD_DEFCONFIG = comet_defconfig
4
5# Do not use GP-relative jumps
6KBUILD_CFLAGS += -G0
7LDFLAGS_vmlinux += -G0
8
9# Do not use single-byte enums; these will overflow.
10KBUILD_CFLAGS += -fno-short-enums
11
12# Modules must use either long-calls, or use pic/plt.
13# Use long-calls for now, it's easier. And faster.
14# CFLAGS_MODULE += -fPIC
15# LDFLAGS_MODULE += -shared
16CFLAGS_MODULE += -mlong-calls
17
18cflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
19cflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
20cflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
21cflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)
22
23aflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
24aflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
25aflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
26aflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)
27
28ldflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
29ldflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
30ldflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
31ldflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)
32
33KBUILD_CFLAGS += $(cflags-y)
34KBUILD_AFLAGS += $(aflags-y)
35
36# no KBUILD_LDFLAGS?
37LDFLAGS += $(ldflags-y)
38
39# Thread-info register will be r19. This value is not configureable;
40# it is hard-coded in several files.
41TIR_NAME := r19
42KBUILD_CFLAGS += -ffixed-$(TIR_NAME) -DTHREADINFO_REG=$(TIR_NAME) -D__linux__
43KBUILD_AFLAGS += -DTHREADINFO_REG=$(TIR_NAME)
44
45LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
46libs-y += $(LIBGCC)
47
48head-y := arch/hexagon/kernel/head.o \
49 arch/hexagon/kernel/init_task.o
50
51core-y += arch/hexagon/kernel/ \
52 arch/hexagon/mm/ \
53 arch/hexagon/lib/
54
55# arch/hexagon/platform/common/
56#
57#core-$(CONFIG_HEXAGON_COMET) += arch/hexagon/platform/comet/
58#machine-$(CONFIG_HEXAGON_COMET) := comet
diff --git a/arch/hexagon/kernel/Makefile b/arch/hexagon/kernel/Makefile
new file mode 100644
index 000000000000..3689f3754d09
--- /dev/null
+++ b/arch/hexagon/kernel/Makefile
@@ -0,0 +1,18 @@
1extra-y := head.o vmlinux.lds init_task.o
2
3obj-$(CONFIG_SMP) += smp.o topology.o
4
5obj-y += setup.o irq_cpu.o traps.o syscalltab.o signal.o time.o
6obj-y += process.o syscall.o trampoline.o reset.o ptrace.o
7obj-y += vdso.o
8
9obj-$(CONFIG_KGDB) += kgdb.o
10obj-$(CONFIG_MODULES) += module.o hexagon_ksyms.o
11
12# Modules required to work with the Hexagon Virtual Machine
13obj-y += vm_entry.o vm_events.o vm_switch.o vm_ops.o vm_init_segtable.o
14obj-y += vm_vectors.o
15
16obj-$(CONFIG_HAS_DMA) += dma.o
17
18obj-$(CONFIG_STACKTRACE) += stacktrace.o
diff --git a/arch/hexagon/kernel/asm-offsets.c b/arch/hexagon/kernel/asm-offsets.c
new file mode 100644
index 000000000000..89ffa514611f
--- /dev/null
+++ b/arch/hexagon/kernel/asm-offsets.c
@@ -0,0 +1,104 @@
1/*
2 * Copyright (C) 1996 David S. Miller
3 * Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Ralf Baechle
4 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
5 * Kevin Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
6 * Copyright (C) 2000 MIPS Technologies, Inc.
7 *
8 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 and
12 * only version 2 as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 * 02110-1301, USA.
23 */
24
25#include <linux/compat.h>
26#include <linux/types.h>
27#include <linux/sched.h>
28#include <linux/mm.h>
29#include <linux/interrupt.h>
30#include <linux/kbuild.h>
31#include <asm/ptrace.h>
32#include <asm/processor.h>
33
34/* This file is used to produce asm/linkerscript constants from header
35 files typically used in c. Specifically, it generates asm-offsets.h */
36
37int main(void)
38{
39 COMMENT("This is a comment.");
40 /* might get these from somewhere else. */
41 DEFINE(_PAGE_SIZE, PAGE_SIZE);
42 DEFINE(_PAGE_SHIFT, PAGE_SHIFT);
43 BLANK();
44
45 COMMENT("Hexagon pt_regs definitions");
46 OFFSET(_PT_SYSCALL_NR, pt_regs, syscall_nr);
47 OFFSET(_PT_UGPGP, pt_regs, ugpgp);
48 OFFSET(_PT_R3130, pt_regs, r3130);
49 OFFSET(_PT_R2928, pt_regs, r2928);
50 OFFSET(_PT_R2726, pt_regs, r2726);
51 OFFSET(_PT_R2524, pt_regs, r2524);
52 OFFSET(_PT_R2322, pt_regs, r2322);
53 OFFSET(_PT_R2120, pt_regs, r2120);
54 OFFSET(_PT_R1918, pt_regs, r1918);
55 OFFSET(_PT_R1716, pt_regs, r1716);
56 OFFSET(_PT_R1514, pt_regs, r1514);
57 OFFSET(_PT_R1312, pt_regs, r1312);
58 OFFSET(_PT_R1110, pt_regs, r1110);
59 OFFSET(_PT_R0908, pt_regs, r0908);
60 OFFSET(_PT_R0706, pt_regs, r0706);
61 OFFSET(_PT_R0504, pt_regs, r0504);
62 OFFSET(_PT_R0302, pt_regs, r0302);
63 OFFSET(_PT_R0100, pt_regs, r0100);
64 OFFSET(_PT_LC0SA0, pt_regs, lc0sa0);
65 OFFSET(_PT_LC1SA1, pt_regs, lc1sa1);
66 OFFSET(_PT_M1M0, pt_regs, m1m0);
67 OFFSET(_PT_PREDSUSR, pt_regs, predsusr);
68 OFFSET(_PT_EVREC, pt_regs, hvmer);
69 OFFSET(_PT_ER_VMEL, pt_regs, hvmer.vmel);
70 OFFSET(_PT_ER_VMEST, pt_regs, hvmer.vmest);
71 OFFSET(_PT_ER_VMPSP, pt_regs, hvmer.vmpsp);
72 OFFSET(_PT_ER_VMBADVA, pt_regs, hvmer.vmbadva);
73 DEFINE(_PT_REGS_SIZE, sizeof(struct pt_regs));
74 BLANK();
75
76 COMMENT("Hexagon thread_info definitions");
77 OFFSET(_THREAD_INFO_FLAGS, thread_info, flags);
78 OFFSET(_THREAD_INFO_PT_REGS, thread_info, regs);
79 OFFSET(_THREAD_INFO_SP, thread_info, sp);
80 DEFINE(_THREAD_SIZE, THREAD_SIZE);
81 BLANK();
82
83 COMMENT("Hexagon hexagon_switch_stack definitions");
84 OFFSET(_SWITCH_R1716, hexagon_switch_stack, r1716);
85 OFFSET(_SWITCH_R1918, hexagon_switch_stack, r1918);
86 OFFSET(_SWITCH_R2120, hexagon_switch_stack, r2120);
87 OFFSET(_SWITCH_R2322, hexagon_switch_stack, r2322);
88
89 OFFSET(_SWITCH_R2524, hexagon_switch_stack, r2524);
90 OFFSET(_SWITCH_R2726, hexagon_switch_stack, r2726);
91 OFFSET(_SWITCH_FP, hexagon_switch_stack, fp);
92 OFFSET(_SWITCH_LR, hexagon_switch_stack, lr);
93 DEFINE(_SWITCH_STACK_SIZE, sizeof(struct hexagon_switch_stack));
94 BLANK();
95
96 COMMENT("Hexagon task_struct definitions");
97 OFFSET(_TASK_THREAD_INFO, task_struct, stack);
98 OFFSET(_TASK_STRUCT_THREAD, task_struct, thread);
99
100 COMMENT("Hexagon thread_struct definitions");
101 OFFSET(_THREAD_STRUCT_SWITCH_SP, thread_struct, switch_sp);
102
103 return 0;
104}
diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S
new file mode 100644
index 000000000000..071d3c30edfb
--- /dev/null
+++ b/arch/hexagon/kernel/vmlinux.lds.S
@@ -0,0 +1,88 @@
1/*
2 * Linker script for Hexagon kernel
3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
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 and
8 * only version 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 * 02110-1301, USA.
19 */
20
21#define LOAD_OFFSET PAGE_OFFSET
22
23#include <asm-generic/vmlinux.lds.h>
24#include <asm/asm-offsets.h> /* Most of the kernel defines are here */
25#include <asm/mem-layout.h> /* except for page_offset */
26#include <asm/cache.h> /* and now we're pulling cache line size */
27OUTPUT_ARCH(hexagon)
28ENTRY(stext)
29
30jiffies = jiffies_64;
31
32/*
33See asm-generic/vmlinux.lds.h for expansion of some of these macros.
34See asm-generic/sections.h for seemingly required labels.
35*/
36
37#define PAGE_SIZE _PAGE_SIZE
38
39/* This LOAD_OFFSET is temporary for debugging on the simulator; it may change
40 for hypervisor pseudo-physical memory. */
41
42
43SECTIONS
44{
45 . = PAGE_OFFSET + LOAD_ADDRESS;
46
47 __init_begin = .;
48 HEAD_TEXT_SECTION
49 INIT_TEXT_SECTION(PAGE_SIZE)
50 PERCPU_SECTION(L1_CACHE_BYTES)
51 __init_end = .;
52
53 . = ALIGN(_PAGE_SIZE);
54 _stext = .;
55 .text : AT(ADDR(.text) - LOAD_OFFSET) {
56 _text = .;
57 TEXT_TEXT
58 SCHED_TEXT
59 LOCK_TEXT
60 KPROBES_TEXT
61 *(.fixup)
62 }
63 _etext = .;
64
65 INIT_DATA_SECTION(PAGE_SIZE)
66
67 _sdata = .;
68 RW_DATA_SECTION(32,PAGE_SIZE,PAGE_SIZE)
69 RO_DATA_SECTION(PAGE_SIZE)
70 _edata = .;
71
72 EXCEPTION_TABLE(16)
73 NOTES
74
75 BSS_SECTION(_PAGE_SIZE, _PAGE_SIZE, _PAGE_SIZE)
76
77 _end = .;
78
79 /DISCARD/ : {
80 EXIT_TEXT
81 EXIT_DATA
82 EXIT_CALL
83 }
84
85 STABS_DEBUG
86 DWARF_DEBUG
87
88}
diff --git a/arch/hexagon/lib/Makefile b/arch/hexagon/lib/Makefile
new file mode 100644
index 000000000000..874655e85671
--- /dev/null
+++ b/arch/hexagon/lib/Makefile
@@ -0,0 +1,4 @@
1#
2# Makefile for hexagon-specific library files.
3#
4obj-y = checksum.o io.o memcpy.o memset.o
diff --git a/arch/hexagon/mm/Makefile b/arch/hexagon/mm/Makefile
new file mode 100644
index 000000000000..1a0be4d576e1
--- /dev/null
+++ b/arch/hexagon/mm/Makefile
@@ -0,0 +1,6 @@
1#
2# Makefile for Hexagon memory management subsystem
3#
4
5obj-y := init.o pgalloc.o ioremap.o uaccess.o vm_fault.o cache.o
6obj-y += copy_to_user.o copy_from_user.o strnlen_user.o vm_tlb.o