summaryrefslogtreecommitdiff
path: root/sys/arch/arm64
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-08-13 09:00:21 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-08-13 09:00:21 +0000
commit62f4b393d1b376dfd19fdeaae5f11782ee9682fe (patch)
treeec6a00d5ff26eff01cc9b008d4a5dc0feaf2cacc /sys/arch/arm64
parentcc619e08eaa74544ac1447b29b8d6ed2c0e79d2b (diff)
Allow PXE booting using u-boot by relaxing our requirements
of the EFI PXE protocol. This also brings us in line with the GRUB2 implementation. Tested by naddy@ to behave the same Tested by sven falempin on his Pine64
Diffstat (limited to 'sys/arch/arm64')
-rw-r--r--sys/arch/arm64/stand/efiboot/conf.c4
-rw-r--r--sys/arch/arm64/stand/efiboot/efipxe.c17
2 files changed, 5 insertions, 16 deletions
diff --git a/sys/arch/arm64/stand/efiboot/conf.c b/sys/arch/arm64/stand/efiboot/conf.c
index 3cba4d95faa..3b47ff62681 100644
--- a/sys/arch/arm64/stand/efiboot/conf.c
+++ b/sys/arch/arm64/stand/efiboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.22 2019/08/12 19:17:35 kettenis Exp $ */
+/* $OpenBSD: conf.c,v 1.23 2019/08/13 09:00:20 patrick Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -45,7 +45,7 @@
#include "efipxe.h"
#include "softraid_arm64.h"
-const char version[] = "0.18";
+const char version[] = "0.19";
int debug = 0;
struct fs_ops file_system[] = {
diff --git a/sys/arch/arm64/stand/efiboot/efipxe.c b/sys/arch/arm64/stand/efiboot/efipxe.c
index 176f65b4c0d..9a9af5886fa 100644
--- a/sys/arch/arm64/stand/efiboot/efipxe.c
+++ b/sys/arch/arm64/stand/efiboot/efipxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efipxe.c,v 1.5 2019/04/25 20:19:30 naddy Exp $ */
+/* $OpenBSD: efipxe.c,v 1.6 2019/08/13 09:00:20 patrick Exp $ */
/*
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
*
@@ -89,7 +89,7 @@ efi_pxeprobe(void)
return;
for (i = 0; i < nhandles; i++) {
- EFI_PXE_BASE_CODE_DHCPV4_PACKET *dhcp = NULL;
+ EFI_PXE_BASE_CODE_DHCPV4_PACKET *dhcp;
status = EFI_CALL(BS->HandleProtocol, handles[i],
&devp_guid, (void **)&dp0);
@@ -113,21 +113,10 @@ efi_pxeprobe(void)
if (pxe->Mode == NULL)
continue;
- if (pxe->Mode->DhcpAckReceived) {
- dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET *)
- &pxe->Mode->DhcpAck;
- }
- if (pxe->Mode->PxeReplyReceived) {
- dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET *)
- &pxe->Mode->PxeReply;
- }
-
- if (!dhcp)
- continue;
-
if (pxe->Mtftp != NULL)
use_mtftp = 1;
+ dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET *)&pxe->Mode->DhcpAck;
memcpy(&bootip, dhcp->BootpYiAddr, sizeof(bootip));
memcpy(&servip, dhcp->BootpSiAddr, sizeof(servip));
memcpy(&gateip, dhcp->BootpSiAddr, sizeof(gateip));