diff options
author | Patrick Venture <venture@google.com> | 2019-01-17 15:22:45 -0800 |
---|---|---|
committer | Patrick Venture <venture@google.com> | 2019-01-22 08:50:50 -0800 |
commit | 8e1b233564406465c09f51097502ebcce95593a0 (patch) | |
tree | 52b4cdc97c9833773bf4d2591e4d5acbc6a9b1f7 /tools/lpc.cpp | |
parent | 63c2ae0f2cf7ca2886d546a0e8113a106a63a9d4 (diff) | |
download | phosphor-ipmi-flash-8e1b233564406465c09f51097502ebcce95593a0.tar.gz phosphor-ipmi-flash-8e1b233564406465c09f51097502ebcce95593a0.zip |
tools: lpc: start implementation, send metadata
With the LPC interface, send the window information to the BMC.
Tested: Ran on test system and verified window mapped via ioctl to
driver as expected.
Change-Id: I7ffac6b52205b215fd698a574d098b505091c3d4
Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'tools/lpc.cpp')
-rw-r--r-- | tools/lpc.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/lpc.cpp b/tools/lpc.cpp index 97b7902..7a5faa2 100644 --- a/tools/lpc.cpp +++ b/tools/lpc.cpp @@ -16,12 +16,35 @@ #include "lpc.hpp" +#include <cstring> + namespace host_tool { bool LpcDataHandler::sendContents(const std::string& input, std::uint16_t session) { + /* TODO: Add mechanism for configuring this. */ + LpcRegion host_lpc_buf; + + /* TODO: Remove hard-coded configuration used with test machine. */ + host_lpc_buf.address = 0xfedc1000; + host_lpc_buf.length = 0x1000; + + std::vector<std::uint8_t> payload(sizeof(host_lpc_buf)); + std::memcpy(payload.data(), &host_lpc_buf, sizeof(host_lpc_buf)); + + blob->writeMeta(session, 0x00, payload); + + /* TODO: Call sessionstat and see if the metadata confirms the region was + * mapped successfully, once the lpc data handler implements it. + */ + + /* todo: + * configure memory region (somehow) + * copy contents from file to memory region + * send external chunk (writeBlob) until it's all sent. + */ return false; } |