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) : { |
Andrey Petrov | dd56de9 | 2016-02-25 17:22:17 -0800 | [diff] [blame] | 21 | _car_region_start = . ; |
Aaron Durbin | 75c51d9 | 2015-09-29 16:31:20 -0500 | [diff] [blame] | 22 | /* Vboot work buffer is completely volatile outside of verstage and |
| 23 | * romstage. Appropriate code needs to handle the transition. */ |
Julius Werner | 58c3938 | 2017-02-13 17:53:29 -0800 | [diff] [blame] | 24 | #if IS_ENABLED(CONFIG_VBOOT_SEPARATE_VERSTAGE) |
Aaron Durbin | 75c51d9 | 2015-09-29 16:31:20 -0500 | [diff] [blame] | 25 | VBOOT2_WORK(., 16K) |
| 26 | #endif |
Andrey Petrov | ee9e4ae | 2016-02-08 17:17:05 -0800 | [diff] [blame] | 27 | /* 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 Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 35 | /* 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 Solanki | 04bb480 | 2016-12-13 21:16:46 +0530 | [diff] [blame] | 39 | PRERAM_CBMEM_CONSOLE(., (CONFIG_LATE_CBMEM_INIT ? 0 : CONFIG_PRERAM_CBMEM_CONSOLE_SIZE)) |
Andrey Petrov | dd56de9 | 2016-02-25 17:22:17 -0800 | [diff] [blame] | 40 | _car_relocatable_data_start = .; |
Aaron Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 41 | /* 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 Petrov | dd56de9 | 2016-02-25 17:22:17 -0800 | [diff] [blame] | 44 | * to reside in the migrated area (between _car_relocatable_data_start |
| 45 | * and _car_relocatable_data_end). */ |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 46 | TIMESTAMP(., 0x100) |
Lee Leahy | 43d0d0d | 2017-04-14 09:42:59 -0700 | [diff] [blame^] | 47 | #if IS_ENABLED(CONFIG_DRIVERS_STORAGE) |
| 48 | _car_drivers_storage_start = .; |
| 49 | . += 256; |
| 50 | _car_drivers_storage_end = .; |
| 51 | #endif |
Aaron Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 52 | /* _car_global_start and _car_global_end provide symbols to per-stage |
| 53 | * variables that are not shared like the timestamp and the pre-ram |
| 54 | * cbmem console. This is useful for clearing this area on a per-stage |
| 55 | * basis when more than one stage uses cache-as-ram for CAR_GLOBALs. */ |
| 56 | _car_global_start = .; |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 57 | *(.car.global_data); |
| 58 | . = ALIGN(ARCH_POINTER_ALIGN_SIZE); |
Aaron Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 59 | _car_global_end = .; |
Andrey Petrov | dd56de9 | 2016-02-25 17:22:17 -0800 | [diff] [blame] | 60 | _car_relocatable_data_end = .; |
| 61 | |
| 62 | _car_region_end = . + CONFIG_DCACHE_RAM_SIZE - (. - _car_region_start); |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | /* Global variables are not allowed in romstage |
| 66 | * This section is checked during stage creation to ensure |
| 67 | * that there are no global variables present |
| 68 | */ |
| 69 | |
| 70 | . = 0xffffff00; |
| 71 | .illegal_globals . : { |
Nico Huber | 98fc426 | 2016-01-23 01:24:33 +0100 | [diff] [blame] | 72 | *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data) |
| 73 | *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data.*) |
Aaron Durbin | 956c4f2 | 2015-09-05 13:31:14 -0500 | [diff] [blame] | 74 | *(.bss) |
| 75 | *(.bss.*) |
| 76 | *(.sbss) |
| 77 | *(.sbss.*) |
| 78 | } |
| 79 | |
Aaron Durbin | dd6fa93 | 2015-09-24 12:18:07 -0500 | [diff] [blame] | 80 | _bogus = ASSERT((CONFIG_DCACHE_RAM_SIZE == 0) || (SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full"); |