summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2014-09-22 19:36:28 -0700
committerPatrick Georgi <pgeorgi@google.com>2015-03-20 15:32:46 +0100
commitb7d7412261d14e9e7a9ef5835d76cc243821b07b (patch)
tree205fa6944fbdc99e610023efd78626aeaf92a40e /payloads/libpayload/libc
parent864ec8c488eb195b73c876be8fe2b879efa470e0 (diff)
libpayload: cros: include mac addresses in coreboot table
Pass MAC addresses found in coreboot table into lib_sysinfo. BUG=chrome-os-partner:32152 TEST=with all changes in place MAC addresses are properly inserted into the kernel device tree. Change-Id: I6b13c1c2c246362256abce3efa4a97b355647ef8 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: e2fe74f86b4ed43eb8a3c9d99055afc5d6fb7b78 Original-Change-Id: I1d0bd437fb27fabd14b9ba1fb5415586cd8847bb Original-Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/219444 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/8751 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r--payloads/libpayload/libc/coreboot.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/payloads/libpayload/libc/coreboot.c b/payloads/libpayload/libc/coreboot.c
index b51372660f..8ed0307650 100644
--- a/payloads/libpayload/libc/coreboot.c
+++ b/payloads/libpayload/libc/coreboot.c
@@ -114,6 +114,20 @@ static void cb_parse_vdat(unsigned char *ptr, struct sysinfo_t *info)
info->vdat_addr = phys_to_virt(vdat->range_start);
info->vdat_size = vdat->range_size;
}
+
+static void cb_parse_mac_addresses(unsigned char *ptr,
+ struct sysinfo_t *info)
+{
+ struct cb_macs *macs = (struct cb_macs *)ptr;
+ int i;
+
+ info->num_macs = (macs->count < ARRAY_SIZE(info->macs)) ?
+ macs->count : ARRAY_SIZE(info->macs);
+
+ for (i = 0; i < info->num_macs; i++)
+ info->macs[i] = macs->mac_addrs[i];
+}
+
#endif
static void cb_parse_tstamp(unsigned char *ptr, struct sysinfo_t *info)
@@ -291,6 +305,9 @@ int cb_parse_header(void *addr, int len, struct sysinfo_t *info)
case CB_TAG_VBOOT_HANDOFF:
cb_parse_vboot_handoff(ptr, info);
break;
+ case CB_TAG_MAC_ADDRS:
+ cb_parse_mac_addresses(ptr, info);
+ break;
#endif
case CB_TAG_TIMESTAMPS:
cb_parse_tstamp(ptr, info);