From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 9/9] efi: bus: add firmware vendor and resision and tables info
Date: Fri, 10 Feb 2017 11:37:50 +0100 [thread overview]
Message-ID: <1486723070-32548-9-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1486723070-32548-1-git-send-email-plagnioj@jcrosoft.com>
This alllow us to known where we boot from
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
drivers/efi/efi-device.c | 23 +++++++++++++++++++++++
include/efi.h | 7 ++++++-
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/drivers/efi/efi-device.c b/drivers/efi/efi-device.c
index 2864d0cf1..7eb94de45 100644
--- a/drivers/efi/efi-device.c
+++ b/drivers/efi/efi-device.c
@@ -341,10 +341,33 @@ struct bus_type efi_bus = {
.remove = efi_bus_remove,
};
+static void efi_businfo(struct device_d *dev)
+{
+ int i;
+
+ printf("Tables:\n");
+ for (i = 0; i < efi_sys_table->nr_tables; i++) {
+ efi_config_table_t *t = &efi_sys_table->tables[i];
+
+ printf(" %d: %pUl: %s\n", i, &t->guid,
+ efi_guid_string(&t->guid));
+ }
+}
+
static int efi_init_devices(void)
{
+ char *fw_vendor = NULL;
+
bus_register(&efi_bus);
+ fw_vendor = strdup_wchar_to_char((const wchar_t *)efi_sys_table->fw_vendor);
+ dev_add_param_fixed(efi_bus.dev, "fw_vendor", fw_vendor);
+ free(fw_vendor);
+
+ dev_add_param_int_ro(efi_bus.dev, "fw_revision", efi_sys_table->fw_revision, "%u");
+
+ efi_bus.dev->info = efi_businfo;
+
efi_register_devices();
return 0;
diff --git a/include/efi.h b/include/efi.h
index fa6fb2782..4b812c9ab 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -488,6 +488,11 @@ extern efi_guid_t efi_block_io_protocol_guid;
extern efi_guid_t efi_barebox_vendor_guid;
extern efi_guid_t efi_systemd_vendor_guid;
+typedef struct {
+ efi_guid_t guid;
+ unsigned long table;
+} efi_config_table_t;
+
#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)
#define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))
@@ -510,7 +515,7 @@ typedef struct {
efi_runtime_services_t *runtime;
efi_boot_services_t *boottime;
unsigned long nr_tables;
- unsigned long tables;
+ efi_config_table_t *tables;
} efi_system_table_t;
typedef struct {
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2017-02-10 10:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 9:56 [PATCH 0/9] EFI: drop arch efi Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` [PATCH 1/9] efi: move block io driver to driver/block Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` [PATCH 2/9] efi: move clocksource out of arch Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` [PATCH 3/9] efi: move bus driver to driver/efi Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` [PATCH 4/9] efi: move debug_ll.h to include/efi Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` [PATCH 5/9] efi: move startup and payload to common/efi Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` [PATCH 6/9] x86: move bios bootup code to arch/x86/bios Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` [PATCH 7/9] efi: move x86 efi boot support to x86 arch Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` [PATCH 8/9] ARCH: efi: Finally drop it as now we can build efi bootup from x86 Jean-Christophe PLAGNIOL-VILLARD
2017-02-10 10:37 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2017-02-14 7:39 ` [PATCH 0/9] EFI: drop arch efi Sascha Hauer
2017-02-15 13:04 ` Sascha Hauer
2017-02-15 19:27 ` Jean-Christophe PLAGNIOL-VILLARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1486723070-32548-9-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.