Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 1 | /* |
| 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 Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 16 | */ |
| 17 | |
| 18 | /* This file is included inside a SECTIONS block */ |
| 19 | . = CONFIG_DCACHE_RAM_BASE; |
| 20 | .car.data . (NOLOAD) : { |
Aaron Durbin | 75c51d9 | 2015-09-29 16:31:20 -0500 | [diff] [blame] | 21 | /* 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 Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 26 | /* 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 Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 31 | _car_data_start = .; |
Aaron Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 32 | /* 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 Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 37 | #if IS_ENABLED(CONFIG_HAS_PRECBMEM_TIMESTAMP_REGION) |
| 38 | TIMESTAMP(., 0x100) |
| 39 | #endif |
Aaron Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 40 | /* _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 Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 45 | *(.car.global_data); |
| 46 | . = ALIGN(ARCH_POINTER_ALIGN_SIZE); |
Aaron Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 47 | _car_global_end = .; |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 48 | _car_data_end = .; |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 49 | } |
| 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 Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 66 | _bogus = ASSERT((CONFIG_DCACHE_RAM_SIZE == 0) || (SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full"); |