Enable -Werror for romcc
[coreboot.git] / util / mkelfImage / include / linuxbios_tables.h
1 #ifndef LINUXBIOS_TABLES_H
2 #define LINUXBIOS_TABLES_H
3
4 #include <stdint.h>
5
6 /* The linuxbios table information is for conveying information
7  * from the firmware to the loaded OS image.  Primarily this
8  * is expected to be information that cannot be discovered by
9  * other means, such as quering the hardware directly.
10  *
11  * All of the information should be Position Independent Data.
12  * That is it should be safe to relocated any of the information
13  * without it's meaning/correctnes changing.   For table that
14  * can reasonably be used on multiple architectures the data
15  * size should be fixed.  This should ease the transition between
16  * 32 bit and 64 bit architectures etc.
17  *
18  * The completeness test for the information in this table is:
19  * - Can all of the hardware be detected?
20  * - Are the per motherboard constants available?
21  * - Is there enough to allow a kernel to run that was written before
22  *   a particular motherboard is constructed? (Assuming the kernel
23  *   has drivers for all of the hardware but it does not have
24  *   assumptions on how the hardware is connected together).
25  *
26  * With this test it should be straight forward to determine if a
27  * table entry is required or not.  This should remove much of the
28  * long term compatibility burden as table entries which are
29  * irrelevant or have been replaced by better alternatives may be
30  * dropped.  Of course it is polite and expidite to include extra
31  * table entries and be backwards compatible, but it is not required.
32  */
33
34
35 struct lb_header
36 {
37         uint8_t  signature[4]; /* LBIO */
38         uint32_t header_bytes;
39         uint32_t header_checksum;
40         uint32_t table_bytes;
41         uint32_t table_checksum;
42         uint32_t table_entries;
43 };
44
45 /* Every entry in the boot enviroment list will correspond to a boot
46  * info record.  Encoding both type and size.  The type is obviously
47  * so you can tell what it is.  The size allows you to skip that
48  * boot enviroment record if you don't know what it easy.  This allows
49  * forward compatibility with records not yet defined.
50  */
51 struct lb_record {
52         uint32_t tag;           /* tag ID */
53         uint32_t size;          /* size of record (in bytes) */
54 };
55
56 #define LB_TAG_UNUSED   0x0000
57
58 #define LB_TAG_MEMORY   0x0001
59
60 struct lb_memory_range {
61         uint64_t start;
62         uint64_t size;
63         uint32_t type;
64 #define LB_MEM_RAM      1
65 #define LB_MEM_RESERVED 2
66
67 };
68
69 struct lb_memory {
70         uint32_t tag;
71         uint32_t size;
72         struct lb_memory_range map[0];
73 };
74
75 #define LB_TAG_HWRPB    0x0002
76 struct lb_hwrpb {
77         uint32_t tag;
78         uint32_t size;
79         uint64_t hwrpb;
80 };
81
82 #define LB_TAG_FORWARD  0x0011
83 struct lb_forward {
84         uint32_t tag;
85         uint32_t size;
86         uint64_t forward;
87 };
88
89
90
91 #endif /* LINUXBIOS_TABLES_H */