Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu> |
| 3 | * Copyright (C) 2008-2009 PetaLogix |
| 4 | * Copyright (C) 2006 Atmark Techno, Inc. |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. |
| 9 | */ |
| 10 | |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 11 | OUTPUT_ARCH(microblaze) |
Michal Simek | ca28b51 | 2010-07-28 09:29:11 +0200 | [diff] [blame] | 12 | ENTRY(microblaze_start) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 13 | |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame] | 14 | #include <asm/page.h> |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 15 | #include <asm-generic/vmlinux.lds.h> |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame] | 16 | #include <asm/thread_info.h> |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 17 | |
Michal Simek | 02b0804 | 2010-09-28 16:04:14 +1000 | [diff] [blame^] | 18 | #ifdef __MICROBLAZEEL__ |
| 19 | jiffies = jiffies_64; |
| 20 | #else |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 21 | jiffies = jiffies_64 + 4; |
Michal Simek | 02b0804 | 2010-09-28 16:04:14 +1000 | [diff] [blame^] | 22 | #endif |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 23 | |
| 24 | SECTIONS { |
Michal Simek | d4c1285 | 2009-05-26 16:30:24 +0200 | [diff] [blame] | 25 | . = CONFIG_KERNEL_START; |
Michal Simek | ca28b51 | 2010-07-28 09:29:11 +0200 | [diff] [blame] | 26 | microblaze_start = CONFIG_KERNEL_BASE_ADDR; |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 27 | .text : AT(ADDR(.text) - LOAD_OFFSET) { |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 28 | _text = . ; |
| 29 | _stext = . ; |
Steven J. Magnani | 7a0248e | 2010-04-09 22:03:37 -0500 | [diff] [blame] | 30 | HEAD_TEXT |
| 31 | TEXT_TEXT |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 32 | *(.fixup) |
Michal Simek | 7cf79d5 | 2009-11-06 12:27:25 +0100 | [diff] [blame] | 33 | EXIT_TEXT |
| 34 | EXIT_CALL |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 35 | SCHED_TEXT |
| 36 | LOCK_TEXT |
| 37 | KPROBES_TEXT |
Michal Simek | 7cf79d5 | 2009-11-06 12:27:25 +0100 | [diff] [blame] | 38 | IRQENTRY_TEXT |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 39 | . = ALIGN (4) ; |
| 40 | _etext = . ; |
| 41 | } |
| 42 | |
| 43 | . = ALIGN (4) ; |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 44 | __fdt_blob : AT(ADDR(__fdt_blob) - LOAD_OFFSET) { |
| 45 | _fdt_start = . ; /* place for fdt blob */ |
| 46 | *(__fdt_blob) ; /* Any link-placed DTB */ |
| 47 | . = _fdt_start + 0x4000; /* Pad up to 16kbyte */ |
| 48 | _fdt_end = . ; |
| 49 | } |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 50 | |
| 51 | . = ALIGN(16); |
| 52 | RODATA |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame] | 53 | EXCEPTION_TABLE(16) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 54 | |
| 55 | /* |
| 56 | * sdata2 section can go anywhere, but must be word aligned |
| 57 | * and SDA2_BASE must point to the middle of it |
| 58 | */ |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 59 | .sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) { |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 60 | _ssrw = .; |
Steven J. Magnani | ba9c4f8 | 2010-05-13 10:48:27 -0500 | [diff] [blame] | 61 | . = ALIGN(PAGE_SIZE); /* page aligned when MMU used */ |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 62 | *(.sdata2) |
| 63 | . = ALIGN(8); |
| 64 | _essrw = .; |
| 65 | _ssrw_size = _essrw - _ssrw; |
| 66 | _KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2); |
| 67 | } |
| 68 | |
| 69 | _sdata = . ; |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame] | 70 | RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 71 | _edata = . ; |
| 72 | |
| 73 | /* Reserve some low RAM for r0 based memory references */ |
| 74 | . = ALIGN(0x4) ; |
| 75 | r0_ram = . ; |
Steven J. Magnani | ba9c4f8 | 2010-05-13 10:48:27 -0500 | [diff] [blame] | 76 | . = . + PAGE_SIZE; /* a page should be enough */ |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 77 | |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 78 | /* Under the microblaze ABI, .sdata and .sbss must be contiguous */ |
| 79 | . = ALIGN(8); |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 80 | .sdata : AT(ADDR(.sdata) - LOAD_OFFSET) { |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 81 | _ssro = .; |
| 82 | *(.sdata) |
| 83 | } |
| 84 | |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 85 | .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 86 | _ssbss = .; |
| 87 | *(.sbss) |
| 88 | _esbss = .; |
| 89 | _essro = .; |
| 90 | _ssro_size = _essro - _ssro ; |
| 91 | _KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ; |
| 92 | } |
| 93 | |
Michal Simek | 13cdee2 | 2009-10-30 14:41:52 +0100 | [diff] [blame] | 94 | . = ALIGN(PAGE_SIZE); |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 95 | __init_begin = .; |
| 96 | |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame] | 97 | INIT_TEXT_SECTION(PAGE_SIZE) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 98 | |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 99 | .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { |
Michal Simek | 05bf7d4 | 2009-06-20 14:24:01 +0200 | [diff] [blame] | 100 | INIT_DATA |
| 101 | } |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 102 | |
| 103 | . = ALIGN(4); |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 104 | .init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) { |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 105 | __ivt_start = .; |
| 106 | *(.init.ivt) |
| 107 | __ivt_end = .; |
| 108 | } |
| 109 | |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 110 | .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame] | 111 | INIT_SETUP(0) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 112 | } |
| 113 | |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 114 | .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) { |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame] | 115 | INIT_CALLS |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 116 | } |
| 117 | |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 118 | .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) { |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame] | 119 | CON_INITCALL |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 120 | } |
| 121 | |
Arnd Bergmann | 6b43742 | 2009-05-01 21:36:44 +0000 | [diff] [blame] | 122 | SECURITY_INIT |
| 123 | |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 124 | __init_end_before_initramfs = .; |
| 125 | |
Steven J. Magnani | ba9c4f8 | 2010-05-13 10:48:27 -0500 | [diff] [blame] | 126 | .init.ramfs ALIGN(PAGE_SIZE) : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 127 | __initramfs_start = .; |
| 128 | *(.init.ramfs) |
| 129 | __initramfs_end = .; |
| 130 | . = ALIGN(4); |
| 131 | LONG(0); |
| 132 | /* |
| 133 | * FIXME this can break initramfs for MMU. |
| 134 | * Pad init.ramfs up to page boundary, |
| 135 | * so that __init_end == __bss_start. This will make image.elf |
| 136 | * consistent with the image.bin |
| 137 | */ |
Steven J. Magnani | ba9c4f8 | 2010-05-13 10:48:27 -0500 | [diff] [blame] | 138 | /* . = ALIGN(PAGE_SIZE); */ |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 139 | } |
| 140 | __init_end = .; |
| 141 | |
Steven J. Magnani | ba9c4f8 | 2010-05-13 10:48:27 -0500 | [diff] [blame] | 142 | .bss ALIGN (PAGE_SIZE) : AT(ADDR(.bss) - LOAD_OFFSET) { |
Michal Simek | a061dd5 | 2009-09-22 09:58:56 +0200 | [diff] [blame] | 143 | /* page aligned when MMU used */ |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 144 | __bss_start = . ; |
| 145 | *(.bss*) |
| 146 | *(COMMON) |
| 147 | . = ALIGN (4) ; |
| 148 | __bss_stop = . ; |
| 149 | _ebss = . ; |
| 150 | } |
Steven J. Magnani | ba9c4f8 | 2010-05-13 10:48:27 -0500 | [diff] [blame] | 151 | . = ALIGN(PAGE_SIZE); |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 152 | _end = .; |
Tejun Heo | 405d967 | 2009-06-24 15:13:38 +0900 | [diff] [blame] | 153 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 154 | DISCARDS |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 155 | } |