xref: /openbmc/phosphor-ipmi-flash/tools/lpc.hpp (revision 69a9e194)
1 #pragma once
2 
3 #include "blob_interface.hpp"
4 #include "interface.hpp"
5 #include "internal/sys.hpp"
6 
7 #include <cstdint>
8 
9 namespace host_tool
10 {
11 
12 struct LpcRegion
13 {
14     /* Host LPC address at which the chunk is to be mapped. */
15     std::uint32_t address;
16     /* Size of the chunk to be mapped. */
17     std::uint32_t length;
18 };
19 
20 class LpcDataHandler : public DataInterface
21 {
22   public:
23     LpcDataHandler(BlobInterface* blob,
24                    const internal::Sys* sys = &internal::sys_impl) :
25         blob(blob),
26         sys(sys){};
27 
28     bool sendContents(const std::string& input, std::uint16_t session) override;
29     blobs::FirmwareBlobHandler::UpdateFlags supportedType() const override
30     {
31         return blobs::FirmwareBlobHandler::UpdateFlags::lpc;
32     }
33 
34   private:
35     BlobInterface* blob;
36     const internal::Sys* sys;
37 };
38 
39 } // namespace host_tool
40