Replace UNPACK_CB64 macro with inline
[coreboot.git] / payloads / libpayload / include / coreboot_tables.h
index 88dc251cd881a1b5a950b40c1ada078a66a3529a..3b3b7d2299b00146b1838cb3dc8edaf05d9d3420 100644 (file)
@@ -60,9 +60,13 @@ struct cb_memory_range {
        u32 type;
 };
 
-#define CB_MEM_RAM      1
-#define CB_MEM_RESERVED 2
-#define CB_MEM_TABLE    16
+#define CB_MEM_RAM          1
+#define CB_MEM_RESERVED     2
+#define CB_MEM_ACPI         3
+#define CB_MEM_NVS          4
+#define CB_MEM_UNUSABLE     5
+#define CB_MEM_VENDOR_RSVD  6
+#define CB_MEM_TABLE       16
 
 struct cb_memory {
        u32 tag;
@@ -110,7 +114,11 @@ struct cb_string {
 struct cb_serial {
        u32 tag;
        u32 size;
-       u16 ioport;
+#define CB_SERIAL_TYPE_IO_MAPPED     1
+#define CB_SERIAL_TYPE_MEMORY_MAPPED 2
+       u32 type;
+       u32 baseaddr;
+       u32 baud;
 };
 
 #define CB_TAG_CONSOLE       0x00010
@@ -122,13 +130,98 @@ struct cb_console {
 };
 
 #define CB_TAG_CONSOLE_SERIAL8250 0
-#define CB_TAG_CONSOLE_VGA        1
-#define CB_TAG_CONSOLE_BTEXT      2
+#define CB_TAG_CONSOLE_VGA        1 // OBSOLETE
+#define CB_TAG_CONSOLE_BTEXT      2 // OBSOLETE
 #define CB_TAG_CONSOLE_LOGBUF     3
-#define CB_TAG_CONSOLE_SROM       4
+#define CB_TAG_CONSOLE_SROM       4 // OBSOLETE
 #define CB_TAG_CONSOLE_EHCI       5
 
-/* Still to come: CMOS information. */
+#define CB_TAG_FORWARD       0x00011
+
+struct cb_forward {
+       u32 tag;
+       u32 size;
+       u64 forward;
+};
+
+#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;
+};
+
+#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;
+};
+
+/* Helpful inlines */
+
+static inline u64 cb_unpack64(struct cbuint64 val)
+{
+       return (((u64) val.hi) << 32) | val.lo;
+}
 
 /* Helpful macros */
 
@@ -145,7 +238,4 @@ struct cb_console {
 #define MB_PART_STRING(_mb) \
        (((unsigned char *) ((_mb)->strings)) + (_mb)->part_number_idx)
 
-#define UNPACK_CB64(_in) \
-       ( (((u64) _in.hi) << 32) | _in.lo )
-
 #endif