diff options
Diffstat (limited to 'src/vendorcode/google')
-rw-r--r-- | src/vendorcode/google/chromeos/gnvs.c | 32 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/gnvs.h | 9 |
2 files changed, 24 insertions, 17 deletions
diff --git a/src/vendorcode/google/chromeos/gnvs.c b/src/vendorcode/google/chromeos/gnvs.c index a278b4109c..70aa899042 100644 --- a/src/vendorcode/google/chromeos/gnvs.c +++ b/src/vendorcode/google/chromeos/gnvs.c @@ -27,40 +27,46 @@ #include "chromeos.h" #include "gnvs.h" -chromeos_acpi_t *vboot_data = NULL; +static chromeos_acpi_t *chromeos_acpi; static u32 me_hash_saved[8]; -void chromeos_init_vboot(chromeos_acpi_t *chromeos) +void chromeos_init_vboot(chromeos_acpi_t *init) { - vboot_data = chromeos; + chromeos_acpi = init; /* Copy saved ME hash into NVS */ - memcpy(vboot_data->mehh, me_hash_saved, sizeof(vboot_data->mehh)); + memcpy(chromeos_acpi->mehh, me_hash_saved, sizeof(chromeos_acpi->mehh)); struct vboot_handoff *vboot_handoff; if (vboot_get_handoff_info((void **)&vboot_handoff, NULL) == 0) - memcpy(&chromeos->vdat[0], &vboot_handoff->shared_data[0], - ARRAY_SIZE(chromeos->vdat)); + memcpy(&chromeos_acpi->vdat[0], &vboot_handoff->shared_data[0], + ARRAY_SIZE(chromeos_acpi->vdat)); - chromeos_ram_oops_init(chromeos); + chromeos_ram_oops_init(chromeos_acpi); } void chromeos_set_me_hash(u32 *hash, int len) { - if ((len*sizeof(u32)) > sizeof(vboot_data->mehh)) + if ((len*sizeof(u32)) > sizeof(chromeos_acpi->mehh)) return; /* Copy to NVS or save until it is ready */ - if (vboot_data) + if (chromeos_acpi) /* This does never happen! */ - memcpy(vboot_data->mehh, hash, len*sizeof(u32)); + memcpy(chromeos_acpi->mehh, hash, len*sizeof(u32)); else memcpy(me_hash_saved, hash, len*sizeof(u32)); } -void acpi_get_vdat_info(uint64_t *vdat_addr, uint32_t *vdat_size) +void acpi_get_chromeos_acpi_info(uint64_t *chromeos_acpi_addr, + uint32_t *chromeos_acpi_size) { - *vdat_addr = (intptr_t)vboot_data; - *vdat_size = sizeof(*vboot_data); + *chromeos_acpi_addr = (intptr_t)chromeos_acpi; + *chromeos_acpi_size = sizeof(*chromeos_acpi); +} + +chromeos_acpi_t *acpi_get_chromeos_acpi(void) +{ + return chromeos_acpi; } diff --git a/src/vendorcode/google/chromeos/gnvs.h b/src/vendorcode/google/chromeos/gnvs.h index 82cd409e8e..e865c0e832 100644 --- a/src/vendorcode/google/chromeos/gnvs.h +++ b/src/vendorcode/google/chromeos/gnvs.h @@ -53,7 +53,7 @@ typedef struct { u32 vbt7; // 18e active main firmware type u32 vbt8; // 192 recovery reason u32 vbt9; // 196 fmap base address - u8 vdat[3072]; // 19a + u8 vdat[3072]; // 19a VDAT space filled by verified boot u32 vbt10; // d9a smbios bios version u32 mehh[8]; // d9e management engine hash u32 ramoops_base; // dbe ramoops base address @@ -61,9 +61,10 @@ typedef struct { u8 pad[314]; // dc6-eff } __packed chromeos_acpi_t; -extern chromeos_acpi_t *vboot_data; -void chromeos_init_vboot(chromeos_acpi_t *chromeos); +void chromeos_init_vboot(chromeos_acpi_t *init); void chromeos_set_me_hash(u32*, int); -void acpi_get_vdat_info(uint64_t *vdat_addr, uint32_t *vdat_size); +void acpi_get_chromeos_acpi_info(uint64_t *chromeos_acpi_addr, + uint32_t *chromeos_acpi_size); +chromeos_acpi_t *acpi_get_chromeos_acpi(void); #endif |