From 712cd2987489fe62aedeb24730e730871b1eb627 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 6 Sep 2016 14:26:27 +0200 Subject: efi_loader: Allow bouncing for network So far bounce buffers were only used for disk I/O, but network I/O may suffer from the same problem. On platforms that have problems doing DMA on high addresses, let's also bounce outgoing network packets. Incoming ones always already get bounced. This patch fixes EFI PXE boot on ZynqMP for me. Signed-off-by: Alexander Graf --- lib/efi_loader/efi_net.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/efi_loader/efi_net.c') diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index dd3b48570d8..6a8a0d7b1d7 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -152,7 +152,14 @@ static efi_status_t EFIAPI efi_net_transmit(struct efi_simple_network *this, return EFI_EXIT(EFI_INVALID_PARAMETER); } +#ifdef CONFIG_EFI_LOADER_BOUNCE_BUFFER + /* Ethernet packets always fit, just bounce */ + memcpy(efi_bounce_buffer, buffer, buffer_size); + net_send_packet(efi_bounce_buffer, buffer_size); +#else net_send_packet(buffer, buffer_size); +#endif + new_tx_packet = buffer; return EFI_EXIT(EFI_SUCCESS); -- cgit v1.2.3 From e275458c2f011a7e66ac01e6558f15f4cf4972f9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 25 Sep 2016 15:27:32 -0600 Subject: efi: Fix missing EFIAPI specifiers These are missing in some functions. Add them to keep things consistent. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Reviewed-by: Alexander Graf Signed-off-by: Alexander Graf --- lib/efi_loader/efi_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/efi_loader/efi_net.c') diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index 6a8a0d7b1d7..3796496caa1 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -198,7 +198,7 @@ static efi_status_t EFIAPI efi_net_receive(struct efi_simple_network *this, return EFI_EXIT(EFI_SUCCESS); } -static efi_status_t efi_net_open_dp(void *handle, efi_guid_t *protocol, +static efi_status_t EFIAPI efi_net_open_dp(void *handle, efi_guid_t *protocol, void **protocol_interface, void *agent_handle, void *controller_handle, uint32_t attributes) { @@ -210,7 +210,7 @@ static efi_status_t efi_net_open_dp(void *handle, efi_guid_t *protocol, return EFI_SUCCESS; } -static efi_status_t efi_net_open_pxe(void *handle, efi_guid_t *protocol, +static efi_status_t EFIAPI efi_net_open_pxe(void *handle, efi_guid_t *protocol, void **protocol_interface, void *agent_handle, void *controller_handle, uint32_t attributes) { -- cgit v1.2.3