Commit 24e88ab0 authored by Ard Biesheuvel's avatar Ard Biesheuvel
Browse files

Merge tag 'efi-loongarch-for-v6.1-2' into HEAD

Second shared stable tag between EFI and LoongArch trees

This is necessary because the EFI libstub refactoring patches are mostly
directed at enabling LoongArch to wire up generic EFI boot support
without being forced to consume DT properties that conflict with
information that EFI also provides, e.g., memory map and reservations,
etc.
parents a241d94b 40cd01a9
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -65,10 +65,6 @@ linux,uefi-mmap-desc-size 32-bit Size in bytes of each entry in the UEFI


linux,uefi-mmap-desc-ver    32-bit   Version of the mmap descriptor format.
linux,uefi-mmap-desc-ver    32-bit   Version of the mmap descriptor format.


linux,initrd-start          64-bit   Physical start address of an initrd

linux,initrd-end            64-bit   Physical end address of an initrd

kaslr-seed                  64-bit   Entropy used to randomize the kernel image
kaslr-seed                  64-bit   Entropy used to randomize the kernel image
                                     base address location.
                                     base address location.
==========================  ======   ===========================================
==========================  ======   ===========================================
+0 −3
Original line number Original line Diff line number Diff line
@@ -104,8 +104,6 @@ config LOONGARCH
	select MODULES_USE_ELF_RELA if MODULES
	select MODULES_USE_ELF_RELA if MODULES
	select NEED_PER_CPU_EMBED_FIRST_CHUNK
	select NEED_PER_CPU_EMBED_FIRST_CHUNK
	select NEED_PER_CPU_PAGE_FIRST_CHUNK
	select NEED_PER_CPU_PAGE_FIRST_CHUNK
	select OF
	select OF_EARLY_FLATTREE
	select PCI
	select PCI
	select PCI_DOMAINS_GENERIC
	select PCI_DOMAINS_GENERIC
	select PCI_ECAM if ACPI
	select PCI_ECAM if ACPI
@@ -311,7 +309,6 @@ config DMI
config EFI
config EFI
	bool "EFI runtime service support"
	bool "EFI runtime service support"
	select UCS2_STRING
	select UCS2_STRING
	select EFI_PARAMS_FROM_FDT
	select EFI_RUNTIME_WRAPPERS
	select EFI_RUNTIME_WRAPPERS
	help
	help
	  This enables the kernel to use EFI runtime services that are
	  This enables the kernel to use EFI runtime services that are
+1 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ struct loongson_system_configuration {
};
};


extern u64 efi_system_table;
extern u64 efi_system_table;
extern unsigned long fw_arg0, fw_arg1;
extern unsigned long fw_arg0, fw_arg1, fw_arg2;
extern struct loongson_board_info b_info;
extern struct loongson_board_info b_info;
extern struct loongson_system_configuration loongson_sysconf;
extern struct loongson_system_configuration loongson_sysconf;


+29 −1
Original line number Original line Diff line number Diff line
@@ -27,8 +27,13 @@
static unsigned long efi_nr_tables;
static unsigned long efi_nr_tables;
static unsigned long efi_config_table;
static unsigned long efi_config_table;


static unsigned long __initdata boot_memmap = EFI_INVALID_TABLE_ADDR;

static efi_system_table_t *efi_systab;
static efi_system_table_t *efi_systab;
static efi_config_table_type_t arch_tables[] __initdata = {{},};
static efi_config_table_type_t arch_tables[] __initdata = {
	{LINUX_EFI_BOOT_MEMMAP_GUID,	&boot_memmap,	"MEMMAP" },
	{},
};


