blob: f22944939b51f8269e5ad9affde1f889620e8584 [file] [log] [blame]
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -07001#pragma once
2
3#include "interface.hpp"
4#include "io.hpp"
5#include "pci.hpp"
6
7#include <cstdint>
8#include <ipmiblob/blob_interface.hpp>
9
10constexpr std::uint16_t aspeedVendorId = 0x1a03;
11constexpr std::uint16_t aspeedDeviceId = 0x2000;
Patrick Venture24141612019-05-03 17:59:18 -070012constexpr std::size_t aspeedP2aConfig = 0x0f000;
13constexpr std::size_t aspeedP2aBridge = 0x0f004;
14constexpr std::uint32_t p2ABridgeEnabled = 0x1;
Patrick Ventureb5bf0fc2019-05-03 14:33:49 -070015
16namespace host_tool
17{
18
19class P2aDataHandler : public DataInterface
20{
21 public:
22 P2aDataHandler(ipmiblob::BlobInterface* blob, HostIoInterface* io,
23 PciUtilInterface* pci) :
24 blob(blob),
25 io(io), pci(pci)
26 {
27 }
28
29 bool sendContents(const std::string& input, std::uint16_t session) override;
30 blobs::FirmwareBlobHandler::UpdateFlags supportedType() const override
31 {
32 return blobs::FirmwareBlobHandler::UpdateFlags::p2a;
33 }
34
35 private:
36 ipmiblob::BlobInterface* blob;
37 HostIoInterface* io;
38 PciUtilInterface* pci;
39};
40
41} // namespace host_tool