blob: e5669dc051cf48418ff4f55e50fbeba5bc1a2a29 [file] [log] [blame]
Aaron Durbin956c4f22015-09-05 13:31:14 -05001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2006 Advanced Micro Devices, Inc.
5 * Copyright (C) 2008-2010 coresystems GmbH
6 * Copyright 2015 Google Inc
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
Aaron Durbin956c4f22015-09-05 13:31:14 -050016 */
17
18/* This file is included inside a SECTIONS block */
19. = CONFIG_DCACHE_RAM_BASE;
20.car.data . (NOLOAD) : {
Aaron Durbin75c51d92015-09-29 16:31:20 -050021 /* Vboot work buffer is completely volatile outside of verstage and
22 * romstage. Appropriate code needs to handle the transition. */
23#if IS_ENABLED(CONFIG_SEPARATE_VERSTAGE)
24 VBOOT2_WORK(., 16K)
25#endif
Aaron Durbindd6fa932015-09-24 12:18:07 -050026 /* The pre-ram cbmem console as well as the timestamp region are fixed
27 * in size. Therefore place them at the beginning .car.data section
28 * so that multiple stages (romstage and verstage) have a consistent
29 * link address of these shared objects. */
30 PRERAM_CBMEM_CONSOLE(., (CONFIG_LATE_CBMEM_INIT ? 0 : 0xc00))
Aaron Durbin956c4f22015-09-05 13:31:14 -050031 _car_data_start = .;
Aaron Durbindd6fa932015-09-24 12:18:07 -050032 /* The timestamp implementation relies on this storage to be around
33 * after migration. One of the fields indicates not to use it as the
34 * backing store once cbmem comes online. Therefore, this data needs
35 * to reside in the migrated area (between _car_data_start and
36 * _car_data_end). */
Aaron Durbin956c4f22015-09-05 13:31:14 -050037#if IS_ENABLED(CONFIG_HAS_PRECBMEM_TIMESTAMP_REGION)
38 TIMESTAMP(., 0x100)
39#endif
Aaron Durbindd6fa932015-09-24 12:18:07 -050040 /* _car_global_start and _car_global_end provide symbols to per-stage
41 * variables that are not shared like the timestamp and the pre-ram
42 * cbmem console. This is useful for clearing this area on a per-stage
43 * basis when more than one stage uses cache-as-ram for CAR_GLOBALs. */
44 _car_global_start = .;
Aaron Durbin956c4f22015-09-05 13:31:14 -050045 *(.car.global_data);
46 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
Aaron Durbindd6fa932015-09-24 12:18:07 -050047 _car_global_end = .;
Aaron Durbin956c4f22015-09-05 13:31:14 -050048 _car_data_end = .;
Aaron Durbin956c4f22015-09-05 13:31:14 -050049}
50
51/* Global variables are not allowed in romstage
52 * This section is checked during stage creation to ensure
53 * that there are no global variables present
54 */
55
56. = 0xffffff00;
57.illegal_globals . : {
58 *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/buildOpts.romstage.o" "*/agesawrapper.romstage.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data)
59 *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/buildOpts.romstage.o" "*/agesawrapper.romstage.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data.*)
60 *(.bss)
61 *(.bss.*)
62 *(.sbss)
63 *(.sbss.*)
64}
65
Aaron Durbindd6fa932015-09-24 12:18:07 -050066_bogus = ASSERT((CONFIG_DCACHE_RAM_SIZE == 0) || (SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full");