void __init efi_runtime_init(void)
void __init efi_runtime_init(void)
{
{
@@ -51,6 +56,7 @@ void __init efi_init(void)
{
{
	int size;
	int size;
	void *config_tables;
	void *config_tables;
	struct efi_boot_memmap *tbl;


	if (!efi_system_table)
	if (!efi_system_table)
		return;
		return;
@@ -61,6 +67,8 @@ void __init efi_init(void)
		return;
		return;
	}
	}


	efi_systab_report_header(&efi_systab->hdr, efi_systab->fw_vendor);

	set_bit(EFI_64BIT, &efi.flags);
	set_bit(EFI_64BIT, &efi.flags);
	efi_nr_tables	 = efi_systab->nr_tables;
	efi_nr_tables	 = efi_systab->nr_tables;
	efi_config_table = (unsigned long)efi_systab->tables;
	efi_config_table = (unsigned long)efi_systab->tables;
@@ -70,6 +78,26 @@ void __init efi_init(void)
	efi_config_parse_tables(config_tables, efi_systab->nr_tables, arch_tables);
	efi_config_parse_tables(config_tables, efi_systab->nr_tables, arch_tables);
	early_memunmap(config_tables, efi_nr_tables * size);
	early_memunmap(config_tables, efi_nr_tables * size);


	set_bit(EFI_CONFIG_TABLES, &efi.flags);

	if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI)
	if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI)
		memblock_reserve(screen_info.lfb_base, screen_info.lfb_size);
		memblock_reserve(screen_info.lfb_base, screen_info.lfb_size);

	if (boot_memmap == EFI_INVALID_TABLE_ADDR)
		return;

	tbl = early_memremap_ro(boot_memmap, sizeof(*tbl));
	if (tbl) {
		struct efi_memory_map_data data;

		data.phys_map		= boot_memmap + sizeof(*tbl);
		data.size		= tbl->map_size;
		data.desc_size		= tbl->desc_size;
		data.desc_version	= tbl->desc_ver;

		if (efi_memmap_init_early(&data) < 0)
			panic("Unable to map EFI memory map.\n");

		early_memunmap(tbl, sizeof(*tbl));
	}
}
}
+4 −9
Original line number Original line Diff line number Diff line
@@ -8,7 +8,6 @@
#include <linux/efi.h>
#include <linux/efi.h>
#include <linux/export.h>
#include <linux/export.h>
#include <linux/memblock.h>
#include <linux/memblock.h>
#include <linux/of_fdt.h>
#include <asm/early_ioremap.h>
#include <asm/early_ioremap.h>
#include <asm/bootinfo.h>
#include <asm/bootinfo.h>
#include <asm/loongson.h>
#include <asm/loongson.h>
@@ -20,21 +19,17 @@ EXPORT_SYMBOL(loongson_sysconf);
void __init init_environ(void)
void __init init_environ(void)
{
{
	int efi_boot = fw_arg0;
	int efi_boot = fw_arg0;
	struct efi_memory_map_data data;
	char *cmdline = early_memremap_ro(fw_arg1, COMMAND_LINE_SIZE);
	void *fdt_ptr = early_memremap_ro(fw_arg1, SZ_64K);


	if (efi_boot)
	if (efi_boot)
		set_bit(EFI_BOOT, &efi.flags);
		set_bit(EFI_BOOT, &efi.flags);
	else
	else
		clear_bit(EFI_BOOT, &efi.flags);
		clear_bit(EFI_BOOT, &efi.flags);


	early_init_dt_scan(fdt_ptr);
	strscpy(boot_command_line, cmdline, COMMAND_LINE_SIZE);
	early_init_fdt_reserve_self();
	early_memunmap(cmdline, COMMAND_LINE_SIZE);
	efi_system_table = efi_get_fdt_params(&data);


	efi_memmap_init_early(&data);
	efi_system_table = fw_arg2;
	memblock_reserve(data.phys_map & PAGE_MASK,
			 PAGE_ALIGN(data.size + (data.phys_map & ~PAGE_MASK)));
}
}


static int __init init_cpu_fullname(void)
static int __init init_cpu_fullname(void)
Loading