Lines Matching +full:pcie +full:- +full:ob
3 * Copyright (c) 2018-present Facebook.
9 * http://www.apache.org/licenses/LICENSE-2.0
22 #include <ipmid/api-types.hpp>
27 #include <phosphor-logging/log.hpp>
77 constexpr const char* certPath = "/mnt/data/host/bios-rootcert";
83 static constexpr const char* FRU_EEPROM = "/sys/bus/i2c/devices/6-0054/eeprom";
139 ipmi::getDbusProperty(bus, object.second.begin()->first, in getIPObject()
146 variant = ipmi::getDbusProperty(bus, object.second.begin()->first, in getIPObject()
149 objectInfo = std::make_pair(object.first, object.second.begin()->first); in getIPObject()
151 // if LinkLocalIP found look for Non-LinkLocalIP in getIPObject()
288 oemData[bootOrderKey][KEY_BOOT_SEQ][i - 1] = "NA"; in setBootOrder()
290 oemData[bootOrderKey][KEY_BOOT_SEQ][i - 1] = in setBootOrder()
364 std::string seqStr = oemData[hostName][KEY_BOOT_SEQ][i - 1]; in getBootOrder()
374 //----------------------------------------------------------------------
376 //----------------------------------------------------------------------
428 return -1; in readDimmType()
524 std::strcpy(data, result->c_str()); in getNetworkData()
598 size_t targetIndex = (hostPosition > 0 ? hostPosition - 1 : 0); in getMotherBoardFruPath()
660 phosphor::logging::entry("ERRNO=0x%X", -ret)); in getFruData()
662 return -1; in getFruData()
681 return -1; in getFruData()
719 return -1; in getFruData()
741 return -1; in sysConfig()
749 return -1; in sysConfig()
764 return -1; in sysConfig()
827 return -1; in procInfo()
834 return -1; in procInfo()
846 std::sregex_token_iterator(s.begin(), s.end(), regex, -1), in procInfo()
866 //----------------------------------------------------------------------
868 //----------------------------------------------------------------------
884 //----------------------------------------------------------------------
886 //----------------------------------------------------------------------
906 //----------------------------------------------------------------------
908 //----------------------------------------------------------------------
944 //----------------------------------------------------------------------
946 //----------------------------------------------------------------------
983 //----------------------------------------------------------------------
985 //----------------------------------------------------------------------
1019 //----------------------------------------------------------------------
1021 //----------------------------------------------------------------------
1047 //----------------------------------------------------------------------
1049 //----------------------------------------------------------------------
1080 //----------------------------------------------------------------------
1082 //----------------------------------------------------------------------
1093 //----------------------------------------------------------------------
1095 //----------------------------------------------------------------------
1100 std::to_string(ctx->hostIdx + 1); in ipmiOemGet80PortRecord()
1102 std::to_string(ctx->hostIdx + 1); in ipmiOemGet80PortRecord()
1116 conn->new_method_call(postCodeService.c_str(), postCodeObjPath.c_str(), in ipmiOemGet80PortRecord()
1122 auto reply = conn->call(msg); in ipmiOemGet80PortRecord()
1137 for (int j = postCodeSize - 1; j >= 0; --j) in ipmiOemGet80PortRecord()
1148 startIndex = resData.size() - maxPostCodeLen; in ipmiOemGet80PortRecord()
1156 //----------------------------------------------------------------------
1158 //----------------------------------------------------------------------
1171 std::optional<size_t> hostId = findHost(ctx->hostIdx); in ipmiOemSetBootOrder()
1186 //----------------------------------------------------------------------
1188 //----------------------------------------------------------------------
1193 std::optional<size_t> hostId = findHost(ctx->hostIdx); in ipmiOemGetBootOrder()
1208 //----------------------------------------------------------------------
1225 if (req->chassis_type >= sizeof(chassisType) / sizeof(uint8_t*)) in ipmiOemSetMachineCfgInfo()
1229 chassisType[req->chassis_type]; in ipmiOemSetMachineCfgInfo()
1231 if (req->mb_type >= sizeof(mbType) / sizeof(uint8_t*)) in ipmiOemSetMachineCfgInfo()
1234 oemData[KEY_MC_CONFIG][KEY_MC_MB_TYPE] = mbType[req->mb_type]; in ipmiOemSetMachineCfgInfo()
1236 oemData[KEY_MC_CONFIG][KEY_MC_PROC_CNT] = req->proc_cnt; in ipmiOemSetMachineCfgInfo()
1237 oemData[KEY_MC_CONFIG][KEY_MC_MEM_CNT] = req->mem_cnt; in ipmiOemSetMachineCfgInfo()
1238 oemData[KEY_MC_CONFIG][KEY_MC_HDD35_CNT] = req->hdd35_cnt; in ipmiOemSetMachineCfgInfo()
1239 oemData[KEY_MC_CONFIG][KEY_MC_HDD25_CNT] = req->hdd25_cnt; in ipmiOemSetMachineCfgInfo()
1241 if (req->riser_type >= sizeof(riserType) / sizeof(uint8_t*)) in ipmiOemSetMachineCfgInfo()
1244 oemData[KEY_MC_CONFIG][KEY_MC_RSR_TYPE] = riserType[req->riser_type]; in ipmiOemSetMachineCfgInfo()
1248 if (req->pcie_card_loc & BIT_0) in ipmiOemSetMachineCfgInfo()
1250 if (req->pcie_card_loc & BIT_1) in ipmiOemSetMachineCfgInfo()
1252 if (req->pcie_card_loc & BIT_2) in ipmiOemSetMachineCfgInfo()
1254 if (req->pcie_card_loc & BIT_3) in ipmiOemSetMachineCfgInfo()
1257 if (req->slot1_pcie_type >= sizeof(pcieType) / sizeof(uint8_t*)) in ipmiOemSetMachineCfgInfo()
1261 pcieType[req->slot1_pcie_type]; in ipmiOemSetMachineCfgInfo()
1263 if (req->slot2_pcie_type >= sizeof(pcieType) / sizeof(uint8_t*)) in ipmiOemSetMachineCfgInfo()
1267 pcieType[req->slot2_pcie_type]; in ipmiOemSetMachineCfgInfo()
1269 if (req->slot3_pcie_type >= sizeof(pcieType) / sizeof(uint8_t*)) in ipmiOemSetMachineCfgInfo()
1273 pcieType[req->slot3_pcie_type]; in ipmiOemSetMachineCfgInfo()
1275 if (req->slot4_pcie_type >= sizeof(pcieType) / sizeof(uint8_t*)) in ipmiOemSetMachineCfgInfo()
1279 pcieType[req->slot4_pcie_type]; in ipmiOemSetMachineCfgInfo()
1281 oemData[KEY_MC_CONFIG][KEY_MC_AEP_CNT] = req->aep_mem_cnt; in ipmiOemSetMachineCfgInfo()
1288 //----------------------------------------------------------------------
1290 //----------------------------------------------------------------------
1302 //----------------------------------------------------------------------
1304 //----------------------------------------------------------------------
1326 //----------------------------------------------------------------------
1328 //----------------------------------------------------------------------
1359 //----------------------------------------------------------------------
1361 //----------------------------------------------------------------------
1374 int fd = -1; in setGUID()
1385 ss << "/sys/bus/i2c/devices/" << static_cast<int>(bus) << "-" in setGUID()
1394 if (access(eepromPath.c_str(), F_OK) == -1) in setGUID()
1402 if (fd == -1) in setGUID()
1424 //----------------------------------------------------------------------
1426 //----------------------------------------------------------------------
1438 uint8_t bicAddr = (uint8_t)ctx->hostIdx << 2; in ipmiOemSetSystemGuid()
1440 if (sendBicCmd(ctx->netFn, ctx->cmd, bicAddr, reqData, respData)) in ipmiOemSetSystemGuid()
1469 //----------------------------------------------------------------------
1471 //----------------------------------------------------------------------
1481 //----------------------------------------------------------------------
1483 //----------------------------------------------------------------------
1571 //----------------------------------------------------------------------
1573 //----------------------------------------------------------------------
1659 //----------------------------------------------------------------------
1661 //----------------------------------------------------------------------
1663 // address. FRU IDs are dynamic based on entity-manager probe orders so
1664 // this allows a look-up based on known data from the host to identify a
1670 // - Byte 1: bus
1671 // - Byte 2: slave address
1674 // - Byte 1 - Completion Code
1675 // - Byte 2 - FRU ID
1715 const auto& properties = it->second; in ipmiOemGetFruId()
1724 uint32_t busValue = std::get<uint32_t>(busIt->second); in ipmiOemGetFruId()
1725 uint32_t addrValue = std::get<uint32_t>(addrIt->second); in ipmiOemGetFruId()
1741 return -1; in ipmiOemGetFruId()
1752 return -1; in ipmiOemGetFruId()
1760 //----------------------------------------------------------------------
1762 //----------------------------------------------------------------------
1775 // Ex. Intel(R) Xeon(R) CPU E5-2685 v3 @ 2.60GHz
1794 auto hostId = findHost(ctx->hostIdx); in ipmiOemQSetProcInfo()
1818 //----------------------------------------------------------------------
1820 //----------------------------------------------------------------------
1833 // Ex. Intel(R) Xeon(R) CPU E5-2685 v3 @ 2.60GHz
1852 auto hostId = findHost(ctx->hostIdx); in ipmiOemQGetProcInfo()
1879 //----------------------------------------------------------------------
1881 //----------------------------------------------------------------------
1915 // 0x01 – DDR-1 RAM
1917 // 0x03 – DDR-2 RAM
1919 // 0x05 – DDR-3 RAM
1920 // 0x06 – DDR-4 RAM
1927 // Byte 1..20 –Module Part Number (JEDEC Standard No. 21-C)
1930 // Byte 1..4 –Module Serial Number (JEDEC Standard No. 21-C)
1933 // Byte 1 - Module Manufacturer ID, LSB
1934 // Byte 2 - Module Manufacturer ID, MSB
1946 auto hostId = findHost(ctx->hostIdx); in ipmiOemQSetDimmInfo()
1974 //----------------------------------------------------------------------
2010 // 0x01 – DDR-1 RAM
2012 // 0x03 – DDR-2 RAM
2014 // 0x05 – DDR-3 RAM
2015 // 0x06 – DDR-4 RAM
2022 // Byte 1..20 –Module Part Number (JEDEC Standard No. 21-C)
2025 // Byte 1..4 –Module Serial Number (JEDEC Standard No. 21-C)
2028 // Byte 1 - Module Manufacturer ID, LSB
2029 // Byte 2 - Module Manufacturer ID, MSB
2041 auto hostId = findHost(ctx->hostIdx); in ipmiOemQGetDimmInfo()
2070 //----------------------------------------------------------------------
2072 //----------------------------------------------------------------------
2076 // OB SATA controller.
2128 // Byte 5..12 - HDD Block Number, LSB
2132 // Byte 1 - Max HDD Quantity
2140 // 3h – PCIE SSD (NVME)
2151 uint8_t ctrlType = req->hddCtrlType & 0x0f; in ipmiOemQSetDriveInfo()
2159 if (len < 6 || req->paramSel >= numParam || ctrlType > 2) in ipmiOemQSetDriveInfo()
2166 len = len - 6; // Get Actual data length in ipmiOemQSetDriveInfo()
2169 ss << std::setw(2) << std::setfill('0') << (int)req->hddIndex; in ipmiOemQSetDriveInfo()
2170 oemData[KEY_Q_DRIVE_INFO][KEY_HDD_CTRL_TYPE] = req->hddCtrlType; in ipmiOemQSetDriveInfo()
2172 req->hddIndex; in ipmiOemQSetDriveInfo()
2174 str = bytesToStr(req->data, len); in ipmiOemQSetDriveInfo()
2176 [driveInfoKey[req->paramSel]] = str.c_str(); in ipmiOemQSetDriveInfo()
2182 //----------------------------------------------------------------------
2184 //----------------------------------------------------------------------
2211 uint8_t ctrlType = req->hddCtrlType & 0x0f; in ipmiOemQGetDriveInfo()
2218 if (req->paramSel >= numParam || ctrlType > 2) in ipmiOemQGetDriveInfo()
2230 ss << std::setw(2) << std::setfill('0') << (int)req->hddIndex; in ipmiOemQGetDriveInfo()
2237 driveInfoKey[req->paramSel]) == in ipmiOemQGetDriveInfo()
2242 [driveInfoKey[req->paramSel]]; in ipmiOemQGetDriveInfo()
2259 uint8_t bicAddr = (uint8_t)ctx->hostIdx << 2; in sendDCMICmd()
2261 if (sendBicCmd(ctx->netFn, ctx->cmd, bicAddr, cmdData, respData)) in sendDCMICmd()
2323 if (pReq->offset >= fileSize) in ipmiOemGetHttpsData()
2330 auto readLen = std::min<uint16_t>(pReq->length, fileSize - pReq->offset); in ipmiOemGetHttpsData()
2333 file.seekg(pReq->offset); in ipmiOemGetHttpsData()
2423 ss << std::format(" MCA_CTRL : 0x{:016X}\n", pBank->mcaCtrl); in handleMcaBank()
2424 ss << std::format(" MCA_STATUS : 0x{:016X}\n", pBank->mcaSts); in handleMcaBank()
2425 ss << std::format(" MCA_ADDR : 0x{:016X}\n", pBank->mcaAddr); in handleMcaBank()
2426 ss << std::format(" MCA_MISC0 : 0x{:016X}\n", pBank->mcaMisc0); in handleMcaBank()
2427 ss << std::format(" MCA_CTRL_MASK : 0x{:016X}\n", pBank->mcaCtrlMask); in handleMcaBank()
2428 ss << std::format(" MCA_CONFIG : 0x{:016X}\n", pBank->mcaConfig); in handleMcaBank()
2429 ss << std::format(" MCA_IPID : 0x{:016X}\n", pBank->mcaIpid); in handleMcaBank()
2430 ss << std::format(" MCA_SYND : 0x{:016X}\n", pBank->mcaSynd); in handleMcaBank()
2431 ss << std::format(" MCA_DESTAT : 0x{:016X}\n", pBank->mcaDestat); in handleMcaBank()
2432 ss << std::format(" MCA_DEADDR : 0x{:016X}\n", pBank->mcaDeaddr); in handleMcaBank()
2433 ss << std::format(" MCA_MISC1 : 0x{:016X}\n", pBank->mcaMisc1); in handleMcaBank()
2448 if (data.size() < sizeof(T) + sizeof(BankCorePair) * pBank->mcaCount) in handleVirtualBank()
2456 ss << std::format(" S5_RESET_STATUS : 0x{:08X}\n", pBank->s5ResetSts); in handleVirtualBank()
2457 ss << std::format(" PM_BREAKEVENT : 0x{:08X}\n", pBank->breakevent); in handleVirtualBank()
2460 ss << std::format(" WARMCOLDRSTSTATUS : 0x{:08X}\n", pBank->rstSts); in handleVirtualBank()
2462 ss << std::format(" PROCESSOR NUMBER : 0x{:04X}\n", pBank->procNum); in handleVirtualBank()
2463 ss << std::format(" APIC ID : 0x{:08X}\n", pBank->apicId); in handleVirtualBank()
2464 ss << std::format(" EAX : 0x{:08X}\n", pBank->eax); in handleVirtualBank()
2465 ss << std::format(" EBX : 0x{:08X}\n", pBank->ebx); in handleVirtualBank()
2466 ss << std::format(" ECX : 0x{:08X}\n", pBank->ecx); in handleVirtualBank()
2467 ss << std::format(" EDX : 0x{:08X}\n", pBank->edx); in handleVirtualBank()
2469 for (size_t i = 0; i < pBank->mcaCount; i++) in handleVirtualBank()
2471 ss << std::format("(0x{:02X},0x{:02X}) ", pBank->mcaList[i].bankId, in handleVirtualBank()
2472 pBank->mcaList[i].coreId); in handleVirtualBank()
2494 pBank->hwAssertStsHi[i]); in handleCpuWdtBank()
2496 pBank->hwAssertStsLo[i]); in handleCpuWdtBank()
2498 pBank->origWdtAddrLogHi[i]); in handleCpuWdtBank()
2500 pBank->origWdtAddrLogLo[i]); in handleCpuWdtBank()
2502 pBank->hwAssertMskHi[i]); in handleCpuWdtBank()
2504 pBank->hwAssertMskLo[i]); in handleCpuWdtBank()
2506 pBank->origWdtAddrLogStat[i]); in handleCpuWdtBank()
2532 pBank->hwAssertStsHi[i]); in handleHwAssertBank()
2534 pBank->hwAssertStsLo[i]); in handleHwAssertBank()
2536 pBank->hwAssertMskHi[i]); in handleHwAssertBank()
2538 pBank->hwAssertMskLo[i]); in handleHwAssertBank()
2556 ss << std::format(" [Bus{} Dev{} Fun{}]\n", pBank->bus, pBank->dev, in handlePcieAerBank()
2557 pBank->fun); in handlePcieAerBank()
2559 pBank->cmd); in handlePcieAerBank()
2561 pBank->sts); in handlePcieAerBank()
2563 pBank->slot); in handlePcieAerBank()
2565 pBank->secondBus); in handlePcieAerBank()
2567 pBank->vendorId); in handlePcieAerBank()
2569 pBank->devId); in handlePcieAerBank()
2571 pBank->classCodeHi, pBank->classCodeLo); in handlePcieAerBank()
2573 pBank->secondSts); in handlePcieAerBank()
2575 pBank->ctrl); in handlePcieAerBank()
2577 pBank->uncorrErrSts); in handlePcieAerBank()
2579 pBank->uncorrErrMsk); in handlePcieAerBank()
2581 pBank->uncorrErrSeverity); in handlePcieAerBank()
2583 pBank->corrErrSts); in handlePcieAerBank()
2585 pBank->corrErrMsk); in handlePcieAerBank()
2587 pBank->hdrLogDw0); in handlePcieAerBank()
2589 pBank->hdrLogDw1); in handlePcieAerBank()
2591 pBank->hdrLogDw2); in handlePcieAerBank()
2593 pBank->hdrLogDw3); in handlePcieAerBank()
2595 pBank->rootErrSts); in handlePcieAerBank()
2597 pBank->corrErrSrcId); in handlePcieAerBank()
2599 pBank->errSrcId); in handlePcieAerBank()
2601 pBank->laneErrSts); in handlePcieAerBank()
2614 if (data.size() < sizeof(CrdWdtRegBank) + sizeof(uint32_t) * pBank->count) in handleWdtRegBank()
2621 ss << std::format(" [NBIO{}] {}\n", pBank->nbio, pBank->name); in handleWdtRegBank()
2622 ss << std::format(" Address: 0x{:08X}\n", pBank->addr); in handleWdtRegBank()
2623 ss << std::format(" Data Count: {}\n", pBank->count); in handleWdtRegBank()
2625 for (size_t i = 0; i < pBank->count; i++) in handleWdtRegBank()
2627 ss << std::format(" {}: 0x{:08X}\n", i, pBank->data[i]); in handleWdtRegBank()
2646 ss << std::format(" CPU PPIN : 0x{:016X}\n", pBank->ppin); in handleCrdHdrBank()
2647 ss << std::format(" UCODE VERSION : 0x{:08X}\n", pBank->ucodeVer); in handleCrdHdrBank()
2648 ss << std::format(" PMIO 80h : 0x{:08X}\n", pBank->pmio); in handleCrdHdrBank()
2650 … " BIT0 - SMN Parity/SMN Timeouts PSP/SMU Parity and ECC/SMN On-Package Link Error : {}\n", in handleCrdHdrBank()
2651 pBank->pmio & 0x1); in handleCrdHdrBank()
2652 ss << std::format(" BIT2 - PSP Parity and ECC : {}\n", in handleCrdHdrBank()
2653 (pBank->pmio & 0x4) >> 2); in handleCrdHdrBank()
2654 ss << std::format(" BIT3 - SMN Timeouts SMU : {}\n", in handleCrdHdrBank()
2655 (pBank->pmio & 0x8) >> 3); in handleCrdHdrBank()
2656 ss << std::format(" BIT4 - SMN Off-Package Link Packet Error : {}\n", in handleCrdHdrBank()
2657 (pBank->pmio & 0x10) >> 4); in handleCrdHdrBank()
2705 const std::filesystem::path dumpDir = "/var/lib/fb-ipmi-oem"; in handleCtrlBank()
2714 << std::put_time(std::localtime(&now), "%Y-%m-%d %H:%M:%S") in handleCtrlBank()
2741 reqData.size() - sizeof(CrashDumpHdr)}; in ipmiOemCrashdump()
2744 switch (pHdr->bankHdr.bankType) in ipmiOemCrashdump()
2750 if (pHdr->bankHdr.version >= 3) in ipmiOemCrashdump()