The newest version of OBP is capable of doing an EFI boot. When Linux
is booted thru this EFI loader, the /sys/firmware/efi directory does
not exist. Many userspace applications, such as GRUB, check whether
the dir /sys/firmware/efi exists, if it exists it means
the kernel has booted in EFI mode.
A new Open Firmware property called efi-booter has been added
to /chosen. This new property is only present when doing an
EFI boot.
Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
Reviewed-by Thomas Tai <thomas.tai@oracle.com>
Orabug:
26037358
Signed-off-by: Allen Pais <allen.pais@oracle.com>
config HAVE_SETUP_PER_CPU_AREA
def_bool y if SPARC64
+config EFI
+ def_bool y if SPARC64
+ select UCS2_STRING
+
config NEED_PER_CPU_EMBED_FIRST_CHUNK
def_bool y if SPARC64
#include <linux/start_kernel.h>
#include <linux/bootmem.h>
#include <linux/iommu-common.h>
+#include <linux/efi.h>
#include <asm/io.h>
#include <asm/processor.h>
}
}
+void __init sparc_efi_init(void)
+{
+#ifdef CONFIG_EFI
+ phandle node;
+
+ node = prom_finddevice("/chosen");
+ if (prom_getproplen(node, "efi-booter") > 0) {
+ set_bit(EFI_BOOT, &efi.flags);
+ set_bit(EFI_64BIT, &efi.flags);
+ }
+#endif
+}
+
void __init setup_arch(char **cmdline_p)
{
/* Initialize PROM console and command line. */
}
#endif
+ sparc_efi_init();
+
/* Get boot processor trap_block[] setup. */
init_cur_cpu_trap(current_thread_info());
return 0;
}
+#ifndef CONFIG_SPARC
int __init efi_config_init(efi_config_table_type_t *arch_tables)
{
void *config_tables;
early_memunmap(config_tables, efi.systab->nr_tables * sz);
return ret;
}
+#endif
#ifdef CONFIG_EFI_VARS_MODULE
static int __init efi_load_efivars(void)