Browse Source

Patch queue for efi - 2018-06-14

A few minor fixes for the release:
 
   - Compile fixes
   - HI20 relocations for RISC-V
   - Fix bootefi without load path
   - Fix Runtime Services with certain compilers
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJbIp83AAoJECszeR4D/txg98QQAKjmnamRAJDWg5L2ZW9O8F6X
 wtpVu5O9A6C8mVnt1RICPX2zgeeZ/Hx+2NIkvzj9rOon6CNt9ofNgefKJs9i7lI2
 JOCZM9In66lGJUtNvMhbmFfWboa4DZN3bhbzU0h+clErMlcXaaatEOewUHfYTSzj
 MxwQGktESvGOvZVcKPUXnFqd4dNFnBUF7yC9R903L3LXfAtSZZwmyhoEpNeUY6PK
 1KMsycOmb5alZ90QzxAsWNTMDysnwmMXZmFTyFms3uy/NlMion+p2Wx6PQJK8woT
 ImMhAF7B4c/C+Qa2n2oGrFIjSJi/8oDupKT2tLMcFEZWkyXoHbDLm2vAADBLVWIB
 9IoxOt+N+ZVI+RSUbG0MI3aNzOcbIhXb3XwSbBnvsSabT9Uv1GMCRZfAKyROJCVR
 jZx2xvOEsJZrgbPe3fM7UUlwYvOOvc+dKGYj+PjnoS8egq676GguMgGgI9PLsJOx
 S0350+lhyVkKaSJOsTaeIFoExMrvSOmFSRl2KI1eDASwYIBI/afMIK3pgIcI4W4B
 rRYGpF7jIcQzw11mEpu4DnC/yqJFmF60EywTY+pbvPKsW0GUSJ2Lt7h7f4eL1cgo
 /za3FK1mzONKQqT6imvy3E/qWam7E58jG+W0TuQsOBH7L/1YerFmtHNnwysPUOCm
 qGHYKbPExzeLtPsVsWol
 =/PaA
 -----END PGP SIGNATURE-----

Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot

Patch queue for efi - 2018-06-14

A few minor fixes for the release:

  - Compile fixes
  - HI20 relocations for RISC-V
  - Fix bootefi without load path
  - Fix Runtime Services with certain compilers
master
Tom Rini 2 years ago
parent
commit
9d0dc69235
9 changed files with 54 additions and 20 deletions
  1. +4
    -7
      arch/arm/cpu/armv8/fwcall.c
  2. +4
    -7
      arch/arm/mach-bcm283x/reset.c
  3. +9
    -0
      cmd/bootefi.c
  4. +7
    -2
      disk/part_efi.c
  5. +1
    -2
      include/efi.h
  6. +3
    -0
      include/pe.h
  7. +14
    -0
      lib/efi_loader/efi_image_loader.c
  8. +4
    -0
      lib/efi_loader/efi_runtime.c
  9. +8
    -2
      scripts/Makefile.lib

+ 4
- 7
arch/arm/cpu/armv8/fwcall.c View File

