118a5ab91SZhikui Ren /* 218a5ab91SZhikui Ren // Copyright (c) 2020 intel Corporation 318a5ab91SZhikui Ren // 418a5ab91SZhikui Ren // Licensed under the Apache License, Version 2.0 (the "License"); 518a5ab91SZhikui Ren // you may not use this file except in compliance with the License. 618a5ab91SZhikui Ren // You may obtain a copy of the License at 718a5ab91SZhikui Ren // 818a5ab91SZhikui Ren // http://www.apache.org/licenses/LICENSE-2.0 918a5ab91SZhikui Ren // 1018a5ab91SZhikui Ren // Unless required by applicable law or agreed to in writing, software 1118a5ab91SZhikui Ren // distributed under the License is distributed on an "AS IS" BASIS, 1218a5ab91SZhikui Ren // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1318a5ab91SZhikui Ren // See the License for the specific language governing permissions and 1418a5ab91SZhikui Ren // limitations under the License. 1518a5ab91SZhikui Ren */ 1618a5ab91SZhikui Ren 1718a5ab91SZhikui Ren #pragma once 1818a5ab91SZhikui Ren 1918a5ab91SZhikui Ren #include <sdbusplus/asio/object_server.hpp> 2018a5ab91SZhikui Ren #include <xyz/openbmc_project/Inventory/Decorator/Asset/server.hpp> 2118a5ab91SZhikui Ren 2218a5ab91SZhikui Ren namespace cpu_info 2318a5ab91SZhikui Ren { 2418a5ab91SZhikui Ren static constexpr char const* cpuInfoObject = "xyz.openbmc_project.CPUInfo"; 2518a5ab91SZhikui Ren static constexpr char const* cpuInfoPath = "/xyz/openbmc_project/CPUInfo"; 2618a5ab91SZhikui Ren static constexpr char const* cpuInfoInterface = "xyz.openbmc_project.CPUInfo"; 2794c94bfbSJonathan Doman static constexpr const char* cpuPath = 2894c94bfbSJonathan Doman "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu"; 2918a5ab91SZhikui Ren 306d3ad586SZhikui Ren static constexpr const int configCheckInterval = 10; 316d3ad586SZhikui Ren static constexpr const int peciCheckInterval = 60; 3218a5ab91SZhikui Ren 3318a5ab91SZhikui Ren /** \ todo add cpu interface to CPUInfo and consolidate with smbios service 3418a5ab91SZhikui Ren * using processor = 3518a5ab91SZhikui Ren sdbusplus::xyz::openbmc_project::Inventory::Item::server::Cpu; 3618a5ab91SZhikui Ren */ 3718a5ab91SZhikui Ren 386d3ad586SZhikui Ren // This will be expanded to CPUInfo object_server in a future patch 396d3ad586SZhikui Ren struct CPUInfo 4018a5ab91SZhikui Ren { 416d3ad586SZhikui Ren CPUInfo(const size_t cpuId, const uint8_t peciAddress, 426d3ad586SZhikui Ren const uint8_t i2cBusNum, const uint8_t i2cSlaveAddress) : 436d3ad586SZhikui Ren id(cpuId), 446d3ad586SZhikui Ren peciAddr(peciAddress), i2cBus(i2cBusNum), i2cDevice(i2cSlaveAddress) 4518a5ab91SZhikui Ren {} 4618a5ab91SZhikui Ren 476d3ad586SZhikui Ren uint8_t id; 486d3ad586SZhikui Ren uint8_t peciAddr; 496d3ad586SZhikui Ren uint8_t i2cBus; 506d3ad586SZhikui Ren uint8_t i2cDevice; 51*2285be4fSJonathan Doman std::string sSpec; 5218a5ab91SZhikui Ren }; 5318a5ab91SZhikui Ren 5418a5ab91SZhikui Ren } // namespace cpu_info 55