summaryrefslogtreecommitdiffstats
path: root/pci_handler.cpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2019-05-14 11:40:57 -0700
committerPatrick Venture <venture@google.com>2019-05-14 21:09:24 +0000
commit18bbe3c686c2ff1dd202161aaeb4d9e0d971cafe (patch)
treeca9d0c9c18646a1cb040012c558d2930d2cce5c0 /pci_handler.cpp
parente564d5bcb43d45a694a7b0a7c9fec3090dd8b107 (diff)
downloadphosphor-ipmi-flash-18bbe3c686c2ff1dd202161aaeb4d9e0d971cafe.tar.gz
phosphor-ipmi-flash-18bbe3c686c2ff1dd202161aaeb4d9e0d971cafe.zip
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
Diffstat (limited to 'pci_handler.cpp')
-rw-r--r--pci_handler.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/pci_handler.cpp b/pci_handler.cpp
index 51a2ca5..56016c7 100644
--- a/pci_handler.cpp
+++ b/pci_handler.cpp
@@ -98,8 +98,10 @@ bool PciDataHandler::close()
std::vector<std::uint8_t> PciDataHandler::copyFrom(std::uint32_t length)
{
- /* TODO: implement this. */
- return {};
+ std::vector<std::uint8_t> results(length);
+ std::memcpy(results.data(), mapped, length);
+
+ return results;
}
bool PciDataHandler::writeMeta(const std::vector<std::uint8_t>& configuration)
OpenPOWER on IntegriCloud