From fab0c9f35db584ed0fb597fa99719a965e2fbd9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 28 Nov 2013 18:10:03 +0200 Subject: butterfly: Fix build without ChromeOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: http://review.coreboot.org/4307 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc --- src/mainboard/google/butterfly/mainboard.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/mainboard/google') 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 #include #include +#if CONFIG_CHROMEOS #include +#else +#include +#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(); -- cgit v1.2.3