blob: 61c3d2a35ba33917dec4ca41e585c537fde4c5ce [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
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Patrick Georgi3c970ee2010-02-19 19:59:03 +000019 */
20
Stefan Reinauer79253842010-04-13 13:43:35 +000021/* We use ELF as output format. So that we can debug the code in some form. */
Patrick Georgi3c970ee2010-02-19 19:59:03 +000022OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
23OUTPUT_ARCH(i386)
24
Patrick Georgi1c1d9a02010-02-23 19:38:44 +000025MEMORY {
26 rom : ORIGIN = 0xffff0000, LENGTH = 64K
27}
Patrick Georgi3c970ee2010-02-19 19:59:03 +000028
29TARGET(binary)
30SECTIONS
31{
Kyösti Mälkki7dfe32c2012-02-14 10:39:17 +020032 /* Symbol ap_sipi_vector must be aligned to 4kB to start AP CPUs
33 * with Startup IPI message without RAM.
Kyösti Mälkkib192df42011-11-23 16:33:12 +020034 */
35 .bogus ROMLOC_MIN : {
Kyösti Mälkki7dfe32c2012-02-14 10:39:17 +020036 . = ALIGN(4096);
Kyösti Mälkkib192df42011-11-23 16:33:12 +020037 ROMLOC = .;
38 } >rom = 0xff
39
Patrick Georgi3c970ee2010-02-19 19:59:03 +000040 /* This section might be better named .setup */
Patrick Georgi1c1d9a02010-02-23 19:38:44 +000041 .rom ROMLOC : {
Patrick Georgi3c970ee2010-02-19 19:59:03 +000042 _rom = .;
Kyösti Mälkki7dfe32c2012-02-14 10:39:17 +020043 ap_sipi_vector = .;
Patrick Georgi3c970ee2010-02-19 19:59:03 +000044 *(.rom.text);
45 *(.rom.data);
46 *(.rom.data.*);
47 *(.rodata.*);
Patrick Georgi3c970ee2010-02-19 19:59:03 +000048 _erom = .;
Stefan Reinauer79253842010-04-13 13:43:35 +000049 } >rom = 0xff
Patrick Georgi3c970ee2010-02-19 19:59:03 +000050
Kyösti Mälkkib192df42011-11-23 16:33:12 +020051 /* Allocation reserves extra 16 bytes here. Alignment requirements
52 * may cause the total size of a section to change when the start
53 * address gets applied.
54 */
Kyösti Mälkki7dfe32c2012-02-14 10:39:17 +020055 ROMLOC_MIN = 0xffffff00 - (_erom - _rom + 16) - 4096;
56
57 /* Post-check proper SIPI vector. */
58 _bogus = ASSERT(((ap_sipi_vector & 0x0fff) == 0x0), "Bad SIPI vector alignment");
59 _bogus = ASSERT((ap_sipi_vector == CONFIG_AP_SIPI_VECTOR), "Address mismatch on AP_SIPI_VECTOR");
Patrick Georgi3c970ee2010-02-19 19:59:03 +000060
61 /DISCARD/ : {
62 *(.comment)
63 *(.note)
64 *(.comment.*)
65 *(.note.*)
Patrick Georgi1c1d9a02010-02-23 19:38:44 +000066 *(.iplt)
67 *(.rel.*)
68 *(.igot.*)
Patrick Georgi3c970ee2010-02-19 19:59:03 +000069 }
70}