Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
| 3 | #include "item_updater_mmc.hpp" |
| 4 | |
| 5 | #include "activation_mmc.hpp" |
| 6 | #include "version.hpp" |
| 7 | |
| 8 | namespace openpower |
| 9 | { |
| 10 | namespace software |
| 11 | { |
| 12 | namespace updater |
| 13 | { |
| 14 | |
| 15 | // These functions are just a stub (empty) because the current eMMC |
| 16 | // implementation uses the BMC updater (repo phosphor-bmc-code-mgmt) to write |
| 17 | // the new host FW to flash since it's delivered as a "System" image in the |
| 18 | // same BMC tarball as the BMC image. |
| 19 | |
| 20 | std::unique_ptr<Activation> ItemUpdaterMMC::createActivationObject( |
| 21 | const std::string& path, const std::string& versionId, |
| 22 | const std::string& extVersion, |
| 23 | sdbusplus::xyz::openbmc_project::Software::server::Activation::Activations |
| 24 | activationStatus, |
| 25 | AssociationList& assocs) |
| 26 | { |
| 27 | return std::make_unique<ActivationMMC>( |
| 28 | bus, path, *this, versionId, extVersion, activationStatus, assocs); |
| 29 | } |
| 30 | |
| 31 | std::unique_ptr<Version> ItemUpdaterMMC::createVersionObject( |
| 32 | const std::string& objPath, const std::string& versionId, |
| 33 | const std::string& versionString, |
| 34 | sdbusplus::xyz::openbmc_project::Software::server::Version::VersionPurpose |
| 35 | versionPurpose, |
| 36 | const std::string& filePath) |
| 37 | { |
| 38 | auto version = std::make_unique<Version>( |
| 39 | bus, objPath, *this, versionId, versionString, versionPurpose, filePath, |
| 40 | std::bind(&ItemUpdaterMMC::erase, this, std::placeholders::_1)); |
| 41 | version->deleteObject = std::make_unique<Delete>(bus, objPath, *version); |
| 42 | return version; |
| 43 | } |
| 44 | |
Brad Bishop | c8f2250 | 2020-11-06 14:42:09 -0500 | [diff] [blame] | 45 | bool ItemUpdaterMMC::validateImage(const std::string&) |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 46 | { |
| 47 | return true; |
| 48 | } |
| 49 | |
| 50 | void ItemUpdaterMMC::processPNORImage() |
Brad Bishop | 8facccf | 2020-11-04 09:44:58 -0500 | [diff] [blame] | 51 | {} |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 52 | |
| 53 | void ItemUpdaterMMC::reset() |
Brad Bishop | 8facccf | 2020-11-04 09:44:58 -0500 | [diff] [blame] | 54 | {} |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 55 | |
| 56 | bool ItemUpdaterMMC::isVersionFunctional(const std::string& versionId) |
| 57 | { |
| 58 | return versionId == functionalVersionId; |
| 59 | } |
| 60 | |
Brad Bishop | c8f2250 | 2020-11-06 14:42:09 -0500 | [diff] [blame] | 61 | void ItemUpdaterMMC::freePriority(uint8_t, const std::string&) |
Brad Bishop | 8facccf | 2020-11-04 09:44:58 -0500 | [diff] [blame] | 62 | {} |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 63 | |
| 64 | void ItemUpdaterMMC::deleteAll() |
Brad Bishop | 8facccf | 2020-11-04 09:44:58 -0500 | [diff] [blame] | 65 | {} |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 66 | |
| 67 | bool ItemUpdaterMMC::freeSpace() |
| 68 | { |
| 69 | return true; |
| 70 | } |
| 71 | |
Brad Bishop | c8f2250 | 2020-11-06 14:42:09 -0500 | [diff] [blame] | 72 | void ItemUpdaterMMC::updateFunctionalAssociation(const std::string&) |
Brad Bishop | 8facccf | 2020-11-04 09:44:58 -0500 | [diff] [blame] | 73 | {} |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 74 | |
| 75 | void GardResetMMC::reset() |
Brad Bishop | 8facccf | 2020-11-04 09:44:58 -0500 | [diff] [blame] | 76 | {} |
Adriana Kobylak | 8bc2ab4 | 2020-07-15 09:16:27 -0500 | [diff] [blame] | 77 | |
| 78 | } // namespace updater |
| 79 | } // namespace software |
| 80 | } // namespace openpower |