Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 1 | /* |
Stefan Reinauer | 7925384 | 2010-04-13 13:43:35 +0000 | [diff] [blame] | 2 | * This file is part of the coreboot project. |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 3 | * |
Stefan Reinauer | 7925384 | 2010-04-13 13:43:35 +0000 | [diff] [blame] | 4 | * Copyright (C) 2006 Advanced Micro Devices, Inc. |
| 5 | * Copyright (C) 2008-2010 coresystems GmbH |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 6 | * |
Stefan Reinauer | 7925384 | 2010-04-13 13:43:35 +0000 | [diff] [blame] | 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; version 2 of the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 15 | */ |
| 16 | |
Alexandru Gagniuc | 72bb66e | 2015-10-02 10:59:13 -0700 | [diff] [blame] | 17 | ENTRY(reset_vector) |
| 18 | |
Patrick Georgi | 1c1d9a0 | 2010-02-23 19:38:44 +0000 | [diff] [blame] | 19 | MEMORY { |
| 20 | rom : ORIGIN = 0xffff0000, LENGTH = 64K |
| 21 | } |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 22 | |
| 23 | TARGET(binary) |
| 24 | SECTIONS |
| 25 | { |
Kyösti Mälkki | 7dfe32c | 2012-02-14 10:39:17 +0200 | [diff] [blame] | 26 | /* Symbol ap_sipi_vector must be aligned to 4kB to start AP CPUs |
Kyösti Mälkki | f8c7c23 | 2012-04-06 04:03:50 +0300 | [diff] [blame] | 27 | * with Startup IPI message without RAM. Align .rom to next 4 byte |
| 28 | * boundary anyway, so no pad byte appears between _rom and _start. |
Kyösti Mälkki | b192df4 | 2011-11-23 16:33:12 +0200 | [diff] [blame] | 29 | */ |
| 30 | .bogus ROMLOC_MIN : { |
Kyösti Mälkki | f8c7c23 | 2012-04-06 04:03:50 +0300 | [diff] [blame] | 31 | . = CONFIG_SIPI_VECTOR_IN_ROM ? ALIGN(4096) : ALIGN(4); |
Kyösti Mälkki | b192df4 | 2011-11-23 16:33:12 +0200 | [diff] [blame] | 32 | ROMLOC = .; |
| 33 | } >rom = 0xff |
| 34 | |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 35 | /* This section might be better named .setup */ |
Patrick Georgi | 1c1d9a0 | 2010-02-23 19:38:44 +0000 | [diff] [blame] | 36 | .rom ROMLOC : { |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 37 | _rom = .; |
Kyösti Mälkki | 7dfe32c | 2012-02-14 10:39:17 +0200 | [diff] [blame] | 38 | ap_sipi_vector = .; |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 39 | *(.rom.text); |
| 40 | *(.rom.data); |
| 41 | *(.rom.data.*); |
Alexandru Gagniuc | dbeedbe | 2015-10-02 12:17:56 -0700 | [diff] [blame] | 42 | *(.text); |
| 43 | *(.text.*); |
| 44 | *(.rodata); |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 45 | *(.rodata.*); |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 46 | _erom = .; |
Stefan Reinauer | 7925384 | 2010-04-13 13:43:35 +0000 | [diff] [blame] | 47 | } >rom = 0xff |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 48 | |
Kyösti Mälkki | b192df4 | 2011-11-23 16:33:12 +0200 | [diff] [blame] | 49 | /* Allocation reserves extra 16 bytes here. Alignment requirements |
| 50 | * may cause the total size of a section to change when the start |
| 51 | * address gets applied. |
| 52 | */ |
Kyösti Mälkki | f8c7c23 | 2012-04-06 04:03:50 +0300 | [diff] [blame] | 53 | ROMLOC_MIN = 0xffffff00 - (_erom - _rom + 16) - |
| 54 | (CONFIG_SIPI_VECTOR_IN_ROM ? 4096 : 0); |
Kyösti Mälkki | 7dfe32c | 2012-02-14 10:39:17 +0200 | [diff] [blame] | 55 | |
| 56 | /* Post-check proper SIPI vector. */ |
Kyösti Mälkki | f8c7c23 | 2012-04-06 04:03:50 +0300 | [diff] [blame] | 57 | _bogus = ASSERT(!CONFIG_SIPI_VECTOR_IN_ROM || ((ap_sipi_vector & 0x0fff) == 0x0), |
| 58 | "Bad SIPI vector alignment"); |
| 59 | _bogus = ASSERT(!CONFIG_SIPI_VECTOR_IN_ROM || (ap_sipi_vector == CONFIG_AP_SIPI_VECTOR), |
| 60 | "Address mismatch on AP_SIPI_VECTOR"); |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 61 | |
| 62 | /DISCARD/ : { |
| 63 | *(.comment) |
| 64 | *(.note) |
| 65 | *(.comment.*) |
| 66 | *(.note.*) |
Alexandru Gagniuc | dbeedbe | 2015-10-02 12:17:56 -0700 | [diff] [blame] | 67 | *(.eh_frame) |
Patrick Georgi | 1c1d9a0 | 2010-02-23 19:38:44 +0000 | [diff] [blame] | 68 | *(.iplt) |
| 69 | *(.rel.*) |
| 70 | *(.igot.*) |
Patrick Georgi | 3c970ee | 2010-02-19 19:59:03 +0000 | [diff] [blame] | 71 | } |
| 72 | } |