summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vendorcode/google/chromeos/chromeos.h8
-rw-r--r--src/vendorcode/google/chromeos/gnvs.c2
-rw-r--r--src/vendorcode/google/chromeos/ramoops.c29
3 files changed, 11 insertions, 28 deletions
diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h
index 35e2dde740..233078baea 100644
--- a/src/vendorcode/google/chromeos/chromeos.h
+++ b/src/vendorcode/google/chromeos/chromeos.h
@@ -27,14 +27,6 @@ static inline void reboot_from_watchdog(void) { return; }
*/
void mainboard_prepare_cr50_reset(void);
-#include "gnvs.h"
-
-#if CONFIG(CHROMEOS_RAMOOPS)
-void chromeos_ram_oops_init(chromeos_acpi_t *chromeos);
-#else /* !CONFIG_CHROMEOS_RAMOOPS */
-static inline void chromeos_ram_oops_init(chromeos_acpi_t *chromeos) {}
-#endif /* CONFIG_CHROMEOS_RAMOOPS */
-
void cbmem_add_vpd_calibration_data(void);
void chromeos_set_me_hash(u32*, int);
diff --git a/src/vendorcode/google/chromeos/gnvs.c b/src/vendorcode/google/chromeos/gnvs.c
index f0e8e5b913..62d19d6d51 100644
--- a/src/vendorcode/google/chromeos/gnvs.c
+++ b/src/vendorcode/google/chromeos/gnvs.c
@@ -38,8 +38,6 @@ void chromeos_init_chromeos_acpi(chromeos_acpi_t *init)
/* Copy saved ME hash into NVS */
memcpy(chromeos_acpi->mehh, me_hash_saved, sizeof(chromeos_acpi->mehh));
- chromeos_ram_oops_init(chromeos_acpi);
-
vpd_size = chromeos_vpd_region("RO_VPD", &vpd_base);
if (vpd_size && vpd_base) {
chromeos_acpi->vpd_ro_base = vpd_base;
diff --git a/src/vendorcode/google/chromeos/ramoops.c b/src/vendorcode/google/chromeos/ramoops.c
index ae72133d11..77e079f2b1 100644
--- a/src/vendorcode/google/chromeos/ramoops.c
+++ b/src/vendorcode/google/chromeos/ramoops.c
@@ -9,11 +9,11 @@
#include <cbmem.h>
#include <device/device.h>
#include "chromeos.h"
+#include "gnvs.h"
-#if CONFIG(HAVE_ACPI_TABLES)
-
-static void set_ramoops(chromeos_acpi_t *chromeos, void *ram_oops, size_t size)
+static void set_ramoops(void *ram_oops, size_t size)
{
+ chromeos_acpi_t *chromeos = chromeos_get_chromeos_acpi();
if (chromeos == NULL) {
printk(BIOS_DEBUG, "chromeos gnvs is NULL. ramoops not set.\n");
return;
@@ -24,33 +24,26 @@ static void set_ramoops(chromeos_acpi_t *chromeos, void *ram_oops, size_t size)
chromeos->ramoops_len = size;
}
-void chromeos_ram_oops_init(chromeos_acpi_t *chromeos)
-{
- const size_t size = CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE;
- void *ram_oops;
-
- ram_oops = cbmem_add(CBMEM_ID_RAM_OOPS, size);
-
- set_ramoops(chromeos, ram_oops, size);
-}
-
-#else
-
static void ramoops_alloc(void *arg)
{
const size_t size = CONFIG_CHROMEOS_RAMOOPS_RAM_SIZE;
+ void *ram_oops;
if (size == 0)
return;
- if (cbmem_add(CBMEM_ID_RAM_OOPS, size) == NULL)
+ ram_oops = cbmem_add(CBMEM_ID_RAM_OOPS, size);
+ if (ram_oops == NULL) {
printk(BIOS_ERR, "Could not allocate RAMOOPS buffer\n");
+ return;
+ }
+
+ if (CONFIG(HAVE_ACPI_TABLES))
+ set_ramoops(ram_oops, size);
}
BOOT_STATE_INIT_ENTRY(BS_WRITE_TABLES, BS_ON_ENTRY, ramoops_alloc, NULL);
-#endif
-
void lb_ramoops(struct lb_header *header)
{
void *buffer = cbmem_find(CBMEM_ID_RAM_OOPS);