blob: 920422f5c18502ad6f412c62478151ce31df2604 [file] [log] [blame]
#pragma once
#include "interface.hpp"
#include "internal/sys.hpp"
#include "io.hpp"
#include "pci.hpp"
#include <cstdint>
#include <ipmiblob/blob_interface.hpp>
constexpr std::uint16_t aspeedVendorId = 0x1a03;
constexpr std::uint16_t aspeedDeviceId = 0x2000;
constexpr std::size_t aspeedP2aOffset = 0x10000;
constexpr std::size_t aspeedP2aConfig = 0x0f000;
constexpr std::size_t aspeedP2aBridge = 0x0f004;
constexpr std::uint32_t p2ABridgeEnabled = 0x1;
namespace host_tool
{
class P2aDataHandler : public DataInterface
{
public:
P2aDataHandler(ipmiblob::BlobInterface* blob, HostIoInterface* io,
PciUtilInterface* pci,
const internal::Sys* sys = &internal::sys_impl) :
blob(blob),
io(io), pci(pci), sys(sys)
{
}
bool sendContents(const std::string& input, std::uint16_t session) override;
ipmi_flash::FirmwareBlobHandler::UpdateFlags supportedType() const override
{
return ipmi_flash::FirmwareBlobHandler::UpdateFlags::p2a;
}
private:
ipmiblob::BlobInterface* blob;
HostIoInterface* io;
PciUtilInterface* pci;
const internal::Sys* sys;
};
} // namespace host_tool