summaryrefslogtreecommitdiffstats
path: root/src/arch
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2014-04-02 17:57:05 -0700
committerMike Loptien <mike.loptien@se-eng.com>2014-10-07 23:41:28 +0200
commit35382a6eeb6634c291ffb67a3c4fa7a4601a7328 (patch)
tree12552f6b75fbb014b68b0075486d0e7e53fb875c /src/arch
parent34c5933a66caf839ac82c2bdf3e50bcce816b36d (diff)
downloadcoreboot-staging-35382a6eeb6634c291ffb67a3c4fa7a4601a7328.zip
coreboot-staging-35382a6eeb6634c291ffb67a3c4fa7a4601a7328.tar.gz
cbmem console: Locate the preram console with a symbol instead of a section.
On non-x86 systems, the location of the preram CBMEM console may not be in a predictable place relative to other things in the linker script. That makes it difficult to work with as its own section because the linker will complain if you try to move backwards as it lays out memory. If the console header is treated as an actual blob of memory which has to be put in the image, we'd have to predict where to put it so that it isn't before something with a lower address or after something with a higher address. Symbols, on the other hand, can be defined arbitrarily. Change-Id: I3257b981eee0c15bb997a9f2c55a03494c6ec6f0 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: https://chromium-review.googlesource.com/193164 Reviewed-by: Tom Warren <twarren@nvidia.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Commit-Queue: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org> (cherry picked from commit a492761c27076bcac080013d509ae4aafd6dc3e3) Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com> Reviewed-on: http://review.coreboot.org/7013 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/include/arch/early_variables.h1
-rw-r--r--src/arch/x86/include/arch/early_variables.h2
-rw-r--r--src/arch/x86/init/romstage.ld14
3 files changed, 7 insertions, 10 deletions
diff --git a/src/arch/arm/include/arch/early_variables.h b/src/arch/arm/include/arch/early_variables.h
index 041d0ae..5b58baa 100644
--- a/src/arch/arm/include/arch/early_variables.h
+++ b/src/arch/arm/include/arch/early_variables.h
@@ -21,7 +21,6 @@
#define ARCH_EARLY_VARIABLES_H
#define CAR_GLOBAL
-#define CAR_CBMEM
#define CAR_MIGRATE(migrate_fn_)
static inline void *car_get_var_ptr(void *var) { return var; }
diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h
index ea1a133..80e82d6 100644
--- a/src/arch/x86/include/arch/early_variables.h
+++ b/src/arch/x86/include/arch/early_variables.h
@@ -26,10 +26,8 @@ asm(".previous");
asm(".section .car.cbmem_console,\"w\",@nobits");
asm(".previous");
#define CAR_GLOBAL __attribute__((section(".car.global_data")))
-#define CAR_CBMEM __attribute__((section(".car.cbmem_console")))
#else
#define CAR_GLOBAL
-#define CAR_CBMEM
#endif
#if defined(__PRE_RAM__)
diff --git a/src/arch/x86/init/romstage.ld b/src/arch/x86/init/romstage.ld
index 5458cfc..d6eb511 100644
--- a/src/arch/x86/init/romstage.ld
+++ b/src/arch/x86/init/romstage.ld
@@ -55,15 +55,15 @@ SECTIONS
.car.data . (NOLOAD) : {
_car_data_start = .;
*(.car.global_data);
- /* The cbmem_console section comes last to take advantage of
- * a zero-sized array to hold the memconsole contents that
- * grows to a bound of CONFIG_CONSOLE_CAR_BUFFER_SIZE. However,
- * collisions within the cache-as-ram region cannot be
+ _car_data_end = .;
+ /* The preram cbmem console area comes last to take advantage
+ * of a zero-sized array to hold the memconsole contents that
+ * grows to a bound of CONFIG_CONSOLE_PRERAM_BUFFER_SIZE.
+ * However, collisions within the cache-as-ram region cannot be
* statically checked because the cache-as-ram region usage is
* cpu/chipset dependent. */
- *(.car.cbmem_console);
- _car_data_end = .;
+ preram_cbmem_console = .;
}
- _bogus = ASSERT((SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full");
+ _bogus = ASSERT((SIZEOF(.car.data) + CONFIG_CONSOLE_PRERAM_BUFFER_SIZE <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full");
}
OpenPOWER on IntegriCloud