summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/chromebook-x86/chromeos/Makefile1
-rw-r--r--board/chromebook-x86/chromeos/fmap.c21
-rw-r--r--board/nvidia/chromeos/Makefile1
-rw-r--r--board/nvidia/chromeos/fmap.c24
-rw-r--r--common/cmd_vbexport_test.c5
-rw-r--r--common/cmd_vboot_twostop.c4
-rw-r--r--include/chromeos/fmap.h4
-rw-r--r--lib/vboot/bootstub_entry.c4
-rw-r--r--lib/vboot/global_data.c4
9 files changed, 59 insertions, 9 deletions
diff --git a/board/chromebook-x86/chromeos/Makefile b/board/chromebook-x86/chromeos/Makefile
index a3eb6ec90f2..4a74a221b65 100644
--- a/board/chromebook-x86/chromeos/Makefile
+++ b/board/chromebook-x86/chromeos/Makefile
@@ -39,6 +39,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)libchromeos_board.a
COBJS-$(CONFIG_CHROMEOS) += cros_gpio.o
+COBJS-$(CONFIG_CHROMEOS) += fmap.o
COBJS-$(CONFIG_CHROMEOS) += power_management.o
COBJS := $(COBJS-y)
diff --git a/board/chromebook-x86/chromeos/fmap.c b/board/chromebook-x86/chromeos/fmap.c
new file mode 100644
index 00000000000..7101af8cbc6
--- /dev/null
+++ b/board/chromebook-x86/chromeos/fmap.c
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ */
+
+/* Implementation of per-board fmap accessor functions */
+
+#include <chromeos/fmap.h>
+#include <common.h>
+
+int
+decode_twostop_fmap(struct twostop_fmap *fmap)
+{
+ printf("decode_twostop_fmap used but not implemented.\n");
+ return 0;
+}
diff --git a/board/nvidia/chromeos/Makefile b/board/nvidia/chromeos/Makefile
index 5bbae8c752f..76b0cad25e3 100644
--- a/board/nvidia/chromeos/Makefile
+++ b/board/nvidia/chromeos/Makefile
@@ -13,6 +13,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)libchromeos_board.a
COBJS-$(CONFIG_CHROMEOS) += cros_gpio.o
+COBJS-$(CONFIG_CHROMEOS) += fmap.o
COBJS-$(CONFIG_CHROMEOS) += power_management.o
COBJS := $(COBJS-y)
diff --git a/board/nvidia/chromeos/fmap.c b/board/nvidia/chromeos/fmap.c
new file mode 100644
index 00000000000..20095726c93
--- /dev/null
+++ b/board/nvidia/chromeos/fmap.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ */
+
+/* Implementation of per-board fmap accessor functions */
+
+#include <chromeos/fmap.h>
+#include <common.h>
+#include <chromeos/fdt_decode.h>
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int
+decode_twostop_fmap(struct twostop_fmap *fmap)
+{
+ return fdt_decode_twostop_fmap(gd->blob, fmap);
+}
diff --git a/common/cmd_vbexport_test.c b/common/cmd_vbexport_test.c
index b04ab2cd81b..bfd3e14862b 100644
--- a/common/cmd_vbexport_test.c
+++ b/common/cmd_vbexport_test.c
@@ -400,15 +400,14 @@ static int show_screen_and_delay(uint32_t screen_type)
static uint8_t *read_gbb_from_firmware(void)
{
- void *fdt_ptr = (void *)gd->blob;
vb_global_t *global;
firmware_storage_t file;
struct twostop_fmap fmap;
global = get_vboot_global();
- if (fdt_decode_twostop_fmap(fdt_ptr, &fmap)) {
- VbExDebug("Failed to load fmap config from fdt!\n");
+ if (decode_twostop_fmap(&fmap)) {
+ VbExDebug("Failed to load fmap config!\n");
return NULL;
}
diff --git a/common/cmd_vboot_twostop.c b/common/cmd_vboot_twostop.c
index 64a8ad2d603..55b5a9d7956 100644
--- a/common/cmd_vboot_twostop.c
+++ b/common/cmd_vboot_twostop.c
@@ -447,7 +447,7 @@ twostop_init(struct twostop_fmap *fmap, firmware_storage_t *file,
cros_gpio_dump(&recsw);
cros_gpio_dump(&devsw);
- if (fdt_decode_twostop_fmap(gd->blob, fmap)) {
+ if (decode_twostop_fmap(fmap)) {
VBDEBUG(PREFIX "failed to decode fmap\n");
return -1;
}
@@ -633,7 +633,7 @@ twostop_readwrite_main_firmware(void)
return VB_SELECT_ERROR;
}
- if (fdt_decode_twostop_fmap(gd->blob, &fmap)) {
+ if (decode_twostop_fmap(&fmap)) {
VBDEBUG(PREFIX "failed to decode fmap\n");
return VB_SELECT_ERROR;
}
diff --git a/include/chromeos/fmap.h b/include/chromeos/fmap.h
index 37efc4b1284..a2a88a16b50 100644
--- a/include/chromeos/fmap.h
+++ b/include/chromeos/fmap.h
@@ -11,6 +11,8 @@
#ifndef CHROMEOS_FMAP_H_
#define CHROMEOS_FMAP_H_
+#include <compiler.h>
+
/* Structures to hold Chrome OS specific configuration from the FMAP. */
struct fmap_entry {
@@ -42,4 +44,6 @@ struct twostop_fmap {
void dump_fmap(struct twostop_fmap *config);
+int decode_twostop_fmap(struct twostop_fmap *fmap);
+
#endif /* CHROMEOS_FMAP_H_ */
diff --git a/lib/vboot/bootstub_entry.c b/lib/vboot/bootstub_entry.c
index c30405076ed..17110b67b5e 100644
--- a/lib/vboot/bootstub_entry.c
+++ b/lib/vboot/bootstub_entry.c
@@ -300,8 +300,8 @@ void bootstub_entry(void)
VbSelectFirmwareParams fparams;
VbError_t ret;
- if (fdt_decode_twostop_fmap(fdt_ptr, &fmap))
- VbExError(PREFIX "Failed to load fmap config from fdt.\n");
+ if (decode_twostop_fmap(&fmap))
+ VbExError(PREFIX "Failed to load fmap config.\n");
/* Open firmware storage device */
if (firmware_storage_open_spi(&file))
diff --git a/lib/vboot/global_data.c b/lib/vboot/global_data.c
index 1442096dafd..ac0fac5e3a0 100644
--- a/lib/vboot/global_data.c
+++ b/lib/vboot/global_data.c
@@ -47,8 +47,8 @@ int init_vboot_global(vb_global_t *global, firmware_storage_t *file)
return 1;
}
- if (fdt_decode_twostop_fmap(gd->blob, &fmap)) {
- VBDEBUG(PREFIX "Failed to load fmap config from fdt!\n");
+ if (decode_twostop_fmap(&fmap)) {
+ VBDEBUG(PREFIX "Failed to load fmap config!\n");
return 1;
}