coreboot: Move coreboot table processing code out of depthcharge-y.

This code has extra dependencies and should only be used when handing off from
coreboot.

Change-Id: I163d86ece5335ed445e18106e4752ef39b1020ad
diff --git a/src/base/Makefile.inc b/src/base/Makefile.inc
index 50af5b2..bcae633 100644
--- a/src/base/Makefile.inc
+++ b/src/base/Makefile.inc
@@ -20,7 +20,6 @@
 depthcharge-y += banner.c
 depthcharge-y += cleanup.c
 depthcharge-y += console.c
-depthcharge-y += coreboot.c
 depthcharge-y += dc_stack.c
 depthcharge-y += dcdir.c
 depthcharge-y += device_tree.c
@@ -35,5 +34,6 @@
 depthcharge-y += queue.c
 depthcharge-y += ranges.c
 depthcharge-y += state_machine.c
+depthcharge-y += sysinfo.c
 depthcharge-y += time.c
 depthcharge-y += timestamp.c
diff --git a/src/base/sysinfo.c b/src/base/sysinfo.c
new file mode 100644
index 0000000..05f1c9d
--- /dev/null
+++ b/src/base/sysinfo.c
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008 Advanced Micro Devices, Inc.
+ * Copyright (C) 2009 coresystems GmbH
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <assert.h>
+#include <sysinfo.h>
+
+#include "base/fwdb.h"
+
+struct sysinfo_t *get_sysinfo(void)
+{
+	static struct sysinfo_t *sysinfo;
+	if (sysinfo)
+		return sysinfo;
+
+	FwdbEntry sysinfo_entry;
+	assert(fwdb_access("lib_sysinfo", &sysinfo_entry, NULL) == 0);
+	assert(sysinfo_entry.size == sizeof(struct sysinfo_t));
+	sysinfo = (struct sysinfo_t *)sysinfo_entry.ptr;
+
+	return sysinfo;
+}
+
+int create_sysinfo(void)
+{
+	FwdbEntry sysinfo_entry = {
+		.ptr = NULL,
+		.size = sizeof(struct sysinfo_t),
+	};
+	return fwdb_access("lib_sysinfo", NULL, &sysinfo_entry);
+}
diff --git a/src/drivers/board/samus/coreboot.c b/src/drivers/board/samus/coreboot.c
index 567e171..8c12341 100644
--- a/src/drivers/board/samus/coreboot.c
+++ b/src/drivers/board/samus/coreboot.c
@@ -28,7 +28,7 @@
 	// Make sure the backlight is disabled. We'll re-enable it if we
 	// need it.
 	SamusPanel *panel = board__panel();
-	return monitor_disable(panel);
+	return monitor_disable(&panel->ops);
 }
 
 INIT_FUNC(samus_coreboot_handoff);
diff --git a/src/module/Makefile.inc b/src/module/Makefile.inc
index ad0b652..1762f49 100644
--- a/src/module/Makefile.inc
+++ b/src/module/Makefile.inc
@@ -15,7 +15,7 @@
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-subdirs-y += cb fsp qemu trampoline uefi
+subdirs-y += cb fsp handoff qemu trampoline uefi
 
 depthcharge-y += module.c
 
diff --git a/src/module/handoff/Makefile.inc b/src/module/handoff/Makefile.inc
new file mode 100644
index 0000000..473071f
--- /dev/null
+++ b/src/module/handoff/Makefile.inc
@@ -0,0 +1,20 @@
+##
+## Copyright 2012 Google Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+##
+
+classes-y += coreboot_handoff
+
+coreboot_handoff-y += coreboot.c
diff --git a/src/base/coreboot.c b/src/module/handoff/coreboot.c
similarity index 94%
rename from src/base/coreboot.c
rename to src/module/handoff/coreboot.c
index ca5d625..55d42c3 100644
--- a/src/base/coreboot.c
+++ b/src/module/handoff/coreboot.c
@@ -37,29 +37,6 @@
 #include "drivers/framebuffer/framebuffer.h"
 #include "vboot/util/vboot_handoff.h"
 
-struct sysinfo_t *get_sysinfo(void)
-{
-	static struct sysinfo_t *sysinfo;
-	if (sysinfo)
-		return sysinfo;
-
-	FwdbEntry sysinfo_entry;
-	assert(fwdb_access("lib_sysinfo", &sysinfo_entry, NULL) == 0);
-	assert(sysinfo_entry.size == sizeof(struct sysinfo_t));
-	sysinfo = (struct sysinfo_t *)sysinfo_entry.ptr;
-
-	return sysinfo;
-}
-
-int create_sysinfo(void)
-{
-	FwdbEntry sysinfo_entry = {
-		.ptr = NULL,
-		.size = sizeof(struct sysinfo_t),
-	};
-	return fwdb_access("lib_sysinfo", NULL, &sysinfo_entry);
-}
-
 /*
  * The code in this file applies to all coreboot architectures. Some coreboot
  * table tags are architecture specific, they are handled by their respective