Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35033 )
Change subject: arch/x86: Drop _car_relocatable_data symbols ......................................................................
arch/x86: Drop _car_relocatable_data symbols
These have become aliases to _car_global_[start|end].
Change-Id: Ibdcaaafdc0e4c6df4a795474903768230d41680d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/car.ld M src/arch/x86/include/arch/early_variables.h M src/arch/x86/include/arch/symbols.h M src/cpu/amd/car/post_cache_as_ram.c M src/cpu/x86/car.c M src/drivers/intel/fsp2_0/memory_init.c M src/soc/intel/quark/romstage/fsp2_0.c 7 files changed, 18 insertions(+), 26 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/35033/1
diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld index 25b667c..822f7fd 100644 --- a/src/arch/x86/car.ld +++ b/src/arch/x86/car.ld @@ -68,8 +68,6 @@ . += 80; _car_ehci_dbg_info_end = .;
- _car_relocatable_data_start = .; - /* _car_global_start and _car_global_end provide symbols to per-stage * variables that are not shared like the timestamp and the pre-ram * cbmem console. This is useful for clearing this area on a per-stage @@ -82,18 +80,18 @@ *(.sbss) *(.sbss.*) #else - /* .car.global_data objects only around when - * CONFIG_CAR_GLOBAL_MIGRATION is employed. */ *(.car.global_data); #endif . = ALIGN(ARCH_POINTER_ALIGN_SIZE); _car_global_end = .; - _car_relocatable_data_end = .;
#if CONFIG(CAR_GLOBAL_MIGRATION) _car_stack_start = .; _car_stack_end = _car_region_end; +#else + _car_unallocated_start = .; #endif + _car_region_end = . + CONFIG_DCACHE_RAM_SIZE - (. - _car_region_start); }
diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h index 3910a82..b5db194 100644 --- a/src/arch/x86/include/arch/early_variables.h +++ b/src/arch/x86/include/arch/early_variables.h @@ -48,13 +48,13 @@
static inline size_t car_data_size(void) { - size_t car_size = _car_relocatable_data_size; - return ALIGN_UP(car_size, 64); + size_t car_size = _car_global_size; + return ALIGN(car_size, 64); }
static inline size_t car_object_offset(void *ptr) { - return (char *)ptr - &_car_relocatable_data_start[0]; + return (char *)ptr - &_car_global_start[0]; }
#else diff --git a/src/arch/x86/include/arch/symbols.h b/src/arch/x86/include/arch/symbols.h index 97a07c0..5d65a7b 100644 --- a/src/arch/x86/include/arch/symbols.h +++ b/src/arch/x86/include/arch/symbols.h @@ -40,16 +40,10 @@ (_car_ehci_dbg_info_end - _car_ehci_dbg_info_start)
/* - * The _car_relocatable_data_[start|end] symbols cover CAR data which is - * relocatable once memory comes online. Variables with CAR_GLOBAL decoration - * reside within this region. The _car_global_[start|end] is a subset of the - * relocatable region which excludes the timestamp region because of - * intricacies in the timestamp code. + * The _car_global_[start|end]symbols cover CAR data which is relocatable + * once memory comes online. Variables with CAR_GLOBAL decoration + * reside within this region. */ -extern char _car_relocatable_data_start[]; -extern char _car_relocatable_data_end[]; -#define _car_relocatable_data_size \ - (_car_relocatable_data_end - _car_relocatable_data_start) extern char _car_global_start[]; extern char _car_global_end[]; #define _car_global_size (_car_global_end - _car_global_start) diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c index dfa4c3d..bf701ff 100644 --- a/src/cpu/amd/car/post_cache_as_ram.c +++ b/src/cpu/amd/car/post_cache_as_ram.c @@ -107,11 +107,11 @@ void *migrated_car = (void *)(CONFIG_RAMTOP - car_size);
print_car_debug("Copying data from cache to RAM..."); - memcpy_(migrated_car, _car_relocatable_data_start, car_size); + memcpy_(migrated_car, _car_global_start, car_size); print_car_debug(" Done\n");
print_car_debug("Verifying data integrity in RAM..."); - if (memcmp_(migrated_car, _car_relocatable_data_start, car_size) == 0) + if (memcmp_(migrated_car, _car_global_start, car_size) == 0) print_car_debug(" Done\n"); else print_car_debug(" FAILED\n"); diff --git a/src/cpu/x86/car.c b/src/cpu/x86/car.c index 6fc6168..62ab83b 100644 --- a/src/cpu/x86/car.c +++ b/src/cpu/x86/car.c @@ -46,8 +46,8 @@ { char *migrated_base = NULL; int offset; - void *_car_start = _car_relocatable_data_start; - void *_car_end = _car_relocatable_data_end; + void *_car_start = _car_global_start; + void *_car_end = _car_global_end;
/* If the cache-as-ram has not been migrated return the pointer * passed in. */ @@ -84,8 +84,8 @@ void *car_sync_var_ptr(void *var) { void **mig_var = car_get_var_ptr(var); - void *_car_start = _car_relocatable_data_start; - void *_car_end = _car_relocatable_data_end; + void *_car_start = _car_global_start; + void *_car_end = _car_global_end;
/* Not moved or migrated yet. */ if (mig_var == var) @@ -134,7 +134,7 @@ return; }
- memcpy(migrated_base, _car_relocatable_data_start, car_size); + memcpy(migrated_base, _car_global_start, car_size);
/* Mark that the data has been moved. */ car_migrated = ~0; diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index 0797c2e..17686c8 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -404,7 +404,7 @@ /* Build up memory map of romstage address space including CAR. */ memranges_init_empty(&memmap, &freeranges[0], ARRAY_SIZE(freeranges)); memranges_insert(&memmap, (uintptr_t)_car_region_start, - _car_relocatable_data_end - _car_region_start, 0); + _car_unallocated_start - _car_region_start, 0); memranges_insert(&memmap, (uintptr_t)_program, REGION_SIZE(program), 0);
if (!CONFIG(FSP_M_XIP)) diff --git a/src/soc/intel/quark/romstage/fsp2_0.c b/src/soc/intel/quark/romstage/fsp2_0.c index 0489621..e6da5dd 100644 --- a/src/soc/intel/quark/romstage/fsp2_0.c +++ b/src/soc/intel/quark/romstage/fsp2_0.c @@ -142,7 +142,7 @@ aupd->StackBase); printk(BIOS_SPEW, "| |\n"); printk(BIOS_SPEW, "+-------------------+ 0x%p\n", - _car_relocatable_data_end); + _car_global_end); printk(BIOS_SPEW, "| coreboot data |\n"); printk(BIOS_SPEW, "+-------------------+ 0x%p\n", _car_stack_end);
Hello Patrick Rudolph, Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35033
to look at the new patch set (#2).
Change subject: arch/x86: Drop _car_relocatable_data symbols ......................................................................
arch/x86: Drop _car_relocatable_data symbols
These have become aliases to _car_global_[start|end].
Change-Id: Ibdcaaafdc0e4c6df4a795474903768230d41680d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/assembly_entry.S M src/arch/x86/car.ld M src/arch/x86/include/arch/early_variables.h M src/arch/x86/include/arch/symbols.h M src/cpu/amd/car/post_cache_as_ram.c M src/cpu/x86/car.c M src/drivers/intel/fsp2_0/memory_init.c M src/soc/intel/common/block/cpu/car/cache_as_ram_fsp.S M src/soc/intel/quark/romstage/fsp2_0.c 9 files changed, 41 insertions(+), 43 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/35033/2
Hello Patrick Rudolph, Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35033
to look at the new patch set (#3).
Change subject: arch/x86: Drop _car_relocatable_data symbols ......................................................................
arch/x86: Drop _car_relocatable_data symbols
These have become aliases to _car_global_[start|end].
Change-Id: Ibdcaaafdc0e4c6df4a795474903768230d41680d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/car.ld M src/arch/x86/include/arch/early_variables.h M src/arch/x86/include/arch/symbols.h M src/cpu/amd/car/post_cache_as_ram.c M src/cpu/x86/car.c M src/drivers/intel/fsp2_0/memory_init.c M src/soc/intel/quark/romstage/fsp2_0.c 7 files changed, 18 insertions(+), 26 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/35033/3
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35033 )
Change subject: arch/x86: Drop _car_relocatable_data symbols ......................................................................
Patch Set 3: Code-Review+2
Hello Aaron Durbin, Patrick Rudolph, Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35033
to look at the new patch set (#4).
Change subject: arch/x86: Drop _car_relocatable_data symbols ......................................................................
arch/x86: Drop _car_relocatable_data symbols
These have become aliases to _car_global_[start|end].
Change-Id: Ibdcaaafdc0e4c6df4a795474903768230d41680d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/car.ld M src/arch/x86/include/arch/early_variables.h M src/arch/x86/include/arch/symbols.h M src/cpu/amd/car/post_cache_as_ram.c M src/cpu/x86/car.c M src/drivers/intel/fsp2_0/memory_init.c M src/soc/intel/quark/romstage/fsp2_0.c 7 files changed, 16 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/35033/4
Marshall Dawson has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35033 )
Change subject: arch/x86: Drop _car_relocatable_data symbols ......................................................................
Patch Set 4: Code-Review+2
Hello Aaron Durbin, Patrick Rudolph, Julius Werner, Marshall Dawson, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35033
to look at the new patch set (#8).
Change subject: arch/x86: Drop _car_relocatable_data symbols ......................................................................
arch/x86: Drop _car_relocatable_data symbols
These have become aliases to _car_global_[start|end].
Change-Id: Ibdcaaafdc0e4c6df4a795474903768230d41680d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/car.ld M src/arch/x86/include/arch/early_variables.h M src/arch/x86/include/arch/symbols.h M src/cpu/amd/car/post_cache_as_ram.c M src/cpu/x86/car.c M src/drivers/intel/fsp2_0/memory_init.c M src/soc/intel/quark/romstage/fsp2_0.c 7 files changed, 16 insertions(+), 24 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/35033/8
Kyösti Mälkki has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35033 )
Change subject: arch/x86: Drop _car_relocatable_data symbols ......................................................................
arch/x86: Drop _car_relocatable_data symbols
These have become aliases to _car_global_[start|end].
Change-Id: Ibdcaaafdc0e4c6df4a795474903768230d41680d Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/35033 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com --- M src/arch/x86/car.ld M src/arch/x86/include/arch/early_variables.h M src/arch/x86/include/arch/symbols.h M src/cpu/amd/car/post_cache_as_ram.c M src/cpu/x86/car.c M src/drivers/intel/fsp2_0/memory_init.c M src/soc/intel/quark/romstage/fsp2_0.c 7 files changed, 16 insertions(+), 24 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved
diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld index b382a76..a09150f 100644 --- a/src/arch/x86/car.ld +++ b/src/arch/x86/car.ld @@ -64,8 +64,6 @@ . += 80; _car_ehci_dbg_info_end = .;
- _car_relocatable_data_start = .; - /* _car_global_start and _car_global_end provide symbols to per-stage * variables that are not shared like the timestamp and the pre-ram * cbmem console. This is useful for clearing this area on a per-stage @@ -78,13 +76,11 @@ *(.sbss) *(.sbss.*) #else - /* .car.global_data objects only around when - * CONFIG_CAR_GLOBAL_MIGRATION is employed. */ *(.car.global_data); #endif . = ALIGN(ARCH_POINTER_ALIGN_SIZE); _car_global_end = .; - _car_relocatable_data_end = .; + _car_unallocated_start = .;
#if !CONFIG(C_ENVIRONMENT_BOOTBLOCK) _car_stack_start = .; diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h index b501d78..57f4306 100644 --- a/src/arch/x86/include/arch/early_variables.h +++ b/src/arch/x86/include/arch/early_variables.h @@ -52,13 +52,13 @@
static inline size_t car_data_size(void) { - size_t car_size = _car_relocatable_data_size; - return ALIGN_UP(car_size, 64); + size_t car_size = _car_global_size; + return ALIGN(car_size, 64); }
static inline size_t car_object_offset(void *ptr) { - return (char *)ptr - &_car_relocatable_data_start[0]; + return (char *)ptr - &_car_global_start[0]; }
#else diff --git a/src/arch/x86/include/arch/symbols.h b/src/arch/x86/include/arch/symbols.h index 18b0539..a516155 100644 --- a/src/arch/x86/include/arch/symbols.h +++ b/src/arch/x86/include/arch/symbols.h @@ -31,22 +31,18 @@ extern char _car_stack_end[]; #define _car_stack_size (_car_stack_end - _car_stack_start)
+extern char _car_unallocated_start[]; + extern char _car_ehci_dbg_info_start[]; extern char _car_ehci_dbg_info_end[]; #define _car_ehci_dbg_info_size \ (_car_ehci_dbg_info_end - _car_ehci_dbg_info_start)
/* - * The _car_relocatable_data_[start|end] symbols cover CAR data which is - * relocatable once memory comes online. Variables with CAR_GLOBAL decoration - * reside within this region. The _car_global_[start|end] is a subset of the - * relocatable region which excludes the timestamp region because of - * intricacies in the timestamp code. + * The _car_global_[start|end]symbols cover CAR data which is relocatable + * once memory comes online. Variables with CAR_GLOBAL decoration + * reside within this region. */ -extern char _car_relocatable_data_start[]; -extern char _car_relocatable_data_end[]; -#define _car_relocatable_data_size \ - (_car_relocatable_data_end - _car_relocatable_data_start) extern char _car_global_start[]; extern char _car_global_end[]; #define _car_global_size (_car_global_end - _car_global_start) diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c index e094576..78e417f 100644 --- a/src/cpu/amd/car/post_cache_as_ram.c +++ b/src/cpu/amd/car/post_cache_as_ram.c @@ -101,11 +101,11 @@ void *migrated_car = (void *)(CONFIG_RAMTOP - car_size);
print_car_debug("Copying data from cache to RAM..."); - memcpy_(migrated_car, _car_relocatable_data_start, car_size); + memcpy_(migrated_car, _car_global_start, car_size); print_car_debug(" Done\n");
print_car_debug("Verifying data integrity in RAM..."); - if (memcmp_(migrated_car, _car_relocatable_data_start, car_size) == 0) + if (memcmp_(migrated_car, _car_global_start, car_size) == 0) print_car_debug(" Done\n"); else print_car_debug(" FAILED\n"); diff --git a/src/cpu/x86/car.c b/src/cpu/x86/car.c index 4995cf8..d8767ae 100644 --- a/src/cpu/x86/car.c +++ b/src/cpu/x86/car.c @@ -44,8 +44,8 @@ { char *migrated_base = NULL; int offset; - void *_car_start = _car_relocatable_data_start; - void *_car_end = _car_relocatable_data_end; + void *_car_start = _car_global_start; + void *_car_end = _car_global_end;
/* If the cache-as-ram has not been migrated return the pointer * passed in. */ @@ -127,7 +127,7 @@ return; }
- memcpy(migrated_base, _car_relocatable_data_start, car_size); + memcpy(migrated_base, _car_global_start, car_size);
/* Mark that the data has been moved. */ car_migrated = ~0; diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index 08afffc..1386d2c 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -407,7 +407,7 @@ /* Build up memory map of romstage address space including CAR. */ memranges_init_empty(&memmap, &freeranges[0], ARRAY_SIZE(freeranges)); memranges_insert(&memmap, (uintptr_t)_car_region_start, - _car_relocatable_data_end - _car_region_start, 0); + _car_unallocated_start - _car_region_start, 0); memranges_insert(&memmap, (uintptr_t)_program, REGION_SIZE(program), 0);
if (!CONFIG(FSP_M_XIP)) diff --git a/src/soc/intel/quark/romstage/fsp2_0.c b/src/soc/intel/quark/romstage/fsp2_0.c index 6e23de7..c999bce 100644 --- a/src/soc/intel/quark/romstage/fsp2_0.c +++ b/src/soc/intel/quark/romstage/fsp2_0.c @@ -115,7 +115,7 @@ aupd->StackBase); printk(BIOS_SPEW, "| |\n"); printk(BIOS_SPEW, "+-------------------+ 0x%p\n", - _car_relocatable_data_end); + _car_global_end); printk(BIOS_SPEW, "| coreboot data |\n"); printk(BIOS_SPEW, "+-------------------+ 0x%p\n", _car_stack_end);