[457b6ae] | 1 | /* |
---|
[e2d79559] | 2 | * This file contains GNU linker directives for a generic MC68360 board. |
---|
| 3 | * Variations in hardware type and dynamic memory size can be made |
---|
| 4 | * by overriding some values with linker command-line arguments. |
---|
[457b6ae] | 5 | * |
---|
| 6 | * Saskatchewan Accelerator Laboratory |
---|
| 7 | * University of Saskatchewan |
---|
| 8 | * Saskatoon, Saskatchewan, CANADA |
---|
| 9 | * eric@skatter.usask.ca |
---|
| 10 | * |
---|
| 11 | * $Id$ |
---|
| 12 | */ |
---|
| 13 | |
---|
| 14 | /* |
---|
[e2d79559] | 15 | * Declare some sizes. |
---|
| 16 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
| 17 | * number used there is not constant. If this happens to you, edit |
---|
| 18 | * the lines marked XXX below to use a constant value. |
---|
| 19 | */ |
---|
| 20 | RamSize = DEFINED(RamSize) ? RamSize : 4M; |
---|
| 21 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
| 22 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
| 23 | |
---|
| 24 | /* |
---|
| 25 | * Declare hardware type |
---|
| 26 | */ |
---|
| 27 | MC68360HardwareTypeMotorolaGeneric = 0; |
---|
| 28 | MC68360HardwareTypeAtlasHSB = 1; |
---|
| 29 | MC68360HardwareType = DEFINED(MC68360HardwareType) ? MC68360HardwareType : 0; |
---|
| 30 | |
---|
| 31 | /* |
---|
| 32 | * Declare on-board memory. |
---|
| 33 | * It would be nice if the ram length could be given as |
---|
| 34 | * LENGTH=RamSize, but gld doesn't allow non-constant |
---|
| 35 | * values in the LENGTH expression. |
---|
[457b6ae] | 36 | */ |
---|
| 37 | MEMORY { |
---|
[e2d79559] | 38 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
[996a9cb4] | 39 | rom : ORIGIN = 0xFF000000, LENGTH = 1M |
---|
| 40 | dpram : ORIGIN = 0xFE000000, LENGTH = 8k |
---|
[457b6ae] | 41 | } |
---|
| 42 | |
---|
| 43 | /* |
---|
[e2d79559] | 44 | * Declare low-order three octets of Ethernet address. |
---|
[457b6ae] | 45 | */ |
---|
[e2d79559] | 46 | ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; |
---|
[11532ca] | 47 | |
---|
| 48 | /* |
---|
[e2d79559] | 49 | * Declare hardware type. |
---|
| 50 | * Acceptable values are: |
---|
| 51 | * 0 - Generic system as described in the MC68360 User's Manual |
---|
| 52 | * (MC68360UM/AD Rev. 1). |
---|
| 53 | * 1 - ATLAS Computer Equipment Incorporated ACE360/HSB. |
---|
[11532ca] | 54 | */ |
---|
[e2d79559] | 55 | MC68360HardwareType = DEFINED(MC68360HardwareType) ? MC68360HardwareType : 0; |
---|
[457b6ae] | 56 | |
---|
| 57 | /* |
---|
| 58 | * Load objects |
---|
| 59 | */ |
---|
| 60 | SECTIONS { |
---|
[e2d79559] | 61 | /* |
---|
| 62 | * Hardware variations |
---|
| 63 | */ |
---|
| 64 | _RamSize = RamSize; |
---|
| 65 | __RamSize = RamSize; |
---|
| 66 | _MC68360HardwareType = MC68360HardwareType; |
---|
| 67 | __MC68360HardwareType = MC68360HardwareType; |
---|
| 68 | _MC68360HardwareTypeMotorolaGeneric = MC68360HardwareTypeMotorolaGeneric; |
---|
| 69 | __MC68360HardwareTypeMotorolaGeneric = MC68360HardwareTypeMotorolaGeneric; |
---|
| 70 | _MC68360HardwareTypeAtlasHSB = MC68360HardwareTypeAtlasHSB; |
---|
| 71 | __MC68360HardwareTypeAtlasHSB = MC68360HardwareTypeAtlasHSB; |
---|
| 72 | |
---|
[996a9cb4] | 73 | /* |
---|
| 74 | * Boot PROM |
---|
| 75 | */ |
---|
| 76 | rom : { |
---|
| 77 | _RomBase = .; |
---|
| 78 | __RomBase = .; |
---|
| 79 | } >rom |
---|
| 80 | |
---|
| 81 | /* |
---|
| 82 | * Dynamic RAM |
---|
| 83 | */ |
---|
| 84 | ram : { |
---|
| 85 | _RamBase = .; |
---|
| 86 | __RamBase = .; |
---|
| 87 | } >ram |
---|
| 88 | |
---|
| 89 | /* |
---|
| 90 | * Text, data and bss segments |
---|
| 91 | */ |
---|
[457b6ae] | 92 | .text : { |
---|
[996a9cb4] | 93 | CREATE_OBJECT_SYMBOLS |
---|
| 94 | *(.text) |
---|
| 95 | . = ALIGN (16); |
---|
| 96 | etext = .; |
---|
| 97 | _etext = .; |
---|
[457b6ae] | 98 | } >ram |
---|
| 99 | .data : { |
---|
[996a9cb4] | 100 | copy_start = .; |
---|
| 101 | *(.data) |
---|
| 102 | . = ALIGN (16); |
---|
| 103 | _edata = .; |
---|
| 104 | copy_end = .; |
---|
[457b6ae] | 105 | } >ram |
---|
| 106 | .bss : { |
---|
[996a9cb4] | 107 | M68Kvec = .; |
---|
| 108 | _M68Kvec = .; |
---|
| 109 | . += (256 * 4); |
---|
| 110 | clear_start = .; |
---|
| 111 | *(.bss) |
---|
| 112 | *(COMMON) |
---|
| 113 | . = ALIGN (16); |
---|
| 114 | _end = .; |
---|
[11532ca] | 115 | |
---|
[996a9cb4] | 116 | _HeapStart = .; |
---|
| 117 | __HeapStart = .; |
---|
[3e7b167] | 118 | . += HeapSize; /* XXX -- Old gld can't handle this */ |
---|
| 119 | . += StackSize; /* XXX -- Old gld can't handle this */ |
---|
| 120 | /* . += 0x10000; */ /* HeapSize for old gld */ |
---|
| 121 | /* . += 0x1000; */ /* StackSize for old gld */ |
---|
[996a9cb4] | 122 | . = ALIGN (16); |
---|
| 123 | stack_init = .; |
---|
| 124 | clear_end = .; |
---|
[457b6ae] | 125 | |
---|
[996a9cb4] | 126 | _WorkspaceBase = .; |
---|
| 127 | __WorkspaceBase = .; |
---|
| 128 | } >ram |
---|
[457b6ae] | 129 | |
---|
[996a9cb4] | 130 | /* |
---|
| 131 | * On-chip memory/peripherals |
---|
| 132 | */ |
---|
| 133 | dpram : { |
---|
| 134 | m360 = .; |
---|
| 135 | _m360 = .; |
---|
| 136 | . += (8 * 1024); |
---|
[457b6ae] | 137 | |
---|
[996a9cb4] | 138 | } >dpram |
---|
[457b6ae] | 139 | } |
---|