blob: 92360096d19ceeab0f18f9eaa8cd0bfef7273ab0 [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) : {
Andrey Petrovdd56de92016-02-25 17:22:17 -080021 _car_region_start = . ;
Aaron Durbin75c51d92015-09-29 16:31:20 -050022 /* Vboot work buffer is completely volatile outside of verstage and
23 * romstage. Appropriate code needs to handle the transition. */
24#if IS_ENABLED(CONFIG_SEPARATE_VERSTAGE)
25 VBOOT2_WORK(., 16K)
26#endif
Andrey Petrovee9e4ae2016-02-08 17:17:05 -080027 /* Stack for CAR stages. Since it persists across all stages that
28 * use CAR it can be reused. The chipset/SoC is expected to provide
29 * the stack size. */
30#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK)
31 _car_stack_start = .;
32 . += CONFIG_DCACHE_BSP_STACK_SIZE;
33 _car_stack_end = .;
34#endif
Aaron Durbindd6fa932015-09-24 12:18:07 -050035 /* The pre-ram cbmem console as well as the timestamp region are fixed
36 * in size. Therefore place them at the beginning .car.data section
37 * so that multiple stages (romstage and verstage) have a consistent
38 * link address of these shared objects. */
Naresh G Solanki04bb4802016-12-13 21:16:46 +053039 PRERAM_CBMEM_CONSOLE(., (CONFIG_LATE_CBMEM_INIT ? 0 : CONFIG_PRERAM_CBMEM_CONSOLE_SIZE))
Andrey Petrovdd56de92016-02-25 17:22:17 -080040 _car_relocatable_data_start = .;
Aaron Durbindd6fa932015-09-24 12:18:07 -050041 /* The timestamp implementation relies on this storage to be around
42 * after migration. One of the fields indicates not to use it as the
43 * backing store once cbmem comes online. Therefore, this data needs
Andrey Petrovdd56de92016-02-25 17:22:17 -080044 * to reside in the migrated area (between _car_relocatable_data_start
45 * and _car_relocatable_data_end). */
Aaron Durbin956c4f22015-09-05 13:31:14 -050046 TIMESTAMP(., 0x100)
Aaron Durbindd6fa932015-09-24 12:18:07 -050047 /* _car_global_start and _car_global_end provide symbols to per-stage
48 * variables that are not shared like the timestamp and the pre-ram
49 * cbmem console. This is useful for clearing this area on a per-stage
50 * basis when more than one stage uses cache-as-ram for CAR_GLOBALs. */
51 _car_global_start = .;
Aaron Durbin956c4f22015-09-05 13:31:14 -050052 *(.car.global_data);
53 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
Aaron Durbindd6fa932015-09-24 12:18:07 -050054 _car_global_end = .;
Andrey Petrovdd56de92016-02-25 17:22:17 -080055 _car_relocatable_data_end = .;
56
57 _car_region_end = . + CONFIG_DCACHE_RAM_SIZE - (. - _car_region_start);
Aaron Durbin956c4f22015-09-05 13:31:14 -050058}
59
60/* Global variables are not allowed in romstage
61 * This section is checked during stage creation to ensure
62 * that there are no global variables present
63 */
64
65. = 0xffffff00;
66.illegal_globals . : {
Nico Huber98fc4262016-01-23 01:24:33 +010067 *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data)
68 *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data.*)
Aaron Durbin956c4f22015-09-05 13:31:14 -050069 *(.bss)
70 *(.bss.*)
71 *(.sbss)
72 *(.sbss.*)
73}
74
Aaron Durbindd6fa932015-09-24 12:18:07 -050075_bogus = ASSERT((CONFIG_DCACHE_RAM_SIZE == 0) || (SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full");