blob: e327b694249d30630c2e74fe2ed836153e0961e9 [file] [log] [blame]
AppaRao Pulic532f552019-07-05 15:23:50 +05301/*
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
18#include <string>
19
AppaRao Pulic532f552019-07-05 15:23:50 +053020namespace pfr
21{
22
23enum class ImageType
24{
Vikram Bodireddy3c6c8c32019-12-05 11:06:15 +053025 cpldActive,
26 cpldRecovery,
AppaRao Pulic532f552019-07-05 15:23:50 +053027 biosActive,
28 biosRecovery,
29 bmcActive,
Vikram Bodireddy8292dc62021-05-26 13:31:47 +053030 bmcRecovery,
31 afmActive,
32 afmRecovery
AppaRao Pulic532f552019-07-05 15:23:50 +053033};
34
AppaRao Puli88aa33b2019-07-18 23:49:55 +053035enum class ActionType
36{
37 recoveryCount,
38 recoveryReason,
39 panicCount,
40 panicReason,
41 majorError,
42 minorError
43};
44
AppaRao Pulidbe184d2019-10-09 18:04:22 +053045std::string toHexString(const uint8_t val);
AppaRao Puli67d184c2020-05-29 00:48:33 +053046std::string getFirmwareVersion(const ImageType& imgType);
Chalapathi Venkataramashettyf8819702021-02-03 09:43:46 +000047int getProvisioningStatus(bool& ufmLocked, bool& ufmProvisioned,
48 bool& ufmSupport);
AppaRao Puli67d184c2020-05-29 00:48:33 +053049int readCpldReg(const ActionType& action, uint8_t& value);
Chalapathi Venkataramashettye6fb18e2021-02-03 14:51:00 +000050std::string readCPLDVersion();
AppaRao Puli46cead92019-07-22 16:50:09 +053051int setBMCBootCheckpoint(const uint8_t checkPoint);
AppaRao Pulic532f552019-07-05 15:23:50 +053052
53} // namespace pfr