This is just a bunch of boilerplate code that extends the protocol
HardwareInterrupt to HardwareInterrupt2, and adds some hooks that allow
protocol clients to configure the interrupt type.
Patch #1 and patch #3 are complete afaict. Patch #2 needs to actual GIC
manipulation code to be inserted, but I am sure someone else will be able
to do this much more quickly.
Ard Biesheuvel (3):
EmbeddedPkg: introduce HardwareInterrupt2 protocol
ArmPkg/ArmGicDxe: expose HardwareInterrupt2 protocol
ArmPkg/GenericWatchdogDxe: use HardwareInterrupt2 protocol to set
interrupt type
ArmPkg/Drivers/ArmGic/ArmGicCommonDxe.c | 4 +-
ArmPkg/Drivers/ArmGic/ArmGicDxe.h | 2 +
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf | 1 +
ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 37 +++-
ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c | 37 +++-
ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.c | 26 +--
ArmPkg/Drivers/GenericWatchdogDxe/GenericWatchdogDxe.inf | 4 +-
EmbeddedPkg/EmbeddedPkg.dec | 1 +
EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h | 181 ++++++++++++++++++++
9 files changed, 278 insertions(+), 15 deletions(-)
create mode 100644 EmbeddedPkg/Include/Protocol/HardwareInterrupt2.h
--
2.7.4
The RX path in MarvellYukonDxe uses DMA buffers allocated via
EFI_PCI_IO_PROTOCOL::AllocateBuffer(), and copies the contents of each
into a temporary buffer, whose contents are copied yet another time before
arriving at the caller of EFI_SIMPLE_NETWORK_PROTOCOL::Receive()
This is inefficient for several reasons:
- the streaming bus master DMA operations used for RX do not require the
use of buffers allocated via EFI_PCI_IO_PROTOCOL::AllocateBuffer(), which
may return uncached memory on platforms with non-coherent DMA
- EFI_PCI_IO_PROTOCOL::AllocateBuffer() performs page based allocations,
which means the UEFI memory map is modified for every packet received,
now that the improper reuse of DMA buffers has been fixed.
So drop the call to EFI_PCI_IO_PROTOCOL::AllocateBuffer(), and instead,
perform a pool allocation whose ownership is transferred from the RX ring
to the RX linked list, which removes the need for a copy.
Also, since pool allocations decay to page based allocations for sizes
that equal or exceed EFI_PAGE_SIZE, reduce MAX_SUPPORTED_PACKET_SIZE to
the Ethernet default of 1500 bytes.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel(a)linaro.org>
---
It builds, but does it run? I have no clue, since I don't own a Juno or
a Softiron 1000. Comments and testing appreciated. Thanks.
Drivers/Net/MarvellYukonDxe/if_msk.c | 26 ++++++--------------
Drivers/Net/MarvellYukonDxe/if_msk.h | 2 +-
2 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/Drivers/Net/MarvellYukonDxe/if_msk.c b/Drivers/Net/MarvellYukonDxe/if_msk.c
index ecd716a66b55..d49c8e92a69a 100644
--- a/Drivers/Net/MarvellYukonDxe/if_msk.c
+++ b/Drivers/Net/MarvellYukonDxe/if_msk.c
@@ -595,7 +595,7 @@ msk_newbuf (
rxd = &sc_if->msk_cdata.msk_rxdesc[idx];
- Status = mPciIo->AllocateBuffer (mPciIo, AllocateAnyPages, EfiBootServicesData, EFI_SIZE_TO_PAGES (Length), &Buffer, 0);
+ Status = gBS->AllocatePool (EfiBootServicesData, Length, &Buffer);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -603,8 +603,7 @@ msk_newbuf (
Status = mPciIo->Map (mPciIo, EfiPciIoOperationBusMasterWrite, Buffer, &Length, &PhysAddr, &Mapping);
if (EFI_ERROR (Status)) {
- Length = MAX_SUPPORTED_PACKET_SIZE;
- mPciIo->FreeBuffer (mPciIo, EFI_SIZE_TO_PAGES (Length), Buffer);
+ gBS->FreePool (Buffer);
return Status;
}
@@ -1630,7 +1629,7 @@ msk_txrx_dma_free (
mPciIo->Unmap (mPciIo, rxd->rx_m.DmaMapping);
// Free Rx buffers as we own these
if(rxd->rx_m.Buf != NULL) {
- mPciIo->FreeBuffer (mPciIo, EFI_SIZE_TO_PAGES (rxd->rx_m.Length), rxd->rx_m.Buf);
+ gBS->FreePool (rxd->rx_m.Buf);
rxd->rx_m.Buf = NULL;
}
gBS->SetMem (&(rxd->rx_m), sizeof (MSK_DMA_BUF), 0);
@@ -1933,23 +1932,14 @@ msk_rxeof (
if (!EFI_ERROR (Status)) {
gBS->SetMem (m_link, sizeof (MSK_LINKED_SYSTEM_BUF), 0);
m_link->Signature = RX_MBUF_SIGNATURE;
- Status = gBS->AllocatePool (EfiBootServicesData,
- len,
- (VOID**) &m_link->SystemBuf.Buf);
- if(!EFI_ERROR (Status)) {
- gBS->CopyMem (m_link->SystemBuf.Buf, m.Buf, len);
- m_link->SystemBuf.Length = len;
-
- InsertTailList (&mSoftc->ReceiveQueueHead, &m_link->Link);
- } else {
- DEBUG ((EFI_D_NET, "Marvell Yukon: failed to allocate DMA buffer. Dropping Frame\n"));
- gBS->FreePool (m_link);
- }
+ m_link->SystemBuf.Buf = m.Buf;
+ m_link->SystemBuf.Length = len;
+
+ InsertTailList (&mSoftc->ReceiveQueueHead, &m_link->Link);
} else {
DEBUG ((EFI_D_NET, "Marvell Yukon: failed to allocate receive buffer link. Dropping Frame\n"));
+ gBS->FreePool (m.Buf);
}
-
- mPciIo->FreeBuffer (mPciIo, EFI_SIZE_TO_PAGES (m.Length), m.Buf);
} while (0);
MSK_RX_INC (sc_if->msk_cdata.msk_rx_cons, MSK_RX_RING_CNT);
diff --git a/Drivers/Net/MarvellYukonDxe/if_msk.h b/Drivers/Net/MarvellYukonDxe/if_msk.h
index a5025a39ecf3..66513d3c54c1 100644
--- a/Drivers/Net/MarvellYukonDxe/if_msk.h
+++ b/Drivers/Net/MarvellYukonDxe/if_msk.h
@@ -15,7 +15,7 @@
#include <Uefi.h>
-#define MAX_SUPPORTED_PACKET_SIZE EFI_PAGE_SIZE
+#define MAX_SUPPORTED_PACKET_SIZE (1500)
EFI_STATUS mskc_probe (EFI_PCI_IO_PROTOCOL *PciIo);
--
2.7.4
This is v2 of the Celloboard driver to upload the Renesas PD720202
XHCI firmware at boot, so that both the UEFI firmware and the OS can
use the device without having to care about this firmware.
Now tested using a PD720201 with an external ROM, which contains the
same firmware. This involved ignoring the 'has external ROM' check
temporarily, allowing the builtin firmware image to be overridden with
by the image from this driver.
Ard Biesheuvel (2):
Drivers/Xhci: implement firmware download driver for Renesas PD72020x
Platforms/AMD/CelloBoard: add Renesas PD72020x firmware uploader
Drivers/Xhci/RenesasFirmwarePD720202/RenesasFirmwarePD720202.c | 386 ++++++++++++++++++++
Drivers/Xhci/RenesasFirmwarePD720202/RenesasFirmwarePD720202.inf | 43 +++
OpenPlatformPkg.dec | 3 +
Platforms/AMD/Styx/CelloBoard/CelloBoard.dsc | 4 +
Platforms/AMD/Styx/CelloBoard/CelloBoard.fdf | 10 +
5 files changed, 446 insertions(+)
create mode 100644 Drivers/Xhci/RenesasFirmwarePD720202/RenesasFirmwarePD720202.c
create mode 100644 Drivers/Xhci/RenesasFirmwarePD720202/RenesasFirmwarePD720202.inf
--
2.7.4
Hi experts,
UEFI spec says BIS (Boot Integrity Services) protocol is used to
authenticate image. However, it seems UEFI secure boot has already
covered the same function even for PXE boot. Also I can't see any
implementation of BIS in EDK2.
So is BIS a little outdated and can be completely replaced by UEFI
secure boot?
Thanks and Regards,
Heyi