1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (c) 2015 Google, Inc
5 * Access to the EFI information table
11 #include <asm/global_data.h>
13 int efi_info_get(enum efi_entry_t type, void **datap, int *sizep)
15 struct efi_entry_hdr *entry;
16 struct efi_info_hdr *info;
22 info = map_sysmem(gd->arch.table, 0);
23 if (info->version != EFI_TABLE_VERSION) {
24 ret = -EPROTONOSUPPORT;
28 entry = (struct efi_entry_hdr *)((ulong)info + info->hdr_size);
29 while (entry->type != EFIET_END) {
30 if (entry->type == type) {
32 *datap = map_sysmem(entry->addr, entry->size);
38 entry = (struct efi_entry_hdr *)((ulong)entry + entry->link);