AppaRao Puli | c532f55 | 2019-07-05 15:23:50 +0530 | [diff] [blame] | 1 | /* |
| 2 | // Copyright (c) 2019 Intel Corporation |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | */ |
| 16 | #pragma once |
| 17 | |
Chalapathi Venkataramashetty | 55e7934 | 2021-03-29 10:17:48 +0000 | [diff] [blame] | 18 | #include <boost/algorithm/string/predicate.hpp> |
| 19 | #include <boost/asio.hpp> |
| 20 | #include <sdbusplus/asio/object_server.hpp> |
| 21 | |
AppaRao Puli | c532f55 | 2019-07-05 15:23:50 +0530 | [diff] [blame] | 22 | #include <string> |
| 23 | |
AppaRao Puli | c532f55 | 2019-07-05 15:23:50 +0530 | [diff] [blame] | 24 | namespace pfr |
| 25 | { |
| 26 | |
| 27 | enum class ImageType |
| 28 | { |
Vikram Bodireddy | 3c6c8c3 | 2019-12-05 11:06:15 +0530 | [diff] [blame] | 29 | cpldActive, |
| 30 | cpldRecovery, |
AppaRao Puli | c532f55 | 2019-07-05 15:23:50 +0530 | [diff] [blame] | 31 | biosActive, |
| 32 | biosRecovery, |
| 33 | bmcActive, |
Vikram Bodireddy | 8292dc6 | 2021-05-26 13:31:47 +0530 | [diff] [blame] | 34 | bmcRecovery, |
| 35 | afmActive, |
| 36 | afmRecovery |
AppaRao Puli | c532f55 | 2019-07-05 15:23:50 +0530 | [diff] [blame] | 37 | }; |
| 38 | |
AppaRao Puli | 88aa33b | 2019-07-18 23:49:55 +0530 | [diff] [blame] | 39 | enum class ActionType |
| 40 | { |
| 41 | recoveryCount, |
| 42 | recoveryReason, |
| 43 | panicCount, |
| 44 | panicReason, |
| 45 | majorError, |
Chalapathi Venkataramashetty | bcc7ce1 | 2021-05-17 04:27:21 +0000 | [diff] [blame] | 46 | minorError, |
| 47 | readRoTRev |
AppaRao Puli | 88aa33b | 2019-07-18 23:49:55 +0530 | [diff] [blame] | 48 | }; |
| 49 | |
AppaRao Puli | dbe184d | 2019-10-09 18:04:22 +0530 | [diff] [blame] | 50 | std::string toHexString(const uint8_t val); |
AppaRao Puli | 67d184c | 2020-05-29 00:48:33 +0530 | [diff] [blame] | 51 | std::string getFirmwareVersion(const ImageType& imgType); |
Chalapathi Venkataramashetty | f881970 | 2021-02-03 09:43:46 +0000 | [diff] [blame] | 52 | int getProvisioningStatus(bool& ufmLocked, bool& ufmProvisioned, |
| 53 | bool& ufmSupport); |
Zhikui Ren | c96f37d | 2021-12-08 15:40:51 -0800 | [diff] [blame] | 54 | int getPlatformState(uint8_t& state); |
AppaRao Puli | 67d184c | 2020-05-29 00:48:33 +0530 | [diff] [blame] | 55 | int readCpldReg(const ActionType& action, uint8_t& value); |
Chalapathi Venkataramashetty | e6fb18e | 2021-02-03 14:51:00 +0000 | [diff] [blame] | 56 | std::string readCPLDVersion(); |
sri anjaneyulu alapati | be13259 | 2023-07-17 10:16:39 +0000 | [diff] [blame] | 57 | int setBMCBootCompleteChkPoint(const uint8_t checkPoint); |
Chalapathi Venkataramashetty | 55e7934 | 2021-03-29 10:17:48 +0000 | [diff] [blame] | 58 | void init(std::shared_ptr<sdbusplus::asio::connection> conn, |
| 59 | bool& i2cConfigLoaded); |
deepak kumar agrawal | b29a15c | 2022-03-25 07:45:57 +0000 | [diff] [blame] | 60 | int setBMCBusy(bool setValue); |
| 61 | int getMBRegister(uint32_t regAddr, uint8_t& mailBoxReply); |
AppaRao Puli | c532f55 | 2019-07-05 15:23:50 +0530 | [diff] [blame] | 62 | |
| 63 | } // namespace pfr |