blob: 0ec159f4cef8619f28bdb7fb26e633e0d3f47326 [file] [log] [blame]
Patrick Venture148cd652018-11-06 10:59:47 -08001#include "config.h"
2
Patrick Venturec7ca2912018-11-02 11:38:33 -07003#include "firmware_handler.hpp"
4
5#include <blobs-ipmid/manager.hpp>
6#include <memory>
7#include <phosphor-logging/log.hpp>
8
9namespace blobs
10{
11using namespace phosphor::logging;
12
Patrick Venture148cd652018-11-06 10:59:47 -080013std::vector<std::string> supportedFirmware = {
14 "/flash/hash",
15#ifdef ENABLE_STATIC_LAYOUT
16 "/flash/image",
17#endif
18};
19
Patrick Venturec7ca2912018-11-02 11:38:33 -070020void setupFirmwareHandler() __attribute__((constructor));
21
22void setupFirmwareHandler()
23{
24 auto* manager = getBlobManager();
Patrick Venture68cf64f2018-11-06 10:46:51 -080025 if (!manager->registerHandler(
Patrick Venture148cd652018-11-06 10:59:47 -080026 FirmwareBlobHandler::CreateFirmwareBlobHandler(supportedFirmware)))
Patrick Venturec7ca2912018-11-02 11:38:33 -070027 {
28 log<level::ERR>("Failed to register Firmware Handler");
29 }
30}
31
32} // namespace blobs