blob: 905339288ee8c3ccea1e0b4c278ced06bf9cb15d [file] [log] [blame]
Jason M. Billsd1e40602019-05-09 11:43:51 -07001/*
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
17#pragma once
18#include <peci.h>
19
20#include <cstdint>
21#include <vector>
22
23namespace peci_pcie
24{
Patrick Williams42a9ac82023-05-10 07:51:22 -050025static constexpr const char* peciPCIeObject = "xyz.openbmc_project.PCIe";
26static constexpr const char* peciPCIePath =
Lakshmi Yadlapatide3bae32023-03-31 13:05:12 -050027 "/xyz/openbmc_project/inventory/pcie";
Patrick Williams42a9ac82023-05-10 07:51:22 -050028static constexpr const char* peciPCIeDeviceInterface =
Lakshmi Yadlapatide3bae32023-03-31 13:05:12 -050029 "xyz.openbmc_project.Inventory.Item.PCIeDevice";
Jason M. Billsd1e40602019-05-09 11:43:51 -070030
31static constexpr const int maxPCIBuses = 256;
32static constexpr const int maxPCIDevices = 32;
33static constexpr const int maxPCIFunctions = 8;
34
35static constexpr const int peciCheckInterval = 10;
Jason M. Billsee6d80b2021-06-11 07:37:30 -070036static constexpr const int osStandbyDelaySeconds = 10;
Spencer Kubb5efe72021-09-02 16:11:14 +080037
38static constexpr const int pointToCapStruct = 0x34;
39static constexpr const int maskOfCLS = 0x0F;
40
41static constexpr const int capPointerOffset = 1;
42static constexpr const int linkStatusOffset = 18;
43
44// PCIe version
45// GEN1 : 0001b : transfer rate 2.5GB
46// GEN2 : 0010b : transfer rate 5GB
47// GEN3 : 0011b : transfer rate 8GB
48// GEN4 : 0100b : transfer rate 16GB
49// GEN5 : 0101b : transfer rate 32GB
50enum GenerationInUse : int
51{
52 pcieGen1 = 1,
53 pcieGen2,
54 pcieGen3,
55 pcieGen4,
56 pcieGen5
57};
Jason M. Billsd1e40602019-05-09 11:43:51 -070058} // namespace peci_pcie