140e9b92eSEd Tanous // SPDX-License-Identifier: Apache-2.0 240e9b92eSEd Tanous // SPDX-FileCopyrightText: Copyright OpenBMC Authors 30ec8b83dSEd Tanous #pragma once 40ec8b83dSEd Tanous #include <nlohmann/json.hpp> 50ec8b83dSEd Tanous 60ec8b83dSEd Tanous namespace pcie_device 70ec8b83dSEd Tanous { 80ec8b83dSEd Tanous // clang-format off 90ec8b83dSEd Tanous 100ec8b83dSEd Tanous enum class PCIeTypes{ 110ec8b83dSEd Tanous Invalid, 120ec8b83dSEd Tanous Gen1, 130ec8b83dSEd Tanous Gen2, 140ec8b83dSEd Tanous Gen3, 150ec8b83dSEd Tanous Gen4, 160ec8b83dSEd Tanous Gen5, 17dd5c81e9SGunnar Mills Gen6, 180ec8b83dSEd Tanous }; 190ec8b83dSEd Tanous 200ec8b83dSEd Tanous enum class DeviceType{ 210ec8b83dSEd Tanous Invalid, 220ec8b83dSEd Tanous SingleFunction, 230ec8b83dSEd Tanous MultiFunction, 240ec8b83dSEd Tanous Simulated, 250ec8b83dSEd Tanous Retimer, 260ec8b83dSEd Tanous }; 270ec8b83dSEd Tanous 280ec8b83dSEd Tanous enum class SlotType{ 290ec8b83dSEd Tanous Invalid, 300ec8b83dSEd Tanous FullLength, 310ec8b83dSEd Tanous HalfLength, 320ec8b83dSEd Tanous LowProfile, 330ec8b83dSEd Tanous Mini, 340ec8b83dSEd Tanous M2, 350ec8b83dSEd Tanous OEM, 360ec8b83dSEd Tanous OCP3Small, 370ec8b83dSEd Tanous OCP3Large, 380ec8b83dSEd Tanous U2, 39*9b46bc0bSMyung Bae EDSFF, 400ec8b83dSEd Tanous }; 410ec8b83dSEd Tanous 420ec8b83dSEd Tanous enum class LaneSplittingType{ 430ec8b83dSEd Tanous Invalid, 440ec8b83dSEd Tanous None, 450ec8b83dSEd Tanous Bridged, 460ec8b83dSEd Tanous Bifurcated, 470ec8b83dSEd Tanous }; 480ec8b83dSEd Tanous 49a8d8f9d8SEd Tanous enum class CXLDeviceType{ 50a8d8f9d8SEd Tanous Invalid, 51a8d8f9d8SEd Tanous Type1, 52a8d8f9d8SEd Tanous Type2, 53a8d8f9d8SEd Tanous Type3, 54a8d8f9d8SEd Tanous }; 55a8d8f9d8SEd Tanous 56e9cc1bc9SEd Tanous enum class CXLDynamicCapacityPolicies{ 57e9cc1bc9SEd Tanous Invalid, 58e9cc1bc9SEd Tanous Free, 59e9cc1bc9SEd Tanous Contiguous, 60e9cc1bc9SEd Tanous Prescriptive, 61e9cc1bc9SEd Tanous TagBased, 62e9cc1bc9SEd Tanous }; 63e9cc1bc9SEd Tanous 640ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(PCIeTypes, { 650ec8b83dSEd Tanous {PCIeTypes::Invalid, "Invalid"}, 660ec8b83dSEd Tanous {PCIeTypes::Gen1, "Gen1"}, 670ec8b83dSEd Tanous {PCIeTypes::Gen2, "Gen2"}, 680ec8b83dSEd Tanous {PCIeTypes::Gen3, "Gen3"}, 690ec8b83dSEd Tanous {PCIeTypes::Gen4, "Gen4"}, 700ec8b83dSEd Tanous {PCIeTypes::Gen5, "Gen5"}, 71dd5c81e9SGunnar Mills {PCIeTypes::Gen6, "Gen6"}, 720ec8b83dSEd Tanous }); 730ec8b83dSEd Tanous 740ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(DeviceType, { 750ec8b83dSEd Tanous {DeviceType::Invalid, "Invalid"}, 760ec8b83dSEd Tanous {DeviceType::SingleFunction, "SingleFunction"}, 770ec8b83dSEd Tanous {DeviceType::MultiFunction, "MultiFunction"}, 780ec8b83dSEd Tanous {DeviceType::Simulated, "Simulated"}, 790ec8b83dSEd Tanous {DeviceType::Retimer, "Retimer"}, 800ec8b83dSEd Tanous }); 810ec8b83dSEd Tanous 820ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(SlotType, { 830ec8b83dSEd Tanous {SlotType::Invalid, "Invalid"}, 840ec8b83dSEd Tanous {SlotType::FullLength, "FullLength"}, 850ec8b83dSEd Tanous {SlotType::HalfLength, "HalfLength"}, 860ec8b83dSEd Tanous {SlotType::LowProfile, "LowProfile"}, 870ec8b83dSEd Tanous {SlotType::Mini, "Mini"}, 880ec8b83dSEd Tanous {SlotType::M2, "M2"}, 890ec8b83dSEd Tanous {SlotType::OEM, "OEM"}, 900ec8b83dSEd Tanous {SlotType::OCP3Small, "OCP3Small"}, 910ec8b83dSEd Tanous {SlotType::OCP3Large, "OCP3Large"}, 920ec8b83dSEd Tanous {SlotType::U2, "U2"}, 93*9b46bc0bSMyung Bae {SlotType::EDSFF, "EDSFF"}, 940ec8b83dSEd Tanous }); 950ec8b83dSEd Tanous 960ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LaneSplittingType, { 970ec8b83dSEd Tanous {LaneSplittingType::Invalid, "Invalid"}, 980ec8b83dSEd Tanous {LaneSplittingType::None, "None"}, 990ec8b83dSEd Tanous {LaneSplittingType::Bridged, "Bridged"}, 1000ec8b83dSEd Tanous {LaneSplittingType::Bifurcated, "Bifurcated"}, 1010ec8b83dSEd Tanous }); 1020ec8b83dSEd Tanous 103a8d8f9d8SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(CXLDeviceType, { 104a8d8f9d8SEd Tanous {CXLDeviceType::Invalid, "Invalid"}, 105a8d8f9d8SEd Tanous {CXLDeviceType::Type1, "Type1"}, 106a8d8f9d8SEd Tanous {CXLDeviceType::Type2, "Type2"}, 107a8d8f9d8SEd Tanous {CXLDeviceType::Type3, "Type3"}, 108a8d8f9d8SEd Tanous }); 109a8d8f9d8SEd Tanous 110e9cc1bc9SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(CXLDynamicCapacityPolicies, { 111e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::Invalid, "Invalid"}, 112e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::Free, "Free"}, 113e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::Contiguous, "Contiguous"}, 114e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::Prescriptive, "Prescriptive"}, 115e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::TagBased, "TagBased"}, 116e9cc1bc9SEd Tanous }); 117e9cc1bc9SEd Tanous 1180ec8b83dSEd Tanous } 1190ec8b83dSEd Tanous // clang-format on 120