libpayload: Add support for parsing RAMOOPS range from coreboot

CQ-DEPEND=CL:228856
BUG=chrome-os-partner:33676
BRANCH=None
TEST=Compiles and boots to kernel prompt. ramoops console log verified after
causing kernel to fault.

Change-Id: I8886015977e1fd999ef74fe73d08cff935cbce5c
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/228742
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Furquan Shaikh 2014-11-08 17:19:31 -08:00 committed by chrome-internal-fetch
commit 80c843fc78
3 changed files with 14 additions and 0 deletions

View file

@ -188,6 +188,7 @@ struct cb_gpios {
#define CB_TAG_VBNV 0x0019
#define CB_TAG_VBOOT_HANDOFF 0x0020
#define CB_TAG_DMA 0x0022
#define CB_TAG_RAM_OOPS 0x0023
struct cb_range {
uint32_t tag;
uint32_t size;

View file

@ -115,6 +115,8 @@ struct sysinfo_t {
void *acpi_gnvs;
u32 board_id;
void *wifi_calibration;
uint64_t ramoops_buffer;
uint32_t ramoops_buffer_size;
};
extern struct sysinfo_t lib_sysinfo;

View file

@ -189,6 +189,14 @@ static void cb_parse_wifi_calibration(void *ptr, struct sysinfo_t *info)
info->wifi_calibration = phys_to_virt(cbmem->cbmem_tab);
}
static void cb_parse_ramoops(void *ptr, struct sysinfo_t *info)
{
struct cb_range *ramoops = (struct cb_range *)ptr;
info->ramoops_buffer = ramoops->range_start;
info->ramoops_buffer_size = ramoops->range_size;
}
int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
{
struct cb_header *header;
@ -324,6 +332,9 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
case CB_TAG_WIFI_CALIBRATION:
cb_parse_wifi_calibration(ptr, info);
break;
case CB_TAG_RAM_OOPS:
cb_parse_ramoops(ptr, info);
break;
default:
cb_parse_arch_specific(rec, info);
break;