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, 399b46bc0bSMyung 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 64*d125652eSGunnar Mills enum class CXLProtocolVersion{ 65*d125652eSGunnar Mills Invalid, 66*d125652eSGunnar Mills CXL1_1, 67*d125652eSGunnar Mills CXL2_0, 68*d125652eSGunnar Mills CXL3_0, 69*d125652eSGunnar Mills CXL3_1, 70*d125652eSGunnar Mills CXL3_2, 71*d125652eSGunnar Mills }; 72*d125652eSGunnar Mills 730ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(PCIeTypes, { 740ec8b83dSEd Tanous {PCIeTypes::Invalid, "Invalid"}, 750ec8b83dSEd Tanous {PCIeTypes::Gen1, "Gen1"}, 760ec8b83dSEd Tanous {PCIeTypes::Gen2, "Gen2"}, 770ec8b83dSEd Tanous {PCIeTypes::Gen3, "Gen3"}, 780ec8b83dSEd Tanous {PCIeTypes::Gen4, "Gen4"}, 790ec8b83dSEd Tanous {PCIeTypes::Gen5, "Gen5"}, 80dd5c81e9SGunnar Mills {PCIeTypes::Gen6, "Gen6"}, 810ec8b83dSEd Tanous }); 820ec8b83dSEd Tanous 830ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(DeviceType, { 840ec8b83dSEd Tanous {DeviceType::Invalid, "Invalid"}, 850ec8b83dSEd Tanous {DeviceType::SingleFunction, "SingleFunction"}, 860ec8b83dSEd Tanous {DeviceType::MultiFunction, "MultiFunction"}, 870ec8b83dSEd Tanous {DeviceType::Simulated, "Simulated"}, 880ec8b83dSEd Tanous {DeviceType::Retimer, "Retimer"}, 890ec8b83dSEd Tanous }); 900ec8b83dSEd Tanous 910ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(SlotType, { 920ec8b83dSEd Tanous {SlotType::Invalid, "Invalid"}, 930ec8b83dSEd Tanous {SlotType::FullLength, "FullLength"}, 940ec8b83dSEd Tanous {SlotType::HalfLength, "HalfLength"}, 950ec8b83dSEd Tanous {SlotType::LowProfile, "LowProfile"}, 960ec8b83dSEd Tanous {SlotType::Mini, "Mini"}, 970ec8b83dSEd Tanous {SlotType::M2, "M2"}, 980ec8b83dSEd Tanous {SlotType::OEM, "OEM"}, 990ec8b83dSEd Tanous {SlotType::OCP3Small, "OCP3Small"}, 1000ec8b83dSEd Tanous {SlotType::OCP3Large, "OCP3Large"}, 1010ec8b83dSEd Tanous {SlotType::U2, "U2"}, 1029b46bc0bSMyung Bae {SlotType::EDSFF, "EDSFF"}, 1030ec8b83dSEd Tanous }); 1040ec8b83dSEd Tanous 1050ec8b83dSEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(LaneSplittingType, { 1060ec8b83dSEd Tanous {LaneSplittingType::Invalid, "Invalid"}, 1070ec8b83dSEd Tanous {LaneSplittingType::None, "None"}, 1080ec8b83dSEd Tanous {LaneSplittingType::Bridged, "Bridged"}, 1090ec8b83dSEd Tanous {LaneSplittingType::Bifurcated, "Bifurcated"}, 1100ec8b83dSEd Tanous }); 1110ec8b83dSEd Tanous 112a8d8f9d8SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(CXLDeviceType, { 113a8d8f9d8SEd Tanous {CXLDeviceType::Invalid, "Invalid"}, 114a8d8f9d8SEd Tanous {CXLDeviceType::Type1, "Type1"}, 115a8d8f9d8SEd Tanous {CXLDeviceType::Type2, "Type2"}, 116a8d8f9d8SEd Tanous {CXLDeviceType::Type3, "Type3"}, 117a8d8f9d8SEd Tanous }); 118a8d8f9d8SEd Tanous 119e9cc1bc9SEd Tanous NLOHMANN_JSON_SERIALIZE_ENUM(CXLDynamicCapacityPolicies, { 120e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::Invalid, "Invalid"}, 121e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::Free, "Free"}, 122e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::Contiguous, "Contiguous"}, 123e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::Prescriptive, "Prescriptive"}, 124e9cc1bc9SEd Tanous {CXLDynamicCapacityPolicies::TagBased, "TagBased"}, 125e9cc1bc9SEd Tanous }); 126e9cc1bc9SEd Tanous 127*d125652eSGunnar Mills NLOHMANN_JSON_SERIALIZE_ENUM(CXLProtocolVersion, { 128*d125652eSGunnar Mills {CXLProtocolVersion::Invalid, "Invalid"}, 129*d125652eSGunnar Mills {CXLProtocolVersion::CXL1_1, "CXL1_1"}, 130*d125652eSGunnar Mills {CXLProtocolVersion::CXL2_0, "CXL2_0"}, 131*d125652eSGunnar Mills {CXLProtocolVersion::CXL3_0, "CXL3_0"}, 132*d125652eSGunnar Mills {CXLProtocolVersion::CXL3_1, "CXL3_1"}, 133*d125652eSGunnar Mills {CXLProtocolVersion::CXL3_2, "CXL3_2"}, 134*d125652eSGunnar Mills }); 135*d125652eSGunnar Mills 1360ec8b83dSEd Tanous } 1370ec8b83dSEd Tanous // clang-format on 138