Commit ac623bdf authored by Jing Li's avatar Jing Li Committed by guzitao
Browse files

sw64: fix compile error of efi.systab

Sunway inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB73UR



--------------------------------

The systab field has been removed from struct efi. To get systab, we can
parse it from the DTB provided by firmware.

Signed-off-by: default avatarJing Li <jingli@wxiat.com>
Reviewed-by: default avatarHe Sheng <hesheng@wxiat.com>
Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
parent 49e2eb55
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -30,5 +30,7 @@ extern void (*pm_halt)(void);
extern int i2c_set_adapter(void);
extern void cpld_write(uint8_t slave_addr, uint8_t reg, uint8_t data);
extern void fix_jm585_reset(void);
extern void early_parse_fdt_property(const void *fdt, const char *path,
		const char *prop_name, u64 *property, int size);

#endif /* _ASM_SW64_PLATFORM_H */
+4 −3
Original line number Diff line number Diff line
@@ -289,11 +289,10 @@ static void update_boot_params(void)
		params.dtb_start = (unsigned long)arch_kexec_alloc_and_setup_fdt(
				params.initrd_start, params.initrd_size,
				(const char *)params.cmdline);
		/* update dtb base address */
		sunway_dtb_address = params.dtb_start;

#ifdef CONFIG_EFI
		params.efi_systab = virt_to_phys((void *)efi.systab);
		early_parse_fdt_property((void *)sunway_dtb_address, "/chosen",
			"linux,uefi-system-table", &params.efi_systab, sizeof(u64));
		params.efi_memmap = efi.memmap.phys_map;
		params.efi_memmap_size = efi.memmap.map_end - efi.memmap.map;
		params.efi_memdesc_size = efi.memmap.desc_size;
@@ -312,6 +311,8 @@ static void update_boot_params(void)
		if (update_efi_properties(&params))
			pr_err("Note: failed to update efi properties\n");
#endif
		/* update dtb base address */
		sunway_dtb_address = params.dtb_start;
	}

	pr_info("initrd_start     = %#llx, initrd_size         = %#llx\n"
+1 −1
Original line number Diff line number Diff line
@@ -553,7 +553,7 @@ static bool __init arch_dtb_verify(void *dt_virt, bool from_firmware)
	return true;
}

static void early_parse_fdt_property(const void *fdt, const char *path,
void early_parse_fdt_property(const void *fdt, const char *path,
		const char *prop_name, u64 *property, int size)
{
	int node, prop_len;