aboutsummaryrefslogtreecommitdiff
path: root/src/arch/ppc
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@openbios.org>2004-05-26 15:43:27 +0000
committerStefan Reinauer <stepan@openbios.org>2004-05-26 15:43:27 +0000
commit38ffff0d724fdbce9bf525f01f3e969de9b583d9 (patch)
treedd93a4e0e5fc974a201e47ad4f6a0d3bcd83d212 /src/arch/ppc
parente891783e5ffa8ba9d17f088ee2e9bfa9653184d0 (diff)
move arch/<arch>/config to arch/<arch>/init
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1571 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/ppc')
-rw-r--r--src/arch/ppc/Config.lb2
-rw-r--r--src/arch/ppc/init/ldscript.lb94
2 files changed, 95 insertions, 1 deletions
diff --git a/src/arch/ppc/Config.lb b/src/arch/ppc/Config.lb
index 87b54ed080..31ccc297ce 100644
--- a/src/arch/ppc/Config.lb
+++ b/src/arch/ppc/Config.lb
@@ -1,4 +1,4 @@
-ldscript config/ldscript.lb
+ldscript init/ldscript.lb
makerule linuxbios.rom
depends "linuxbios"
diff --git a/src/arch/ppc/init/ldscript.lb b/src/arch/ppc/init/ldscript.lb
new file mode 100644
index 0000000000..a8ad86f1c0
--- /dev/null
+++ b/src/arch/ppc/init/ldscript.lb
@@ -0,0 +1,94 @@
+/*
+ * Memory map:
+ *
+ * _ROMBASE : start of ROM
+ * _RESET : reset vector (may be at top of ROM)
+ * _EXCEPTIONS_VECTORS : exception table
+ *
+ * _ROMSTART : linuxbios text
+ * : payload text
+ *
+ * _RAMBASE : address to copy payload
+ */
+
+/*
+ * Written by Johan Rydberg, based on work by Daniel Kahlin.
+ * Rewritten by Eric Biederman
+ * Re-rewritten by Greg Watson for PPC
+ */
+
+/*
+ * We use ELF as output format. So that we can
+ * debug the code in some form.
+ */
+
+OUTPUT_FORMAT("elf32-powerpc")
+ENTRY(_start)
+
+TARGET(binary)
+INPUT(linuxbios_payload)
+SECTIONS
+{
+ /*
+ * Absolute location of base of ROM
+ */
+ . = _ROMBASE;
+
+ /*
+ * Absolute location of reset vector. This may actually be at the
+ * the top of ROM.
+ */
+ . = _RESET;
+ .reset . : {
+ *(.rom.reset);
+ . = ALIGN(16);
+ }
+
+ /*
+ * Absolute location of exception vector table.
+ */
+ . = _EXCEPTION_VECTORS;
+ .exception_vectors . : {
+ *(.rom.exception_vectors);
+ . = ALIGN(16);
+ }
+
+ /*
+ * Absolute location of LinuxBIOS initialization code in ROM.
+ */
+ . = _ROMSTART;
+ .rom . : {
+ _rom = .;
+ *(.rom.text);
+ *(.text);
+ *(.rom.data);
+ *(.rodata);
+ *(EXCLUDE_FILE(linuxbios_payload) .data);
+ . = ALIGN(16);
+ _erom = .;
+ }
+ _lrom = LOADADDR(.rom);
+ _elrom = LOADADDR(.rom) + SIZEOF(.rom);
+
+ /*
+ * Payload is LinuxBIOS proper.
+ */
+ .payload . : {
+ _payload = . ;
+ linuxbios_payload(*)
+ _epayload = . ;
+ }
+
+ /*
+ * Absolute location of where payload will be relocated in RAM.
+ */
+ _iseg = _RAMBASE;
+ _eiseg = _iseg + SIZEOF(.payload);
+ _liseg = _payload;
+ _eliseg = _epayload;
+
+ /DISCARD/ : {
+ *(.comment)
+ *(.note)
+ }
+}