coreboot/src/include
Vadim Bendebury 32da8bed19 CBMEM CONSOLE: Add CBMEM console driver implementation.
The CBMEM console driver saves console output in a CBMEM area, which
then is made available to Linux applications for perusing.

There are some system limitations which need to be worked around
to achieve this goal:

- some console traffic is generated before DRAM is initialized,
  leave alone CBMEM initialized.

- after the RAM based stage starts, a lot of traffic is generated
  before CBMEM is initialized.

As a result, the console log lives in three different places -
the bottom of the cache as RAM space, the CBMEM buffer (where it
is expected to be) and a static buffer used early in the RAM
stage.

When execution starts (in the cache as RAM mode), the console
buffer is allocated at the bottom of the cache as RAM memory
address range. Once DRAM is initialized, the CBMEM structure is
initialized, and then the console buffer contents are copied from
the bottom of the cache as RAM space into the CBMEM area right
before the cache as RAM mode is disabled. The
src/lib/cbmem_console.c:cbmemc_reinit() takes care of the
copying.

At this point the cache as RAM memory is about to be disabled,
but the ROM stage is still going generating console output. To
make sure this output is not lost, cbmemc_reinit() saves the new
buffer address at a fixed location (0x600 was chosen for this),
and the actual "printing" function checks to see if the RAM is
already initialized (the stack is in RAM), and if so, gets the
console buffer pointer from this location instead of using the
cache as RAM address.

When the RAM stage starts, a static buffer is used to store the
console output, as the CBMEM buffer location is not known. Then,
when CBMEM is reinitialized, cbmemc_reinit() again takes care of
the copying.

In case the allocated buffers are not large enough, the excessive
data is dropped, and the copying routine adds some text to the
output buffer to indicate that there has been data lost and how
many characters were dropped.

Change-Id: I8c126e31db6cb2141f7f4f97c5047f39a8db44fc
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: http://review.coreboot.org/719
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
2012-03-29 20:14:25 +02:00
..
arch-generic - First stab at getting the ppc ports building and working. 2004-11-18 22:38:08 +00:00
boot Extend coreboot table entry for serial ports 2011-10-21 23:34:30 +02:00
console CBMEM CONSOLE: Add CBMEM console driver implementation. 2012-03-29 20:14:25 +02:00
cpu xchg is atomic with side-effects 2012-03-16 22:22:49 +01:00
device Add RDC R8610 PCI IDs. 2012-03-27 11:58:28 +02:00
pc80 Add cmos helper functions for reading/writing a dword 2012-03-28 21:35:10 +02:00
smp Since some people disapprove of white space cleanups mixed in regular commits 2010-04-27 06:56:47 +00:00
assert.h We call this cache as ram everywhere, so let's call it the same in Kconfig 2010-08-30 17:53:13 +00:00
cbfs.h split CBFS support into shared core and extended functions 2011-08-04 08:10:54 +02:00
cbfs_core.h Since cbfs_core.h provides a macro that uses ntohl, make sure ntohl is available 2012-03-14 23:00:25 +01:00
cbmem.h Increase CBMEM to accommodate larger console. 2012-03-29 20:13:43 +02:00
delay.h This is a general cleanup patch 2010-02-22 06:09:43 +00:00
ehci.h Fix usb debug dongle support 2011-10-31 04:06:10 +01:00
fallback.h In 2007 Adrian Reber suggested that we drop ASSEMBLY in favor of __ASSEMBLER__. 2011-04-10 04:15:23 +00:00
ip_checksum.h Add support for the console over Ethernet (through PCI NE2000). 2010-07-16 20:02:09 +00:00
lib.h AMD Geode cpus: apply un-written naming rules 2012-02-13 21:56:38 +01:00
reset.h more warning fixes. 2010-03-17 03:14:54 +00:00
sdram_mode.h Various license header consistency fixes (trivial). 2010-02-15 23:10:19 +00:00
smbios.h Add automatic SMBIOS table generation 2011-08-26 20:08:52 +02:00
spd.h Some more DIMM0 related cleanups and deduplication. 2010-11-20 20:23:08 +00:00
spd_ddr2.h Add VIA CX700 support, plus VIA vt8454c reference board support. 2009-04-17 08:37:18 +00:00
stdlib.h drop unneeded __ROMCC__ checks when the check for __PRE_RAM__ is more 2010-03-28 21:26:54 +00:00
string.h Add an implementation for the memchr library function 2012-03-09 20:00:53 +01:00
swab.h Add macros for 64bit byte order swapping 2011-10-21 14:13:19 +02:00
timestamp.h Add timestamp collecting to coreboot. 2012-03-28 20:43:59 +02:00
trace.h Add support for the tracing infastructure in coreboot. 2011-09-07 01:26:47 +02:00
types.h Some changes required to get yabel working on v2 (and they generally make 2009-03-01 10:16:01 +00:00
uart8250.h move console includes to central console/console.h 2012-03-09 20:31:45 +01:00
usb_ch9.h USB Debug Port related license header fixes (trivial). 2010-09-23 18:16:46 +00:00
usbdebug.h Fix usb debug dongle support 2011-10-31 04:06:10 +01:00
version.h Rename almost all occurences of LinuxBIOS to coreboot. 2008-01-18 15:08:58 +00:00
watchdog.h This is a general cleanup patch 2010-02-22 06:09:43 +00:00