[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] [PATCH 15/56] microblaze_v2: head.S + linker script
- To: linux-kernel@xxxxxxxxxxxxxxx
- Subject: [microblaze-uclinux] [PATCH 15/56] microblaze_v2: head.S + linker script
- From: monstr@xxxxxxxxx
- Date: Sun, 4 May 2008 13:41:04 +0200
- Cc: arnd@xxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, stephen.neuendorffer@xxxxxxxxxx, John.Linn@xxxxxxxxxx, john.williams@xxxxxxxxxxxxx, matthew@xxxxxx, will.newton@xxxxxxxxx, drepper@xxxxxxxxxx, microblaze-uclinux@xxxxxxxxxxxxxx, grant.likely@xxxxxxxxxxxx, Michal Simek <monstr@xxxxxxxxx>
- In-reply-to: <f0c837df4106a31c1a81917596603918f722ea7b.1209897266.git.monstr@xxxxxxxxx>
- In-reply-to: <a4a778e34c66d126f5c4bf1ca423cf32950ea5ab.1209897266.git.monstr@xxxxxxxxx>
- References: <1209901305-6404-1-git-send-email-monstr@xxxxxxxxx> <a4a778e34c66d126f5c4bf1ca423cf32950ea5ab.1209897266.git.monstr@xxxxxxxxx> <c805caeb1dd7f6d1349c4a463cb88a5342a170d2.1209897266.git.monstr@xxxxxxxxx> <f120ababf2bade9aab7199bffb3014aa606e5a1c.1209897266.git.monstr@xxxxxxxxx> <684c36e5ad3f598e5079e88ec195545c4a7150c2.1209897266.git.monstr@xxxxxxxxx> <ed3695121faf485d491cecdd96d5d4dcc498411d.1209897266.git.monstr@xxxxxxxxx> <0674b1f7abb9a3d564b68c95bc28adc2c2fe9551.1209897266.git.monstr@xxxxxxxxx> <9a7c6646e5dd9724c1cf34767adec181481fa3ef.1209897266.git.monstr@xxxxxxxxx> <932956128c9c655a218a940eaf02017a5dd0bdf9.1209897266.git.monstr@xxxxxxxxx> <2f801c33caee22e112af51ae927c264ce99ead01.1209897266.git.monstr@xxxxxxxxx> <2391e49379fb6639f57d9d6e5811f3d49a4c6fda.1209897266.git.monstr@xxxxxxxxx> <0873f3a1f3b72591735c6461b51964693cac52e5.1209897266.git.monstr@xxxxxxxxx> <0ba1f259d3c17eba54e334622493577493f5065f.1209897266.git.monstr@xxxxxxxxx> <694451053534fea7b78fb9d618b53a2b5ebeb602.1209897266.git.monstr@xxxxxxxxx> <f0c837df4106a31c1a81917596603918f722ea7b.1209897266.git.monstr@xxxxxxxxx>
- References: <a4a778e34c66d126f5c4bf1ca423cf32950ea5ab.1209897266.git.monstr@xxxxxxxxx>
- Reply-to: microblaze-uclinux@xxxxxxxxxxxxxx
- Sender: owner-microblaze-uclinux@xxxxxxxxxxxxxx
From: Michal Simek <monstr@xxxxxxxxx>
Signed-off-by: Michal Simek <monstr@xxxxxxxxx>
---
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@xxxxxxxxx>
+ * 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
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/