2008-03-20 00:56:58 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the libpayload project.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2008 Advanced Micro Devices, Inc.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2008-04-11 20:01:50 +02:00
|
|
|
#ifndef _COREBOOT_TABLES_H
|
|
|
|
#define _COREBOOT_TABLES_H
|
2008-03-20 00:56:58 +01:00
|
|
|
|
|
|
|
#include <arch/types.h>
|
|
|
|
|
|
|
|
struct cbuint64 {
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 lo;
|
|
|
|
u32 hi;
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_header {
|
2008-04-11 20:01:50 +02:00
|
|
|
u8 signature[4];
|
|
|
|
u32 header_bytes;
|
|
|
|
u32 header_checksum;
|
|
|
|
u32 table_bytes;
|
|
|
|
u32 table_checksum;
|
|
|
|
u32 table_entries;
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct cb_record {
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_UNUSED 0x0000
|
|
|
|
#define CB_TAG_MEMORY 0x0001
|
|
|
|
|
|
|
|
struct cb_memory_range {
|
|
|
|
struct cbuint64 start;
|
|
|
|
struct cbuint64 size;
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 type;
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_MEM_RAM 1
|
|
|
|
#define CB_MEM_RESERVED 2
|
|
|
|
#define CB_MEM_TABLE 16
|
|
|
|
|
|
|
|
struct cb_memory {
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
2008-03-20 00:56:58 +01:00
|
|
|
struct cb_memory_range map[0];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_HWRPB 0x0002
|
|
|
|
|
|
|
|
struct cb_hwrpb {
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u64 hwrpb;
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_MAINBOARD 0x0003
|
|
|
|
|
|
|
|
struct cb_mainboard {
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u8 vendor_idx;
|
|
|
|
u8 part_number_idx;
|
|
|
|
u8 strings[0];
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_VERSION 0x0004
|
|
|
|
#define CB_TAG_EXTRA_VERSION 0x0005
|
|
|
|
#define CB_TAG_BUILD 0x0006
|
|
|
|
#define CB_TAG_COMPILE_TIME 0x0007
|
|
|
|
#define CB_TAG_COMPILE_BY 0x0008
|
|
|
|
#define CB_TAG_COMPILE_HOST 0x0009
|
|
|
|
#define CB_TAG_COMPILE_DOMAIN 0x000a
|
|
|
|
#define CB_TAG_COMPILER 0x000b
|
|
|
|
#define CB_TAG_LINKER 0x000c
|
|
|
|
#define CB_TAG_ASSEMBLER 0x000d
|
|
|
|
|
|
|
|
struct cb_string {
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u8 string[0];
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_SERIAL 0x000f
|
|
|
|
|
|
|
|
struct cb_serial {
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u16 ioport;
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_CONSOLE 0x00010
|
|
|
|
|
|
|
|
struct cb_console {
|
2008-04-11 20:01:50 +02:00
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u16 type;
|
2008-03-20 00:56:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_CONSOLE_SERIAL8250 0
|
2010-11-22 09:09:50 +01:00
|
|
|
#define CB_TAG_CONSOLE_VGA 1 // OBSOLETE
|
|
|
|
#define CB_TAG_CONSOLE_BTEXT 2 // OBSOLETE
|
2008-03-20 00:56:58 +01:00
|
|
|
#define CB_TAG_CONSOLE_LOGBUF 3
|
2010-11-22 09:09:50 +01:00
|
|
|
#define CB_TAG_CONSOLE_SROM 4 // OBSOLETE
|
2008-03-20 00:56:58 +01:00
|
|
|
#define CB_TAG_CONSOLE_EHCI 5
|
|
|
|
|
2009-03-17 17:41:01 +01:00
|
|
|
#define CB_TAG_FORWARD 0x00011
|
|
|
|
|
|
|
|
struct cb_forward {
|
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u64 forward;
|
|
|
|
};
|
|
|
|
|
2010-03-25 19:56:26 +01:00
|
|
|
#define CB_TAG_FRAMEBUFFER 0x0012
|
|
|
|
struct cb_framebuffer {
|
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
|
|
|
|
u64 physical_address;
|
|
|
|
u32 x_resolution;
|
|
|
|
u32 y_resolution;
|
|
|
|
u32 bytes_per_line;
|
|
|
|
u8 bits_per_pixel;
|
|
|
|
u8 red_mask_pos;
|
|
|
|
u8 red_mask_size;
|
|
|
|
u8 green_mask_pos;
|
|
|
|
u8 green_mask_size;
|
|
|
|
u8 blue_mask_pos;
|
|
|
|
u8 blue_mask_size;
|
|
|
|
u8 reserved_mask_pos;
|
|
|
|
u8 reserved_mask_size;
|
|
|
|
};
|
|
|
|
|
2008-08-07 12:21:05 +02:00
|
|
|
#define CB_TAG_CMOS_OPTION_TABLE 0x00c8
|
|
|
|
struct cb_cmos_option_table {
|
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u32 header_length;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_OPTION 0x00c9
|
|
|
|
#define CMOS_MAX_NAME_LENGTH 32
|
|
|
|
struct cb_cmos_entries {
|
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u32 bit;
|
|
|
|
u32 length;
|
|
|
|
u32 config;
|
|
|
|
u32 config_id;
|
|
|
|
u8 name[CMOS_MAX_NAME_LENGTH];
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#define CB_TAG_OPTION_ENUM 0x00ca
|
|
|
|
#define CMOS_MAX_TEXT_LENGTH 32
|
|
|
|
struct cb_cmos_enums {
|
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u32 config_id;
|
|
|
|
u32 value;
|
|
|
|
u8 text[CMOS_MAX_TEXT_LENGTH];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_OPTION_DEFAULTS 0x00cb
|
|
|
|
#define CMOS_IMAGE_BUFFER_SIZE 128
|
|
|
|
struct cb_cmos_defaults {
|
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u32 name_length;
|
|
|
|
u8 name[CMOS_MAX_NAME_LENGTH];
|
|
|
|
u8 default_set[CMOS_IMAGE_BUFFER_SIZE];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define CB_TAG_OPTION_CHECKSUM 0x00cc
|
|
|
|
#define CHECKSUM_NONE 0
|
|
|
|
#define CHECKSUM_PCBIOS 1
|
|
|
|
struct cb_cmos_checksum {
|
|
|
|
u32 tag;
|
|
|
|
u32 size;
|
|
|
|
u32 range_start;
|
|
|
|
u32 range_end;
|
|
|
|
u32 location;
|
|
|
|
u32 type;
|
|
|
|
};
|
2008-03-20 00:56:58 +01:00
|
|
|
|
|
|
|
/* Helpful macros */
|
|
|
|
|
|
|
|
#define MEM_RANGE_COUNT(_rec) \
|
2008-03-20 20:54:59 +01:00
|
|
|
(((_rec)->size - sizeof(*(_rec))) / sizeof((_rec)->map[0]))
|
2008-03-20 00:56:58 +01:00
|
|
|
|
|
|
|
#define MEM_RANGE_PTR(_rec, _idx) \
|
2008-04-11 20:01:50 +02:00
|
|
|
(((u8 *) (_rec)) + sizeof(*(_rec)) \
|
2008-03-20 20:54:59 +01:00
|
|
|
+ (sizeof((_rec)->map[0]) * (_idx)))
|
2008-03-20 00:56:58 +01:00
|
|
|
|
|
|
|
#define MB_VENDOR_STRING(_mb) \
|
|
|
|
(((unsigned char *) ((_mb)->strings)) + (_mb)->vendor_idx)
|
|
|
|
|
|
|
|
#define MB_PART_STRING(_mb) \
|
|
|
|
(((unsigned char *) ((_mb)->strings)) + (_mb)->part_number_idx)
|
|
|
|
|
|
|
|
#define UNPACK_CB64(_in) \
|
2008-04-11 20:01:50 +02:00
|
|
|
( (((u64) _in.hi) << 32) | _in.lo )
|
2008-03-20 00:56:58 +01:00
|
|
|
|
|
|
|
#endif
|