blob: bbff36e4fa8b09c48138898eb3f30b0c8ef4f681 [file] [log] [blame]
Patrick Georgi3c970ee2010-02-19 19:59:03 +00001/*
Stefan Reinauer79253842010-04-13 13:43:35 +00002 * This file is part of the coreboot project.
Patrick Georgi3c970ee2010-02-19 19:59:03 +00003 *
Stefan Reinauer79253842010-04-13 13:43:35 +00004 * Copyright (C) 2006 Advanced Micro Devices, Inc.
5 * Copyright (C) 2008-2010 coresystems GmbH
Patrick Georgi3c970ee2010-02-19 19:59:03 +00006 *
Stefan Reinauer79253842010-04-13 13:43:35 +00007 * 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.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010018 * Foundation, Inc.
Patrick Georgi3c970ee2010-02-19 19:59:03 +000019 */
20
Alexandru Gagniuc72bb66e2015-10-02 10:59:13 -070021ENTRY(reset_vector)
22
Patrick Georgi1c1d9a02010-02-23 19:38:44 +000023MEMORY {
24 rom : ORIGIN = 0xffff0000, LENGTH = 64K
25}
Patrick Georgi3c970ee2010-02-19 19:59:03 +000026
27TARGET(binary)
28SECTIONS
29{
Kyösti Mälkki7dfe32c2012-02-14 10:39:17 +020030 /* Symbol ap_sipi_vector must be aligned to 4kB to start AP CPUs
Kyösti Mälkkif8c7c232012-04-06 04:03:50 +030031 * with Startup IPI message without RAM. Align .rom to next 4 byte
32 * boundary anyway, so no pad byte appears between _rom and _start.
Kyösti Mälkkib192df42011-11-23 16:33:12 +020033 */
34 .bogus ROMLOC_MIN : {
Kyösti Mälkkif8c7c232012-04-06 04:03:50 +030035 . = CONFIG_SIPI_VECTOR_IN_ROM ? ALIGN(4096) : ALIGN(4);
Kyösti Mälkkib192df42011-11-23 16:33:12 +020036 ROMLOC = .;
37 } >rom = 0xff
38
Patrick Georgi3c970ee2010-02-19 19:59:03 +000039 /* This section might be better named .setup */
Patrick Georgi1c1d9a02010-02-23 19:38:44 +000040 .rom ROMLOC : {
Patrick Georgi3c970ee2010-02-19 19:59:03 +000041 _rom = .;
Kyösti Mälkki7dfe32c2012-02-14 10:39:17 +020042 ap_sipi_vector = .;
Patrick Georgi3c970ee2010-02-19 19:59:03 +000043 *(.rom.text);
44 *(.rom.data);
45 *(.rom.data.*);
Alexandru Gagniucdbeedbe2015-10-02 12:17:56 -070046 *(.text);
47 *(.text.*);
48 *(.rodata);
Patrick Georgi3c970ee2010-02-19 19:59:03 +000049 *(.rodata.*);
Patrick Georgi3c970ee2010-02-19 19:59:03 +000050 _erom = .;
Stefan Reinauer79253842010-04-13 13:43:35 +000051 } >rom = 0xff
Patrick Georgi3c970ee2010-02-19 19:59:03 +000052
Kyösti Mälkkib192df42011-11-23 16:33:12 +020053 /* Allocation reserves extra 16 bytes here. Alignment requirements
54 * may cause the total size of a section to change when the start
55 * address gets applied.
56 */
Kyösti Mälkkif8c7c232012-04-06 04:03:50 +030057 ROMLOC_MIN = 0xffffff00 - (_erom - _rom + 16) -
58 (CONFIG_SIPI_VECTOR_IN_ROM ? 4096 : 0);
Kyösti Mälkki7dfe32c2012-02-14 10:39:17 +020059
60 /* Post-check proper SIPI vector. */
Kyösti Mälkkif8c7c232012-04-06 04:03:50 +030061 _bogus = ASSERT(!CONFIG_SIPI_VECTOR_IN_ROM || ((ap_sipi_vector & 0x0fff) == 0x0),
62 "Bad SIPI vector alignment");
63 _bogus = ASSERT(!CONFIG_SIPI_VECTOR_IN_ROM || (ap_sipi_vector == CONFIG_AP_SIPI_VECTOR),
64 "Address mismatch on AP_SIPI_VECTOR");
Patrick Georgi3c970ee2010-02-19 19:59:03 +000065
66 /DISCARD/ : {
67 *(.comment)
68 *(.note)
69 *(.comment.*)
70 *(.note.*)
Alexandru Gagniucdbeedbe2015-10-02 12:17:56 -070071 *(.eh_frame)
Patrick Georgi1c1d9a02010-02-23 19:38:44 +000072 *(.iplt)
73 *(.rel.*)
74 *(.igot.*)
Patrick Georgi3c970ee2010-02-19 19:59:03 +000075 }
76}