[PATCH 15/56] microblaze_v2: head.S + linker script

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: monstr
Date: Sunday, May 4, 2008 - 4:41 am

From: Michal Simek <monstr@monstr.eu>


Signed-off-by: Michal Simek <monstr@monstr.eu>
---
 arch/microblaze/kernel/head.S        |   40 +++++++++
 arch/microblaze/kernel/vmlinux.lds.S |  145 ++++++++++++++++++++++++++++++++++
 2 files changed, 185 insertions(+), 0 deletions(-)
 create mode 100644 arch/microblaze/kernel/head.S
 create mode 100644 arch/microblaze/kernel/vmlinux.lds.S

diff --git a/arch/microblaze/kernel/head.S b/arch/microblaze/kernel/head.S
new file mode 100644
index 0000000..8ca148b
--- /dev/null
+++ b/arch/microblaze/kernel/head.S
@@ -0,0 +1,40 @@
+/*
+ * arch/microblaze/kernel/head.S
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2007 Michal Simek <monstr@monstr.eu>
+ * Copyright (C) 2006 Atmark Techno, Inc.
+ */
+
+#include <linux/linkage.h>
+#include <asm/thread_info.h>
+
+	.text
+ENTRY(_start)
+	mfs	r1, rmsr
+	andi	r1, r1, ~2
+	mts	rmsr, r1
+
+	/* Initialize small data anchors */
+	la	r13, r0, _KERNEL_SDA_BASE_
+	la	r2, r0, _KERNEL_SDA2_BASE_
+
+	/* Initialize stack pointer */
+	la	r1, r0, init_thread_union + THREAD_SIZE - 4
+
+	/* Initialize r31 with current task address */
+	la	r31, r0, init_task
+
+	/* Call platform dependent initialize function.
+	 * Please see $(ARCH)/mach-$(SUBARCH)/setup.c for
+	 * the function. */
+	la	r8, r0, machine_early_init
+	brald	r15, r8
+	nop
+
+	la	r15, r0, machine_halt
+	braid	start_kernel
+	nop
diff --git a/arch/microblaze/kernel/vmlinux.lds.S b/arch/microblaze/kernel/vmlinux.lds.S
new file mode 100644
index 0000000..8940f1f
--- /dev/null
+++ b/arch/microblaze/kernel/vmlinux.lds.S
@@ -0,0 +1,145 @@
+/*
+ * arch/microblaze/kernel/vmlinux.lds.S
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2006 Atmark Techno, Inc.
+ */
+
+OUTPUT_FORMAT("elf32-microblaze", "elf32-microblaze", "elf32-microblaze")
+OUTPUT_ARCH(microblaze)
+ENTRY(_start)
+
+#include <linux/autoconf.h>
+#include <asm-generic/vmlinux.lds.h>
+
+jiffies = jiffies_64 + 4;
+
+SECTIONS {
+	. = CONFIG_KERNEL_BASE_ADDR;
+
+	.text : {
+		_text = . ;
+		_stext = . ;
+		TEXT_TEXT
+		SCHED_TEXT
+		LOCK_TEXT
+		. = ALIGN (4) ;
+		_etext = . ;
+	}
+
+	. = ALIGN(16);
+	RODATA
+
+	/* sdata2 section can go anywhere, but must be word aligned
+	 and SDA2_BASE must point to the middle of it */
+	.sdata2 : {
+		_ssrw = .;
+		. = ALIGN(0x8);
+		*(.sdata2)
+	. = ALIGN(8);
+	_essrw = .;
+	_ssrw_size = _essrw - _ssrw;
+	_KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2);
+	}
+
+	_sdata = . ;
+	.data ALIGN (0x4) : {
+		DATA_DATA
+	}
+	. = ALIGN(32);
+	.data.cacheline_aligned : { *(.data.cacheline_aligned) }
+	_edata = . ;
+
+	/* The initial task */
+	. = ALIGN(8192);
+	.data.init_task : { *(.data.init_task) }
+
+	/* Under the microblaze ABI, .sdata and .sbss must be contiguous */
+	. = ALIGN(8);
+	.sdata : {
+		_ssro = .;
+		*(.sdata)
+	}
+
+	.sbss :	{
+		_ssbss = .;
+		*(.sbss)
+		_esbss = .;
+		_essro = .;
+		_ssro_size = _essro - _ssro ;
+		_KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ;
+	}
+
+	. = ALIGN(16);
+	__start___ex_table = .;
+	__ex_table : { *(__ex_table) }
+	__stop___ex_table = .;
+
+	__init_begin = .;
+
+	. = ALIGN(4096);
+	.init.text : {
+		_sinittext = . ;
+		*(.init.text)
+		*(.exit.text)
+		*(.exit.data)
+		_einittext = .;
+	}
+
+	.init.data : { *(.init.data) }
+
+	. = ALIGN(4);
+	.init.ivt : {
+		__ivt_start = .;
+		*(.init.ivt)
+		__ivt_end = .;
+	}
+
+	.init.setup : {
+		__setup_start = .;
+		*(.init.setup)
+		__setup_end = .;
+	}
+
+	.initcall.init : {
+		__initcall_start = .;
+		INITCALLS
+		__initcall_end = .;
+	}
+
+	.con_initcall.init : {
+		__con_initcall_start = .;
+		*(.con_initcall.init)
+		__con_initcall_end = .;
+	}
+
+	__init_end_before_initramfs = .;
+
+	.init.ramfs ALIGN(4096) : {
+		__initramfs_start = .;
+		*(.init.ramfs)
+		__initramfs_end = .;
+		. = ALIGN(4);
+		LONG(0);
+		. = ALIGN(4096);/* Pad init.ramfs up to page boundary, so
+				that __init_end == __bss_start. This will
+				make image.elf consistent with the image.bin */
+	}
+
+	__init_end = .;
+
+	.bss ALIGN (4096) : {
+		__bss_start = . ;
+			*(.bss*)
+			*(COMMON)
+		. = ALIGN (4) ;
+		__bss_stop = . ;
+		_ebss = . ;
+	}
+	. = ALIGN(4096);
+	_end = .;
+}
+
-- 
1.5.4.GIT

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Microblaze patches V2, monstr, (Sun May 4, 4:40 am)
[PATCH 01/56] microblaze_v2: Kconfig patches, monstr, (Sun May 4, 4:40 am)
[PATCH 03/56] microblaze_v2: Cpuinfo handling, monstr, (Sun May 4, 4:40 am)
[PATCH 07/56] microblaze_v2: Signal support, monstr, (Sun May 4, 4:40 am)
[PATCH 09/56] microblaze_v2: cache support, monstr, (Sun May 4, 4:40 am)
[PATCH 12/56] microblaze_v2: lmb support, monstr, (Sun May 4, 4:41 am)
[PATCH 14/56] microblaze_v2: defconfig file, monstr, (Sun May 4, 4:41 am)
[PATCH 15/56] microblaze_v2: head.S + linker script, monstr, (Sun May 4, 4:41 am)
[PATCH 17/56] microblaze_v2: checksum support, monstr, (Sun May 4, 4:41 am)
[PATCH 19/56] microblaze_v2: uaccess files, monstr, (Sun May 4, 4:41 am)
[PATCH 20/56] microblaze_v2: heartbeat file, monstr, (Sun May 4, 4:41 am)
[PATCH 22/56] microblaze_v2: asm-offsets, monstr, (Sun May 4, 4:41 am)
[PATCH 24/56] microblaze_v2: time support, monstr, (Sun May 4, 4:41 am)
[PATCH 25/56] microblaze_v2: ptrace support, monstr, (Sun May 4, 4:41 am)
[PATCH 26/56] microblaze_v2: traps support, monstr, (Sun May 4, 4:41 am)
[PATCH 33/56] microblaze_v2: ioctl support, monstr, (Sun May 4, 4:41 am)
[PATCH 36/56] microblaze_v2: dma support, monstr, (Sun May 4, 4:41 am)
[PATCH 37/56] microblaze_v2: headers for irq, monstr, (Sun May 4, 4:41 am)
[PATCH 42/56] microblaze_v2: stats headers, monstr, (Sun May 4, 4:41 am)
[PATCH 48/56] microblaze_v2: pool.h socket.h, monstr, (Sun May 4, 4:41 am)
[PATCH 51/56] microblaze_v2: Kbuild file, monstr, (Sun May 4, 4:41 am)
[PATCH 52/56] microblaze_v2: pci headers, monstr, (Sun May 4, 4:41 am)
[PATCH 53/56] microblaze_v2: IPC headers, monstr, (Sun May 4, 4:41 am)
[PATCH 54/56] microblaze_v2: entry.S, monstr, (Sun May 4, 4:41 am)
[PATCH 55/56] microblaze_v2: sys_microblaze.c, monstr, (Sun May 4, 4:41 am)
Re: [PATCH 07/56] microblaze_v2: Signal support, Arnd Bergmann, (Sun May 4, 12:52 pm)
Re: [PATCH 17/56] microblaze_v2: checksum support, Arnd Bergmann, (Sun May 4, 12:59 pm)
Re: [PATCH 30/56] microblaze_v2: includes SHM*, msgbuf, Arnd Bergmann, (Sun May 4, 2:10 pm)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, Grant Likely, (Sun May 4, 2:24 pm)
Re: [PATCH 32/56] microblaze_v2: definitions of types, Arnd Bergmann, (Sun May 4, 2:28 pm)
Re: [PATCH 33/56] microblaze_v2: ioctl support, Arnd Bergmann, (Sun May 4, 2:34 pm)
Re: [PATCH 42/56] microblaze_v2: stats headers, Arnd Bergmann, (Sun May 4, 3:31 pm)
Re: [PATCH 48/56] microblaze_v2: pool.h socket.h, Arnd Bergmann, (Sun May 4, 3:39 pm)
Re: [PATCH 52/56] microblaze_v2: pci headers, Arnd Bergmann, (Sun May 4, 3:45 pm)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, John Williams, (Sun May 4, 6:42 pm)
Re: [PATCH 03/56] microblaze_v2: Cpuinfo handling, John Williams, (Sun May 4, 6:52 pm)
Re: [PATCH 09/56] microblaze_v2: cache support, John Williams, (Sun May 4, 7:09 pm)
Re: [PATCH 12/56] microblaze_v2: lmb support, John Williams, (Sun May 4, 7:11 pm)
Re: [PATCH 24/56] microblaze_v2: time support, John Williams, (Sun May 4, 7:19 pm)
Re: [PATCH 36/56] microblaze_v2: dma support, John Williams, (Sun May 4, 7:25 pm)
Re: Microblaze patches V2, John Williams, (Sun May 4, 7:30 pm)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, Michal Simek, (Sun May 4, 11:36 pm)
Re: [PATCH 36/56] microblaze_v2: dma support, Geert Uytterhoeven, (Sun May 4, 11:45 pm)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, Michal Simek, (Sun May 4, 11:46 pm)
Re: Microblaze patches V2, Michal Simek, (Mon May 5, 12:02 am)
Re: [PATCH 43/56] microblaze_v2: termbits.h termios.h, Arnd Bergmann, (Mon May 5, 2:50 am)
Re: [PATCH 17/56] microblaze_v2: checksum support, Michal Simek, (Mon May 5, 7:05 am)
Re: [PATCH 33/56] microblaze_v2: ioctl support, Michal Simek, (Mon May 5, 7:06 am)
Re: [PATCH 52/56] microblaze_v2: pci headers, Michal Simek, (Mon May 5, 7:08 am)
Re: [PATCH 01/56] microblaze_v2: Kconfig patches, Michal Simek, (Mon May 5, 7:16 am)
Re: [PATCH 03/56] microblaze_v2: Cpuinfo handling, Michal Simek, (Mon May 5, 7:19 am)
Re: [PATCH 24/56] microblaze_v2: time support, Michal Simek, (Mon May 5, 7:22 am)
Re: [PATCH 04/56] microblaze_v2: Open firmware files, Grant Likely, (Mon May 5, 7:24 am)
Re: [PATCH 18/56] microblaze_v2: early_printk support, Grant Likely, (Mon May 5, 7:36 am)
RE: [PATCH 10/56] microblaze_v2: Generic dts file for plat ..., Stephen Neuendorffer, (Mon May 5, 10:25 am)
RE: [microblaze-uclinux] [PATCH 09/56] microblaze_v2: cach ..., Stephen Neuendorffer, (Mon May 5, 10:37 am)
Re: [PATCH 18/56] microblaze_v2: early_printk support, Michal Simek, (Mon May 5, 1:10 pm)
Re: [PATCH 12/56] microblaze_v2: lmb support, Segher Boessenkool, (Mon May 5, 2:32 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, Stephen Neuendorffer, (Mon May 5, 2:32 pm)
RE: [PATCH 04/56] microblaze_v2: Open firmware files, Stephen Neuendorffer, (Mon May 5, 2:56 pm)
RE: [PATCH 09/56] microblaze_v2: cache support, Stephen Neuendorffer, (Mon May 5, 3:37 pm)
Re: [PATCH 18/56] microblaze_v2: early_printk support, John Williams, (Mon May 5, 4:22 pm)
RE: [PATCH 10/56] microblaze_v2: Generic dts file for plat ..., Stephen Neuendorffer, (Mon May 5, 4:32 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, John Williams, (Mon May 5, 4:33 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, Stephen Neuendorffer, (Mon May 5, 5:13 pm)
RE: [PATCH 10/56] microblaze_v2: Generic dts file for plat ..., Stephen Neuendorffer, (Mon May 5, 5:17 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, John Williams, (Mon May 5, 5:25 pm)
Re: [PATCH 24/56] microblaze_v2: time support, John Williams, (Mon May 5, 5:30 pm)
RE: [PATCH 07/56] microblaze_v2: Signal support, Stephen Neuendorffer, (Mon May 5, 5:33 pm)
Re: [PATCH 04/56] microblaze_v2: Open firmware files, Michal Simek, (Tue May 6, 12:27 am)
Re: [PATCH 18/56] microblaze_v2: early_printk support, Michal Simek, (Tue May 6, 1:14 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Tue May 6, 2:16 am)
Re: [PATCH 07/56] microblaze_v2: Signal support, Michal Simek, (Tue May 6, 2:41 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Geert Uytterhoeven, (Tue May 6, 2:48 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Tue May 6, 2:53 am)
Re: [PATCH 24/56] microblaze_v2: time support, Michal Simek, (Tue May 6, 2:56 am)
Re: [PATCH 24/56] microblaze_v2: time support, Michal Simek, (Tue May 6, 3:02 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Geert Uytterhoeven, (Tue May 6, 4:17 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Arnd Bergmann, (Tue May 6, 4:24 am)
Re: [PATCH 24/56] microblaze_v2: time support, Arnd Bergmann, (Tue May 6, 4:38 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Tue May 6, 6:20 am)
Re: [PATCH 24/56] microblaze_v2: time support, Michal Simek, (Tue May 6, 6:26 am)
Re: [PATCH 24/56] microblaze_v2: time support, Grant Likely, (Tue May 6, 7:28 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Arnd Bergmann, (Tue May 6, 8:36 am)
RE: [PATCH 24/56] microblaze_v2: time support, Stephen Neuendorffer, (Tue May 6, 9:36 am)
Re: [PATCH 46/56] microblaze_v2: headers files entry.h cur ..., Geert Uytterhoeven, (Tue May 6, 1:57 pm)
Re: [PATCH 24/56] microblaze_v2: time support, John Williams, (Tue May 6, 3:50 pm)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Tue May 6, 11:24 pm)
Re: [PATCH 36/56] microblaze_v2: dma support, Geert Uytterhoeven, (Wed May 7, 12:17 am)
Re: [PATCH 24/56] microblaze_v2: time support, Thomas Gleixner, (Wed May 7, 12:22 am)
Re: [PATCH 37/56] microblaze_v2: headers for irq, Thomas Gleixner, (Wed May 7, 12:26 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Arnd Bergmann, (Wed May 7, 2:21 am)
RE: [microblaze-uclinux] [PATCH 04/56] microblaze_v2: Open ..., Stephen Neuendorffer, (Wed May 7, 9:04 am)
Re: [PATCH 36/56] microblaze_v2: dma support, Michal Simek, (Wed May 7, 11:43 am)
RE: [microblaze-uclinux] [PATCH 04/56] microblaze_v2: Open ..., Stephen Neuendorffer, (Wed May 7, 1:14 pm)
Re: [PATCH 37/56] microblaze_v2: headers for irq, Michal Simek, (Sun May 11, 6:56 am)