| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#ifndef _SYSINFO_H |
| 30 |
#define _SYSINFO_H |
| 31 |
|
| 32 |
#include <pci/pci.h> |
| 33 |
#include <stdint.h> |
| 34 |
|
| 35 |
|
| 36 |
#define SYSINFO_MAX_MEM_RANGES 32 |
| 37 |
|
| 38 |
#define SYSINFO_MAX_GPIOS 8 |
| 39 |
|
| 40 |
|
| 41 |
#define SYSINFO_MAX_MACS 10 |
| 42 |
|
| 43 |
|
| 44 |
#define SYSINFO_MAX_MMAP_WINDOWS 2 |
| 45 |
|
| 46 |
#include <coreboot_tables.h> |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
struct sysinfo_t { |
| 56 |
unsigned int cpu_khz; |
| 57 |
uintptr_t cb_serial; |
| 58 |
unsigned short ser_ioport; |
| 59 |
unsigned long ser_base; |
| 60 |
|
| 61 |
int n_memranges; |
| 62 |
|
| 63 |
struct memrange { |
| 64 |
unsigned long long base; |
| 65 |
unsigned long long size; |
| 66 |
unsigned int type; |
| 67 |
} memrange[SYSINFO_MAX_MEM_RANGES]; |
| 68 |
|
| 69 |
uintptr_t cmos_option_table; |
| 70 |
u32 cmos_range_start; |
| 71 |
u32 cmos_range_end; |
| 72 |
u32 cmos_checksum_location; |
| 73 |
u32 vbnv_start; |
| 74 |
u32 vbnv_size; |
| 75 |
|
| 76 |
uintptr_t version; |
| 77 |
uintptr_t extra_version; |
| 78 |
uintptr_t build; |
| 79 |
uintptr_t compile_time; |
| 80 |
uintptr_t compile_by; |
| 81 |
uintptr_t compile_host; |
| 82 |
uintptr_t compile_domain; |
| 83 |
uintptr_t compiler; |
| 84 |
uintptr_t linker; |
| 85 |
uintptr_t assembler; |
| 86 |
uintptr_t mem_chip_base; |
| 87 |
uintptr_t pcie_ctrl_base; |
| 88 |
|
| 89 |
uintptr_t cb_version; |
| 90 |
|
| 91 |
struct cb_framebuffer framebuffer; |
| 92 |
|
| 93 |
int num_gpios; |
| 94 |
struct cb_gpio gpios[SYSINFO_MAX_GPIOS]; |
| 95 |
int num_macs; |
| 96 |
struct mac_address macs[SYSINFO_MAX_MACS]; |
| 97 |
uintptr_t serialno; |
| 98 |
|
| 99 |
unsigned long *mbtable; |
| 100 |
|
| 101 |
uintptr_t cb_header; |
| 102 |
uintptr_t cb_mainboard; |
| 103 |
|
| 104 |
uintptr_t vboot_workbuf; |
| 105 |
|
| 106 |
#if CONFIG(LP_ARCH_X86) |
| 107 |
int x86_rom_var_mtrr_index; |
| 108 |
#endif |
| 109 |
|
| 110 |
uintptr_t tstamp_table; |
| 111 |
uintptr_t cbmem_cons; |
| 112 |
uintptr_t mrc_cache; |
| 113 |
uintptr_t acpi_gnvs; |
| 114 |
uintptr_t acpi_cnvs; |
| 115 |
uintptr_t acpi_rsdp; |
| 116 |
uintptr_t smbios; |
| 117 |
uintptr_t cse_bp_info; |
| 118 |
uintptr_t cse_info; |
| 119 |
|
| 120 |
#define UNDEFINED_STRAPPING_ID (~0) |
| 121 |
#define UNDEFINED_FW_CONFIG ~((uint64_t)0) |
| 122 |
u32 board_id; |
| 123 |
u32 ram_code; |
| 124 |
u32 sku_id; |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
u64 fw_config; |
| 131 |
|
| 132 |
uintptr_t wifi_calibration; |
| 133 |
uint64_t ramoops_buffer; |
| 134 |
uint32_t ramoops_buffer_size; |
| 135 |
struct { |
| 136 |
uint32_t size; |
| 137 |
uint32_t sector_size; |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
uint8_t erase_cmd; |
| 144 |
uint8_t flags; |
| 145 |
uint16_t reserved; |
| 146 |
uint32_t mmap_window_count; |
| 147 |
struct flash_mmap_window mmap_table[SYSINFO_MAX_MMAP_WINDOWS]; |
| 148 |
} spi_flash; |
| 149 |
uint64_t fmap_offset; |
| 150 |
uint64_t cbfs_offset; |
| 151 |
uint64_t cbfs_size; |
| 152 |
uint64_t boot_media_size; |
| 153 |
uint64_t mtc_start; |
| 154 |
uint32_t mtc_size; |
| 155 |
uintptr_t chromeos_vpd; |
| 156 |
int mmc_early_wake_status; |
| 157 |
|
| 158 |
|
| 159 |
uintptr_t fmap_cache; |
| 160 |
|
| 161 |
#if CONFIG(LP_PCI) |
| 162 |
struct pci_access pacc; |
| 163 |
#endif |
| 164 |
|
| 165 |
uintptr_t type_c_info; |
| 166 |
|
| 167 |
|
| 168 |
uintptr_t cbfs_ro_mcache_offset; |
| 169 |
uint32_t cbfs_ro_mcache_size; |
| 170 |
uintptr_t cbfs_rw_mcache_offset; |
| 171 |
uint32_t cbfs_rw_mcache_size; |
| 172 |
|
| 173 |
|
| 174 |
uintptr_t pvmfw; |
| 175 |
uint32_t pvmfw_size; |
| 176 |
enum boot_mode_t boot_mode; |
| 177 |
}; |
| 178 |
|
| 179 |
extern struct sysinfo_t lib_sysinfo; |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
int cb_parse_arch_specific(struct cb_record *rec, struct sysinfo_t *info); |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
int cb_parse_header(void *addr, int len, struct sysinfo_t *info); |
| 194 |
|
| 195 |
#endif |