@@ -143,15 +143,12 @@ void __efi_runtime EFIAPI efi_reset_system(
efi_status_t reset_status,
unsigned long data_size, void *reset_data)
{
switch (reset_type) {
case EFI_RESET_COLD:
case EFI_RESET_WARM:
case EFI_RESET_PLATFORM_SPECIFIC:
if (reset_type == EFI_RESET_COLD ||
reset_type == EFI_RESET_WARM ||
reset_type == EFI_RESET_PLATFORM_SPECIFIC) {
psci_system_reset();
break;
case EFI_RESET_SHUTDOWN:
} else if (reset_type == EFI_RESET_SHUTDOWN) {
psci_system_off();
break;
}

while (1) { }


+ 4
- 7
arch/arm/mach-bcm283x/reset.c View File

@@ -59,13 +59,11 @@ void __efi_runtime EFIAPI efi_reset_system(
{
u32 val;

switch (reset_type) {
case EFI_RESET_COLD:
case EFI_RESET_WARM:
case EFI_RESET_PLATFORM_SPECIFIC:
if (reset_type == EFI_RESET_COLD ||
reset_type == EFI_RESET_WARM ||
reset_type == EFI_RESET_PLATFORM_SPECIFIC) {
reset_cpu(0);
break;
case EFI_RESET_SHUTDOWN:
} else if (reset_type == EFI_RESET_SHUTDOWN) {
/*
* We set the watchdog hard reset bit here to distinguish this reset
* from the normal (full) reset. bootcode.bin will not reboot after a
@@ -76,7 +74,6 @@ void __efi_runtime EFIAPI efi_reset_system(
val |= BCM2835_WDOG_RSTS_RASPBERRYPI_HALT;
writel(val, &wdog_regs->rsts);
reset_cpu(0);
break;
}

while (1) { }


+ 9
- 0
cmd/bootefi.c View File

@@ -263,6 +263,7 @@ static efi_status_t do_bootefi_exec(void *efi,
{
struct efi_loaded_image loaded_image_info = {};
struct efi_object loaded_image_info_obj = {};
struct efi_object mem_obj = {};
struct efi_device_path *memdp = NULL;
efi_status_t ret;

@@ -279,6 +280,12 @@ static efi_status_t do_bootefi_exec(void *efi,
/* actual addresses filled in after efi_load_pe() */
memdp = efi_dp_from_mem(0, 0, 0);
device_path = image_path = memdp;
efi_add_handle(&mem_obj);

ret = efi_add_protocol(mem_obj.handle, &efi_guid_device_path,
device_path);
if (ret != EFI_SUCCESS)
goto exit;
} else {
assert(device_path && image_path);
}
@@ -343,6 +350,8 @@ static efi_status_t do_bootefi_exec(void *efi,
exit:
/* image has returned, loaded-image obj goes *poof*: */
list_del(&loaded_image_info_obj.link);
if (mem_obj.handle)
list_del(&mem_obj.link);

return ret;
}


+ 7
- 2
disk/part_efi.c View File

@@ -23,6 +23,11 @@

DECLARE_GLOBAL_DATA_PTR;

/*
* GUID for basic data partions.
*/
static const efi_guid_t partition_basic_data_guid = PARTITION_BASIC_DATA_GUID;

#ifdef CONFIG_HAVE_BLOCK_DEVICE
/**
* efi_crc32() - EFI version of crc32 function
@@ -502,12 +507,12 @@ int gpt_fill_pte(struct blk_desc *dev_desc,
} else {
/* default partition type GUID */
memcpy(bin_type_guid,
&PARTITION_BASIC_DATA_GUID, 16);
&partition_basic_data_guid, 16);
}
#else
/* partition type GUID */
memcpy(gpt_e[i].partition_type_guid.b,
&PARTITION_BASIC_DATA_GUID, 16);
&partition_basic_data_guid, 16);
#endif

#if CONFIG_IS_ENABLED(PARTITION_UUIDS)


+ 1
- 2
include/efi.h View File

@@ -89,12 +89,11 @@ typedef u64 efi_virtual_addr_t;
typedef void *efi_handle_t;

#define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
((efi_guid_t) \
{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, \
((a) >> 24) & 0xff, \
(b) & 0xff, ((b) >> 8) & 0xff, \
(c) & 0xff, ((c) >> 8) & 0xff, \
(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } })
(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } }

/* Generic EFI table header */
struct efi_table_hdr {


+ 3
- 0
include/pe.h View File

@@ -201,10 +201,13 @@ typedef struct _IMAGE_RELOCATION
#define IMAGE_REL_BASED_MIPS_JMPADDR 5
#define IMAGE_REL_BASED_ARM_MOV32A 5 /* yes, 5 too */
#define IMAGE_REL_BASED_ARM_MOV32 5 /* yes, 5 too */
#define IMAGE_REL_BASED_RISCV_HI20 5 /* yes, 5 too */
#define IMAGE_REL_BASED_SECTION 6
#define IMAGE_REL_BASED_REL 7
#define IMAGE_REL_BASED_ARM_MOV32T 7 /* yes, 7 too */
#define IMAGE_REL_BASED_THUMB_MOV32 7 /* yes, 7 too */
#define IMAGE_REL_BASED_RISCV_LOW12I 7 /* yes, 7 too */
#define IMAGE_REL_BASED_RISCV_LOW12S 8
#define IMAGE_REL_BASED_MIPS_JMPADDR16 9
#define IMAGE_REL_BASED_IA64_IMM64 9 /* yes, 9 too */
#define IMAGE_REL_BASED_DIR64 10


+ 14
- 0
lib/efi_loader/efi_image_loader.c View File

@@ -126,6 +126,20 @@ static efi_status_t efi_loader_relocate(const IMAGE_BASE_RELOCATION *rel,
case IMAGE_REL_BASED_DIR64:
*x64 += (uint64_t)delta;
break;
#ifdef __riscv
case IMAGE_REL_BASED_RISCV_HI20:
*x32 = ((*x32 & 0xfffff000) + (uint32_t)delta) |
(*x32 & 0x00000fff);
break;
case IMAGE_REL_BASED_RISCV_LOW12I:
case IMAGE_REL_BASED_RISCV_LOW12S:
/* We know that we're 4k aligned */
if (delta & 0xfff) {
printf("Unsupported reloc offset\n");
return EFI_LOAD_ERROR;
}
break;
#endif
default:
printf("Unknown Relocation off %x type %x\n",
offset, type);


+ 4
- 0
lib/efi_loader/efi_runtime.c View File

@@ -28,6 +28,10 @@ static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void);
static efi_status_t __efi_runtime EFIAPI efi_device_error(void);
static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void);

/*
* TODO(sjg@chromium.org): These defines and structs should come from the elf
* header for each arch (or a generic header) rather than being repeated here.
*/
#if defined(CONFIG_ARM64)
#define R_RELATIVE 1027
#define R_MASK 0xffffffffULL


+ 8
- 2
scripts/Makefile.lib View File

@@ -385,8 +385,14 @@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \

EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS)

$(obj)/%_efi.so: $(obj)/%.o arch/$(ARCH)/lib/$(EFI_CRT0) \
arch/$(ARCH)/lib/$(EFI_RELOC)
$(obj)/efi_crt0.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_CRT0:.o=.S)
$(call if_changed_dep,as_o_S)

$(obj)/efi_reloc.o: $(srctree)/arch/$(ARCH)/lib/$(EFI_RELOC:.o=.c) $(recordmcount_source) FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)

$(obj)/%_efi.so: $(obj)/%.o $(obj)/efi_crt0.o $(obj)/efi_reloc.o
$(call cmd,efi_ld)

# ACPI


Loading…
Cancel
Save