switch-coreboot/src/lib
Julius Werner 3c814b2e2b cbmem: Always maintain backing store struct in a global on non-x86
The current CBMEM code contains an optimization that maintains the
structure with information about the CBMEM backing store in a global
variable, so that we don't have to recover it from cbmem_top() again
every single time we access CBMEM. However, due to the problems with
using globals in x86 romstage, this optimization has only been enabled
in ramstage.

However, all non-x86 platforms are SRAM-based (at least for now) and
can use globals perfectly fine in earlier stages. Therefore, this patch
extends the optimization on those platforms to all stages. This also
allows us to remove the requirement that cbmem_top() needs to return
NULL before its backing store has been initialized from those boards,
since the CBMEM code can now keep track of whether it has been
initialized by itself.

Change-Id: Ia6c1db00ae01dee485d5e96e4315cb399dc63696
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/16273
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2016-08-27 01:16:34 +02:00
..
b64_decode.c lib: add base64 decoder 2015-04-22 08:50:54 +02:00
boot_device.c lib/boot_device: add RW boot device construct 2016-08-19 03:07:05 +02:00
bootblock.c lib: Add asmlinkage attribute to bootblock_main_with_timestamp 2016-06-09 17:15:35 +02:00
bootmem.c lib/bootmem: allow architecture specific bootmem ranges 2016-04-21 20:46:45 +02:00
bootmode.c bootmode: Get rid of CONFIG_BOOTMODE_STRAPS 2016-07-28 00:36:22 +02:00
cbfs.c cbfs: Add "struct" file type and associated helpers 2016-08-27 01:16:22 +02:00
cbmem_common.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
cbmem_console.c src/lib: Capitalize ROM, RAM, NVRAM and CPU 2016-07-31 19:30:54 +02:00
cbmem_stage_cache.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
compute_ip_checksum.c lib: Fix spelling 2013-07-10 20:17:51 +02:00
coreboot_table.c drivers/spi: ensure SPI flash is boot device for coreboot tables 2016-08-19 18:14:20 +02:00
debug.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
delay.c - Major cleanup of the bootpath 2003-07-19 04:28:22 +00:00
edid.c edid: Make framebuffer row alignment configurable 2016-04-07 20:46:38 +02:00
ext_stage_cache.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
fallback_boot.c drivers/pc80: Rework normal / fallback selector code 2015-11-03 21:55:20 +01:00
fmap.c lib/fmap: provide RW region device support 2016-08-19 18:17:04 +02:00
gcc.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-glue.c lib/gcov-glue.c: Remove trailing number from COVERAGE_MAGIC macro 2016-02-02 01:39:28 +01:00
gcov-io.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-io.h tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
gcov-iov.h Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
generic_dump_spd.c misc: Drop print_ implementation from non-romcc boards 2015-01-09 06:12:22 +01:00
generic_sdram.c misc: Drop print_ implementation from non-romcc boards 2015-01-09 06:12:22 +01:00
gpio.c lib/gpio: add pullup & pulldown gpio_base2_value() variants 2016-07-07 20:44:36 +02:00
halt.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
hardwaremain.c lib/hardwaremain: Add \n to "Boot failed" message 2016-05-31 20:20:44 +02:00
hexdump.c lib/hexdump: Refactor to skip lines with all ones as well 2016-01-22 14:10:28 +01:00
hexstrtobin.c hexstrtobin: Add a library function to decode ASCII hex into binary 2016-05-21 05:58:51 +02:00
imd.c Correct some common spelling mistakes 2016-01-07 22:57:02 +01:00
imd_cbmem.c cbmem: Always maintain backing store struct in a global on non-x86 2016-08-27 01:16:34 +02:00
jpeg.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
jpeg.h tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
libgcc.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
libgcov.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
lzma.c lib: remove ulzma() 2016-07-01 23:55:16 +02:00
lzmadecode.c lzma: Port size-checking ulzman() version to coreboot 2016-02-12 22:00:55 +01:00
lzmadecode.h Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
Makefile.inc drivers/spi: move cbfs_spi.c location 2016-08-19 03:05:07 +02:00
malloc.c Remove leftover smi_get_tseg_base 2015-05-29 07:06:37 +02:00
memchr.c Add an implementation for the memchr library function 2012-03-09 20:00:53 +01:00
memcmp.c - Initial checkin of the freebios2 tree 2003-04-22 19:02:15 +00:00
memcpy.c fix compiler warnings (trivial) 2009-01-20 21:40:16 +00:00
memmove.c tidy 2004-03-13 03:40:29 +00:00
memrange.c lib/memrange: avoid shadow object declarations 2016-02-26 02:14:56 +01:00
memset.c fix compiler warnings (trivial) 2009-01-20 21:40:16 +00:00
mocked_tlcl.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
nhlt.c lib/nhlt: add helper functions for adding endpoints 2016-06-29 23:13:54 +02:00
primitive_memtest.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
prog_loaders.c region: Add writeat and eraseat support 2016-06-24 20:48:12 +02:00
prog_ops.c lib/prog_loading: introduce prog_segment_loaded() 2016-04-02 03:56:37 +02:00
program.ld program.ld: Don't exclude sbe region from verstage 2016-05-21 06:04:32 +02:00
ramtest.c misc: Drop print_ implementation from non-romcc boards 2015-01-09 06:12:22 +01:00
reg_script.c lib/reg_script: Fix braces 2016-05-05 19:41:29 +02:00
rmodule.c lib/prog_loading: introduce prog_segment_loaded() 2016-04-02 03:56:37 +02:00
rmodule.ld rmodule: use program.ld for linking 2015-09-09 19:35:30 +00:00
romstage_stack.c intel post-car: Consolidate choose_top_of_stack() 2016-07-10 11:16:07 +02:00
rtc.c lib: Add real-time-clock functions 2016-06-24 20:22:05 +02:00
selfboot.c src/lib: Capitalize ROM, RAM, NVRAM and CPU 2016-07-31 19:30:54 +02:00
stack.c lib/stack: Add stack overrun detection 2015-10-24 05:57:33 +02:00
thread.c src/lib: Capitalize ROM, RAM, NVRAM and CPU 2016-07-31 19:30:54 +02:00
timer.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
timer_queue.c tree: drop last paragraph of GPL copyright header 2015-10-31 21:37:39 +01:00
timestamp.c memlayout: Ensure TIMESTAMP() region is big enough to avoid BUG() 2016-08-23 21:33:29 +02:00
tlcl.c chromeos: vboot2: Add TPM PCR extension support 2015-04-20 17:06:28 +02:00
tlcl_internal.h vboot2: read secdata and nvdata 2015-03-23 19:51:47 +01:00
tlcl_structures.h vboot2: copy tlcl from vboot_reference as a preparation for vboot2 integration 2015-01-27 01:43:57 +01:00
tpm2_marshaling.c tpm2: implement and use pcr_extend command 2016-07-14 00:00:30 +02:00
tpm2_marshaling.h tpm2: avoid comparison between signed and unsigned ints 2016-07-13 23:58:32 +02:00
tpm2_tlcl.c src/lib: Capitalize ROM, RAM, NVRAM and CPU 2016-07-31 19:30:54 +02:00
tpm2_tlcl_structures.h tpm2: implement and use pcr_extend command 2016-07-14 00:00:30 +02:00
tpm_error_messages.h Remove non-ascii & unprintable characters 2016-08-01 21:44:45 +02:00
trace.c src/lib/trace.c: Make address size generic 2016-03-10 17:28:26 +01:00
version.c lib/version: Correct whitespace alignment 2016-07-15 00:10:50 +02:00
wrdd.c lib: Implement framework for retrieving WiFi regulatory domain 2016-03-08 18:41:33 +01:00