Initial commit
This commit is contained in:
+2058
File diff suppressed because it is too large
Load Diff
+141
@@ -0,0 +1,141 @@
|
||||
#include <ipmid/api-types.hpp>
|
||||
#include <ipmid/api.hpp>
|
||||
#include <ipmid/message.hpp>
|
||||
#include <ipmid/utils.hpp>
|
||||
#include <sdbusplus/message/types.hpp>
|
||||
|
||||
typedef struct {
|
||||
uint8_t socket_id;
|
||||
uint8_t channel_id;
|
||||
uint8_t dimm_id;
|
||||
uint8_t temp_integer;
|
||||
uint8_t temp_decimal;
|
||||
/*Memory temperature infomation(unit °C)*/
|
||||
}memory_info_t;
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
enum class DataType {
|
||||
TEMPERATURE,
|
||||
CURRENT,
|
||||
POWER,
|
||||
VOLTAGE,
|
||||
STATUS
|
||||
};
|
||||
|
||||
enum class TempSensor {
|
||||
TS0,
|
||||
TS1,
|
||||
SPD_TS,
|
||||
MAX_TS01
|
||||
};
|
||||
|
||||
enum class ReqId {
|
||||
TS0 = 0,
|
||||
TS1 = 1,
|
||||
SPD_TEMP = 2,
|
||||
MAX_TEMP = 3,
|
||||
VOLTAGE = 4,
|
||||
CURRENT = 5,
|
||||
STATUS_REG = 6
|
||||
};
|
||||
|
||||
enum class RailChannel {
|
||||
SWA,
|
||||
SWB,
|
||||
SWC,
|
||||
SWD,
|
||||
SWE,
|
||||
SWF
|
||||
};
|
||||
|
||||
enum class StatusReg {
|
||||
REG_04 = 0x04,
|
||||
REG_05 = 0x05,
|
||||
REG_06 = 0x06,
|
||||
REG_07 = 0x07,
|
||||
REG_08 = 0x08,
|
||||
REG_09 = 0x09,
|
||||
REG_0A = 0x0A,
|
||||
REG_0B = 0x0B
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
int8_t int_part;
|
||||
uint8_t frac_part;
|
||||
} dimm_temp_sensor_t;
|
||||
typedef struct {
|
||||
int8_t TS0_int;
|
||||
uint8_t TS0_frac;
|
||||
int8_t TS1_int;
|
||||
uint8_t TS1_frac;
|
||||
int8_t SPD_int;
|
||||
uint8_t SPD_frac;
|
||||
} dimm_temp_t;
|
||||
|
||||
typedef struct {
|
||||
uint16_t SWA;
|
||||
uint16_t SWB;
|
||||
uint16_t SWC;
|
||||
uint16_t SWD;
|
||||
uint16_t SWE;
|
||||
uint16_t SWF;
|
||||
} dimm_rail_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t dimmId;
|
||||
dimm_temp_t dimmTemp;
|
||||
dimm_rail_t dimmVolt;
|
||||
dimm_rail_t dimmCur;
|
||||
dimm_rail_t dimmPow;
|
||||
} oem_dimm_info_t;
|
||||
#pragma pack()
|
||||
|
||||
|
||||
#define MAX_FSC_PWM_CHANNEL 29
|
||||
#define FSC_FAN_TABLE_AUTO 0
|
||||
#define FSC_FAN_TABLE_MANUAL 1
|
||||
typedef struct
|
||||
{
|
||||
uint8_t u8ControlMode;
|
||||
uint8_t u8PWM[MAX_FSC_PWM_CHANNEL];
|
||||
}SFscControlMode;
|
||||
|
||||
namespace ipmi {
|
||||
constexpr Iana oemIANA =
|
||||
56799; // 0x00dddf https://www.iana.org/assignments/enterprise-numbers/?page=568
|
||||
constexpr int prioOem = ipmi::prioMax;
|
||||
constexpr NetFn netFnOemSelf = ipmi::netFnOemFour; // NetFn is 0x36
|
||||
namespace ipmiOem {
|
||||
|
||||
constexpr Cmd cmdGetDeviceFWVersion = 0x01;
|
||||
constexpr Cmd cmdSetFanSpeedControlMode = 0x04;
|
||||
constexpr Cmd cmdGetFanSpeedControlMode = 0x05;
|
||||
constexpr Cmd cmdSetBIOSPasswordConfig = 0x0E;
|
||||
constexpr Cmd cmdGetBIOSPasswordConfig = 0x0F;
|
||||
constexpr Cmd cmdGetPSUInfo = 0x20;
|
||||
constexpr Cmd cmdSwitchBMCFw = 0x23;
|
||||
constexpr Cmd cmdGetSetBiosVer = 0x34;
|
||||
constexpr Cmd cmdRestoreFactoryDefault = 0x35;
|
||||
constexpr Cmd cmdSetSOLBitrate = 0x36;
|
||||
constexpr Cmd cmdGet12VPSUADCValue = 0x60;
|
||||
constexpr Cmd cmdSet12VPSUADCValue = 0x61;
|
||||
constexpr Cmd cmdDIMMTemperatureValue = 0x62;
|
||||
constexpr Cmd cmdSetDIMMSetPoint = 0x63;
|
||||
constexpr Cmd cmdGetDIMMSetPoint = 0x64;
|
||||
constexpr Cmd cmdSetCoverStatus = 0x65;
|
||||
constexpr Cmd cmdGetCoverStatus = 0x66;
|
||||
constexpr Cmd cmdSetCoverPreHeatTemperature = 0x67;
|
||||
constexpr Cmd cmdGetCoverPreHeatTemperature = 0x68;
|
||||
constexpr Cmd cmdBiosSetDimmState = 0x69;
|
||||
constexpr Cmd cmdBiosSetDimmPara = 0x6a;
|
||||
constexpr Cmd cmdBiosGetDimmPara = 0x6b;
|
||||
constexpr Cmd cmdGetDimmTemp = 0x6c;
|
||||
constexpr Cmd cmdGetCoverCurrentTemp = 0x6d;
|
||||
constexpr Cmd cmdSetCoverFSCEnableStatus = 0x6e;
|
||||
constexpr Cmd cmdGetCoverFSCEnableStatus = 0x6f;
|
||||
constexpr Cmd cmdOemI2CReadWrite = 0xA4;
|
||||
|
||||
constexpr Cc ccOemInvalidIANA = 0x80;
|
||||
} // namespace ipmiOem
|
||||
} // namespace ipmi
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
project(
|
||||
'ipmi-oem',
|
||||
'cpp',
|
||||
version: '0.1',
|
||||
meson_version: '>=1.1.1',
|
||||
default_options: [
|
||||
'werror=true',
|
||||
'warning_level=3',
|
||||
'cpp_std=c++23',
|
||||
])
|
||||
|
||||
root = meson.current_source_dir()
|
||||
root_inc = include_directories('.')
|
||||
cpp = meson.get_compiler('cpp')
|
||||
|
||||
# i2c-tools doesn't ship a pkg-config file for libi2c
|
||||
i2c = cpp.find_library('i2c')
|
||||
|
||||
add_project_arguments(
|
||||
cpp.get_supported_arguments([
|
||||
'-DBOOST_ERROR_CODE_HEADER_ONLY',
|
||||
'-DBOOST_SYSTEM_NO_DEPRECATED',
|
||||
'-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
|
||||
'-DBOOST_ASIO_DISABLE_THREADS',
|
||||
'-DBOOST_ALL_NO_LIB',
|
||||
]),
|
||||
language : 'cpp')
|
||||
|
||||
add_project_arguments(
|
||||
cpp.get_supported_arguments([
|
||||
'-Wno-psabi',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-pedantic',
|
||||
'-Wno-non-virtual-dtor'
|
||||
]),
|
||||
language: 'cpp')
|
||||
|
||||
phosphor_logging_dep = dependency('phosphor-logging')
|
||||
phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
|
||||
systemd = dependency('systemd')
|
||||
boost_coroutine = cpp.find_library('boost_coroutine', required: true)
|
||||
sdbusplus_dep = dependency('sdbusplus')
|
||||
ipmid_dep = dependency('libipmid')
|
||||
libs = declare_dependency(
|
||||
include_directories: root_inc,
|
||||
dependencies: [
|
||||
phosphor_dbus_interfaces_dep,
|
||||
phosphor_logging_dep,
|
||||
sdbusplus_dep,
|
||||
ipmid_dep,
|
||||
systemd,
|
||||
i2c
|
||||
])
|
||||
|
||||
ipmi_oem_lib = library(
|
||||
'ipmioem',
|
||||
'ipmi-oem.cpp',
|
||||
implicit_include_directories: false,
|
||||
dependencies: libs,
|
||||
version: meson.project_version(),
|
||||
override_options: ['b_lundef=false'],
|
||||
install: true,
|
||||
install_dir: get_option('libdir') / 'ipmid-providers')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user