summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-11-28 18:10:03 +0200
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2013-12-06 17:50:29 +0100
commitfab0c9f35db584ed0fb597fa99719a965e2fbd9a (patch)
treefb0aa7ca17c3c80911973637110a3cadd1614d44
parente4c657c4afe968c86efe30766a1d14a29c782093 (diff)
downloadcoreboot-fab0c9f35db584ed0fb597fa99719a965e2fbd9a.tar.xz
butterfly: Fix build without ChromeOS
Use a file in CBFS for keyboard layout and ethernet MAC instead of scanning FMAP. Change-Id: I7658c7c4e389deb20d7d8f57cce8b568efdc575d Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/4307 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
-rw-r--r--src/mainboard/google/butterfly/mainboard.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mainboard/google/butterfly/mainboard.c b/src/mainboard/google/butterfly/mainboard.c
index b11c22678f..eb7d363c9c 100644
--- a/src/mainboard/google/butterfly/mainboard.c
+++ b/src/mainboard/google/butterfly/mainboard.c
@@ -39,7 +39,11 @@
#include <smbios.h>
#include <device/pci.h>
#include <ec/quanta/ene_kb3940q/ec.h>
+#if CONFIG_CHROMEOS
#include <vendorcode/google/chromeos/fmap.h>
+#else
+#include <cbfs.h>
+#endif
static unsigned int search(char *p, char *a, unsigned int lengthp,
unsigned int lengtha)
@@ -294,11 +298,21 @@ static void verb_setup(void)
static void mainboard_init(device_t dev)
{
- char **vpd_region_ptr = NULL;
- u32 search_length = find_fmap_entry("RO_VPD", (void **)vpd_region_ptr);
- u32 search_address = (unsigned long)(*vpd_region_ptr);
+ u32 search_address = 0x0;
+ u32 search_length = -1;
u16 io_base = 0;
struct device *ethernet_dev = NULL;
+#if CONFIG_CHROMEOS
+ char **vpd_region_ptr = NULL;
+ search_length = find_fmap_entry("RO_VPD", (void **)vpd_region_ptr);
+ search_address = (unsigned long)(*vpd_region_ptr);
+#else
+ struct cbfs_file *vpd_file = cbfs_get_file(CBFS_DEFAULT_MEDIA, "vpd.bin");
+ if (vpd_file) {
+ search_length = ntohl(vpd_file->len);
+ search_address = (unsigned long)CBFS_SUBHEADER(vpd_file);
+ }
+#endif
/* Initialize the Embedded Controller */
butterfly_ec_init();