coreboot/src/lib
Julius Werner 7dd5bbd712 cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API
There are several use cases for performing a certain task when CBMEM is
first set up (usually to migrate some data into it that was previously
kept in BSS/SRAM/hammerspace), and unfortunately we handle each of them
differently: timestamp migration is called explicitly from
cbmem_initialize(), certain x86-chipset-specific tasks use the
CAR_MIGRATION() macro to register a hook, and the CBMEM console is
migrated through a direct call from romstage (on non-x86 and SandyBridge
boards).

This patch decouples the CAR_MIGRATION() hook mechanism from
cache-as-RAM and rechristens it to CBMEM_INIT_HOOK(), which is a clearer
description of what it really does. All of the above use cases are
ported to this new, consistent model, allowing us to have one less line
of boilerplate in non-CAR romstages.

BRANCH=None
BUG=None
TEST=Built and booted on Nyan_Blaze and Falco with and without
CONFIG_CBMEM_CONSOLE. Confirmed that 'cbmem -c' shows the full log after
boot (and the resume log after S3 resume on Falco). Compiled for Parrot,
Stout and Lumpy.

Change-Id: I1681b372664f5a1f15c3733cbd32b9b11f55f8ea
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/232612
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2014-12-04 04:01:59 +00:00
..
bootblock.ld New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
cbfs.c CBFS: Automate ROM image layout and remove hardcoded offsets 2014-12-03 06:09:54 +00:00
cbfs_core.c CBFS: Automate ROM image layout and remove hardcoded offsets 2014-12-03 06:09:54 +00:00
cbfs_spi.c New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
cbmem.c cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
cbmem_common.c cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
cbmem_console.c cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
clog2.c printk_foo -> printk(BIOS_FOO, ...) 2010-03-22 11:42:32 +00:00
compute_ip_checksum.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
coreboot_table.c ramoops: Add support for passing ramoops buffer address and size through cb 2014-11-14 06:37:22 +00:00
debug.c Myles suspected this hangs certain machines, so back it out. 2010-04-15 12:43:07 +00:00
delay.c
dynamic_cbmem.c cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
edid.c edid: initialize has_valid_detailed_blocks as 1 2014-04-21 12:51:09 +00:00
fallback_boot.c Make set_boot_successful depend on PC80_SYSTEM 2012-11-30 21:33:35 +01:00
gcc.c Unify assembler function handling 2012-12-06 23:13:17 +01:00
gcov-glue.c BACKPORT: coverage: use boot state callbacks 2013-05-01 14:30:01 -07:00
gcov-io.c Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
gcov-io.h Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
gcov-iov.h Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
generic_dump_spd.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
generic_sdram.c Remove duplicate line from pci_ids.h. 2010-10-07 23:02:06 +00:00
gpio.c gpio: add a function to read GPIO array as base-2 value 2014-11-07 20:24:35 +00:00
hardwaremain.c Broadwell FSP: Add new finalize functions for devices and chips 2014-11-20 20:49:36 +00:00
hexdump.c broadwell_fsp: Add intel FSP "driver" from coreboot.org 2014-11-19 04:10:00 +00:00
jpeg.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
jpeg.h Random cosmetic fixes (trivial). 2010-02-22 16:41:49 +00:00
libgcov.c Update gcov patch in documentation 2013-01-19 01:00:50 +01:00
lzma.c Add and consistently use wrapper macro for romstage static variables 2014-06-09 22:21:10 +00:00
lzmadecode.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00: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 cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
malloc.c SMM: Add support for malloc in SMM if using TSEG 2012-07-24 23:44:19 +02:00
memchr.c Add an implementation for the memchr library function 2012-03-09 20:00:53 +01:00
memcmp.c
memcpy.c
memmove.c
memrange.c coreboot memrange: Changes to memrange lib 2014-07-22 01:23:24 +00:00
memset.c
ne2k.c x86: Unify arch/io.h and arch/romcc_io.h 2013-03-22 00:00:09 +01:00
nrv2b.c Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
ns8390.h Add support for the console over Ethernet (through PCI NE2000). 2010-07-16 20:02:09 +00:00
primitive_memtest.c Primitive memory test 2014-07-03 02:56:56 +00:00
ramstage.ld New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
ramstage_cache.c ramstage_cache: allow ramstage usage add valid helper 2013-12-13 00:07:08 +00:00
ramtest.c Replace ramtest pattern to assist in DIMM configuration 2012-03-25 20:17:51 +02:00
reg_script.c Add table driven way to add platform specific reg_script routines 2014-11-20 23:04:25 +00:00
rmodule.c rmodule: Correct the typecast with proper parenthesis 2014-07-23 23:14:18 +00:00
rmodule.ld New mechanism to define SRAM/memory map with automatic bounds checking 2014-10-03 09:09:36 +00:00
romstage.ld cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
selfboot.c timestamp: remove conditional #if CONFIG_COLLECT_TIMESTAMPS 2014-11-07 01:24:01 +00:00
stack.c stack check: cosmetics 2013-11-15 03:54:51 +00:00
thread.c Possible thread stack implementation. 2013-08-23 10:38:10 -07:00
timer.c timer: generic udelay() 2014-09-29 08:42:38 +00:00
timer_queue.c BACKPORT: coreboot: add timer queue implementation 2013-05-01 14:30:57 -07:00
timestamp.c cbmem: Unify random on-CBMEM-init tasks under common CBMEM_INIT_HOOK() API 2014-12-04 04:01:59 +00:00
tlcl.c vboot2: read secdata and nvdata 2014-07-23 02:29:18 +00:00
tlcl_internal.h vboot2: read secdata and nvdata 2014-07-23 02:29:18 +00:00
tlcl_structures.h vboot2: copy tlcl from vboot_reference as a preparation for vboot2 integration 2014-07-08 23:29:11 +00:00
tpm_error_messages.h vboot2: copy tlcl from vboot_reference as a preparation for vboot2 integration 2014-07-08 23:29:11 +00:00
trace.c GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
uart8250.c UART 8250: Unconditionally provide register constants and use UART8250 prefix. 2013-10-02 09:18:38 +00:00
uart8250mem.c UART 8250: Unconditionally provide register constants and use UART8250 prefix. 2013-10-02 09:18:38 +00:00
usbdebug.c USBDEBUG: retry harder for slow devices 2012-07-30 20:54:24 +02:00
version.c coreboot: Introduce stage-specific architecture for coreboot 2014-05-09 04:41:47 +00:00
xmodem.c GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00