aboutsummaryrefslogtreecommitdiffstats
path: root/arch/hexagon/kernel
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/kernel
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/kernel')
-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
3 files changed, 210 insertions, 0 deletions
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}