mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-04 10:43:35 +00:00
x86: coreboot: add SMBIOS cbmem entry parsing
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
d9e7efe10a
commit
53942b9658
3 changed files with 27 additions and 0 deletions
|
@ -69,6 +69,17 @@ static void cb_parse_vbnv(unsigned char *ptr, struct sysinfo_t *info)
|
||||||
info->vbnv_size = vbnv->vbnv_size;
|
info->vbnv_size = vbnv->vbnv_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void cb_parse_cbmem_entry(unsigned char *ptr, struct sysinfo_t *info)
|
||||||
|
{
|
||||||
|
struct cb_cbmem_entry *entry = (struct cb_cbmem_entry *)ptr;
|
||||||
|
|
||||||
|
if (entry->id != CBMEM_ID_SMBIOS)
|
||||||
|
return;
|
||||||
|
|
||||||
|
info->smbios_start = entry->address;
|
||||||
|
info->smbios_size = entry->entry_size;
|
||||||
|
}
|
||||||
|
|
||||||
static void cb_parse_gpios(unsigned char *ptr, struct sysinfo_t *info)
|
static void cb_parse_gpios(unsigned char *ptr, struct sysinfo_t *info)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -206,6 +217,9 @@ static int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
|
||||||
case CB_TAG_VBNV:
|
case CB_TAG_VBNV:
|
||||||
cb_parse_vbnv(ptr, info);
|
cb_parse_vbnv(ptr, info);
|
||||||
break;
|
break;
|
||||||
|
case CB_TAG_CBMEM_ENTRY:
|
||||||
|
cb_parse_cbmem_entry(ptr, info);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
cb_parse_unhandled(rec->tag, ptr);
|
cb_parse_unhandled(rec->tag, ptr);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -49,6 +49,8 @@ struct sysinfo_t {
|
||||||
u32 vdat_size;
|
u32 vdat_size;
|
||||||
void *tstamp_table;
|
void *tstamp_table;
|
||||||
void *cbmem_cons;
|
void *cbmem_cons;
|
||||||
|
u64 smbios_start;
|
||||||
|
u32 smbios_size;
|
||||||
|
|
||||||
struct cb_serial *serial;
|
struct cb_serial *serial;
|
||||||
};
|
};
|
||||||
|
|
|
@ -214,6 +214,17 @@ struct cb_vbnv {
|
||||||
uint32_t vbnv_size;
|
uint32_t vbnv_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define CB_TAG_CBMEM_ENTRY 0x0031
|
||||||
|
#define CBMEM_ID_SMBIOS 0x534d4254
|
||||||
|
|
||||||
|
struct cb_cbmem_entry {
|
||||||
|
uint32_t tag;
|
||||||
|
uint32_t size;
|
||||||
|
uint64_t address;
|
||||||
|
uint32_t entry_size;
|
||||||
|
uint32_t id;
|
||||||
|
};
|
||||||
|
|
||||||
#define CB_TAG_CMOS_OPTION_TABLE 0x00c8
|
#define CB_TAG_CMOS_OPTION_TABLE 0x00c8
|
||||||
|
|
||||||
struct cb_cmos_option_table {
|
struct cb_cmos_option_table {
|
||||||
|
|
Loading…
Add table
Reference in a new issue