blob: ba2389ab098f17e2c94d796e18d6f6f121e573ff [file] [log] [blame]
#include "config.h"
#include "firmware_handler.hpp"
#include <blobs-ipmid/manager.hpp>
#include <cstdint>
#include <memory>
#include <phosphor-logging/log.hpp>
namespace blobs
{
using namespace phosphor::logging;
std::vector<std::string> supportedFirmware = {
#ifdef ENABLE_STATIC_LAYOUT
"/flash/image",
#endif
};
std::uint32_t supportedTransports =
static_cast<std::uint32_t>(FirmwareUpdateFlags::bt);
void setupFirmwareHandler() __attribute__((constructor));
void setupFirmwareHandler()
{
#ifdef ENABLE_PCI_BRIDGE
supportedTransports |= static_cast<std::uint32_t>(FirmwareUpdateFlags::p2a);
#endif
#ifdef ENABLE_LPC_BRIDGE
supportedTransports |= static_cast<std::uint32_t>(FirmwareUpdateFlags::lpc);
#endif
auto* manager = getBlobManager();
if (!manager->registerHandler(
FirmwareBlobHandler::CreateFirmwareBlobHandler(
supportedFirmware, supportedTransports)))
{
log<level::ERR>("Failed to register Firmware Handler");
}
}
} // namespace blobs