2020-09-16 11:24:22 +05:30
|
|
|
/*
|
2021-01-04 22:44:58 -08:00
|
|
|
* Copyright (C) 2020-2021 Intel Corporation
|
2020-09-16 11:24:22 +05:30
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#include <string>
|
|
|
|
|
const std::string vendorIntel("Intel(R) Corporation");
|
2021-04-01 18:33:10 +05:30
|
|
|
const std::string unknown("unknown");
|
2020-09-16 11:24:22 +05:30
|
|
|
const std::string intelPciId("0x8086");
|
|
|
|
|
constexpr uint32_t MbpsToBytesPerSecond = 125000;
|
2020-09-28 16:21:41 -07:00
|
|
|
constexpr double milliVoltsFactor = 1000.0;
|
2020-09-16 11:24:22 +05:30
|
|
|
|
|
|
|
|
namespace PciLinkSpeeds {
|
|
|
|
|
constexpr double Pci2_5GigatransfersPerSecond = 2.5;
|
|
|
|
|
constexpr double Pci5_0GigatransfersPerSecond = 5.0;
|
|
|
|
|
constexpr double Pci8_0GigatransfersPerSecond = 8.0;
|
|
|
|
|
constexpr double Pci16_0GigatransfersPerSecond = 16.0;
|
|
|
|
|
constexpr double Pci32_0GigatransfersPerSecond = 32.0;
|
|
|
|
|
|
|
|
|
|
} // namespace PciLinkSpeeds
|
|
|
|
|
enum PciGenerations {
|
|
|
|
|
PciGen1 = 1,
|
|
|
|
|
PciGen2,
|
|
|
|
|
PciGen3,
|
|
|
|
|
PciGen4,
|
|
|
|
|
PciGen5,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
constexpr uint8_t maxPciBars = 6;
|
|
|
|
|
// Linux kernel would report 255 link width, as an indication of unknown.
|
|
|
|
|
constexpr uint32_t unknownPcieLinkWidth = 255u;
|
|
|
|
|
|
|
|
|
|
constexpr uint32_t microSecondsToNanoSeconds = 1000u;
|
|
|
|
|
|
|
|
|
|
constexpr uint64_t convertJouleToMicroJoule = 1000000u;
|
|
|
|
|
constexpr uint64_t minTimeoutModeHeartbeat = 5000u;
|
|
|
|
|
constexpr uint64_t minTimeoutInMicroSeconds = 1000u;
|
|
|
|
|
constexpr uint16_t milliSecsToMicroSecs = 1000;
|
2021-01-04 22:44:58 -08:00
|
|
|
constexpr uint32_t milliFactor = 1000u;
|
2021-03-03 12:34:30 +05:30
|
|
|
constexpr uint32_t microFacor = milliFactor * milliFactor;
|
2021-04-09 12:34:13 +00:00
|
|
|
constexpr uint64_t gigaUnitTransferToUnitTransfer = 1000 * 1000 * 1000;
|
2021-03-03 12:34:30 +05:30
|
|
|
|
|
|
|
|
constexpr int32_t memoryBusWidth = 128; // bus width in bits
|
|
|
|
|
constexpr int32_t numMemoryChannels = 8;
|