1 // SPDX-License-Identifier: Apache-2.0 2 // SPDX-FileCopyrightText: Copyright OpenBMC Authors 3 #pragma once 4 #include <nlohmann/json.hpp> 5 6 namespace pcie_device 7 { 8 // clang-format off 9 10 enum class PCIeTypes{ 11 Invalid, 12 Gen1, 13 Gen2, 14 Gen3, 15 Gen4, 16 Gen5, 17 Gen6, 18 }; 19 20 enum class DeviceType{ 21 Invalid, 22 SingleFunction, 23 MultiFunction, 24 Simulated, 25 Retimer, 26 }; 27 28 enum class SlotType{ 29 Invalid, 30 FullLength, 31 HalfLength, 32 LowProfile, 33 Mini, 34 M2, 35 OEM, 36 OCP3Small, 37 OCP3Large, 38 U2, 39 EDSFF, 40 }; 41 42 enum class LaneSplittingType{ 43 Invalid, 44 None, 45 Bridged, 46 Bifurcated, 47 }; 48 49 enum class CXLDeviceType{ 50 Invalid, 51 Type1, 52 Type2, 53 Type3, 54 }; 55 56 enum class CXLDynamicCapacityPolicies{ 57 Invalid, 58 Free, 59 Contiguous, 60 Prescriptive, 61 TagBased, 62 }; 63 64 NLOHMANN_JSON_SERIALIZE_ENUM(PCIeTypes, { 65 {PCIeTypes::Invalid, "Invalid"}, 66 {PCIeTypes::Gen1, "Gen1"}, 67 {PCIeTypes::Gen2, "Gen2"}, 68 {PCIeTypes::Gen3, "Gen3"}, 69 {PCIeTypes::Gen4, "Gen4"}, 70 {PCIeTypes::Gen5, "Gen5"}, 71 {PCIeTypes::Gen6, "Gen6"}, 72 }); 73 74 NLOHMANN_JSON_SERIALIZE_ENUM(DeviceType, { 75 {DeviceType::Invalid, "Invalid"}, 76 {DeviceType::SingleFunction, "SingleFunction"}, 77 {DeviceType::MultiFunction, "MultiFunction"}, 78 {DeviceType::Simulated, "Simulated"}, 79 {DeviceType::Retimer, "Retimer"}, 80 }); 81 82 NLOHMANN_JSON_SERIALIZE_ENUM(SlotType, { 83 {SlotType::Invalid, "Invalid"}, 84 {SlotType::FullLength, "FullLength"}, 85 {SlotType::HalfLength, "HalfLength"}, 86 {SlotType::LowProfile, "LowProfile"}, 87 {SlotType::Mini, "Mini"}, 88 {SlotType::M2, "M2"}, 89 {SlotType::OEM, "OEM"}, 90 {SlotType::OCP3Small, "OCP3Small"}, 91 {SlotType::OCP3Large, "OCP3Large"}, 92 {SlotType::U2, "U2"}, 93 {SlotType::EDSFF, "EDSFF"}, 94 }); 95 96 NLOHMANN_JSON_SERIALIZE_ENUM(LaneSplittingType, { 97 {LaneSplittingType::Invalid, "Invalid"}, 98 {LaneSplittingType::None, "None"}, 99 {LaneSplittingType::Bridged, "Bridged"}, 100 {LaneSplittingType::Bifurcated, "Bifurcated"}, 101 }); 102 103 NLOHMANN_JSON_SERIALIZE_ENUM(CXLDeviceType, { 104 {CXLDeviceType::Invalid, "Invalid"}, 105 {CXLDeviceType::Type1, "Type1"}, 106 {CXLDeviceType::Type2, "Type2"}, 107 {CXLDeviceType::Type3, "Type3"}, 108 }); 109 110 NLOHMANN_JSON_SERIALIZE_ENUM(CXLDynamicCapacityPolicies, { 111 {CXLDynamicCapacityPolicies::Invalid, "Invalid"}, 112 {CXLDynamicCapacityPolicies::Free, "Free"}, 113 {CXLDynamicCapacityPolicies::Contiguous, "Contiguous"}, 114 {CXLDynamicCapacityPolicies::Prescriptive, "Prescriptive"}, 115 {CXLDynamicCapacityPolicies::TagBased, "TagBased"}, 116 }); 117 118 } 119 // clang-format on 120