Kevin Tung | 3f2f3e6 | 2025-08-15 15:41:07 +0800 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include "common/include/pmbus.hpp" |
| 4 | #include "mps.hpp" |
| 5 | |
| 6 | namespace phosphor::software::VR |
| 7 | { |
| 8 | |
| 9 | class MP297X : public MPSVoltageRegulator |
| 10 | { |
| 11 | public: |
| 12 | MP297X(sdbusplus::async::context& ctx, uint16_t bus, uint16_t address) : |
| 13 | MPSVoltageRegulator(ctx, bus, address) |
| 14 | {} |
| 15 | |
| 16 | sdbusplus::async::task<bool> verifyImage(const uint8_t* image, |
| 17 | size_t imageSize) final; |
| 18 | sdbusplus::async::task<bool> updateFirmware(bool force) final; |
| 19 | sdbusplus::async::task<bool> getCRC(uint32_t* checksum) final; |
| 20 | sdbusplus::async::task<bool> parseDeviceConfiguration() final; |
| 21 | bool forcedUpdateAllowed() final; |
| 22 | |
| 23 | private: |
| 24 | sdbusplus::async::task<bool> checkId(PMBusCmd pmBusCmd, uint32_t expected); |
| 25 | sdbusplus::async::task<bool> isPasswordUnlock(); |
| 26 | sdbusplus::async::task<bool> unlockWriteProtect(); |
| 27 | sdbusplus::async::task<bool> storeDataIntoMTP(); |
| 28 | sdbusplus::async::task<bool> enableMTPPageWriteRead(); |
| 29 | sdbusplus::async::task<bool> enableMultiConfigCRC(); |
| 30 | sdbusplus::async::task<bool> checkMTPCRC(); |
| 31 | sdbusplus::async::task<bool> programPageRegisters( |
| 32 | MPSPage page, |
| 33 | const std::map<uint8_t, std::vector<MPSData>>& groupedData); |
| 34 | }; |
| 35 | |
| 36 | } // namespace phosphor::software::VR |