diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2017-02-15 20:34:17 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-09 07:36:14 +0100 |
commit | 83c9ce1dbc41f9e1d609a3047c9a035168cdf22f (patch) | |
tree | 629ce3a18a9447b4e057981da4fbb4c963bb06e0 /drivers/efi | |
parent | 7e3fcac20a499a268d3374d8fc515044e3bcf6f0 (diff) | |
download | barebox-83c9ce1dbc41f9e1d609a3047c9a035168cdf22f.tar.gz barebox-83c9ce1dbc41f9e1d609a3047c9a035168cdf22f.tar.xz |
efi: bus: add firmware vendor and resision and tables info
This alllow us to known where we boot from
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/efi')
-rw-r--r-- | drivers/efi/efi-device.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/efi/efi-device.c b/drivers/efi/efi-device.c index 2864d0cf1c..7eb94de455 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; |