pci: implement sending firmware image over p2a
Implement sending firmware image over p2a via the aspeed-p2a-ctrl
driver.
Test configuration:
# Image is static, uses the PCI bridge, and requires the ASPEED
# PCI-to-AHB hardware implementation.
EXTRA_OECONF_append_quanta-q71l = " --enable-static-layout"
EXTRA_OECONF_append_quanta-q71l = " --enable-pci-bridge"
EXTRA_OECONF_append_quanta-q71l = " --enable-aspeed-p2a"
EXTRA_OECONF_append_quanta-q71l = " MAPPED_ADDRESS=0x47FF0000"
Tested: Verified via md5sum the image-bmc file sent from the host via
this tool matches the hash of /run/initramfs/bmc-image. This code can
be used to send any file down, but was only tested with a "static"
layout build.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I430bc7444f06f4f93a63e3bf2646bd195eaa2e52
diff --git a/tools/io.hpp b/tools/io.hpp
index 0712694..44cd2cb 100644
--- a/tools/io.hpp
+++ b/tools/io.hpp
@@ -47,14 +47,7 @@
{
}
- /* On destruction, close /dev/mem if it was open. */
- ~DevMemDevice()
- {
- if (opened)
- {
- sys->close(devMemFd);
- }
- }
+ ~DevMemDevice() = default;
/* Don't allow copying or assignment, only moving. */
DevMemDevice(const DevMemDevice&) = delete;
@@ -70,7 +63,6 @@
private:
static const std::string devMemPath;
- bool opened = false;
int devMemFd = -1;
void* devMemMapped = nullptr;
const internal::Sys* sys;