coreboot-kgpe-d16/src/lib
Hung-Te Lin 6fe0cab205 Extend CBFS to support arbitrary ROM source media.
Summary:
	Isolate CBFS underlying I/O to board/arch-specific implementations as
	"media stream", to allow loading and booting romstage on non-x86.

	CBFS functions now all take a new "media source" parameter; use
	CBFS_DEFAULT_MEDIA if you simply want to load from main firmware.
	API Changes:
		cbfs_find => cbfs_get_file.
		cbfs_find_file => cbfs_get_file_content.
		cbfs_get_file => cbfs_get_file_content with correct type.

CBFS used to work only on memory-mapped ROM (all x86). For platforms like ARM,
the ROM may come from USB, UART, or SPI -- any serial devices and not available
for memory mapping.

To support these devices (and allowing CBFS to read from multiple source
at the same time), CBFS operations are now virtual-ized into "cbfs_media".  To
simplify porting existing code, every media source must support both "reading
into pre-allocated memory (read)" and "read and return an allocated buffer
(map)". For devices without native memory-mapped ROM, "cbfs_simple_buffer*"
provides simple memory mapping simulation.

Every CBFS function now takes a cbfs_media* as parameter. CBFS_DEFAULT_MEDIA
is defined for CBFS functions to automatically initialize a per-board default
media (CBFS will internally calls init_default_cbfs_media).  Also revised CBFS
function names relying on memory mapped backend (ex, "cbfs_find" => actually
loads files). Now we only have two getters:
	struct cbfs_file *entry = cbfs_get_file(media, name);
	void *data = cbfs_get_file_content(CBFS_DEFAULT_MEDIA, name, type);

Test results:
 - Verified to work on x86/qemu.
 - Compiles on ARM, and follow up commit will provide working SPI driver.

Change-Id: Iac911ded25a6f2feffbf3101a81364625bb07746
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: http://review.coreboot.org/2182
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2013-01-30 17:58:32 +01:00
..
cbfs.c Extend CBFS to support arbitrary ROM source media. 2013-01-30 17:58:32 +01:00
cbfs_core.c Extend CBFS to support arbitrary ROM source media. 2013-01-30 17:58:32 +01:00
cbmem.c Implement GCC code coverage analysis 2013-01-12 19:09:55 +01:00
cbmem_console.c Add infrastructure for global data in the CAR phase of boot 2012-03-29 23:19:13 +02: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
debug.c Myles suspected this hangs certain machines, so back it out. 2010-04-15 12:43:07 +00:00
delay.c - Major cleanup of the bootpath 2003-07-19 04:28:22 +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 Implement GCC code coverage analysis 2013-01-12 19:09:55 +01: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
hardwaremain.c Extend CBFS to support arbitrary ROM source media. 2013-01-30 17:58:32 +01: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 Shrink the stack sizes we need in coreboot 2012-07-24 19:52:53 +02: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 Implement GCC code coverage analysis 2013-01-12 19:09:55 +01: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 - 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
memset.c fix compiler warnings (trivial) 2009-01-20 21:40:16 +00:00
ne2k.c Fix of fix copy and paste errors in ne2k.c (r6512 by stepan) 2011-04-22 22:26:04 +00: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
ramtest.c Replace ramtest pattern to assist in DIMM configuration 2012-03-25 20:17:51 +02:00
selfboot.c Extend CBFS to support arbitrary ROM source media. 2013-01-30 17:58:32 +01:00
stack.c Clean up stack checking code 2012-11-13 18:25:17 +01:00
timestamp.c src/lib/timestamp.c: Fix spelling of tim*e*stamp 2013-01-22 12:15:08 +01:00
trace.c Add support for the tracing infastructure in coreboot. 2011-09-07 01:26:47 +02:00
uart8250.c Remove whitespace. 2012-02-17 19:04:31 +01:00
uart8250mem.c Don't loop infinitely long on serial comm failures 2012-05-08 04:34:26 +02:00
usbdebug.c USBDEBUG: retry harder for slow devices 2012-07-30 20:54:24 +02:00
version.c This patch fixes build.h dependencies in coreboot again. 2010-03-29 13:04:13 +00:00
xmodem.c Move C labels to start-of-line 2012-03-07 17:48:03 +01:00