├── .shellcheck ├── test ├── expected-schema-errors.txt ├── entity_manager │ ├── meson.build │ └── log_device_inventory.cpp └── meson.build ├── subprojects ├── .clang-tidy ├── .clang-format ├── gtest.wrap ├── valijson.wrap ├── sdbusplus.wrap ├── nlohmann_json.wrap ├── phosphor-logging.wrap ├── phosphor-dbus-interfaces.wrap ├── boost.wrap └── libgpiod.wrap ├── blacklist.json ├── .prettierignore ├── .gitignore ├── .markdownlint.yaml ├── .prettierrc.yaml ├── scripts ├── generate_schema_list.sh ├── generate_config_list.sh ├── run-ci.sh └── generate_meson_array.sh ├── service_files ├── dbus │ └── xyz.openbmc_project.EntityManager.service ├── xyz.openbmc_project.FruDevice.service ├── devicetree-vpd-parser.service ├── xyz.openbmc_project.gpiopresence.service ├── xyz.openbmc_project.EntityManager.service └── meson.build ├── configurations ├── intel │ ├── sas_module.json │ ├── 8x25_hsbp.json │ ├── pcie_ssd_retimer.json │ ├── axx1p100hssi_aic.json │ ├── f1u4x25_hsbp.json │ ├── f1u12x25_hsbp.json │ ├── f2u12x35_hsbp.json │ ├── nvme_p4500_p5500.json │ ├── front_panel.json │ ├── a2ux8x4riser.json │ ├── nvme_intel_p_series.json │ ├── bnp_baseboard.json │ └── axx2prthdhd.json ├── meta │ ├── darwin_chassis.json │ ├── ventura │ │ ├── delta_heat_exchanger.json │ │ ├── ventura_ioboard.json │ │ ├── ventura_ledboard.json │ │ ├── delta_heat_exchanger_fans.json │ │ ├── ventura_valve.json │ │ └── delta_reservoir_pump_unit.json │ ├── minerva │ │ ├── minerva_fanboard_misc.json │ │ ├── minerva_cmm_bsm.json │ │ ├── minerva_sitv.json │ │ ├── minerva_aegis.json │ │ ├── minerva_cmm_misc_boards.json │ │ ├── minerva_janga_smb.json │ │ └── minerva_tahan_smb.json │ ├── yv4 │ │ ├── yosemite4_cpu.json │ │ ├── yosemite4_chassis.json │ │ ├── yosemite4_floatingfalls.json │ │ └── yosemite4_sentineldome_chassis.json │ ├── harma │ │ └── harma_bsm.json │ ├── greatlakes_nic_mellanox.json │ ├── fbyv35_nic_mellanox.json │ ├── catalina │ │ ├── catalina_osfp.json │ │ ├── catalina_hdd_nvme.json │ │ └── catalina_fio.json │ ├── clemente │ │ ├── clemente_hdd.json │ │ ├── clemente_osfp.json │ │ └── clemente_fio.json │ ├── twinlake.json │ ├── bmc_storage_module.json │ ├── santabarbara │ │ ├── santabarbara_evb.json │ │ ├── santabarbara_sitv_pcie.json │ │ └── santabarbara_rainbow.json │ ├── terminus_2x100g_nic_tsff.json │ └── anacapa │ │ ├── anacapa_bridge_l.json │ │ └── anacapa_bridge_r.json ├── nvidia │ ├── bmc_p3809.json │ ├── rtx6000_pro.json │ ├── cable_cartridge.json │ ├── imgx_connectx8_supernic_switch.json │ ├── gb200.json │ ├── hmc.json │ └── cx8_mezzanine_module.json ├── ibm │ ├── bonnell.json │ ├── balcones.json │ ├── tacoma_rack_controller.json │ ├── huygens_chassis.json │ ├── mudflap.json │ ├── tola.json │ ├── ingraham.json │ ├── everest.json │ ├── fuji.json │ ├── rainier_4u_chassis.json │ ├── rainier_1s4u_chassis.json │ ├── rainier_2u_chassis.json │ ├── blueridge_2u_chassis.json │ ├── blueridge_4u_chassis.json │ ├── blueridge_1s4u_chassis.json │ ├── waterloo.json │ ├── pennybacker.json │ ├── sbp1_nvme.json │ └── nisqually.json ├── gigabyte │ └── msx4_mg1.json ├── acbel │ └── rica_psu.json ├── micron │ └── 7450.json ├── ampere │ ├── mtmitchell_riser.json │ ├── mtjefferson_riser.json │ ├── mtjefferson_bp.json │ ├── mtjefferson_bmc.json │ └── mtmitchell_bp.json ├── delta │ └── awf2dc3200w_psu.json ├── 3y-power │ └── 3ypower_vast2112_psu.json ├── broadcomm │ ├── 200g_1p_ocp_mezz.json │ ├── 400g_1p_ocp3.json │ └── 100g_1p_ocp_mezz.json ├── ocp │ ├── cx7_ocp.json │ └── cx8_ocp.json └── VENDORS.md ├── src ├── devicetree_vpd_parser │ ├── meson.build │ ├── machine_context.hpp │ ├── machine_context.cpp │ └── devicetree_vpd_parser.cpp ├── entity_manager │ ├── overlay.hpp │ ├── log_device_inventory.hpp │ ├── power_status_monitor.hpp │ ├── expression.hpp │ ├── main.cpp │ ├── perform_probe.hpp │ ├── meson.build │ ├── perform_scan.hpp │ ├── configuration.hpp │ ├── utils.hpp │ ├── power_status_monitor.cpp │ ├── log_device_inventory.cpp │ └── expression.cpp ├── meson.build ├── fru_device │ ├── gzip_utils.hpp │ ├── meson.build │ ├── fru_reader.hpp │ └── fru_reader.cpp ├── gpio-presence │ ├── main.cpp │ ├── meson.build │ ├── config_provider.hpp │ ├── device_presence.hpp │ └── README.md └── variant_visitors.hpp ├── format-code ├── LICENCE ├── schemas ├── meson.build ├── nvidia.json ├── intel.json ├── pid_zone.json ├── topology.json ├── satellite_controller.json ├── gpio_presence.json ├── spdm_endpoint.json ├── cpld.json ├── leak_detector.json ├── mctp.json ├── valve.json ├── usb_port.json ├── stepwise.json └── virtual_sensor.json ├── docs ├── blacklist_configuration.md └── associations.md └── meson.options /.shellcheck: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/expected-schema-errors.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /subprojects/.clang-tidy: -------------------------------------------------------------------------------- 1 | Checks: '-*' 2 | -------------------------------------------------------------------------------- /blacklist.json: -------------------------------------------------------------------------------- 1 | { 2 | "buses": [] 3 | } 4 | -------------------------------------------------------------------------------- /subprojects/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | DisableFormat: true 3 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | configurations/* 2 | !configurations/**/*.md 3 | -------------------------------------------------------------------------------- /subprojects/gtest.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | revision = HEAD 3 | url = https://github.com/google/googletest.git 4 | -------------------------------------------------------------------------------- /subprojects/valijson.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | revision = HEAD 3 | url = https://github.com/tristanpenman/valijson.git 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build*/* 2 | subprojects/* 3 | !subprojects/*.wrap 4 | !subprojects/.clang-tidy 5 | !subprojects/.clang-format 6 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | default: true 2 | MD013: false 3 | MD024: 4 | siblings_only: true 5 | MD033: 6 | allowed_elements: ["br", "sub", "sup"] 7 | -------------------------------------------------------------------------------- /.prettierrc.yaml: -------------------------------------------------------------------------------- 1 | tabWidth: 4 2 | printWidth: 80 3 | proseWrap: "always" 4 | overrides: 5 | - files: "*.md" 6 | options: 7 | tabWidth: 2 8 | -------------------------------------------------------------------------------- /scripts/generate_schema_list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | self=$(basename "$0") 6 | 7 | ./scripts/generate_meson_array.sh schemas schemas "${self}" 8 | -------------------------------------------------------------------------------- /subprojects/sdbusplus.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | url = https://github.com/openbmc/sdbusplus.git 3 | revision = HEAD 4 | 5 | [provide] 6 | sdbusplus = sdbusplus_dep 7 | -------------------------------------------------------------------------------- /scripts/generate_config_list.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | self=$(basename "$0") 6 | 7 | ./scripts/generate_meson_array.sh configurations configs "${self}" 8 | -------------------------------------------------------------------------------- /subprojects/nlohmann_json.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | revision = HEAD 3 | url = https://github.com/nlohmann/json.git 4 | 5 | [provide] 6 | nlohmann_json = nlohmann_json_dep 7 | -------------------------------------------------------------------------------- /subprojects/phosphor-logging.wrap: -------------------------------------------------------------------------------- 1 | [wrap-git] 2 | url = https://github.com/openbmc/phosphor-logging.git 3 | revision = HEAD 4 | 5 | [provide] 6 | phosphor-logging = phosphor_logging_dep 7 | -------------------------------------------------------------------------------- /subprojects/phosphor-dbus-interfaces.wrap: -------------------------------------------------------------------------------- 1 | 2 | [wrap-git] 3 | url = https://github.com/openbmc/phosphor-dbus-interfaces.git 4 | revision = HEAD 5 | 6 | [provide] 7 | phosphor-dbus-interfaces = phosphor_dbus_interfaces_dep 8 | -------------------------------------------------------------------------------- /subprojects/boost.wrap: -------------------------------------------------------------------------------- 1 | [wrap-file] 2 | source_url = https://downloads.yoctoproject.org/mirror/sources/boost_1_88_0.tar.bz2 3 | source_hash = 46d9d2c06637b219270877c9e16155cbd015b6dc84349af064c088e9b5b12f7b 4 | source_filename = boost_1_88_0.tar.bz2 5 | -------------------------------------------------------------------------------- /service_files/dbus/xyz.openbmc_project.EntityManager.service: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | [D-BUS Service] 4 | Name=xyz.openbmc_project.EntityManager 5 | Exec=/bin/false 6 | User=root 7 | SystemdService=dbus-xyz.openbmc_project.EntityManager.service 8 | -------------------------------------------------------------------------------- /service_files/xyz.openbmc_project.FruDevice.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Fru Device 3 | After=dbus.service 4 | 5 | [Service] 6 | ExecStart=/usr/libexec/entity-manager/fru-device 7 | Restart=always 8 | RestartSec=5 9 | Type=dbus 10 | BusName=xyz.openbmc_project.FruDevice 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /configurations/intel/sas_module.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x4C", 5 | "Bus": "$bus", 6 | "Name": "SAS Module Temperature", 7 | "Type": "TMP75" 8 | } 9 | ], 10 | "Name": "SAS Module", 11 | "Probe": "FALSE", 12 | "Type": "Board" 13 | } 14 | -------------------------------------------------------------------------------- /service_files/devicetree-vpd-parser.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Makes data from device-tree nodes avaliable thru D-Bus 3 | After=dbus.service 4 | 5 | [Service] 6 | ExecStart=/usr/libexec/entity-manager/devicetree-vpd-parser 7 | Type=dbus 8 | BusName=xyz.openbmc_project.MachineContext 9 | 10 | [Install] 11 | WantedBy=basic.target 12 | -------------------------------------------------------------------------------- /scripts/run-ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | scripts/validate_configs.py -v -k -e test/expected-schema-errors.txt 6 | 7 | # fail the script if someone forgot to update the list of configurations or 8 | # schemas 9 | 10 | scripts/generate_config_list.sh 11 | scripts/generate_schema_list.sh 12 | git --no-pager diff --exit-code -- . 13 | -------------------------------------------------------------------------------- /src/devicetree_vpd_parser/meson.build: -------------------------------------------------------------------------------- 1 | cpp_args_fd = cpp_args 2 | executable( 3 | 'devicetree-vpd-parser', 4 | 'machine_context.cpp', 5 | 'devicetree_vpd_parser.cpp', 6 | cpp_args: cpp_args_fd, 7 | dependencies: [sdbusplus, phosphor_dbus_interfaces_dep], 8 | install: true, 9 | install_dir: installdir, 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /format-code: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # When called from openbmc-build-scripts, the `pwd` could be anywhere, but 6 | # the root of the repo is passed in the first argument. Switch to the repo 7 | # root so npm/git run in the right place. 8 | if [ -n "$1" ]; then 9 | cd "$1" 10 | fi 11 | python3 scripts/autojson.py configurations 12 | -------------------------------------------------------------------------------- /service_files/xyz.openbmc_project.gpiopresence.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=GPIO Presence Sensor 3 | 4 | [Service] 5 | ExecStart=/usr/libexec/entity-manager/gpio-presence-sensor 6 | Restart=always 7 | Type=dbus 8 | BusName=xyz.openbmc_project.gpiopresence 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | Alias=dbus-xyz.openbmc_project.gpiopresence.service 13 | -------------------------------------------------------------------------------- /src/entity_manager/overlay.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation 3 | 4 | #pragma once 5 | #include 6 | #include 7 | 8 | void unloadAllOverlays(); 9 | bool loadOverlays(const nlohmann::json& systemConfiguration, 10 | boost::asio::io_context& io); 11 | -------------------------------------------------------------------------------- /service_files/xyz.openbmc_project.EntityManager.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Entity Manager 3 | 4 | [Service] 5 | ExecStartPre=/bin/mkdir -p /var/configuration 6 | ExecStartPre=/bin/mkdir -p /tmp/overlays 7 | ExecStart=/usr/libexec/entity-manager/entity-manager 8 | Restart=always 9 | Type=dbus 10 | BusName=xyz.openbmc_project.EntityManager 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | Alias=dbus-xyz.openbmc_project.EntityManager.service 15 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | cpp_args = boost_args + ['-DPACKAGE_DIR="' + packagedir + '/"'] 2 | cpp_args += ['-DSYSCONF_DIR="' + sysconfdir + '/"'] 3 | installdir = join_paths(get_option('libexecdir'), 'entity-manager') 4 | 5 | subdir('entity_manager') 6 | 7 | if get_option('fru-device') 8 | subdir('fru_device') 9 | endif 10 | 11 | if get_option('devicetree-vpd') 12 | subdir('devicetree_vpd_parser') 13 | endif 14 | 15 | if get_option('gpio-presence') 16 | subdir('gpio-presence') 17 | endif 18 | -------------------------------------------------------------------------------- /configurations/meta/darwin_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [], 3 | "Name": "Darwin Chassis", 4 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'Darwin', 'PRODUCT_MANUFACTURER': 'Meta'})", 5 | "Type": "Chassis", 6 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 7 | "Manufacturer": "N/A", 8 | "Model": "N/A", 9 | "PartNumber": "N/A", 10 | "SerialNumber": "$SerialNumber", 11 | "SparePartNumber": "20-002749" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/fru_device/gzip_utils.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | std::optional gzipInflate(std::span compressedBytes); 14 | 15 | std::vector getNodeFromXml(std::string_view xml, 16 | const char* nodeName); 17 | -------------------------------------------------------------------------------- /configurations/nvidia/bmc_p3809.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "HMC_FRU", 7 | "Type": "EEPROM_24C02" 8 | } 9 | ], 10 | "Name": "BMC", 11 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_MANUFACTURER': 'NVIDIA', 'PRODUCT_PRODUCT_NAME': 'P3809-BMC'})", 12 | "Type": "Board", 13 | "xyz.openbmc_project.Inventory.Item.NetworkInterface": { 14 | "MACAddress": "$MAC_BOARD_INFO_AM2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /configurations/meta/ventura/delta_heat_exchanger.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [], 3 | "Name": "$Name", 4 | "Probe": "xyz.openbmc_project.Inventory.Source.Modbus.FRU({'Name': 'Heat Exchanger.*'})", 5 | "Type": "Chassis", 6 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 7 | "BuildDate": "$BuildDate", 8 | "Manufacturer": "$Manufacturer", 9 | "Model": "$Model", 10 | "PartNumber": "$PartNumber", 11 | "SerialNumber": "$SerialNumber", 12 | "SparePartNumber": "$SparePartNumber" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /subprojects/libgpiod.wrap: -------------------------------------------------------------------------------- 1 | [wrap-file] 2 | directory = libgpiod-1.6.3 3 | source_url = https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-1.6.3.tar.gz 4 | source_filename = libgpiod-1.6.3.tar.gz 5 | source_hash = eb446070be1444fd7d32d32bbca53c2f3bbb0a21193db86198cf6050b7a28441 6 | patch_filename = libgpiod_1.6.3-1_patch.zip 7 | patch_url = https://wrapdb.mesonbuild.com/v2/libgpiod_1.6.3-1/get_patch 8 | patch_hash = 76821c637073679a88f77593c6f7ce65b4b5abf8c998f823fffa13918c8761df 9 | 10 | [provide] 11 | libgpiod = gpiod_dep 12 | libgpiodcxx = gpiodcxx_dep 13 | -------------------------------------------------------------------------------- /configurations/meta/minerva/minerva_fanboard_misc.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [], 4 | "Name": "$Name", 5 | "Probe": [ 6 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': 'MinervaFan*'})" 7 | ], 8 | "Type": "Board", 9 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 10 | "Manufacturer": "Unknown", 11 | "Model": "Unknown", 12 | "PartNumber": "Unknown", 13 | "SerialNumber": "Unknown", 14 | "SparePartNumber": "05-100051" 15 | } 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /configurations/ibm/bonnell.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,bonnell" 7 | ], 8 | "Type": "IBMCompatibleSystem" 9 | } 10 | ], 11 | "Name": "Bonnell Chassis", 12 | "Probe": [ 13 | "com.ibm.ipzvpd.VSBP({'IM': [80, 0, 64, 0]})" 14 | ], 15 | "Type": "Chassis", 16 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 17 | "Names": [ 18 | "com.ibm.Hardware.Chassis.Model.Bonnell" 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/entity_manager/log_device_inventory.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | struct InvAddRemoveInfo 9 | { 10 | std::string model = "Unknown"; 11 | std::string type = "Unknown"; 12 | std::string sn = "Unknown"; 13 | std::string name = "Unknown"; 14 | }; 15 | 16 | void logDeviceAdded(const nlohmann::json& record); 17 | 18 | void logDeviceRemoved(const nlohmann::json& record); 19 | 20 | InvAddRemoveInfo queryInvInfo(const nlohmann::json& record); 21 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Intel Corporation 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /configurations/intel/8x25_hsbp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0xEB", 5 | "Name": "HSBP $index Drive Mux", 6 | "Type": "GenericSMBusMux" 7 | }, 8 | { 9 | "Name": "HSBP $index FRU", 10 | "Type": "IntelHsbpFruDevice" 11 | }, 12 | { 13 | "Name": "HSBP $index Temperature", 14 | "Type": "IntelHsbpTempSensor" 15 | } 16 | ], 17 | "Name": "1U_HSBP", 18 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME':'F1U8X25S3PHSBP'})", 19 | "Type": "Board" 20 | } 21 | -------------------------------------------------------------------------------- /src/entity_manager/power_status_monitor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace power 7 | { 8 | 9 | class PowerStatusMonitor 10 | { 11 | public: 12 | explicit PowerStatusMonitor(sdbusplus::asio::connection& conn); 13 | 14 | bool isPowerOn() const; 15 | 16 | private: 17 | void handlePowerMatch(sdbusplus::message_t& message); 18 | void getInitialPowerStatus(sdbusplus::asio::connection& conn); 19 | 20 | bool powerStatusOn = false; 21 | sdbusplus::bus::match_t powerMatch; 22 | }; 23 | 24 | } // namespace power 25 | -------------------------------------------------------------------------------- /src/gpio-presence/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2022-2024. 3 | * All rights reserved. SPDX-License-Identifier: Apache-2.0 4 | */ 5 | 6 | #include "gpio_presence_manager.hpp" 7 | 8 | #include 9 | #include 10 | 11 | using namespace gpio_presence; 12 | 13 | auto main() -> int 14 | { 15 | lg2::debug("starting GPIO Presence Sensor"); 16 | 17 | sdbusplus::async::context ctx; 18 | 19 | gpio_presence::GPIOPresenceManager controller(ctx); 20 | 21 | controller.setupBusName(); 22 | 23 | controller.start(); 24 | 25 | ctx.run(); 26 | } 27 | -------------------------------------------------------------------------------- /configurations/meta/yv4/yosemite4_cpu.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [], 3 | "Name": "Yosemite 4 Sentinel Dome Slot $bus % 15 CPU", 4 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Sentinel Dome', 'PRODUCT_PRODUCT_NAME': 'Yosemite V4', 'BOARD_MANUFACTURER': '(Quanta|Wiwynn)'})", 5 | "Type": "Cpu", 6 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 7 | "Manufacturer": "N/A", 8 | "Model": "N/A", 9 | "PartNumber": "N/A", 10 | "SerialNumber": "$CHASSIS_INFO_AM1" 11 | }, 12 | "xyz.openbmc_project.Inventory.Decorator.Slot": { 13 | "SlotNumber": "$bus % 15" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /configurations/ibm/balcones.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,balcones", 7 | "ibm,bonnell" 8 | ], 9 | "Type": "IBMCompatibleSystem" 10 | } 11 | ], 12 | "Name": "Balcones Chassis", 13 | "Probe": [ 14 | "com.ibm.ipzvpd.VSBP({'IM': [96, 0, 64, 0]})" 15 | ], 16 | "Type": "Chassis", 17 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 18 | "Names": [ 19 | "com.ibm.Hardware.Chassis.Model.Balcones", 20 | "com.ibm.Hardware.Chassis.Model.Bonnell" 21 | ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /configurations/ibm/tacoma_rack_controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,rainier" 7 | ], 8 | "Type": "IBMCompatibleSystem" 9 | }, 10 | { 11 | "AuthType": "None", 12 | "Hostname": "", 13 | "Name": "aggregated0", 14 | "Port": 443, 15 | "Type": "SatelliteController" 16 | } 17 | ], 18 | "Name": "Tacoma Rack Controller", 19 | "Probe": [ 20 | "xyz.openbmc_project.Inventory.Decorator.Asset({'PartNumber': '03FL073'})" 21 | ], 22 | "Type": "Chassis" 23 | } 24 | -------------------------------------------------------------------------------- /scripts/generate_meson_array.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | LANG=C 5 | 6 | if [ "$#" -ne 3 ]; then 7 | echo "Usage: $0 " >&2 8 | exit 1 9 | fi 10 | 11 | dir="$1" 12 | array_name="$2" 13 | script_name="$3" 14 | meson_file="${dir}/meson.build" 15 | 16 | json_files=$(cd "$dir"; find . -regex "[\./]?[\/a-zA-Z0-9_\-]+.json" | sort | sed 's|^\./||') 17 | 18 | { 19 | echo "# This file is auto-generated. Do not edit manually." 20 | echo "# File content generated with ${script_name}" 21 | echo "${array_name} = [" 22 | for file in $json_files; do 23 | echo " '${file}'," 24 | done 25 | echo "]" 26 | } > "$meson_file" 27 | 28 | -------------------------------------------------------------------------------- /src/entity_manager/expression.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2017 Intel Corporation, 2022 IBM Corp. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | namespace expression 11 | { 12 | enum class Operation 13 | { 14 | addition, 15 | division, 16 | multiplication, 17 | subtraction, 18 | modulo, 19 | }; 20 | 21 | std::optional parseOperation(const std::string& op); 22 | int evaluate(int a, Operation op, int b); 23 | int evaluate(int substitute, std::vector::iterator curr, 24 | std::vector::iterator& end); 25 | } // namespace expression 26 | -------------------------------------------------------------------------------- /schemas/meson.build: -------------------------------------------------------------------------------- 1 | # This file is auto-generated. Do not edit manually. 2 | # File content generated with generate_schema_list.sh 3 | schemas = [ 4 | 'cpld.json', 5 | 'exposes_record.json', 6 | 'firmware.json', 7 | 'global.json', 8 | 'gpio_presence.json', 9 | 'ibm.json', 10 | 'intel.json', 11 | 'leak_detector.json', 12 | 'legacy.json', 13 | 'mctp.json', 14 | 'modbus.json', 15 | 'nvidia.json', 16 | 'openbmc-dbus.json', 17 | 'pid.json', 18 | 'pid_zone.json', 19 | 'satellite_controller.json', 20 | 'spdm_endpoint.json', 21 | 'stepwise.json', 22 | 'topology.json', 23 | 'usb_port.json', 24 | 'valve.json', 25 | 'virtual_sensor.json', 26 | ] 27 | -------------------------------------------------------------------------------- /configurations/meta/yv4/yosemite4_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [], 3 | "Name": "Yosemite 4 Chassis", 4 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Management Board wBMC', 'PRODUCT_PRODUCT_NAME': 'Yosemite V4', 'BOARD_MANUFACTURER': '(Quanta|Wiwynn)'})", 5 | "Type": "Chassis", 6 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 7 | "Manufacturer": "$PRODUCT_MANUFACTURER", 8 | "Model": "$PRODUCT_PRODUCT_NAME", 9 | "PartNumber": "$PRODUCT_PART_NUMBER", 10 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER", 11 | "SparePartNumber": "$PRODUCT_INFO_AM1" 12 | }, 13 | "xyz.openbmc_project.Inventory.Item.Chassis": { 14 | "Type": "Enclosure" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /configurations/nvidia/rtx6000_pro.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Nvidia RTX PRO 6000 FRU", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | "Name": "Nvidia RTX PRO 6000 Blackwell $index", 11 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'RTXPRO6000Blackwel(l)?(DC)?', 'BOARD_MANUFACTURER': '((Nvidia)|(NVIDIA)|(nvidia))'})", 12 | "Type": "Board", 13 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 14 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 15 | "Manufacturer": "$BOARD_MANUFACTURER", 16 | "Model": "$BOARD_PRODUCT_NAME", 17 | "PartNumber": "$BOARD_PART_NUMBER", 18 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /configurations/ibm/huygens_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "EnterUtilizationDwellTime": 240, 5 | "EnterUtilizationPercent": 8, 6 | "ExitUtilizationDwellTime": 10, 7 | "ExitUtilizationPercent": 12, 8 | "IdlePowerSaverEnabled": false, 9 | "Name": "Default Power Mode Properties", 10 | "PowerMode": "MaximumPerformance", 11 | "Type": "PowerModeProperties" 12 | } 13 | ], 14 | "Name": "Huygens System Chassis", 15 | "Probe": [ 16 | "com.ibm.ipzvpd.VSBP({'IM': [112, 0, 16, 0]})" 17 | ], 18 | "Type": "Chassis", 19 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 20 | "Names": [ 21 | "com.ibm.Hardware.Chassis.Model.Huygens" 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /configurations/ibm/mudflap.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x76", 5 | "Bus": "$bus", 6 | "Name": "Ambient 1 Temp", 7 | "NamePressure": "Station Pressure", 8 | "Type": "DPS310" 9 | }, 10 | { 11 | "Address": "0x40", 12 | "Bus": "$bus", 13 | "Name": "Ambient 2 Temp", 14 | "NameHumidity": "Humidity", 15 | "Type": "HDC1080" 16 | }, 17 | { 18 | "Address": "0x48", 19 | "Bus": "$bus", 20 | "Name": "Ambient 0 Temp", 21 | "Type": "TMP75" 22 | } 23 | ], 24 | "Name": "Mudflap Panel", 25 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*Mudflap'})", 26 | "Type": "Board" 27 | } 28 | -------------------------------------------------------------------------------- /configurations/meta/ventura/ventura_ioboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [], 3 | "Name": "Ventura Rear IO BD", 4 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Ventura Rear IO BD'})", 5 | "Type": "Board", 6 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 7 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 8 | "Manufacturer": "$BOARD_MANUFACTURER", 9 | "Model": "$BOARD_PRODUCT_NAME", 10 | "PartNumber": "$BOARD_PART_NUMBER", 11 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 12 | "SparePartNumber": "$BOARD_INFO_AM1" 13 | }, 14 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 15 | "AssetTag": "$PRODUCT_ASSET_TAG" 16 | }, 17 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 18 | "Version": "$PRODUCT_VERSION" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/gpio-presence/meson.build: -------------------------------------------------------------------------------- 1 | gpio_presence_lib = static_library( 2 | 'gpio_presence_lib', 3 | 'device_presence.cpp', 4 | 'device_presence.hpp', 5 | 'gpio_presence_manager.cpp', 6 | 'gpio_presence_manager.hpp', 7 | 'config_provider.cpp', 8 | 'config_provider.hpp', 9 | dependencies: [ 10 | boost, 11 | phosphor_logging_dep, 12 | phosphor_dbus_interfaces_dep, 13 | sdbusplus, 14 | libgpio_dep, 15 | ], 16 | ) 17 | 18 | executable( 19 | 'gpio-presence-sensor', 20 | 'main.cpp', 21 | dependencies: [ 22 | boost, 23 | phosphor_logging_dep, 24 | phosphor_dbus_interfaces_dep, 25 | sdbusplus, 26 | libgpio_dep, 27 | ], 28 | install: true, 29 | install_dir: installdir, 30 | link_with: gpio_presence_lib, 31 | ) 32 | -------------------------------------------------------------------------------- /configurations/meta/ventura/ventura_ledboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [], 3 | "Name": "Ventura RMC LED Board", 4 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Ventura LED Board'})", 5 | "Type": "Board", 6 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 7 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 8 | "Manufacturer": "$BOARD_MANUFACTURER", 9 | "Model": "$BOARD_PRODUCT_NAME", 10 | "PartNumber": "$BOARD_PART_NUMBER", 11 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 12 | "SparePartNumber": "$BOARD_INFO_AM1" 13 | }, 14 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 15 | "AssetTag": "$PRODUCT_ASSET_TAG" 16 | }, 17 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 18 | "Version": "$PRODUCT_VERSION" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/devicetree_vpd_parser/machine_context.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2024 Hewlett Packard Enterprise 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | class MachineContext : 10 | public sdbusplus::aserver::xyz::openbmc_project::inventory::decorator:: 11 | Asset 12 | { 13 | public: 14 | explicit MachineContext(sdbusplus::async::context& ctx, auto path) : 15 | sdbusplus::aserver::xyz::openbmc_project::inventory::decorator::Asset< 16 | MachineContext>(ctx, path) {}; 17 | 18 | void populateFromDeviceTree(); 19 | 20 | static bool keyNodeExists(); 21 | 22 | private: 23 | static constexpr auto nodeBasePath = "/proc/device-tree/"; 24 | }; 25 | -------------------------------------------------------------------------------- /configurations/intel/pcie_ssd_retimer.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "PCIE SSD Retimer FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x4F", 11 | "Bus": "$bus", 12 | "Name": "PCIE SSD Retimer Temp", 13 | "Type": "TMP75" 14 | } 15 | ], 16 | "Name": "PCIE SSD Retimer", 17 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'SP3RT040X16'})", 18 | "Type": "Board", 19 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 20 | "Manufacturer": "$BOARD_MANUFACTURER", 21 | "Model": "$BOARD_PRODUCT_NAME", 22 | "PartNumber": "$BOARD_PART_NUMBER", 23 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /configurations/ibm/tola.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "BridgeGpio": [ 5 | { 6 | "Name": "rtc-battery-voltage-read-enable", 7 | "Polarity": "High" 8 | } 9 | ], 10 | "Index": 0, 11 | "Name": "Battery Voltage", 12 | "PollRate": 86400, 13 | "ScaleFactor": 0.4348, 14 | "Thresholds": [ 15 | { 16 | "Direction": "less than", 17 | "Name": "lower critical", 18 | "Severity": 1, 19 | "Value": 2.45 20 | } 21 | ], 22 | "Type": "ADC" 23 | } 24 | ], 25 | "Name": "Tola Board", 26 | "Probe": "com.ibm.ipzvpd.VINI({'CC': [50, 69, 51, 53]})", 27 | "Type": "Board" 28 | } 29 | -------------------------------------------------------------------------------- /configurations/ibm/ingraham.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "BridgeGpio": [ 5 | { 6 | "Name": "rtc-battery-voltage-read-enable", 7 | "Polarity": "High" 8 | } 9 | ], 10 | "Index": 0, 11 | "Name": "Battery Voltage", 12 | "PollRate": 86400, 13 | "ScaleFactor": 0.4348, 14 | "Thresholds": [ 15 | { 16 | "Direction": "less than", 17 | "Name": "lower critical", 18 | "Severity": 1, 19 | "Value": 2.45 20 | } 21 | ], 22 | "Type": "ADC" 23 | } 24 | ], 25 | "Name": "Ingraham Board", 26 | "Probe": "com.ibm.ipzvpd.VINI({'CC': [54, 66, 53, 56]})", 27 | "Type": "Board" 28 | } 29 | -------------------------------------------------------------------------------- /configurations/gigabyte/msx4_mg1.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Nvidia Alon8 HPM FRU", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | "Name": "Nvidia Alon8 HPM", 11 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'MSX4-MG1-000', 'BOARD_MANUFACTURER': 'Giga Computing'})", 12 | "Type": "Board", 13 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 14 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 15 | "Manufacturer": "$BOARD_MANUFACTURER", 16 | "Model": "$BOARD_PRODUCT_NAME", 17 | "PartNumber": "$BOARD_PART_NUMBER", 18 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 19 | }, 20 | "xyz.openbmc_project.Inventory.Item.NetworkInterface": { 21 | "MACAddress": "$MAC_BOARD_INFO_AM2" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /configurations/acbel/rica_psu.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "PSU$ADDRESS % 4 + 1 FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "$ADDRESS % 4 + 88", 11 | "Bus": "$bus", 12 | "Name": "PSU$ADDRESS % 4 + 1", 13 | "PowerScaleFactor": 1000000, 14 | "Type": "pmbus" 15 | } 16 | ], 17 | "Name": "ACBEL RICA PSU$ADDRESS % 4 + 1", 18 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'R1CA2551B*'})", 19 | "Type": "PowerSupply", 20 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 21 | "Manufacturer": "$PRODUCT_MANUFACTURER", 22 | "Model": "$PRODUCT_PRODUCT_NAME", 23 | "PartNumber": "$PRODUCT_PART_NUMBER", 24 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /configurations/micron/7450.json: -------------------------------------------------------------------------------- 1 | { 2 | "Bus": "$bus", 3 | "Exposes": [ 4 | { 5 | "Address": "$address", 6 | "Bus": "$bus", 7 | "Name": "NVMe $index FRU", 8 | "Type": "EEPROM" 9 | }, 10 | { 11 | "Address": "0x6a", 12 | "Bus": "$bus", 13 | "Name": "NVMe $index Temp", 14 | "Type": "NVME1000" 15 | } 16 | ], 17 | "Logging": "Off", 18 | "Name": "NVMe $index", 19 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PART_NUMBER': '^Micron_7450_.*'})", 20 | "Type": "NVMe", 21 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 22 | "Manufacturer": "$PRODUCT_MANUFACTURER", 23 | "Model": "7450", 24 | "PartNumber": "$PRODUCT_PART_NUMBER", 25 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER" 26 | }, 27 | "xyz.openbmc_project.Inventory.Item.Chassis": {} 28 | } 29 | -------------------------------------------------------------------------------- /service_files/meson.build: -------------------------------------------------------------------------------- 1 | unit_files = [ 2 | ['xyz.openbmc_project.FruDevice.service', 'fru-device'], 3 | ['xyz.openbmc_project.EntityManager.service', ''], 4 | ['devicetree-vpd-parser.service', 'devicetree-vpd'], 5 | ['xyz.openbmc_project.gpiopresence.service', 'gpio-presence'], 6 | ] 7 | 8 | foreach u : unit_files 9 | if u[1] == '' or get_option(u[1]) 10 | configure_file( 11 | copy: true, 12 | input: u[0], 13 | install: true, 14 | install_dir: systemd_system_unit_dir, 15 | output: u[0], 16 | ) 17 | endif 18 | endforeach 19 | 20 | dbus_system_bus_services_dir = dependency('dbus-1').get_variable( 21 | 'system_bus_services_dir', 22 | pkgconfig_define: ['prefix', get_option('prefix')], 23 | ) 24 | install_data( 25 | 'dbus/xyz.openbmc_project.EntityManager.service', 26 | install_dir: dbus_system_bus_services_dir, 27 | ) 28 | -------------------------------------------------------------------------------- /configurations/meta/harma/harma_bsm.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "BMC Storage Module FRU", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | "Name": "Harma BSM", 11 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Harma BSM '})", 12 | "Type": "Board", 13 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 14 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 15 | "Manufacturer": "$BOARD_MANUFACTURER", 16 | "Model": "$BOARD_PRODUCT_NAME", 17 | "PartNumber": "$BOARD_PART_NUMBER", 18 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 19 | "SparePartNumber": "$BOARD_INFO_AM1" 20 | }, 21 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 22 | "AssetTag": "$PRODUCT_ASSET_TAG" 23 | }, 24 | "xyz.openbmc_project.Inventory.Item.Storage": {} 25 | } 26 | -------------------------------------------------------------------------------- /src/fru_device/meson.build: -------------------------------------------------------------------------------- 1 | cpp_args_fd = cpp_args 2 | if get_option('fru-device-resizefru') 3 | cpp_args_fd = cpp_args_fd + ['-DENABLE_FRU_AREA_RESIZE'] 4 | endif 5 | detect_mode = get_option('fru-device-16bitdetectmode') 6 | 7 | cpp_args_fd += [ 8 | '-DFRU_DEVICE_16BITDETECTMODE="' + detect_mode + '"', 9 | '-DENABLE_FRU_UPDATE_PROPERTY=' + (get_option('fru-device-update-property') == 'all' ? '1' : '0'), 10 | ] 11 | 12 | executable( 13 | 'fru-device', 14 | 'fru_device.cpp', 15 | '../utils.cpp', 16 | 'fru_reader.cpp', 17 | 'fru_utils.cpp', 18 | 'gzip_utils.cpp', 19 | cpp_args: cpp_args_fd, 20 | dependencies: [ 21 | boost, 22 | i2c, 23 | libxml2_dep, 24 | nlohmann_json_dep, 25 | phosphor_logging_dep, 26 | sdbusplus, 27 | threads, 28 | valijson, 29 | zlib_dep, 30 | ], 31 | install: true, 32 | install_dir: installdir, 33 | ) 34 | 35 | 36 | -------------------------------------------------------------------------------- /schemas/nvidia.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "NvidiaMctpVdm": { 5 | "description": "Nvidia device that implements an MCTP VDM protocol to provide sensor readings - implemented in dbus-sensors", 6 | "properties": { 7 | "Name": { 8 | "description": "A recognisable name for the device", 9 | "type": "string" 10 | }, 11 | "PollRate": { 12 | "description": "Poll the device at this rate, specified in milliseconds, to fetch sensors", 13 | "type": "number" 14 | }, 15 | "Type": { 16 | "type": "string", 17 | "const": "NvidiaMctpVdm" 18 | } 19 | }, 20 | "required": ["Name", "Type"], 21 | "type": "object" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /configurations/meta/minerva/minerva_cmm_bsm.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "BMC Storage Module FRU", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | "Name": "Minerva CMM BSM", 11 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva_CMM_BSM.*'})", 12 | "Type": "Board", 13 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 14 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 15 | "Manufacturer": "$BOARD_MANUFACTURER", 16 | "Model": "$BOARD_PRODUCT_NAME", 17 | "PartNumber": "$BOARD_PART_NUMBER", 18 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 19 | "SparePartNumber": "$BOARD_INFO_AM1" 20 | }, 21 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 22 | "AssetTag": "$PRODUCT_ASSET_TAG" 23 | }, 24 | "xyz.openbmc_project.Inventory.Item.Storage": {} 25 | } 26 | -------------------------------------------------------------------------------- /configurations/meta/greatlakes_nic_mellanox.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x1f", 5 | "Bus": 8, 6 | "Name": "NIC_REMOTE_TEMP_C", 7 | "Name1": "NIC_TEMP_C", 8 | "Thresholds": [ 9 | { 10 | "Direction": "greater than", 11 | "Index": 2, 12 | "Name": "upper non recoverable", 13 | "Severity": 4, 14 | "Value": 120 15 | }, 16 | { 17 | "Direction": "greater than", 18 | "Index": 2, 19 | "Name": "upper critical", 20 | "Severity": 1, 21 | "Value": 105 22 | } 23 | ], 24 | "Type": "TMP421" 25 | } 26 | ], 27 | "Name": "Great Lakes NIC", 28 | "Probe": "FOUND('Great Lakes Baseboard')", 29 | "Type": "Board" 30 | } 31 | -------------------------------------------------------------------------------- /configurations/meta/fbyv35_nic_mellanox.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x1f", 5 | "Bus": 8, 6 | "Name": "NIC_SENSOR_REMOTE_TEMP", 7 | "Name1": "NIC_SENSOR_TEMP", 8 | "Thresholds": [ 9 | { 10 | "Direction": "greater than", 11 | "Index": 2, 12 | "Name": "upper critical", 13 | "Severity": 1, 14 | "Value": 105 15 | }, 16 | { 17 | "Direction": "greater than", 18 | "Index": 2, 19 | "Name": "upper non recoverable", 20 | "Severity": 4, 21 | "Value": 120 22 | } 23 | ], 24 | "Type": "TMP421" 25 | } 26 | ], 27 | "Name": "Yosemite V3P5 NIC Mellanox", 28 | "Probe": "FOUND('Yosemite V3P5 Baseboard')", 29 | "Type": "Board" 30 | } 31 | -------------------------------------------------------------------------------- /configurations/ibm/everest.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,everest" 7 | ], 8 | "Type": "IBMCompatibleSystem" 9 | }, 10 | { 11 | "EnterUtilizationDwellTime": 240, 12 | "EnterUtilizationPercent": 8, 13 | "ExitUtilizationDwellTime": 10, 14 | "ExitUtilizationPercent": 12, 15 | "IdlePowerSaverEnabled": true, 16 | "Name": "Default Power Mode Properties", 17 | "PowerMode": "MaximumPerformance", 18 | "Type": "PowerModeProperties" 19 | } 20 | ], 21 | "Name": "Everest Chassis", 22 | "Probe": [ 23 | "com.ibm.ipzvpd.VSBP({'IM': [80, 0, 48, 0]})" 24 | ], 25 | "Type": "Chassis", 26 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 27 | "Names": [ 28 | "com.ibm.Hardware.Chassis.Model.Everest" 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/devicetree_vpd_parser/machine_context.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2024 Hewlett Packard Enterprise 3 | 4 | #include "machine_context.hpp" 5 | 6 | #include 7 | #include 8 | 9 | void MachineContext::populateFromDeviceTree() 10 | { 11 | std::string nodeVal; 12 | std::ifstream vpdStream(nodeBasePath + std::string("model")); 13 | if (vpdStream && std::getline(vpdStream, nodeVal)) 14 | { 15 | MachineContext::Asset::model(nodeVal); 16 | vpdStream.close(); 17 | } 18 | 19 | vpdStream.open(nodeBasePath + std::string("serial-number")); 20 | if (vpdStream && std::getline(vpdStream, nodeVal)) 21 | { 22 | MachineContext::Asset::serial_number(nodeVal); 23 | vpdStream.close(); 24 | } 25 | }; 26 | 27 | bool MachineContext::keyNodeExists() 28 | { 29 | std::filesystem::path nodePath{nodeBasePath + std::string("model")}; 30 | 31 | return std::filesystem::exists(nodePath); 32 | }; 33 | -------------------------------------------------------------------------------- /src/variant_visitors.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2019 Intel Corporation 3 | 4 | #pragma once 5 | #include 6 | #include 7 | #include 8 | 9 | struct VariantToIntVisitor 10 | { 11 | template 12 | int operator()(const T& t) const 13 | { 14 | if constexpr (std::is_arithmetic_v) 15 | { 16 | return static_cast(t); 17 | } 18 | throw std::invalid_argument("Cannot translate type to int"); 19 | } 20 | }; 21 | 22 | struct VariantToStringVisitor 23 | { 24 | template 25 | std::string operator()(const T& t) const 26 | { 27 | if constexpr (std::is_same_v) 28 | { 29 | return t; 30 | } 31 | else if constexpr (std::is_arithmetic_v) 32 | { 33 | return std::to_string(t); 34 | } 35 | throw std::invalid_argument("Cannot translate type to string"); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /configurations/meta/yv4/yosemite4_floatingfalls.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [], 3 | "Name": "Yosemite 4 Floating Falls Slot $bus % 15", 4 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Floating Falls', 'PRODUCT_PRODUCT_NAME': 'Yosemite V4', 'BOARD_MANUFACTURER': '(Quanta|Wiwynn)'})", 5 | "Type": "Board", 6 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 7 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 8 | "Manufacturer": "$BOARD_MANUFACTURER", 9 | "Model": "$BOARD_PRODUCT_NAME", 10 | "PartNumber": "$BOARD_PART_NUMBER", 11 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 12 | "SparePartNumber": "$BOARD_INFO_AM1" 13 | }, 14 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 15 | "AssetTag": "$PRODUCT_ASSET_TAG" 16 | }, 17 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 18 | "Version": "$PRODUCT_VERSION" 19 | }, 20 | "xyz.openbmc_project.Inventory.Decorator.Slot": { 21 | "SlotNumber": "$bus % 15" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/entity_manager/main.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2018 Intel Corporation 3 | 4 | #include "entity_manager.hpp" 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | int main() 12 | { 13 | const std::vector configurationDirectories = { 14 | PACKAGE_DIR "configurations", SYSCONF_DIR "configurations"}; 15 | 16 | const std::filesystem::path schemaDirectory(PACKAGE_DIR "schemas"); 17 | 18 | boost::asio::io_context io; 19 | auto systemBus = std::make_shared(io); 20 | systemBus->request_name("xyz.openbmc_project.EntityManager"); 21 | EntityManager em(systemBus, io, configurationDirectories, schemaDirectory); 22 | 23 | boost::asio::post(io, [&]() { em.propertiesChangedCallback(); }); 24 | 25 | em.handleCurrentConfigurationJson(); 26 | 27 | io.run(); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /configurations/nvidia/cable_cartridge.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "NVIDIA CBC FRU $bus % 2 * 2 + $address % 2", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | "Name": "NVIDIA Cable Cartridge $bus % 2 * 2 + $address % 2", 11 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': '18x1RU CBL Cartridge', 'BOARD_MANUFACTURER': 'Nvidia'})", 12 | "Type": "Board", 13 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 14 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 15 | "Manufacturer": "$BOARD_MANUFACTURER", 16 | "Model": "$BOARD_PRODUCT_NAME", 17 | "PartNumber": "$BOARD_PART_NUMBER", 18 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 19 | }, 20 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 21 | "AssetTag": "$PRODUCT_ASSET_TAG" 22 | }, 23 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 24 | "Version": "$PRODUCT_VERSION" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/entity_manager/meson.build: -------------------------------------------------------------------------------- 1 | test( 2 | 'test_entity_manager', 3 | executable( 4 | 'test_entity_manager', 5 | 'test_entity-manager.cpp', 6 | cpp_args: test_boost_args, 7 | dependencies: [ 8 | boost, 9 | gtest, 10 | nlohmann_json_dep, 11 | phosphor_logging_dep, 12 | sdbusplus, 13 | valijson, 14 | ], 15 | link_with: entity_manager_lib, 16 | include_directories: test_include_dir, 17 | ), 18 | ) 19 | 20 | test( 21 | 'test_log_device_inventory', 22 | executable( 23 | 'test_log_device_inventory', 24 | 'log_device_inventory.cpp', 25 | cpp_args: test_boost_args, 26 | dependencies: [ 27 | boost, 28 | gtest, 29 | nlohmann_json_dep, 30 | phosphor_logging_dep, 31 | sdbusplus, 32 | valijson, 33 | ], 34 | link_with: entity_manager_lib, 35 | include_directories: test_include_dir, 36 | ), 37 | ) 38 | -------------------------------------------------------------------------------- /configurations/ibm/fuji.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,fuji", 7 | "ibm,everest" 8 | ], 9 | "Type": "IBMCompatibleSystem" 10 | }, 11 | { 12 | "EnterUtilizationDwellTime": 240, 13 | "EnterUtilizationPercent": 8, 14 | "ExitUtilizationDwellTime": 10, 15 | "ExitUtilizationPercent": 12, 16 | "IdlePowerSaverEnabled": true, 17 | "Name": "Default Power Mode Properties", 18 | "PowerMode": "MaximumPerformance", 19 | "Type": "PowerModeProperties" 20 | } 21 | ], 22 | "Name": "Fuji Chassis", 23 | "Probe": "com.ibm.ipzvpd.VSBP({'IM': [96, 0, 32, 0]})", 24 | "Type": "Chassis", 25 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 26 | "Names": [ 27 | "com.ibm.Hardware.Chassis.Model.Fuji", 28 | "com.ibm.Hardware.Chassis.Model.Everest" 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /configurations/nvidia/imgx_connectx8_supernic_switch.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Nvidia IMGX ConnectX8 SuperNIC Switch FRU", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | "Name": "Nvidia IMGX ConnectX8 SuperNIC Switch", 11 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'ConnectX-8 Alon', 'BOARD_MANUFACTURER': 'Nvidia', 'PRODUCT_PRODUCT_NAME': 'ConnectX-8 Alon'})", 12 | "Type": "Board", 13 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 14 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 15 | "Manufacturer": "$BOARD_MANUFACTURER", 16 | "Model": "$BOARD_PRODUCT_NAME", 17 | "PartNumber": "$BOARD_PART_NUMBER", 18 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 19 | }, 20 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 21 | "AssetTag": "$PRODUCT_ASSET_TAG" 22 | }, 23 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 24 | "Version": "$PRODUCT_VERSION" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /configurations/ampere/mtmitchell_riser.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Mitchell_Riser_$BUS - 38", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | "Name": "Mitchell_Riser_$BUS - 38", 11 | "Probe": [ 12 | "xyz.openbmc_project.FruDevice({'BOARD_PART_NUMBER': '.*YZRI-02759-103.*'})", 13 | "AND", 14 | "FOUND('Mt.Mitchell_Motherboard')" 15 | ], 16 | "Type": "Board", 17 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 18 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 19 | "Manufacturer": "$BOARD_MANUFACTURER", 20 | "Model": "$BOARD_PRODUCT_NAME", 21 | "PartNumber": "$BOARD_PART_NUMBER", 22 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 23 | }, 24 | "xyz.openbmc_project.Inventory.Decorator.Replaceable": { 25 | "FieldReplaceable": false, 26 | "HotPluggable": false 27 | }, 28 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 29 | "Version": "$BOARD_INFO_AM1" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /configurations/meta/catalina/catalina_osfp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Catalina OSFP Board FRU $bus", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | /* Catalina Octal Small Form-factor Pluggable Carrier Board */ 11 | "Name": "Catalina OSFP Carrier", 12 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Catalina OSFP '})", 13 | "Type": "Board", 14 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 15 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 16 | "Manufacturer": "$BOARD_MANUFACTURER", 17 | "Model": "$BOARD_PRODUCT_NAME", 18 | "PartNumber": "$BOARD_PART_NUMBER", 19 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 20 | "SparePartNumber": "$BOARD_INFO_AM1" 21 | }, 22 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 23 | "AssetTag": "$PRODUCT_ASSET_TAG" 24 | }, 25 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 26 | "Version": "$PRODUCT_VERSION" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /configurations/meta/yv4/yosemite4_sentineldome_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [], 3 | "Name": "Yosemite 4 Sentinel Dome Slot $bus % 15 Chassis", 4 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Sentinel Dome', 'PRODUCT_PRODUCT_NAME': 'Yosemite V4', 'BOARD_MANUFACTURER': '(Quanta|Wiwynn)'})", 5 | "Type": "Chassis", 6 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 7 | "Manufacturer": "$PRODUCT_MANUFACTURER", 8 | "Model": "$PRODUCT_PRODUCT_NAME", 9 | "PartNumber": "$PRODUCT_PART_NUMBER", 10 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER", 11 | "SparePartNumber": "$PRODUCT_INFO_AM1" 12 | }, 13 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 14 | "AssetTag": "$PRODUCT_ASSET_TAG" 15 | }, 16 | "xyz.openbmc_project.Inventory.Decorator.ManagedHost": { 17 | "HostIndex": "$bus % 15" 18 | }, 19 | "xyz.openbmc_project.Inventory.Decorator.Slot": { 20 | "SlotNumber": "$bus % 15" 21 | }, 22 | "xyz.openbmc_project.Inventory.Item.Chassis": { 23 | "Type": "Blade" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /configurations/ibm/rainier_4u_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,rainier-4u", 7 | "ibm,rainier" 8 | ], 9 | "Type": "IBMCompatibleSystem" 10 | }, 11 | { 12 | "EnterUtilizationDwellTime": 240, 13 | "EnterUtilizationPercent": 8, 14 | "ExitUtilizationDwellTime": 10, 15 | "ExitUtilizationPercent": 12, 16 | "IdlePowerSaverEnabled": true, 17 | "Name": "Default Power Mode Properties", 18 | "PowerMode": "MaximumPerformance", 19 | "Type": "PowerModeProperties" 20 | } 21 | ], 22 | "Name": "Rainier 4U Chassis", 23 | "Probe": [ 24 | "com.ibm.ipzvpd.VSBP({'IM': [80, 0, 16, 0]})" 25 | ], 26 | "Type": "Chassis", 27 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 28 | "Names": [ 29 | "com.ibm.Hardware.Chassis.Model.Rainier4U", 30 | "com.ibm.Hardware.Chassis.Model.Rainier" 31 | ] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /configurations/ibm/rainier_1s4u_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,rainier-1s4u", 7 | "ibm,rainier" 8 | ], 9 | "Type": "IBMCompatibleSystem" 10 | }, 11 | { 12 | "EnterUtilizationDwellTime": 240, 13 | "EnterUtilizationPercent": 8, 14 | "ExitUtilizationDwellTime": 10, 15 | "ExitUtilizationPercent": 12, 16 | "IdlePowerSaverEnabled": true, 17 | "Name": "Default Power Mode Properties", 18 | "PowerMode": "MaximumPerformance", 19 | "Type": "PowerModeProperties" 20 | } 21 | ], 22 | "Name": "Rainier 1S4U Chassis", 23 | "Probe": [ 24 | "com.ibm.ipzvpd.VSBP({'IM': [80, 0, 16, 2]})" 25 | ], 26 | "Type": "Chassis", 27 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 28 | "Names": [ 29 | "com.ibm.Hardware.Chassis.Model.Rainier1S4U", 30 | "com.ibm.Hardware.Chassis.Model.Rainier" 31 | ] 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /configurations/nvidia/gb200.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "NVIDIA GB200 $bus + 1 % 2 FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Name": "NVIDIA GB200 GPU", 11 | "Type": "NvidiaMctpVdm" 12 | } 13 | ], 14 | "Name": "NVIDIA GB200 $bus + 1 % 2", 15 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'PG548', 'BOARD_MANUFACTURER': 'NVIDIA', 'PRODUCT_PRODUCT_NAME': 'GB200'})", 16 | "Type": "Board", 17 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 18 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 19 | "Manufacturer": "$BOARD_MANUFACTURER", 20 | "Model": "$BOARD_PRODUCT_NAME", 21 | "PartNumber": "$BOARD_PART_NUMBER", 22 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 23 | }, 24 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 25 | "AssetTag": "$PRODUCT_ASSET_TAG" 26 | }, 27 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 28 | "Version": "$PRODUCT_VERSION" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/entity_manager/perform_probe.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "perform_scan.hpp" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace probe 11 | { 12 | 13 | // underscore T for collison with dbus c api 14 | enum class probe_type_codes 15 | { 16 | FALSE_T, 17 | TRUE_T, 18 | AND, 19 | OR, 20 | FOUND, 21 | MATCH_ONE 22 | }; 23 | 24 | using FoundProbeTypeT = std::optional; 25 | 26 | FoundProbeTypeT findProbeType(const std::string& probe); 27 | 28 | // this class finds the needed dbus fields and on destruction runs the probe 29 | struct PerformProbe 30 | { 31 | PerformProbe(nlohmann::json& recordRef, 32 | const std::vector& probeCommand, 33 | std::string probeName, 34 | std::shared_ptr& scanPtr); 35 | virtual ~PerformProbe(); 36 | 37 | private: 38 | nlohmann::json& recordRef; 39 | std::vector _probeCommand; 40 | std::string probeName; 41 | std::shared_ptr scan; 42 | }; 43 | 44 | } // namespace probe 45 | -------------------------------------------------------------------------------- /configurations/meta/clemente/clemente_hdd.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Clemente HDD Board $bus - 25 % 11 FRU", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | /* Clemente Hard Disk Drive Carrier Board */ 11 | "Name": "Clemente HDD Carrier $bus - 25 % 11", 12 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Clemente E1.S BP', 'BOARD_MANUFACTURER': '(Ingrasys|Quanta)'})", 13 | "Type": "Board", 14 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 15 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 16 | "Manufacturer": "$BOARD_MANUFACTURER", 17 | "Model": "$BOARD_PRODUCT_NAME", 18 | "PartNumber": "$BOARD_PART_NUMBER", 19 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 20 | "SparePartNumber": "$BOARD_INFO_AM1" 21 | }, 22 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 23 | "AssetTag": "$PRODUCT_ASSET_TAG" 24 | }, 25 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 26 | "Version": "$PRODUCT_VERSION" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /configurations/intel/axx1p100hssi_aic.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [ 4 | { 5 | "Address": "$address", 6 | "Bus": "$bus", 7 | "Name": "AIC 1 Fru", 8 | "Type": "EEPROM" 9 | }, 10 | { 11 | "Address": "0x72", 12 | "Bus": "$bus", 13 | "ChannelNames": [ 14 | "Pcie_Slot_1", 15 | "Pcie_Slot_2", 16 | "Pcie_Slot_3", 17 | "" 18 | ], 19 | "Name": "Riser Mux", 20 | "Type": "PCA9545Mux" 21 | } 22 | ], 23 | "Name": "Ethernet Network Adapter", 24 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'AXX1P100HSSI'})", 25 | "Type": "Board", 26 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 27 | "Manufacturer": "$BOARD_MANUFACTURER", 28 | "Model": "$BOARD_PRODUCT_NAME", 29 | "PartNumber": "$BOARD_PART_NUMBER", 30 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 31 | } 32 | } 33 | ] 34 | -------------------------------------------------------------------------------- /configurations/meta/twinlake.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x01", 5 | "Bus": "$ipmbindex", 6 | "Class": "IpmbDevice", 7 | "Name": "$ipmbindex + 1 Twinlake Board", 8 | "PowerState": "Always", 9 | "Type": "IpmbDevice" 10 | }, 11 | { 12 | "Address": "0x03", 13 | "Bus": "$ipmbindex", 14 | "Class": "twin_lake", 15 | "Name": "$ipmbindex + 1 Twinlake", 16 | "Type": "IpmbPowerMonitor" 17 | } 18 | ], 19 | "Name": "Twin Lakes $ipmbindex + 1", 20 | "Probe": "xyz.openbmc_project.Ipmb.FruDevice({'PRODUCT_PRODUCT_NAME': 'Twin Lakes .*'})", 21 | "Type": "Board", 22 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 23 | "Manufacturer": "$PRODUCT_MANUFACTURER", 24 | "Model": "$PRODUCT_PRODUCT_NAME", 25 | "PartNumber": "$BOARD_PART_NUMBER", 26 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 27 | }, 28 | "xyz.openbmc_project.Inventory.Decorator.Replaceable": { 29 | "FieldReplaceable": true, 30 | "HotPluggable": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /configurations/meta/clemente/clemente_osfp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Clemente OSFP Board FRU $bus - 29 % 11", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | /* Clemente Octal Small Form-factor Pluggable Carrier Board */ 11 | "Name": "Clemente OSFP Carrier $bus - 29 % 11", 12 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Clemente OSFP ', 'BOARD_MANUFACTURER': '(Ingrasys|Quanta)'})", 13 | "Type": "Board", 14 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 15 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 16 | "Manufacturer": "$BOARD_MANUFACTURER", 17 | "Model": "$BOARD_PRODUCT_NAME", 18 | "PartNumber": "$BOARD_PART_NUMBER", 19 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 20 | "SparePartNumber": "$BOARD_INFO_AM1" 21 | }, 22 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 23 | "AssetTag": "$PRODUCT_ASSET_TAG" 24 | }, 25 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 26 | "Version": "$PRODUCT_VERSION" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /schemas/intel.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "IntelFanConnector": { 5 | "additionalProperties": false, 6 | "properties": { 7 | "LED": { 8 | "type": "string" 9 | }, 10 | "Name": { 11 | "type": "string" 12 | }, 13 | "PwmName": { 14 | "type": "string" 15 | }, 16 | "Pwm": { 17 | "type": "number" 18 | }, 19 | "Status": { 20 | "enum": ["enabled", "disabled"] 21 | }, 22 | "Tachs": { 23 | "items": { 24 | "type": "number" 25 | }, 26 | "type": "array" 27 | }, 28 | "Type": { 29 | "enum": ["IntelFanConnector"] 30 | } 31 | }, 32 | "required": ["Name", "Type", "Status", "Pwm", "Tachs"], 33 | "type": "object" 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /configurations/nvidia/hmc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "NVIDIA HMC FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "AuthType": "None", 11 | "Hostname": "172.31.13.251", 12 | "Name": "HMC", 13 | "Port": 80, 14 | "Type": "SatelliteController" 15 | } 16 | ], 17 | "Name": "NVIDIA HMC", 18 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'P4764', 'BOARD_MANUFACTURER': 'NVIDIA'})", 19 | "Type": "Board", 20 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 21 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 22 | "Manufacturer": "$BOARD_MANUFACTURER", 23 | "Model": "$BOARD_PRODUCT_NAME", 24 | "PartNumber": "$BOARD_PART_NUMBER", 25 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 26 | }, 27 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 28 | "AssetTag": "$PRODUCT_ASSET_TAG" 29 | }, 30 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 31 | "Version": "$PRODUCT_VERSION" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /configurations/meta/bmc_storage_module.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "BMC Storage Module FRU", 7 | "Type": "EEPROM" 8 | } 9 | ], 10 | "Name": "BMC Storage Module", 11 | "Probe": [ 12 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'BMC Storage Module', 'BOARD_MANUFACTURER': 'Wiwynn'})", 13 | "OR", 14 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'BMC Storage Module', 'BOARD_MANUFACTURER': 'Quanta'})", 15 | "OR", 16 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'BMC Storage Module', 'BOARD_MANUFACTURER': 'Ingrasys'})" 17 | ], 18 | "Type": "Board", 19 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 20 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 21 | "Manufacturer": "$BOARD_MANUFACTURER", 22 | "Model": "$BOARD_PRODUCT_NAME", 23 | "PartNumber": "$BOARD_PART_NUMBER", 24 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 25 | "SparePartNumber": "$BOARD_INFO_AM1" 26 | }, 27 | "xyz.openbmc_project.Inventory.Item.Storage": {} 28 | } 29 | -------------------------------------------------------------------------------- /configurations/ibm/rainier_2u_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,rainier-2u", 7 | "ibm,rainier" 8 | ], 9 | "Type": "IBMCompatibleSystem" 10 | }, 11 | { 12 | "EnterUtilizationDwellTime": 240, 13 | "EnterUtilizationPercent": 8, 14 | "ExitUtilizationDwellTime": 10, 15 | "ExitUtilizationPercent": 12, 16 | "IdlePowerSaverEnabled": true, 17 | "Name": "Default Power Mode Properties", 18 | "PowerMode": "MaximumPerformance", 19 | "Type": "PowerModeProperties" 20 | } 21 | ], 22 | "Name": "Rainier 2U Chassis", 23 | "Probe": [ 24 | "com.ibm.ipzvpd.VSBP({'IM': [80, 0, 16, 1]})", 25 | "OR", 26 | "com.ibm.ipzvpd.VSBP({'IM': [80, 0, 16, 3]})" 27 | ], 28 | "Type": "Chassis", 29 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 30 | "Names": [ 31 | "com.ibm.Hardware.Chassis.Model.Rainier2U", 32 | "com.ibm.Hardware.Chassis.Model.Rainier" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /configurations/meta/ventura/delta_heat_exchanger_fans.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [], 4 | "Name": "$Name", 5 | "Probe": "xyz.openbmc_project.Inventory.Source.Modbus.FRU({'Name': 'Heat Exchanger Fan 1.*'})", 6 | "Type": "Chassis", 7 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 8 | "BuildDate": "$BuildDate", 9 | "Manufacturer": "$Manufacturer", 10 | "Model": "$Model", 11 | "PartNumber": "$PartNumber", 12 | "SerialNumber": "$SerialNumber", 13 | "SparePartNumber": "$SparePartNumber" 14 | } 15 | }, 16 | { 17 | "Exposes": [], 18 | "Name": "$Name", 19 | "Probe": "xyz.openbmc_project.Inventory.Source.Modbus.FRU({'Name': 'Heat Exchanger Fan 2.*'})", 20 | "Type": "Chassis", 21 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 22 | "BuildDate": "$BuildDate", 23 | "Manufacturer": "$Manufacturer", 24 | "Model": "$Model", 25 | "PartNumber": "$PartNumber", 26 | "SerialNumber": "$SerialNumber", 27 | "SparePartNumber": "$SparePartNumber" 28 | } 29 | } 30 | ] 31 | -------------------------------------------------------------------------------- /schemas/pid_zone.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "PidZone": { 5 | "additionalProperties": false, 6 | "type": "object", 7 | "properties": { 8 | "AccumulateSetPoint": { 9 | "type": "boolean" 10 | }, 11 | "CycleIntervalTimeMS": { 12 | "type": "number" 13 | }, 14 | "FailSafePercent": { 15 | "type": "number" 16 | }, 17 | "MinThermalOutput": { 18 | "type": "number" 19 | }, 20 | "Name": { 21 | "type": "string" 22 | }, 23 | "Type": { 24 | "const": "Pid.Zone" 25 | }, 26 | "UpdateThermalsTimeMS": { 27 | "type": "number" 28 | }, 29 | "ZoneIndex": { 30 | "type": "number" 31 | } 32 | }, 33 | "required": ["FailSafePercent", "MinThermalOutput", "Name", "Type"] 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /configurations/ampere/mtjefferson_riser.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [ 4 | { 5 | "Address": "$address", 6 | "Bus": "$bus", 7 | "Name": "Jefferson_Riser", 8 | "Type": "EEPROM" 9 | } 10 | ], 11 | "Name": "Mt.Jefferson_Riser", 12 | "Probe": [ 13 | "xyz.openbmc_project.FruDevice({'BOARD_PART_NUMBER': 'CRS201P'})", 14 | "AND", 15 | "FOUND('Mt.Jefferson_Motherboard')" 16 | ], 17 | "Type": "Board", 18 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 19 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 20 | "Manufacturer": "$BOARD_MANUFACTURER", 21 | "Model": "$BOARD_PRODUCT_NAME", 22 | "PartNumber": "$BOARD_PART_NUMBER", 23 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 24 | }, 25 | "xyz.openbmc_project.Inventory.Decorator.Replaceable": { 26 | "FieldReplaceable": false, 27 | "HotPluggable": false 28 | }, 29 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 30 | "Version": "$BOARD_INFO_AM1" 31 | } 32 | } 33 | ] 34 | -------------------------------------------------------------------------------- /src/entity_manager/meson.build: -------------------------------------------------------------------------------- 1 | cpp_args_em = cpp_args + ['-DBOOST_ASIO_DISABLE_THREADS'] 2 | 3 | if get_option('runtime-validate-json') 4 | cpp_args_em += ['-DENABLE_RUNTIME_VALIDATE_JSON=true'] 5 | else 6 | cpp_args_em += ['-DENABLE_RUNTIME_VALIDATE_JSON=false'] 7 | endif 8 | 9 | allowed = get_option('new-device-detection') 10 | cpp_args_em += '-DEM_CACHE_CONFIGURATION=' + allowed.to_string() 11 | 12 | em_deps = [boost, nlohmann_json_dep, phosphor_logging_dep, sdbusplus, valijson] 13 | 14 | entity_manager_lib = static_library( 15 | 'entity-manager', 16 | 'entity_manager.cpp', 17 | 'configuration.cpp', 18 | 'expression.cpp', 19 | 'dbus_interface.cpp', 20 | 'perform_scan.cpp', 21 | 'perform_probe.cpp', 22 | 'power_status_monitor.cpp', 23 | 'overlay.cpp', 24 | 'topology.cpp', 25 | 'utils.cpp', 26 | 'log_device_inventory.cpp', 27 | '../utils.cpp', 28 | cpp_args: cpp_args_em, 29 | dependencies: em_deps, 30 | ) 31 | 32 | executable( 33 | 'entity-manager', 34 | 'main.cpp', 35 | cpp_args: cpp_args_em, 36 | dependencies: em_deps, 37 | link_with: entity_manager_lib, 38 | install: true, 39 | install_dir: installdir, 40 | ) 41 | 42 | -------------------------------------------------------------------------------- /configurations/ibm/blueridge_2u_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,blueridge-2u", 7 | "ibm,blueridge", 8 | "ibm,rainier-2u", 9 | "ibm,rainier" 10 | ], 11 | "Type": "IBMCompatibleSystem" 12 | }, 13 | { 14 | "EnterUtilizationDwellTime": 240, 15 | "EnterUtilizationPercent": 8, 16 | "ExitUtilizationDwellTime": 10, 17 | "ExitUtilizationPercent": 12, 18 | "IdlePowerSaverEnabled": true, 19 | "Name": "Default Power Mode Properties", 20 | "PowerMode": "MaximumPerformance", 21 | "Type": "PowerModeProperties" 22 | } 23 | ], 24 | "Name": "BlueRidge 2U Chassis", 25 | "Probe": "com.ibm.ipzvpd.VSBP({'IM': [96, 0, 16, 1]})", 26 | "Type": "Chassis", 27 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 28 | "Names": [ 29 | "com.ibm.Hardware.Chassis.Model.BlueRidge2U", 30 | "com.ibm.Hardware.Chassis.Model.BlueRidge", 31 | "com.ibm.Hardware.Chassis.Model.Rainier2U", 32 | "com.ibm.Hardware.Chassis.Model.Rainier" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /configurations/ibm/blueridge_4u_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,blueridge-4u", 7 | "ibm,blueridge", 8 | "ibm,rainier-4u", 9 | "ibm,rainier" 10 | ], 11 | "Type": "IBMCompatibleSystem" 12 | }, 13 | { 14 | "EnterUtilizationDwellTime": 240, 15 | "EnterUtilizationPercent": 8, 16 | "ExitUtilizationDwellTime": 10, 17 | "ExitUtilizationPercent": 12, 18 | "IdlePowerSaverEnabled": true, 19 | "Name": "Default Power Mode Properties", 20 | "PowerMode": "MaximumPerformance", 21 | "Type": "PowerModeProperties" 22 | } 23 | ], 24 | "Name": "BlueRidge 4U Chassis", 25 | "Probe": "com.ibm.ipzvpd.VSBP({'IM': [96, 0, 16, 0]})", 26 | "Type": "Chassis", 27 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 28 | "Names": [ 29 | "com.ibm.Hardware.Chassis.Model.BlueRidge4U", 30 | "com.ibm.Hardware.Chassis.Model.BlueRidge", 31 | "com.ibm.Hardware.Chassis.Model.Rainier4U", 32 | "com.ibm.Hardware.Chassis.Model.Rainier" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /configurations/ibm/blueridge_1s4u_chassis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Name": "Compatible System", 5 | "Names": [ 6 | "ibm,blueridge-1s4u", 7 | "ibm,blueridge", 8 | "ibm,rainier-1s4u", 9 | "ibm,rainier" 10 | ], 11 | "Type": "IBMCompatibleSystem" 12 | }, 13 | { 14 | "EnterUtilizationDwellTime": 240, 15 | "EnterUtilizationPercent": 8, 16 | "ExitUtilizationDwellTime": 10, 17 | "ExitUtilizationPercent": 12, 18 | "IdlePowerSaverEnabled": true, 19 | "Name": "Default Power Mode Properties", 20 | "PowerMode": "MaximumPerformance", 21 | "Type": "PowerModeProperties" 22 | } 23 | ], 24 | "Name": "BlueRidge 1S4U Chassis", 25 | "Probe": "com.ibm.ipzvpd.VSBP({'IM': [96, 0, 16, 2]})", 26 | "Type": "Chassis", 27 | "xyz.openbmc_project.Inventory.Decorator.Compatible": { 28 | "Names": [ 29 | "com.ibm.Hardware.Chassis.Model.BlueRidge1S4U", 30 | "com.ibm.Hardware.Chassis.Model.BlueRidge", 31 | "com.ibm.Hardware.Chassis.Model.Rainier1S4U", 32 | "com.ibm.Hardware.Chassis.Model.Rainier" 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /schemas/topology.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "Port": { 5 | "description": "https://github.com/openbmc/docs/blob/master/designs/physical-topology.md", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Name": { 9 | "$ref": "#/$defs/Types/Name" 10 | }, 11 | "PortType": { 12 | "description": "This enum may be extended as described in the design", 13 | "type": "string", 14 | "enum": [ 15 | "powering", 16 | "powered_by", 17 | "cooling", 18 | "cooled_by", 19 | "containing", 20 | "contained_by" 21 | ] 22 | }, 23 | "Type": { 24 | "type": "string", 25 | "const": "Port" 26 | } 27 | }, 28 | "required": ["Name", "PortType", "Type"], 29 | "type": "object" 30 | }, 31 | "Types": { 32 | "Name": { 33 | "type": "string" 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /configurations/delta/awf2dc3200w_psu.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x57", 5 | "Bus": "$bus", 6 | "Name": "PSU $index FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x40", 11 | "Bus": "$bus", 12 | "Labels": [ 13 | "iin", 14 | "iout1", 15 | "iout2", 16 | "fan1", 17 | "vin", 18 | "vcap", 19 | "vout1", 20 | "vout2", 21 | "pin", 22 | "pout1", 23 | "pout2", 24 | "temp1", 25 | "temp2", 26 | "temp3" 27 | ], 28 | "Name": "PSU $index", 29 | "PollRate": 5.0, 30 | "Type": "pmbus" 31 | } 32 | ], 33 | "Name": "Delta AWF2DC3200W $index", 34 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'AWF2DC3200W'})", 35 | "Type": "PowerSupply", 36 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 37 | "Manufacturer": "$PRODUCT_MANUFACTURER", 38 | "Model": "$PRODUCT_PRODUCT_NAME", 39 | "PartNumber": "$PRODUCT_PART_NUMBER", 40 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/gpio-presence/config_provider.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2022-2024. All rights 3 | * reserved. SPDX-License-Identifier: Apache-2.0 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace gpio_presence 11 | { 12 | 13 | using AddedCallback = 14 | std::function; 15 | 16 | using RemovedCallback = 17 | std::function; 18 | 19 | class ConfigProvider 20 | { 21 | public: 22 | explicit ConfigProvider(sdbusplus::async::context& ctx, 23 | const std::string& interface); 24 | 25 | auto initialize(AddedCallback addConfig, RemovedCallback removeConfig) 26 | -> sdbusplus::async::task; 27 | 28 | private: 29 | auto getConfig(AddedCallback addConfig) -> sdbusplus::async::task; 30 | 31 | auto handleInterfacesAdded(AddedCallback addConfig) 32 | -> sdbusplus::async::task; 33 | 34 | auto handleInterfacesRemoved(RemovedCallback removeConfig) 35 | -> sdbusplus::async::task; 36 | 37 | // name of the dbus configuration interface 38 | std::string interface; 39 | 40 | sdbusplus::async::context& ctx; 41 | }; 42 | 43 | } // namespace gpio_presence 44 | -------------------------------------------------------------------------------- /schemas/satellite_controller.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "SatelliteController": { 5 | "title": "satellite controller configuration", 6 | "description": "The configuration used to add remote BMCs to a system", 7 | "type": "object", 8 | "properties": { 9 | "Hostname": { 10 | "description": "Hostname or IP of satellite controller", 11 | "type": "string" 12 | }, 13 | "Port": { 14 | "description": "Network port to connect to satellite controller", 15 | "type": "number" 16 | }, 17 | "AuthType": { 18 | "description": "Type of authorization to use with satellite controller", 19 | "enum": ["None"] 20 | }, 21 | "Name": { 22 | "description": "The name of the object", 23 | "type": "string" 24 | }, 25 | "Type": { 26 | "description": "The type of satellite controller", 27 | "enum": ["SatelliteController"] 28 | } 29 | }, 30 | "required": ["Hostname", "Port", "AuthType", "Name", "Type"] 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /configurations/meta/minerva/minerva_sitv.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x49", 5 | "Bus": 37, 6 | "Name": "SITV_TS1_TEMP_C", 7 | "Type": "TMP175" 8 | }, 9 | { 10 | "Address": "0x4A", 11 | "Bus": 37, 12 | "Name": "SITV_TS2_TEMP_C", 13 | "Type": "TMP175" 14 | }, 15 | { 16 | "Address": "0x4B", 17 | "Bus": 37, 18 | "Name": "SITV_TS3_TEMP_C", 19 | "Type": "TMP175" 20 | }, 21 | { 22 | "Address": "0x4C", 23 | "Bus": 37, 24 | "Name": "SITV_TS4_TEMP_C", 25 | "Type": "TMP175" 26 | } 27 | ], 28 | /* Signal integrity test vehicle board */ 29 | "Name": "Minerva SITV", 30 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva SITV '})", 31 | "Type": "Board", 32 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 33 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 34 | "Manufacturer": "$BOARD_MANUFACTURER", 35 | "Model": "$BOARD_PRODUCT_NAME", 36 | "PartNumber": "$BOARD_PART_NUMBER", 37 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 38 | "SparePartNumber": "$BOARD_INFO_AM1" 39 | }, 40 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 41 | "AssetTag": "$PRODUCT_ASSET_TAG" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /configurations/meta/santabarbara/santabarbara_evb.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Santa Barbara EVB FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x40", 11 | "Bus": "$bus", 12 | "FirmwareInfo": { 13 | "CompatibleHardware": "com.meta.Hardware.Santabarbara.CPLD.LCMXO3D_9400_evb", 14 | "VendorIANA": 40981 15 | }, 16 | "Name": "Santabarbara_EVB_CPLD", 17 | "Type": "LatticeLCMXO3D_9400Firmware" 18 | } 19 | ], 20 | "Name": "Santa Barbara EVB", 21 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Santa Barbara EVB ', 'BOARD_MANUFACTURER': 'Quanta'})", 22 | "Type": "Board", 23 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 24 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 25 | "Manufacturer": "$BOARD_MANUFACTURER", 26 | "Model": "$BOARD_PRODUCT_NAME", 27 | "PartNumber": "$BOARD_PART_NUMBER", 28 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 29 | "SparePartNumber": "$BOARD_INFO_AM1" 30 | }, 31 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 32 | "AssetTag": "$PRODUCT_ASSET_TAG" 33 | }, 34 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 35 | "Version": "$PRODUCT_VERSION" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /configurations/meta/santabarbara/santabarbara_sitv_pcie.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Santa Barbara SITV3_PCIe FRU $bus", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x40", 11 | "Bus": "$bus", 12 | "FirmwareInfo": { 13 | "CompatibleHardware": "com.meta.Hardware.Santabarbara.CPLD.LCMXO3LF_2100C_sitv3", 14 | "VendorIANA": 40981 15 | }, 16 | "Name": "Santabarbara_SITV3_PCIe_CPLD_$bus", 17 | "Type": "LatticeLCMXO3LF_2100CFirmware" 18 | } 19 | ], 20 | "Name": "Santa Barbara SITV3_PCIe $bus", 21 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Santa Barbara SITV3_PCIe'})", 22 | "Type": "Board", 23 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 24 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 25 | "Manufacturer": "$BOARD_MANUFACTURER", 26 | "Model": "$BOARD_PRODUCT_NAME", 27 | "PartNumber": "$BOARD_PART_NUMBER", 28 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 29 | "SparePartNumber": "$BOARD_INFO_AM1" 30 | }, 31 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 32 | "AssetTag": "$PRODUCT_ASSET_TAG" 33 | }, 34 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 35 | "Version": "$PRODUCT_VERSION" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /configurations/meta/santabarbara/santabarbara_rainbow.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Santa Barbara Rainbow module FRU $bus", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x40", 11 | "Bus": "$bus", 12 | "FirmwareInfo": { 13 | "CompatibleHardware": "com.meta.Hardware.Santabarbara.CPLD.LCMXO3D_9400_rainbow", 14 | "VendorIANA": 40981 15 | }, 16 | "Name": "Santabarbara_Rainbow_CPLD_$bus", 17 | "Type": "LatticeLCMXO3D_9400Firmware" 18 | } 19 | ], 20 | "Name": "Santa Barbara Rainbow module $bus", 21 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Santa Barbara Rainbow module', 'BOARD_MANUFACTURER': 'Quanta'})", 22 | "Type": "Board", 23 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 24 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 25 | "Manufacturer": "$BOARD_MANUFACTURER", 26 | "Model": "$BOARD_PRODUCT_NAME", 27 | "PartNumber": "$BOARD_PART_NUMBER", 28 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 29 | "SparePartNumber": "$BOARD_INFO_AM1" 30 | }, 31 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 32 | "AssetTag": "$PRODUCT_ASSET_TAG" 33 | }, 34 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 35 | "Version": "$PRODUCT_VERSION" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /schemas/gpio_presence.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "GPIODeviceDetect": { 5 | "additionalProperties": false, 6 | "description": "Configuration for GPIO device presence daemon", 7 | "type": "object", 8 | "properties": { 9 | "Name": { 10 | "description": "The name of the device", 11 | "type": "string" 12 | }, 13 | "Type": { 14 | "description": "The type of configuration object", 15 | "const": "GPIODeviceDetect" 16 | }, 17 | "PresencePinNames": { 18 | "description": "The names of the GPIOs used for presence detection.", 19 | "type": "array", 20 | "items": { 21 | "type": "string" 22 | } 23 | }, 24 | "PresencePinValues": { 25 | "description": "The presence pin values for the GPIOs.", 26 | "type": "array", 27 | "items": { 28 | "type": "number" 29 | } 30 | } 31 | }, 32 | "required": [ 33 | "Name", 34 | "Type", 35 | "PresencePinNames", 36 | "PresencePinValues" 37 | ] 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/entity_manager/log_device_inventory.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "entity_manager/log_device_inventory.hpp" 3 | 4 | #include 5 | 6 | TEST(LogDevicInventory, QueryInvInfoSuccess) 7 | { 8 | nlohmann::json record = nlohmann::json::parse(R"( 9 | { 10 | "Name": "Supermicro PWS 920P SQ 0", 11 | "Type": "PowerSupply", 12 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 13 | "Manufacturer": "Supermicro", 14 | "Model": "PWS 920P SQ", 15 | "PartNumber": "328923", 16 | "SerialNumber": "43829239" 17 | } 18 | } 19 | )"); 20 | 21 | InvAddRemoveInfo info = queryInvInfo(record); 22 | 23 | EXPECT_EQ(info.name, "Supermicro PWS 920P SQ 0"); 24 | EXPECT_EQ(info.type, "PowerSupply"); 25 | EXPECT_EQ(info.sn, "43829239"); 26 | EXPECT_EQ(info.model, "PWS 920P SQ"); 27 | } 28 | 29 | TEST(LogDevicInventory, QueryInvInfoNoModelFound) 30 | { 31 | nlohmann::json record = nlohmann::json::parse(R"( 32 | { 33 | "Name": "Supermicro PWS 920P SQ 0", 34 | "Type": "PowerSupply", 35 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 36 | "Manufacturer": "Supermicro", 37 | "PartNumber": "328923", 38 | "SerialNumber": "43829239" 39 | } 40 | } 41 | )"); 42 | 43 | InvAddRemoveInfo info = queryInvInfo(record); 44 | 45 | EXPECT_EQ(info.name, "Supermicro PWS 920P SQ 0"); 46 | EXPECT_EQ(info.type, "PowerSupply"); 47 | EXPECT_EQ(info.sn, "43829239"); 48 | EXPECT_EQ(info.model, "Unknown"); 49 | } 50 | -------------------------------------------------------------------------------- /src/entity_manager/perform_scan.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../utils.hpp" 4 | #include "entity_manager.hpp" 5 | 6 | #include 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | namespace scan 17 | { 18 | struct DBusDeviceDescriptor 19 | { 20 | DBusInterface interface; 21 | std::string path; 22 | }; 23 | 24 | using FoundDevices = std::vector; 25 | 26 | struct PerformScan : std::enable_shared_from_this 27 | { 28 | PerformScan(EntityManager& em, nlohmann::json& missingConfigurations, 29 | std::vector& configurations, 30 | boost::asio::io_context& io, std::function&& callback); 31 | 32 | void updateSystemConfiguration(const nlohmann::json& recordRef, 33 | const std::string& probeName, 34 | FoundDevices& foundDevices); 35 | void run(); 36 | virtual ~PerformScan(); 37 | EntityManager& _em; 38 | MapperGetSubTreeResponse dbusProbeObjects; 39 | std::vector passedProbes; 40 | 41 | private: 42 | nlohmann::json& _missingConfigurations; 43 | std::vector _configurations; 44 | std::function _callback; 45 | bool _passed = false; 46 | 47 | boost::asio::io_context& io; 48 | }; 49 | 50 | } // namespace scan 51 | -------------------------------------------------------------------------------- /configurations/meta/minerva/minerva_aegis.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Minerva Aegis FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x40", 11 | "Bus": 11, 12 | "FirmwareInfo": { 13 | "CompatibleHardware": "com.meta.Hardware.Harma.CPLD.LCMXO3D_9400HC_aegis", 14 | "VendorIANA": 40981 15 | }, 16 | "Name": "Minerva_Aegis_CPLD", 17 | "Type": "LatticeLCMXO3D_9400Firmware" 18 | } 19 | ], 20 | "Name": "Minerva Aegis", 21 | "Probe": [ 22 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Aegis Board ', 'PRODUCT_MANUFACTURER': 'Quanta'})", 23 | "OR", 24 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva EVB ', 'PRODUCT_MANUFACTURER': 'Quanta'})", 25 | "AND", 26 | "FOUND('Harma SCM')" 27 | ], 28 | "Type": "Board", 29 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 30 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 31 | "Manufacturer": "$BOARD_MANUFACTURER", 32 | "Model": "$BOARD_PRODUCT_NAME", 33 | "PartNumber": "$BOARD_PART_NUMBER", 34 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 35 | "SparePartNumber": "$BOARD_INFO_AM1" 36 | }, 37 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 38 | "AssetTag": "$PRODUCT_ASSET_TAG" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /configurations/meta/terminus_2x100g_nic_tsff.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Terminus NIC FRU $bus", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x3c", 11 | "Bus": "$bus", 12 | "Labels": [ 13 | "temp1" 14 | ], 15 | "Name": "NIC TEMP $bus", 16 | "Thresholds": [ 17 | { 18 | "Direction": "greater than", 19 | "Index": 1, 20 | "Name": "upper non recoverable", 21 | "Severity": 4, 22 | "Value": 115 23 | }, 24 | { 25 | "Direction": "greater than", 26 | "Index": 1, 27 | "Name": "upper critical", 28 | "Severity": 1, 29 | "Value": 105 30 | } 31 | ], 32 | "Type": "EMC1403" 33 | } 34 | ], 35 | "Name": "Terminus NIC FRU $bus", 36 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Terminus 2x100G NIC TSFF'})", 37 | "Type": "Board", 38 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 39 | "Manufacturer": "$BOARD_MANUFACTURER", 40 | "Model": "$BOARD_PRODUCT_NAME", 41 | "PartNumber": "$BOARD_PART_NUMBER", 42 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /configurations/3y-power/3ypower_vast2112_psu.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "psu$ADDRESS % 4 fru", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "$ADDRESS % 4 + 88", 11 | "Bus": "$bus", 12 | "Labels": [ 13 | "pin", 14 | "pout1", 15 | "vin", 16 | "vout1", 17 | "iout1", 18 | "temp1", 19 | "fan1" 20 | ], 21 | "Name": "psu$ADDRESS % 4", 22 | "PowerScaleFactor": 1000000, 23 | "Type": "pmbus", 24 | "fan1_Name": "psu$ADDRESS % 4 fan", 25 | "iout1_Name": "psu$ADDRESS % 4 iout", 26 | "pin_Name": "psu$ADDRESS % 4 pin", 27 | "pout1_Name": "psu$ADDRESS % 4 pout", 28 | "temp1_Name": "psu$ADDRESS % 4 temp", 29 | "vin_Name": "psu$ADDRESS % 4 vin", 30 | "vout1_Name": "psu$ADDRESS % 4 vout" 31 | } 32 | ], 33 | "Name": "3YPOWER VAST2112 PSU$ADDRESS % 4", 34 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'VAST2112*'})", 35 | "Type": "PowerSupply", 36 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 37 | "Manufacturer": "$PRODUCT_MANUFACTURER", 38 | "Model": "$PRODUCT_PRODUCT_NAME", 39 | "PartNumber": "$PRODUCT_PART_NUMBER", 40 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /configurations/broadcomm/200g_1p_ocp_mezz.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "BRCM OCP NIC FRU $bus", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x1f", 11 | "Bus": "$bus", 12 | "Labels": [ 13 | "temp2" 14 | ], 15 | "Name": "NIC Temp $bus", 16 | "Name1": "NIC Temp $bus", 17 | "Thresholds": [ 18 | { 19 | "Direction": "less than", 20 | "Index": 2, 21 | "Name": "lower critical", 22 | "Severity": 1, 23 | "Value": 5 24 | }, 25 | { 26 | "Direction": "greater than", 27 | "Index": 2, 28 | "Name": "upper critical", 29 | "Severity": 1, 30 | "Value": 105 31 | } 32 | ], 33 | "Type": "TMP421" 34 | } 35 | ], 36 | "Name": "BRCM OCP NIC FRU $bus", 37 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'BRCM 200G 1P.*57508 OCP Mezz'})", 38 | "Type": "Board", 39 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 40 | "Manufacturer": "$BOARD_MANUFACTURER", 41 | "Model": "$BOARD_PRODUCT_NAME", 42 | "PartNumber": "$BOARD_PART_NUMBER", 43 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /configurations/ibm/waterloo.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "BridgeGpio": [ 5 | { 6 | "Name": "rtc-battery-voltage-read-enable", 7 | "Polarity": "High" 8 | } 9 | ], 10 | "Index": 0, 11 | "Name": "Battery Voltage", 12 | "PollRate": 86400, 13 | "ScaleFactor": 0.4348, 14 | "Thresholds": [ 15 | { 16 | "Direction": "less than", 17 | "Name": "lower critical", 18 | "Severity": 1, 19 | "Value": 2.45 20 | } 21 | ], 22 | "Type": "ADC" 23 | }, 24 | { 25 | "I2CAddress": 91, 26 | "I2CBus": 3, 27 | "Name": "Power Supply Slot 0", 28 | "NamedPresenceGpio": "presence-ps0", 29 | "Type": "IBMCFFPSConnector" 30 | }, 31 | { 32 | "I2CAddress": 90, 33 | "I2CBus": 3, 34 | "Name": "Power Supply Slot 1", 35 | "NamedPresenceGpio": "presence-ps1", 36 | "Type": "IBMCFFPSConnector" 37 | }, 38 | { 39 | "Address": "0x64", 40 | "Bus": 2, 41 | "Name": "UCD90160 Power Sequencer", 42 | "Type": "UCD90160" 43 | } 44 | ], 45 | "Name": "Waterloo Backplane", 46 | "Probe": [ 47 | "com.ibm.ipzvpd.VINI({'CC': [50, 69, 52, 54]})" 48 | ], 49 | "Type": "Board" 50 | } 51 | -------------------------------------------------------------------------------- /configurations/ibm/pennybacker.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "BridgeGpio": [ 5 | { 6 | "Name": "rtc-battery-voltage-read-enable", 7 | "Polarity": "High" 8 | } 9 | ], 10 | "Index": 0, 11 | "Name": "Battery Voltage", 12 | "PollRate": 86400, 13 | "ScaleFactor": 0.4348, 14 | "Thresholds": [ 15 | { 16 | "Direction": "less than", 17 | "Name": "lower critical", 18 | "Severity": 1, 19 | "Value": 2.45 20 | } 21 | ], 22 | "Type": "ADC" 23 | }, 24 | { 25 | "I2CAddress": 91, 26 | "I2CBus": 3, 27 | "Name": "Power Supply Slot 0", 28 | "NamedPresenceGpio": "presence-ps0", 29 | "Type": "IBMCFFPSConnector" 30 | }, 31 | { 32 | "I2CAddress": 90, 33 | "I2CBus": 3, 34 | "Name": "Power Supply Slot 1", 35 | "NamedPresenceGpio": "presence-ps1", 36 | "Type": "IBMCFFPSConnector" 37 | }, 38 | { 39 | "Address": "0x64", 40 | "Bus": 2, 41 | "Name": "UCD90160 Power Sequencer", 42 | "Type": "UCD90160" 43 | } 44 | ], 45 | "Name": "Pennybacker Backplane", 46 | "Probe": [ 47 | "com.ibm.ipzvpd.VINI({'CC': [50, 69, 52, 52]})" 48 | ], 49 | "Type": "Board" 50 | } 51 | -------------------------------------------------------------------------------- /configurations/broadcomm/400g_1p_ocp3.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "BRCM OCP NIC FRU $bus", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x1f", 11 | "Bus": "$bus", 12 | "Labels": [ 13 | "temp2" 14 | ], 15 | "Name": "NIC Temp $bus", 16 | "Name1": "NIC Temp $bus", 17 | "Thresholds": [ 18 | { 19 | "Direction": "less than", 20 | "Index": 2, 21 | "Name": "lower critical", 22 | "Severity": 1, 23 | "Value": 5 24 | }, 25 | { 26 | "Direction": "greater than", 27 | "Index": 2, 28 | "Name": "upper critical", 29 | "Severity": 1, 30 | "Value": 105 31 | } 32 | ], 33 | "Type": "TMP421" 34 | } 35 | ], 36 | "Name": "BRCM OCP NIC FRU $bus", 37 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'BRCM 400G 1P.*57608 OCP3', 'BOARD_MANUFACTURER': 'Broadcom'})", 38 | "Type": "Board", 39 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 40 | "Manufacturer": "$BOARD_MANUFACTURER", 41 | "Model": "$BOARD_PRODUCT_NAME", 42 | "PartNumber": "$BOARD_PART_NUMBER", 43 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/devicetree_vpd_parser/devicetree_vpd_parser.cpp: -------------------------------------------------------------------------------- 1 | #include "machine_context.hpp" 2 | 3 | #include 4 | 5 | int main() 6 | { 7 | static constexpr auto reqDBusPath = "/xyz/openbmc_project/MachineContext"; 8 | static constexpr auto reqDBusName = "xyz.openbmc_project.MachineContext"; 9 | 10 | /*Note: OpenBMC convention typically has service name = bus name, 11 | where the bus name is representative of the underlying hardware. 12 | 13 | In the case of MachineContext, the BMC is not gathering data from 14 | specific hardware, but is instead parsing device-tree nodes for 15 | context about the hardware OpenBMC is running on. 16 | 17 | Because the VPD data being parsed is coming from device-tree, 18 | the daemon and matching service name reflect that. 19 | 20 | Because the parsed data represents 'machine context' data, 21 | the bus name and associated path the daemon writes to 22 | reflects that instead. 23 | */ 24 | 25 | sdbusplus::async::context ctx; 26 | sdbusplus::server::manager_t manager{ctx, reqDBusPath}; 27 | 28 | std::unique_ptr mc = nullptr; 29 | if (MachineContext::keyNodeExists()) 30 | { 31 | mc = std::make_unique(ctx, reqDBusPath); 32 | mc->populateFromDeviceTree(); 33 | } 34 | 35 | // NOLINTNEXTLINE(readability-static-accessed-through-instance) 36 | ctx.spawn([](sdbusplus::async::context& ctx) -> sdbusplus::async::task<> { 37 | ctx.request_name(reqDBusName); 38 | co_return; 39 | }(ctx)); 40 | 41 | ctx.run(); 42 | 43 | return 0; 44 | }; 45 | -------------------------------------------------------------------------------- /schemas/spdm_endpoint.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "SpdmTcpEndpoint": { 5 | "title": "SPDM TCP responder configuration", 6 | "description": "The configuration used to add remote SPDM responder to the system", 7 | "type": "object", 8 | "additionalProperties": false, 9 | "properties": { 10 | "Hostname": { 11 | "description": "Hostname or IP of remote SPDM TCP responder", 12 | "type": "string" 13 | }, 14 | "Port": { 15 | "description": "Network port SPDM TCP responder is listening on per DSP0287_1.0.0", 16 | "type": "number" 17 | }, 18 | "TrustedComponentType": { 19 | "description": "Type of the Root of Trust", 20 | "enum": ["discrete", "integrated"] 21 | }, 22 | "Name": { 23 | "description": "The name of the object", 24 | "type": "string" 25 | }, 26 | "Type": { 27 | "description": "The type of object", 28 | "type": "string", 29 | "enum": ["SpdmTcpResponder"] 30 | } 31 | }, 32 | "required": [ 33 | "Hostname", 34 | "Port", 35 | "TrustedComponentType", 36 | "Name", 37 | "Type" 38 | ] 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/entity_manager/configuration.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | constexpr const char* currentConfiguration = "/var/configuration/system.json"; 9 | 10 | class Configuration 11 | { 12 | public: 13 | explicit Configuration( 14 | const std::vector& configurationDirectories, 15 | const std::filesystem::path& schemaDirectory); 16 | std::unordered_set probeInterfaces; 17 | std::vector configurations; 18 | 19 | const std::filesystem::path schemaDirectory; 20 | 21 | protected: 22 | void loadConfigurations(); 23 | void filterProbeInterfaces(); 24 | 25 | private: 26 | std::vector configurationDirectories; 27 | }; 28 | 29 | bool writeJsonFiles(const nlohmann::json& systemConfiguration); 30 | 31 | template 32 | bool setJsonFromPointer(const std::string& ptrStr, const JsonType& value, 33 | nlohmann::json& systemConfiguration) 34 | { 35 | try 36 | { 37 | nlohmann::json::json_pointer ptr(ptrStr); 38 | nlohmann::json& ref = systemConfiguration[ptr]; 39 | ref = value; 40 | return true; 41 | } 42 | catch (const std::out_of_range&) 43 | { 44 | return false; 45 | } 46 | } 47 | 48 | void deriveNewConfiguration(const nlohmann::json& oldConfiguration, 49 | nlohmann::json& newConfiguration); 50 | 51 | bool validateJson(const nlohmann::json& schemaFile, 52 | const nlohmann::json& input); 53 | -------------------------------------------------------------------------------- /schemas/cpld.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "CPLDFirmware": { 5 | "description": "The schema definition for CPLD firmware upgrade", 6 | "type": "object", 7 | "additionalProperties": false, 8 | "properties": { 9 | "Address": { 10 | "$ref": "legacy.json#/$defs/Types/Address" 11 | }, 12 | "Bus": { 13 | "$ref": "legacy.json#/$defs/Types/Bus" 14 | }, 15 | "FirmwareInfo": { 16 | "$ref": "firmware.json#/$defs/FirmwareInfoDef" 17 | }, 18 | "Name": { 19 | "description": "Full name of device", 20 | "type": "string" 21 | }, 22 | "Type": { 23 | "description": "Supported CPLD devices, Firmware", 24 | "enum": [ 25 | "LatticeLCMXO2_4000HCFirmware", 26 | "LatticeLCMXO3D_4300Firmware", 27 | "LatticeLCMXO3D_9400Firmware", 28 | "LatticeLCMXO3LF_2100CFirmware", 29 | "LatticeLCMXO3LF_4300CFirmware", 30 | "LatticeLFMXO5_25Firmware" 31 | ] 32 | }, 33 | "MuxOutputs": { 34 | "$ref": "firmware.json#/$defs/MuxOutputs" 35 | } 36 | }, 37 | "required": ["Address", "Bus", "FirmwareInfo", "Name", "Type"] 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/entity_manager/utils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | using DBusValueVariant = 10 | std::variant>; 12 | using DBusInterface = std::flat_map>; 13 | using DBusObject = std::flat_map>; 14 | 15 | constexpr const char* configurationOutDir = "/var/configuration/"; 16 | constexpr const char* versionHashFile = "/var/configuration/version"; 17 | constexpr const char* versionFile = "/etc/os-release"; 18 | 19 | namespace em_utils 20 | { 21 | 22 | namespace properties 23 | { 24 | constexpr const char* interface = "org.freedesktop.DBus.Properties"; 25 | constexpr const char* get = "Get"; 26 | } // namespace properties 27 | 28 | bool fwVersionIsSame(); 29 | 30 | void handleLeftOverTemplateVars(nlohmann::json& value); 31 | 32 | std::optional templateCharReplace( 33 | nlohmann::json& value, const DBusObject& object, size_t index, 34 | const std::optional& replaceStr = std::nullopt, 35 | bool handleLeftOver = true); 36 | 37 | std::optional templateCharReplace( 38 | nlohmann::json& value, const DBusInterface& interface, size_t index, 39 | const std::optional& replaceStr = std::nullopt); 40 | 41 | std::string buildInventorySystemPath(std::string& boardName, 42 | const std::string& boardType); 43 | 44 | } // namespace em_utils 45 | -------------------------------------------------------------------------------- /configurations/ibm/sbp1_nvme.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x6a", 5 | "Bus": "50", 6 | "Name": "M2 SSD1 Temperature", 7 | "PowerState": "On", 8 | "Thresholds": [ 9 | { 10 | "Direction": "greater than", 11 | "Name": "upper critical", 12 | "Severity": 1, 13 | "Value": 115 14 | }, 15 | { 16 | "Direction": "greater than", 17 | "Name": "upper non critical", 18 | "Severity": 0, 19 | "Value": 110 20 | } 21 | ], 22 | "Type": "NVME1000" 23 | }, 24 | { 25 | "Address": "0x6a", 26 | "Bus": "52", 27 | "Name": "M2 SSD2 Temperature", 28 | "PowerState": "On", 29 | "Thresholds": [ 30 | { 31 | "Direction": "greater than", 32 | "Name": "upper critical", 33 | "Severity": 1, 34 | "Value": 115 35 | }, 36 | { 37 | "Direction": "greater than", 38 | "Name": "upper non critical", 39 | "Severity": 0, 40 | "Value": 110 41 | } 42 | ], 43 | "Type": "NVME1000" 44 | } 45 | ], 46 | "Name": "SBP1 NVMe", 47 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': '.*SBP1'})", 48 | "Type": "NVMe", 49 | "xyz.openbmc_project.Inventory.Item.Chassis": {} 50 | } 51 | -------------------------------------------------------------------------------- /configurations/ocp/cx7_ocp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "OCP CX7 NIC FRU $bus", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x1f", 11 | "Bus": "$bus", 12 | "Labels": [ 13 | "temp2" 14 | ], 15 | "Name": "NIC Temp $bus", 16 | "Name1": "NIC Temp $bus", 17 | "Thresholds": [ 18 | { 19 | "Direction": "less than", 20 | "Index": 2, 21 | "Name": "lower critical", 22 | "Severity": 1, 23 | "Value": 5 24 | }, 25 | { 26 | "Direction": "greater than", 27 | "Index": 2, 28 | "Name": "upper critical", 29 | "Severity": 1, 30 | "Value": 105 31 | } 32 | ], 33 | "Type": "TMP421" 34 | } 35 | ], 36 | "Name": "OCP CX7 NIC $bus", 37 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Nvidia ConnectX-7 OCP3.0'})", 38 | "Type": "Board", 39 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 40 | "Manufacturer": "$BOARD_MANUFACTURER", 41 | "Model": "$BOARD_PRODUCT_NAME", 42 | "PartNumber": "$BOARD_PART_NUMBER", 43 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 44 | "SparePartNumber": "$BOARD_INFO_AM1" 45 | }, 46 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 47 | "AssetTag": "$PRODUCT_ASSET_TAG" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /configurations/ocp/cx8_ocp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "OCP CX8 NIC FRU $bus", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x1f", 11 | "Bus": "$bus", 12 | "Labels": [ 13 | "temp2" 14 | ], 15 | "Name": "NIC Temp $bus", 16 | "Name1": "NIC Temp $bus", 17 | "Thresholds": [ 18 | { 19 | "Direction": "less than", 20 | "Index": 2, 21 | "Name": "lower critical", 22 | "Severity": 1, 23 | "Value": 5 24 | }, 25 | { 26 | "Direction": "greater than", 27 | "Index": 2, 28 | "Name": "upper critical", 29 | "Severity": 1, 30 | "Value": 105 31 | } 32 | ], 33 | "Type": "TMP421" 34 | } 35 | ], 36 | "Name": "OCP CX8 NIC $bus", 37 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Nvidia ConnectX-8 OCP3.0'})", 38 | "Type": "Board", 39 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 40 | "Manufacturer": "$BOARD_MANUFACTURER", 41 | "Model": "$BOARD_PRODUCT_NAME", 42 | "PartNumber": "$BOARD_PART_NUMBER", 43 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 44 | "SparePartNumber": "$BOARD_INFO_AM1" 45 | }, 46 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 47 | "AssetTag": "$PRODUCT_ASSET_TAG" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /configurations/broadcomm/100g_1p_ocp_mezz.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "BRCM OCP NIC FRU $bus", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x1f", 11 | "Bus": "$bus", 12 | "Labels": [ 13 | "temp2" 14 | ], 15 | "Name": "NIC Temp $bus", 16 | "Name1": "NIC Temp $bus", 17 | "Thresholds": [ 18 | { 19 | "Direction": "less than", 20 | "Index": 2, 21 | "Name": "lower critical", 22 | "Severity": 1, 23 | "Value": 5 24 | }, 25 | { 26 | "Direction": "greater than", 27 | "Index": 2, 28 | "Name": "upper critical", 29 | "Severity": 1, 30 | "Value": 105 31 | } 32 | ], 33 | "Type": "TMP421" 34 | } 35 | ], 36 | "Name": "BRCM OCP NIC FRU $bus", 37 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'BRCM 100G 1P.*57504 OCP Mezz'})", 38 | "Type": "Board", 39 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 40 | "Manufacturer": "$BOARD_MANUFACTURER", 41 | "Model": "$BOARD_PRODUCT_NAME", 42 | "PartNumber": "$BOARD_PART_NUMBER", 43 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 44 | "SparePartNumber": "$BOARD_INFO_AM1" 45 | }, 46 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 47 | "AssetTag": "$PRODUCT_ASSET_TAG" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /schemas/leak_detector.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "GPIOLeakDetector": { 5 | "additionalProperties": false, 6 | "description": "Configuration for GPIO based Leak Detector.", 7 | "type": "object", 8 | "properties": { 9 | "Name": { 10 | "description": "The name of the leak detector.", 11 | "type": "string" 12 | }, 13 | "Type": { 14 | "description": "The type of configuration object", 15 | "const": "GPIOLeakDetector" 16 | }, 17 | "SubType": { 18 | "description": "The type of leak detector.", 19 | "enum": ["LeakSensingCable", "Unknown"] 20 | }, 21 | "PinName": { 22 | "description": "The GPIO pin name for the leak detector.", 23 | "type": "string" 24 | }, 25 | "Polarity": { 26 | "description": "The GPIO polarity depicting its active status.", 27 | "$ref": "legacy.json#/$defs/Types/Polarity" 28 | }, 29 | "Level": { 30 | "description": "The severity level of the leak detector.", 31 | "enum": ["Critical", "Warning"] 32 | } 33 | }, 34 | "required": [ 35 | "Name", 36 | "Type", 37 | "SubType", 38 | "PinName", 39 | "Polarity", 40 | "Level" 41 | ] 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/fru_device/fru_reader.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2022 Equinix, Inc. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | extern "C" 14 | { 15 | // For I2C_SMBUS_BLOCK_MAX 16 | #include 17 | } 18 | 19 | // A function to read up to I2C_SMBUS_BLOCK_MAX bytes of FRU data. Returns 20 | // negative on error, or the number of bytes read otherwise, which may be (but 21 | // is not guaranteed to be) less than len if the read would go beyond the end 22 | // of the FRU. 23 | using ReadBlockFunc = 24 | std::function; 25 | 26 | // A caching wrapper around a ReadBlockFunc 27 | class FRUReader 28 | { 29 | public: 30 | explicit FRUReader(ReadBlockFunc readFunc) : readFunc(std::move(readFunc)) 31 | {} 32 | // The ::read() operation here is analogous to ReadBlockFunc (with the same 33 | // return value semantics), but is not subject to SMBus block size 34 | // limitations; it can read as much data as needed in a single call. 35 | ssize_t read(off_t start, size_t len, uint8_t* outbuf); 36 | 37 | private: 38 | static constexpr size_t cacheBlockSize = 32; 39 | static_assert(cacheBlockSize <= I2C_SMBUS_BLOCK_MAX); 40 | using CacheBlock = std::array; 41 | 42 | // indexed by block number (byte number / block size) 43 | using Cache = std::map; 44 | 45 | ReadBlockFunc readFunc; 46 | Cache cache; 47 | 48 | // byte offset of the end of the FRU (if readFunc has reported it) 49 | std::optional eof; 50 | }; 51 | -------------------------------------------------------------------------------- /docs/blacklist_configuration.md: -------------------------------------------------------------------------------- 1 | # Blacklist Configuration 2 | 3 | The blacklist.json in package directory can determine i2c buses and addresses 4 | that should not be scanned by FruDevice. An integer blocks an entire bus from 5 | being scanned. A bus/addresses object can block specific addresses on the bus 6 | while allowing scanning others addresses on the same bus. 7 | 8 | ## For buses 9 | 10 | Put in numbers of buses. For example: 11 | 12 | ```json 13 | { 14 | "buses": [1, 3, 5] 15 | } 16 | ``` 17 | 18 | Note that "buses" should be an array of unsigned integer. 19 | 20 | ## For addresses 21 | 22 | Put in bus and addresses with this format: 23 | 24 | ```json 25 | { 26 | "buses": [ 27 | { 28 | "bus": 3, 29 | "addresses": ["0x30", "0x40"] 30 | }, 31 | { 32 | "bus": 5, 33 | "addresses": ["0x55"] 34 | } 35 | ] 36 | } 37 | ``` 38 | 39 | Note that "bus" should be an unsigned integer and "addresses" be an array of 40 | string of hex. Addresses can also be blocked on all busses. In this case, they 41 | should be strings of hex, just like specifying an address on a bus. This is 42 | useful for when you may not know the bus ahead of time, such as when adding 43 | busses dynamically through the addition of an i2c-mux through a new_device node. 44 | 45 | ```json 46 | { 47 | "addresses": ["0x70", "0x71"] 48 | } 49 | ``` 50 | 51 | This example will not query addresses 0x70 or 0x71 on any bus. 52 | 53 | ## For both 54 | 55 | ```json 56 | { 57 | "buses": [ 58 | 1, 59 | { 60 | "bus": 3, 61 | "addresses": ["0x30", "0x40"] 62 | } 63 | ], 64 | "addresses": ["0x71"] 65 | } 66 | ``` 67 | 68 | This example will skip addresses 0x30 and 0x40 on bus 3, all devices on bus 1, 69 | and all devices at address 0x71. 70 | -------------------------------------------------------------------------------- /configurations/intel/f1u4x25_hsbp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "F1U4X25 HSBP FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x48", 11 | "Bus": "$bus", 12 | "Name": "HSBP Temp", 13 | "Thresholds": [ 14 | { 15 | "Direction": "greater than", 16 | "Name": "upper critical", 17 | "Severity": 1, 18 | "Value": 57 19 | }, 20 | { 21 | "Direction": "greater than", 22 | "Name": "upper non critical", 23 | "Severity": 0, 24 | "Value": 52 25 | }, 26 | { 27 | "Direction": "less than", 28 | "Name": "lower non critical", 29 | "Severity": 0, 30 | "Value": 12 31 | }, 32 | { 33 | "Direction": "less than", 34 | "Name": "lower critical", 35 | "Severity": 1, 36 | "Value": 7 37 | } 38 | ], 39 | "Type": "TMP75" 40 | } 41 | ], 42 | "Name": "F1U4X25 HSBP", 43 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'F1U4X25PCIHSBP'})", 44 | "Type": "Board", 45 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 46 | "Manufacturer": "$BOARD_MANUFACTURER", 47 | "Model": "$BOARD_PRODUCT_NAME", 48 | "PartNumber": "$BOARD_PART_NUMBER", 49 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /meson.options: -------------------------------------------------------------------------------- 1 | option('tests', type: 'feature', description: 'Build tests.') 2 | option( 3 | 'fru-device', 4 | type: 'boolean', 5 | description: 'Build fru-device VPD parser.', 6 | ) 7 | option( 8 | 'fru-device-update-property', 9 | type: 'combo', 10 | choices: ['asset_only', 'all'], 11 | value: 'all', 12 | description: 'Enable updating FRU properties via D-BUS. Choose "asset_only" to update only asset properties, or "all" to update all properties.', 13 | ) 14 | option( 15 | 'fru-device-resizefru', 16 | value: true, 17 | type: 'boolean', 18 | description: 'Allow FruDevice to resize FRU areas.', 19 | ) 20 | option( 21 | 'fru-device-16bitdetectmode', 22 | type: 'combo', 23 | choices: ['MODE_1', 'MODE_2'], 24 | value: 'MODE_1', 25 | description: 'Different modes to detect 16-bit address EEPROM devices. MODE_1 is current and default mode.', 26 | ) 27 | option( 28 | 'devicetree-vpd', 29 | type: 'boolean', 30 | description: 'Build device-tree VPD parser', 31 | ) 32 | option( 33 | 'validate-json', 34 | type: 'boolean', 35 | value: true, 36 | description: 'Run JSON schema validation during the build.', 37 | ) 38 | option( 39 | 'runtime-validate-json', 40 | type: 'boolean', 41 | value: false, 42 | description: 'Run JSON schema validation at runtime.', 43 | ) 44 | option( 45 | 'gpio-presence', 46 | type: 'boolean', 47 | value: true, 48 | description: 'Build gpio presence daemon', 49 | ) 50 | option( 51 | 'new-device-detection', 52 | type: 'boolean', 53 | value: true, 54 | description: 'Cache the current configuration to support new-device detection. This option can be set to false for development, which will force re-parsing of configuration.', 55 | ) 56 | -------------------------------------------------------------------------------- /configurations/intel/f1u12x25_hsbp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "F1U12X25 HSBP FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x48", 11 | "Bus": "$bus", 12 | "Name": "HSBP Temp", 13 | "Thresholds": [ 14 | { 15 | "Direction": "greater than", 16 | "Name": "upper critical", 17 | "Severity": 1, 18 | "Value": 57 19 | }, 20 | { 21 | "Direction": "greater than", 22 | "Name": "upper non critical", 23 | "Severity": 0, 24 | "Value": 52 25 | }, 26 | { 27 | "Direction": "less than", 28 | "Name": "lower non critical", 29 | "Severity": 0, 30 | "Value": 12 31 | }, 32 | { 33 | "Direction": "less than", 34 | "Name": "lower critical", 35 | "Severity": 1, 36 | "Value": 7 37 | } 38 | ], 39 | "Type": "TMP75" 40 | } 41 | ], 42 | "Name": "F1U12X25 HSBP", 43 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'F1U12X25PCIHSBP'})", 44 | "Type": "Board", 45 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 46 | "Manufacturer": "$BOARD_MANUFACTURER", 47 | "Model": "$BOARD_PRODUCT_NAME", 48 | "PartNumber": "$BOARD_PART_NUMBER", 49 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /configurations/intel/f2u12x35_hsbp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "F2U12X35 HSBP FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x48", 11 | "Bus": "$bus", 12 | "Name": "HSBP Temp", 13 | "Thresholds": [ 14 | { 15 | "Direction": "greater than", 16 | "Name": "upper critical", 17 | "Severity": 1, 18 | "Value": 57 19 | }, 20 | { 21 | "Direction": "greater than", 22 | "Name": "upper non critical", 23 | "Severity": 0, 24 | "Value": 52 25 | }, 26 | { 27 | "Direction": "less than", 28 | "Name": "lower non critical", 29 | "Severity": 0, 30 | "Value": 12 31 | }, 32 | { 33 | "Direction": "less than", 34 | "Name": "lower critical", 35 | "Severity": 1, 36 | "Value": 7 37 | } 38 | ], 39 | "Type": "TMP75" 40 | } 41 | ], 42 | "Name": "F2U12X35 HSBP", 43 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'F2U12X35PCIHSBP'})", 44 | "Type": "Board", 45 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 46 | "Manufacturer": "$BOARD_MANUFACTURER", 47 | "Model": "$BOARD_PRODUCT_NAME", 48 | "PartNumber": "$BOARD_PART_NUMBER", 49 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /schemas/mctp.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "MCTPI2CTarget": { 5 | "properties": { 6 | "Address": { 7 | "description": "The physical address for the device on the I2C bus.", 8 | "type": "string" 9 | }, 10 | "Bus": { 11 | "description": "The bus index to which the device is attached", 12 | "type": "string" 13 | }, 14 | "Name": { 15 | "description": "A recognisable name for the device", 16 | "type": "string" 17 | }, 18 | "Type": { 19 | "type": "string", 20 | "enum": ["MCTPI2CTarget"] 21 | } 22 | }, 23 | "required": ["Address", "Bus", "Name", "Type"], 24 | "type": "object" 25 | }, 26 | "MCTPI3CTarget": { 27 | "properties": { 28 | "Address": { 29 | "description": "The 6-byte PID for the device on the I3C bus", 30 | "type": ["string", "array"] 31 | }, 32 | "Bus": { 33 | "description": "The bus index to which the device is attached", 34 | "type": "string" 35 | }, 36 | "Name": { 37 | "description": "A recognisable name for the device", 38 | "type": "string" 39 | }, 40 | "Type": { 41 | "type": "string", 42 | "enum": ["MCTPI3CTarget"] 43 | } 44 | }, 45 | "required": ["Address", "Bus", "Name", "Type"], 46 | "type": "object" 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /configurations/meta/catalina/catalina_hdd_nvme.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "0x6a", 5 | "Bus": "48", 6 | "Name": "HDDBOARD_SSD0_TEMP_C", 7 | "PEC": "Required", 8 | "PowerState": "On", 9 | "Thresholds": [ 10 | { 11 | "Direction": "greater than", 12 | "Hysteresis": 1.4, 13 | "Name": "upper critical", 14 | "Severity": 1, 15 | "Value": 70 16 | }, 17 | { 18 | "Direction": "less than", 19 | "Hysteresis": 0.1, 20 | "Name": "lower critical", 21 | "Severity": 1, 22 | "Value": 5 23 | } 24 | ], 25 | "Type": "NVME1000" 26 | }, 27 | { 28 | "Address": "0x6a", 29 | "Bus": "50", 30 | "Name": "HDDBOARD_SSD2_TEMP_C", 31 | "PEC": "Required", 32 | "PowerState": "On", 33 | "Thresholds": [ 34 | { 35 | "Direction": "greater than", 36 | "Hysteresis": 1.4, 37 | "Name": "upper critical", 38 | "Severity": 1, 39 | "Value": 70 40 | }, 41 | { 42 | "Direction": "less than", 43 | "Hysteresis": 0.1, 44 | "Name": "lower critical", 45 | "Severity": 1, 46 | "Value": 5 47 | } 48 | ], 49 | "Type": "NVME1000" 50 | } 51 | ], 52 | "Name": "Catalina HDD NVMe", 53 | "Probe": "FOUND('Catalina HDD Carrier')", 54 | "Type": "Board", 55 | "xyz.openbmc_project.Inventory.Item.Chassis": {} 56 | } 57 | -------------------------------------------------------------------------------- /configurations/meta/anacapa/anacapa_bridge_l.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "BRIDGE_L FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x4c", 11 | "Bus": "$bus", 12 | "Name": "BRIDGE_L_PCIE_SW_TEMP_C", 13 | "Name1": "BRIDGE_L_OUTLET_TEMP_C", 14 | "Type": "TMP432" 15 | }, 16 | { 17 | "Address": "0x4c", 18 | "Bus": "$bus + 1", 19 | "Name": "BRIDGE_L_BE_TEMP_C", 20 | "Name1": "BRIDGE_L_FE_TEMP_C", 21 | "Type": "TMP432" 22 | }, 23 | { 24 | "Address": "0x60", 25 | "Bus": "$bus", 26 | "Labels": [ 27 | "in1", 28 | "curr1", 29 | "temp1" 30 | ], 31 | "Name": "BRIDGE_L_VR", 32 | "Type": "pmbus", 33 | "curr1_Name": "BRIDGE_L_VR_CURR_A", 34 | "in1_Name": "BRIDGE_L_VR_VOLT_V", 35 | "temp1_Name": "BRIDGE_L_VR_TEMP_C" 36 | } 37 | ], 38 | "Name": "Bridge_L", 39 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Anacapa.* LBB', 'BOARD_MANUFACTURER': 'Inventec'})", 40 | "Type": "Board", 41 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 42 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 43 | "Manufacturer": "$BOARD_MANUFACTURER", 44 | "Model": "$BOARD_PRODUCT_NAME", 45 | "PartNumber": "$BOARD_PART_NUMBER", 46 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 47 | "SparePartNumber": "$BOARD_INFO_AM1" 48 | }, 49 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 50 | "AssetTag": "$PRODUCT_ASSET_TAG" 51 | }, 52 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 53 | "Version": "$PRODUCT_VERSION" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /configurations/meta/anacapa/anacapa_bridge_r.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "BRIDGE_R FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x4c", 11 | "Bus": "$bus", 12 | "Name": "BRIDGE_R_PCIE_SW_TEMP_C", 13 | "Name1": "BRIDGE_R_OUTLET_TEMP_C", 14 | "Type": "TMP432" 15 | }, 16 | { 17 | "Address": "0x4c", 18 | "Bus": "$bus + 1", 19 | "Name": "BRIDGE_R_BE_TEMP_C", 20 | "Name1": "BRIDGE_R_FE_TEMP_C", 21 | "Type": "TMP432" 22 | }, 23 | { 24 | "Address": "0x60", 25 | "Bus": "$bus", 26 | "Labels": [ 27 | "in1", 28 | "curr1", 29 | "temp1" 30 | ], 31 | "Name": "BRIDGE_R_VR", 32 | "Type": "pmbus", 33 | "curr1_Name": "BRIDGE_R_VR_CURR_A", 34 | "in1_Name": "BRIDGE_R_VR_VOLT_V", 35 | "temp1_Name": "BRIDGE_R_VR_TEMP_C" 36 | } 37 | ], 38 | "Name": "Bridge_R", 39 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Anacapa.* RBB', 'BOARD_MANUFACTURER': 'Inventec'})", 40 | "Type": "Board", 41 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 42 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 43 | "Manufacturer": "$BOARD_MANUFACTURER", 44 | "Model": "$BOARD_PRODUCT_NAME", 45 | "PartNumber": "$BOARD_PART_NUMBER", 46 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 47 | "SparePartNumber": "$BOARD_INFO_AM1" 48 | }, 49 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 50 | "AssetTag": "$PRODUCT_ASSET_TAG" 51 | }, 52 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 53 | "Version": "$PRODUCT_VERSION" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /configurations/intel/nvme_p4500_p5500.json: -------------------------------------------------------------------------------- 1 | { 2 | "Bus": "$bus", 3 | "Exposes": [ 4 | { 5 | "Address": "$address", 6 | "Bus": "$bus", 7 | "Name": "NVMe $index FRU", 8 | "Type": "EEPROM" 9 | }, 10 | { 11 | "Address": "0x6a", 12 | "Bus": "$bus", 13 | "Name": "NVMe $index Temp", 14 | "Thresholds": [ 15 | { 16 | "Direction": "greater than", 17 | "Name": "upper critical", 18 | "Severity": 1, 19 | "Value": 115 20 | }, 21 | { 22 | "Direction": "greater than", 23 | "Name": "upper non critical", 24 | "Severity": 0, 25 | "Value": 110 26 | }, 27 | { 28 | "Direction": "less than", 29 | "Name": "lower non critical", 30 | "Severity": 0, 31 | "Value": 5 32 | }, 33 | { 34 | "Direction": "less than", 35 | "Name": "lower critical", 36 | "Severity": 1, 37 | "Value": 0 38 | } 39 | ], 40 | "Type": "NVME1000" 41 | } 42 | ], 43 | "Logging": "Off", 44 | "Name": "NVMe $index", 45 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'P(45|55)\\d\\d\\w?', 'PRODUCT_MANUFACTURER': '(Intel|INTEL).*'})", 46 | "Type": "NVMe", 47 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 48 | "Manufacturer": "$PRODUCT_MANUFACTURER", 49 | "Model": "$PRODUCT_PRODUCT_NAME", 50 | "PartNumber": "$PRODUCT_PART_NUMBER", 51 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER" 52 | }, 53 | "xyz.openbmc_project.Inventory.Item.Chassis": {} 54 | } 55 | -------------------------------------------------------------------------------- /configurations/intel/front_panel.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Front Panel FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x4D", 11 | "Bus": "$bus", 12 | "Name": "Front Panel Temp", 13 | "Thresholds": [ 14 | { 15 | "Direction": "greater than", 16 | "Name": "upper critical", 17 | "Severity": 1, 18 | "Value": 55 19 | }, 20 | { 21 | "Direction": "greater than", 22 | "Name": "upper non critical", 23 | "Severity": 0, 24 | "Value": 50 25 | }, 26 | { 27 | "Direction": "less than", 28 | "Name": "lower non critical", 29 | "Severity": 0, 30 | "Value": 5 31 | }, 32 | { 33 | "Direction": "less than", 34 | "Name": "lower critical", 35 | "Severity": 1, 36 | "Value": 0 37 | } 38 | ], 39 | "Type": "TMP75" 40 | } 41 | ], 42 | "Name": "Intel Front Panel", 43 | "Probe": [ 44 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'FFPANEL'})", 45 | "OR", 46 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'F2USTOPANEL'})" 47 | ], 48 | "Type": "Board", 49 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 50 | "Manufacturer": "$BOARD_MANUFACTURER", 51 | "Model": "$BOARD_PRODUCT_NAME", 52 | "PartNumber": "$BOARD_PART_NUMBER", 53 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 54 | }, 55 | "xyz.openbmc_project.Inventory.Item.Panel": {} 56 | } 57 | -------------------------------------------------------------------------------- /configurations/intel/a2ux8x4riser.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [ 4 | { 5 | "Address": "$address", 6 | "Bus": "$bus", 7 | "Name": "Riser 3 Fru", 8 | "Type": "EEPROM" 9 | }, 10 | { 11 | "Address": "0x4E", 12 | "Bus": "$bus", 13 | "Name": "Riser 3 Temp", 14 | "Thresholds": [ 15 | { 16 | "Direction": "greater than", 17 | "Name": "upper critical", 18 | "Severity": 1, 19 | "Value": 80 20 | }, 21 | { 22 | "Direction": "greater than", 23 | "Name": "upper non critical", 24 | "Severity": 0, 25 | "Value": 75 26 | }, 27 | { 28 | "Direction": "less than", 29 | "Name": "lower non critical", 30 | "Severity": 0, 31 | "Value": 5 32 | }, 33 | { 34 | "Direction": "less than", 35 | "Name": "lower critical", 36 | "Severity": 1, 37 | "Value": 0 38 | } 39 | ], 40 | "Type": "TMP75" 41 | } 42 | ], 43 | "Name": "2Ux8 Riser 3", 44 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'A2UX8X4RISER'})", 45 | "Type": "Board", 46 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 47 | "Manufacturer": "$BOARD_MANUFACTURER", 48 | "Model": "$BOARD_PRODUCT_NAME", 49 | "PartNumber": "$BOARD_PART_NUMBER", 50 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 51 | } 52 | } 53 | ] 54 | -------------------------------------------------------------------------------- /configurations/intel/nvme_intel_p_series.json: -------------------------------------------------------------------------------- 1 | { 2 | "Bus": "$bus", 3 | "Exposes": [ 4 | { 5 | "Address": "$address", 6 | "Bus": "$bus", 7 | "Name": "NVMe $index FRU", 8 | "Type": "EEPROM" 9 | }, 10 | { 11 | "Address": "0x53", 12 | "Bus": "$bus", 13 | "Name": "NVMe $index Temp", 14 | "Thresholds": [ 15 | { 16 | "Direction": "greater than", 17 | "Name": "upper critical", 18 | "Severity": 1, 19 | "Value": 115 20 | }, 21 | { 22 | "Direction": "greater than", 23 | "Name": "upper non critical", 24 | "Severity": 0, 25 | "Value": 110 26 | }, 27 | { 28 | "Direction": "less than", 29 | "Name": "lower non critical", 30 | "Severity": 0, 31 | "Value": 5 32 | }, 33 | { 34 | "Direction": "less than", 35 | "Name": "lower critical", 36 | "Severity": 1, 37 | "Value": 0 38 | } 39 | ], 40 | "Type": "NVME1000" 41 | } 42 | ], 43 | "Logging": "Off", 44 | "Name": "NVMe $index", 45 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': 'P(31|33|35|36|37|41|43|44|46|48|53|56|58)\\d\\d\\w?', 'PRODUCT_MANUFACTURER': '(Intel|INTEL).*'})", 46 | "Type": "NVMe", 47 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 48 | "Manufacturer": "$PRODUCT_MANUFACTURER", 49 | "Model": "$PRODUCT_PRODUCT_NAME", 50 | "PartNumber": "$PRODUCT_PART_NUMBER", 51 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER" 52 | }, 53 | "xyz.openbmc_project.Inventory.Item.Chassis": {} 54 | } 55 | -------------------------------------------------------------------------------- /configurations/meta/clemente/clemente_fio.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Clemente FIO FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x4b", 11 | "Bus": 23, 12 | "Name": "FIOBOARD_TEMP_C", 13 | "Thresholds": [ 14 | { 15 | "Direction": "greater than", 16 | "Name": "upper non recoverable", 17 | "Severity": 4, 18 | "Value": 50 19 | }, 20 | { 21 | "Direction": "greater than", 22 | "Name": "upper critical", 23 | "Severity": 1, 24 | "Value": 46 25 | }, 26 | { 27 | "Direction": "greater than", 28 | "Name": "upper non critical", 29 | "Severity": 0, 30 | "Value": 41 31 | } 32 | ], 33 | "Type": "TMP75" 34 | } 35 | ], 36 | /* Clemente Front IO Board */ 37 | "Name": "Clemente FIO", 38 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Clemente FIO ', 'BOARD_MANUFACTURER': '(Ingrasys|Quanta)'})", 39 | "Type": "Board", 40 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 41 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 42 | "Manufacturer": "$BOARD_MANUFACTURER", 43 | "Model": "$BOARD_PRODUCT_NAME", 44 | "PartNumber": "$BOARD_PART_NUMBER", 45 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 46 | "SparePartNumber": "$BOARD_INFO_AM1" 47 | }, 48 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 49 | "AssetTag": "$PRODUCT_ASSET_TAG" 50 | }, 51 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 52 | "Version": "$PRODUCT_VERSION" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /schemas/valve.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "GPIOValve": { 5 | "additionalProperties": false, 6 | "description": "Configuration for GPIO based Valve.", 7 | "type": "object", 8 | "properties": { 9 | "Name": { 10 | "description": "The name of the valve.", 11 | "type": "string" 12 | }, 13 | "Type": { 14 | "description": "The type of configuration object", 15 | "const": "GPIOValve" 16 | }, 17 | "OpenPinName": { 18 | "description": "The name of the GPIO pin that shows the valve's open status.", 19 | "type": "string" 20 | }, 21 | "OpenPolarity": { 22 | "description": "The GPIO polarity depicting valve's open status.", 23 | "$ref": "legacy.json#/$defs/Types/Polarity" 24 | }, 25 | "OpenControlPinName": { 26 | "description": "The name of the GPIO pin that controls opening the valve.", 27 | "type": "string" 28 | }, 29 | "OpenControlValue": { 30 | "description": "The GPIO value to set to open the valve.", 31 | "type": "boolean" 32 | }, 33 | "CoolantLoopName": { 34 | "description": "The name of the coolant loop to which this valve is connected.", 35 | "type": "string" 36 | } 37 | }, 38 | "required": [ 39 | "Name", 40 | "Type", 41 | "OpenPinName", 42 | "OpenPolarity", 43 | "OpenControlPinName", 44 | "OpenControlValue", 45 | "CoolantLoopName" 46 | ] 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /schemas/usb_port.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "USBPort": { 5 | "description": "The definition of the USB TTY port.", 6 | "type": "object", 7 | "additionalProperties": false, 8 | "properties": { 9 | "Type": { 10 | "description": "The type of configuration object.", 11 | "const": "USBPort" 12 | }, 13 | "Name": { 14 | "description": "The name of the USB port.", 15 | "type": "string" 16 | }, 17 | "DeviceAddress": { 18 | "description": "The address of the USB device.", 19 | "type": "string" 20 | }, 21 | "DeviceInterface": { 22 | "description": "This indicates the interface number of the device.", 23 | "type": "number" 24 | }, 25 | "Port": { 26 | "description": "This indicates the physical port of the serial device within that interface.", 27 | "type": "number" 28 | }, 29 | "Mode": { 30 | "enum": ["RS232", "RS485"] 31 | }, 32 | "BaudRate": { 33 | "description": "The baudrate of the communication channel.", 34 | "enum": [9600, 19200, 57600, 115200] 35 | }, 36 | "RTSDelay": { 37 | "description": "The request to send delay in milli-seconds.", 38 | "type": "number" 39 | } 40 | }, 41 | "required": [ 42 | "Name", 43 | "Type", 44 | "DeviceAddress", 45 | "DeviceInterface", 46 | "Port", 47 | "Mode", 48 | "BaudRate", 49 | "RTSDelay" 50 | ] 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/gpio-presence/device_presence.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: Copyright (c) 2022-2024. All rights 3 | * reserved. SPDX-License-Identifier: Apache-2.0 4 | */ 5 | #pragma once 6 | 7 | #include 8 | 9 | #include 10 | 11 | namespace gpio_presence 12 | { 13 | 14 | enum GPIO_POLARITY 15 | { 16 | ACTIVE_HIGH, 17 | ACTIVE_LOW, 18 | }; 19 | 20 | class DevicePresence; 21 | 22 | using DevicePresenceInterface = 23 | sdbusplus::aserver::xyz::openbmc_project::inventory::source::DevicePresence< 24 | DevicePresence>; 25 | 26 | class DevicePresence 27 | { 28 | public: 29 | DevicePresence(sdbusplus::async::context& ctx, 30 | const std::vector& gpioNames, 31 | const std::vector& gpioValues, 32 | const std::string& deviceName, 33 | const std::unordered_map& gpioState, 34 | const std::vector& parentInvCompatible); 35 | 36 | auto updateGPIOPresence(const std::string& gpioLine) -> void; 37 | 38 | // @returns the object path of the 'detected' interface 39 | auto getObjPath() const -> sdbusplus::message::object_path; 40 | 41 | // computed from the state of the configured gpios 42 | auto isPresent() -> bool; 43 | 44 | // name of the device to detect, e.g. 'cable0' 45 | // (taken from EM config) 46 | const std::string deviceName; 47 | 48 | // maps the name of the gpio to its polarity 49 | std::map gpioPolarity; 50 | 51 | private: 52 | // reference to the map in presence manager 53 | const std::unordered_map& gpioState; 54 | 55 | sdbusplus::async::context& ctx; 56 | 57 | const std::vector parentInventoryCompatible; 58 | 59 | auto updateDbusInterfaces() -> void; 60 | 61 | // property added when the hw is detected 62 | std::unique_ptr detectedIface = nullptr; 63 | }; 64 | 65 | } // namespace gpio_presence 66 | -------------------------------------------------------------------------------- /configurations/ibm/nisqually.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "I2CAddress": 104, 5 | "I2CBus": 3, 6 | "Name": "Power Supply Slot 0", 7 | "NamedPresenceGpio": "presence-ps0", 8 | "Type": "IBMCFFPSConnector" 9 | }, 10 | { 11 | "I2CAddress": 105, 12 | "I2CBus": 3, 13 | "Name": "Power Supply Slot 1", 14 | "NamedPresenceGpio": "presence-ps1", 15 | "Type": "IBMCFFPSConnector" 16 | }, 17 | { 18 | "I2CAddress": 106, 19 | "I2CBus": 3, 20 | "Name": "Power Supply Slot 2", 21 | "NamedPresenceGpio": "presence-ps2", 22 | "Type": "IBMCFFPSConnector" 23 | }, 24 | { 25 | "I2CAddress": 107, 26 | "I2CBus": 3, 27 | "Name": "Power Supply Slot 3", 28 | "NamedPresenceGpio": "presence-ps3", 29 | "Type": "IBMCFFPSConnector" 30 | }, 31 | { 32 | "Address": "0x48", 33 | "Bus": 8, 34 | "Name": "PCIE 0 Temp", 35 | "PollRate": 1, 36 | "Type": "TMP75" 37 | }, 38 | { 39 | "Address": "0x4A", 40 | "Bus": 8, 41 | "Name": "PCIE 1 Temp", 42 | "PollRate": 1, 43 | "Type": "TMP75" 44 | }, 45 | { 46 | "Address": "0x11", 47 | "Bus": 8, 48 | "Name": "UCD90320 Power Sequencer", 49 | "Type": "UCD90320" 50 | } 51 | ], 52 | "Name": "Nisqually Backplane", 53 | "Probe": [ 54 | "com.ibm.ipzvpd.VINI({'CC': [50, 69, 50, 68]})", 55 | "OR", 56 | "com.ibm.ipzvpd.VINI({'CC': [50, 69, 50, 70]})", 57 | "OR", 58 | "com.ibm.ipzvpd.VINI({'CC': [50, 69, 52, 48]})", 59 | "OR", 60 | "com.ibm.ipzvpd.VINI({'CC': [50, 69, 52, 49]})", 61 | "OR", 62 | "com.ibm.ipzvpd.VINI({'CC': [50, 69, 52, 50]})", 63 | "OR", 64 | "com.ibm.ipzvpd.VINI({'CC': [50, 69, 52, 51]})" 65 | ], 66 | "Type": "Board" 67 | } 68 | -------------------------------------------------------------------------------- /configurations/meta/ventura/ventura_valve.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [ 4 | { 5 | "CoolantLoopName": "CoolantLoop_1", 6 | "Name": "$Name", 7 | "OpenControlPinName": "WATER_VALVE_CLOSED_N", 8 | "OpenControlValue": false, 9 | "OpenPinName": "SUPPLY_CNTL_FB_D_R", 10 | "OpenPolarity": "High", 11 | "Type": "GPIOValve" 12 | } 13 | ], 14 | "Name": "$Name", 15 | "Probe": [ 16 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': '^SupplyValve_1$'})" 17 | ], 18 | "Type": "Valve", 19 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 20 | "Manufacturer": "Unknown", 21 | "Model": "Unknown", 22 | "PartNumber": "Unknown", 23 | "SerialNumber": "Unknown", 24 | "SparePartNumber": "Unknown" 25 | }, 26 | "xyz.openbmc_project.Inventory.Item.Valve": { 27 | "Direction": "xyz.openbmc_project.Inventory.Item.Valve.Direction.Supply" 28 | } 29 | }, 30 | { 31 | "Exposes": [ 32 | { 33 | "CoolantLoopName": "CoolantLoop_1", 34 | "Name": "$Name", 35 | "OpenControlPinName": "WATER_VALVE_CLOSED_N", 36 | "OpenControlValue": false, 37 | "OpenPinName": "RETURN_CNTL_FB_D_R", 38 | "OpenPolarity": "High", 39 | "Type": "GPIOValve" 40 | } 41 | ], 42 | "Name": "$Name", 43 | "Probe": [ 44 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': '^ReturnValve_1$'})" 45 | ], 46 | "Type": "Valve", 47 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 48 | "Manufacturer": "Unknown", 49 | "Model": "Unknown", 50 | "PartNumber": "Unknown", 51 | "SerialNumber": "Unknown", 52 | "SparePartNumber": "Unknown" 53 | }, 54 | "xyz.openbmc_project.Inventory.Item.Valve": { 55 | "Direction": "xyz.openbmc_project.Inventory.Item.Valve.Direction.Return" 56 | } 57 | } 58 | ] 59 | -------------------------------------------------------------------------------- /configurations/VENDORS.md: -------------------------------------------------------------------------------- 1 | # Vendors 2 | 3 | To simplify the organization and ownership of configuration files, they can be 4 | organized into vendor-specific subdirectories. This begs the question "what is a 5 | vendor"? 6 | 7 | In some cases a company might design a component (such as a network card), 8 | manufacture said component, and package it into an elegant cardboard box with 9 | their logo, which is sold on retail store shelves to customers; this company is 10 | clearly "the vendor" of said component. Where the situation is less clear is 11 | when multiple companies are involved in the chain between design and end-user. 12 | 13 | For purposes of this repository, the following prioritized guidelines are used 14 | for identifying the vendor: 15 | 16 | 1. A company which primarily initiates and oversees the design, manufacture and 17 | sale of a component is always the vendor. "Sale" does not require retail but 18 | can include components which are exclusively sold to other enterprises for 19 | inclusion in their products. This covers typical "components" such as network 20 | cards, processors, and mainboards. 21 | 22 | 2. When a company is assembling a group of components into a single product, 23 | which they exclusively label and sell, such as a server chassis, they are the 24 | vendor for the assembled product and any sub-components which are exclusively 25 | designed for and used by their assembled product(s). Sub-components that are 26 | procured from others and may be sold by others for use in other products 27 | should be covered by guideline (1). 28 | 29 | 3. When one company primarily oversees the design but other companies 30 | manufacture and/or sell the component or system, such as [OCP][OCP] designs, 31 | the company that primarily oversaw the design of the component would be the 32 | vendor. 33 | 34 | These guidelines are not meant to be exhaustive rules to cover all scenarios and 35 | contractual arrangements, but simply direction pointing for how the repository 36 | is intended to be organized. The overriding principle should be: if someone 37 | claims to be the vendor of a device, they probably are, unless there is strong 38 | evidence they are not. 39 | 40 | [OCP]: https://www.opencompute.org/ 41 | -------------------------------------------------------------------------------- /src/entity_manager/power_status_monitor.cpp: -------------------------------------------------------------------------------- 1 | #include "power_status_monitor.hpp" 2 | 3 | #include "utils.hpp" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | namespace power 12 | { 13 | 14 | using HostState = sdbusplus::common::xyz::openbmc_project::state::Host; 15 | 16 | const static std::string path = 17 | std::format("{}/{}{}", HostState::namespace_path::value, 18 | HostState::namespace_path::host, 0); 19 | const static constexpr char* property = "CurrentHostState"; 20 | 21 | PowerStatusMonitor::PowerStatusMonitor(sdbusplus::asio::connection& conn) : 22 | 23 | powerMatch(static_cast(conn), 24 | "type='signal',interface='" + 25 | std::string(em_utils::properties::interface) + "',path='" + 26 | std::string(power::path) + "',arg0='" + 27 | std::string(HostState::interface) + "'", 28 | std::bind_front(&PowerStatusMonitor::handlePowerMatch, this)) 29 | 30 | { 31 | getInitialPowerStatus(conn); 32 | } 33 | 34 | bool PowerStatusMonitor::isPowerOn() const 35 | { 36 | return powerStatusOn; 37 | } 38 | 39 | void PowerStatusMonitor::handlePowerMatch(sdbusplus::message_t& message) 40 | { 41 | lg2::debug("power match triggered"); 42 | 43 | std::string objectName; 44 | std::flat_map> values; 45 | message.read(objectName, values); 46 | auto findState = values.find(power::property); 47 | if (findState != values.end()) 48 | { 49 | powerStatusOn = 50 | std::get(findState->second).ends_with("Running"); 51 | } 52 | } 53 | 54 | void PowerStatusMonitor::getInitialPowerStatus( 55 | sdbusplus::asio::connection& conn) 56 | { 57 | lg2::debug("querying initial power state"); 58 | 59 | conn.async_method_call( 60 | [this](boost::system::error_code ec, 61 | const std::variant& state) { 62 | if (ec) 63 | { 64 | return; 65 | } 66 | powerStatusOn = std::get(state).ends_with("Running"); 67 | }, 68 | HostState::interface, power::path, em_utils::properties::interface, 69 | em_utils::properties::get, HostState::interface, power::property); 70 | } 71 | 72 | } // namespace power 73 | -------------------------------------------------------------------------------- /configurations/meta/catalina/catalina_fio.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Catalina FIO FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x4b", 11 | "Bus": 23, 12 | "Name": "FIOBOARD_INLET_TEMP_C", 13 | "Thresholds": [ 14 | { 15 | "Direction": "greater than", 16 | "Hysteresis": 0.9, 17 | "Name": "upper critical", 18 | "Severity": 1, 19 | "Value": 45 20 | }, 21 | { 22 | "Direction": "less than", 23 | "Hysteresis": 0.1, 24 | "Name": "lower critical", 25 | "Severity": 1, 26 | "Value": 5 27 | } 28 | ], 29 | "Type": "TMP75" 30 | }, 31 | { 32 | "Address": "0x4f", 33 | "Bus": 23, 34 | "Name": "FIOBOARD_REMOTE_INLET_TEMP_C", 35 | "Thresholds": [ 36 | { 37 | "Direction": "greater than", 38 | "Hysteresis": 0.9, 39 | "Name": "upper critical", 40 | "Severity": 1, 41 | "Value": 45 42 | }, 43 | { 44 | "Direction": "less than", 45 | "Hysteresis": 0.1, 46 | "Name": "lower critical", 47 | "Severity": 1, 48 | "Value": 5 49 | } 50 | ], 51 | "Type": "TMP75" 52 | } 53 | ], 54 | "Name": "Catalina FIO", 55 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Catalina FIO '})", 56 | "Type": "Board", 57 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 58 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 59 | "Manufacturer": "$BOARD_MANUFACTURER", 60 | "Model": "$BOARD_PRODUCT_NAME", 61 | "PartNumber": "$BOARD_PART_NUMBER", 62 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 63 | "SparePartNumber": "$BOARD_INFO_AM1" 64 | }, 65 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 66 | "AssetTag": "$PRODUCT_ASSET_TAG" 67 | }, 68 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 69 | "Version": "$PRODUCT_VERSION" 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/fru_device/fru_reader.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2022 Equinix, Inc. 3 | 4 | #include "fru_reader.hpp" 5 | 6 | #include 7 | 8 | ssize_t FRUReader::read(off_t start, size_t len, uint8_t* outbuf) 9 | { 10 | size_t done = 0; 11 | size_t remaining = len; 12 | size_t cursor = start; 13 | while (done < len) 14 | { 15 | if (eof.has_value() && cursor >= eof.value()) 16 | { 17 | break; 18 | } 19 | 20 | const uint8_t* blkData = nullptr; 21 | size_t available = 0; 22 | size_t blk = cursor / cacheBlockSize; 23 | size_t blkOffset = cursor % cacheBlockSize; 24 | auto findBlk = cache.find(blk); 25 | if (findBlk == cache.end()) 26 | { 27 | // miss, populate cache 28 | uint8_t* newData = cache[blk].data(); 29 | int64_t ret = 30 | readFunc(blk * cacheBlockSize, cacheBlockSize, newData); 31 | 32 | // if we've reached the end of the eeprom, record its size 33 | if (ret >= 0 && static_cast(ret) < cacheBlockSize) 34 | { 35 | eof = (blk * cacheBlockSize) + ret; 36 | } 37 | 38 | if (ret <= 0) 39 | { 40 | // don't leave empty blocks in the cache 41 | cache.erase(blk); 42 | return done != 0U ? done : ret; 43 | } 44 | 45 | blkData = newData; 46 | available = ret; 47 | } 48 | else 49 | { 50 | // hit, use cached data 51 | blkData = findBlk->second.data(); 52 | 53 | // if the hit is to the block containing the (previously 54 | // discovered on the miss that populated it) end of the eeprom, 55 | // don't copy spurious bytes past the end 56 | if (eof.has_value() && (eof.value() / cacheBlockSize == blk)) 57 | { 58 | available = eof.value() % cacheBlockSize; 59 | } 60 | else 61 | { 62 | available = cacheBlockSize; 63 | } 64 | } 65 | 66 | size_t toCopy = (blkOffset >= available) 67 | ? 0 68 | : std::min(available - blkOffset, remaining); 69 | 70 | // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic) 71 | memcpy(outbuf + done, blkData + blkOffset, toCopy); 72 | cursor += toCopy; 73 | done += toCopy; 74 | remaining -= toCopy; 75 | } 76 | 77 | return done; 78 | } 79 | -------------------------------------------------------------------------------- /schemas/stepwise.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "Stepwise": { 5 | "additionalProperties": false, 6 | "type": "object", 7 | "properties": { 8 | "Class": { 9 | "type": "string" 10 | }, 11 | "Inputs": { 12 | "type": "array", 13 | "items": { 14 | "type": "string" 15 | } 16 | }, 17 | "InputUnavailableAsFailed": { 18 | "type": "boolean" 19 | }, 20 | "MissingIsAcceptable": { 21 | "type": "array", 22 | "items": { 23 | "type": "string" 24 | } 25 | }, 26 | "Name": { 27 | "type": "string" 28 | }, 29 | "NegativeHysteresis": { 30 | "type": "number" 31 | }, 32 | "Output": { 33 | "type": "array", 34 | "items": { 35 | "type": "number" 36 | } 37 | }, 38 | "PositiveHysteresis": { 39 | "type": "number" 40 | }, 41 | "Profiles": { 42 | "type": "array", 43 | "items": { 44 | "type": "string" 45 | } 46 | }, 47 | "Reading": { 48 | "type": "array", 49 | "items": { 50 | "type": "number" 51 | } 52 | }, 53 | "TempToMargin": { 54 | "type": "array", 55 | "items": { 56 | "type": "number" 57 | } 58 | }, 59 | "Type": { 60 | "const": "Stepwise" 61 | }, 62 | "Zones": { 63 | "type": "array", 64 | "items": { 65 | "type": "string" 66 | } 67 | } 68 | }, 69 | "required": [ 70 | "Class", 71 | "Inputs", 72 | "Name", 73 | "NegativeHysteresis", 74 | "Output", 75 | "PositiveHysteresis", 76 | "Reading", 77 | "Type", 78 | "Zones" 79 | ] 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/entity_manager/log_device_inventory.cpp: -------------------------------------------------------------------------------- 1 | #include "log_device_inventory.hpp" 2 | 3 | #include "../utils.hpp" 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | static void setStringIfFound(std::string& value, const std::string& key, 14 | const nlohmann::json& record, bool dump = false) 15 | { 16 | const nlohmann::json::const_iterator find = record.find(key); 17 | 18 | if (find == record.end()) 19 | { 20 | return; 21 | } 22 | 23 | const std::string* foundValue = find->get_ptr(); 24 | if (foundValue != nullptr) 25 | { 26 | value = *foundValue; 27 | } 28 | else if (dump) 29 | { 30 | value = find->dump(); 31 | } 32 | } 33 | 34 | InvAddRemoveInfo queryInvInfo(const nlohmann::json& record) 35 | { 36 | InvAddRemoveInfo ret; 37 | 38 | setStringIfFound(ret.type, "Type", record); 39 | setStringIfFound(ret.name, "Name", record); 40 | 41 | const nlohmann::json::const_iterator findAsset = record.find( 42 | sdbusplus::common::xyz::openbmc_project::inventory::decorator::Asset:: 43 | interface); 44 | 45 | if (findAsset != record.end()) 46 | { 47 | setStringIfFound(ret.model, "Model", *findAsset); 48 | setStringIfFound(ret.sn, "SerialNumber", *findAsset, true); 49 | } 50 | 51 | return ret; 52 | } 53 | 54 | void logDeviceAdded(const nlohmann::json& record) 55 | { 56 | if (!EM_CACHE_CONFIGURATION) 57 | { 58 | return; 59 | } 60 | if (!deviceHasLogging(record)) 61 | { 62 | return; 63 | } 64 | 65 | const InvAddRemoveInfo info = queryInvInfo(record); 66 | 67 | sd_journal_send( 68 | "MESSAGE=Inventory Added: %s", info.name.c_str(), "PRIORITY=%i", 69 | LOG_INFO, "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.InventoryAdded", 70 | "REDFISH_MESSAGE_ARGS=%s,%s,%s", info.model.c_str(), info.type.c_str(), 71 | info.sn.c_str(), "NAME=%s", info.name.c_str(), NULL); 72 | } 73 | 74 | void logDeviceRemoved(const nlohmann::json& record) 75 | { 76 | if (!deviceHasLogging(record)) 77 | { 78 | return; 79 | } 80 | 81 | const InvAddRemoveInfo info = queryInvInfo(record); 82 | 83 | sd_journal_send( 84 | "MESSAGE=Inventory Removed: %s", info.name.c_str(), "PRIORITY=%i", 85 | LOG_INFO, "REDFISH_MESSAGE_ID=%s", "OpenBMC.0.1.InventoryRemoved", 86 | "REDFISH_MESSAGE_ARGS=%s,%s,%s", info.model.c_str(), info.type.c_str(), 87 | info.sn.c_str(), "NAME=%s", info.name.c_str(), NULL); 88 | } 89 | -------------------------------------------------------------------------------- /configurations/intel/bnp_baseboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Direction": "Input", 5 | "Index": 32, 6 | "Name": "Reset Button", 7 | "Polarity": "Low", 8 | "Type": "Gpio" 9 | }, 10 | { 11 | "Direction": "Out", 12 | "Index": 33, 13 | "Name": "Reset Out", 14 | "Polarity": "Low", 15 | "Type": "Gpio" 16 | }, 17 | { 18 | "Direction": "Both", 19 | "Index": 34, 20 | "Name": "Power Button", 21 | "Polarity": "Low", 22 | "Type": "Gpio" 23 | }, 24 | { 25 | "Direction": "Both", 26 | "Index": 35, 27 | "Name": "Power Up", 28 | "Polarity": "Low", 29 | "Type": "Gpio" 30 | }, 31 | { 32 | "Direction": "Input", 33 | "Index": 219, 34 | "Name": "Power Good", 35 | "Polarity": "High", 36 | "Type": "Gpio" 37 | }, 38 | { 39 | "Direction": "Input", 40 | "Index": 59, 41 | "Name": "Node ID GPIO 0", 42 | "Polarity": "High", 43 | "Type": "Gpio" 44 | }, 45 | { 46 | "Direction": "Input", 47 | "Index": 60, 48 | "Name": "Node ID GPIO 1", 49 | "Polarity": "High", 50 | "Type": "Gpio" 51 | }, 52 | { 53 | "Direction": "Input", 54 | "Index": 61, 55 | "Name": "Node ID GPIO 2", 56 | "Polarity": "High", 57 | "Type": "Gpio" 58 | }, 59 | { 60 | "Direction": "Input", 61 | "Index": 62, 62 | "Name": "Node ID GPIO 3", 63 | "Polarity": "High", 64 | "Type": "Gpio" 65 | }, 66 | { 67 | "GpioPins": [ 68 | 59, 69 | 60, 70 | 61, 71 | 62 72 | ], 73 | "Name": "Multi Node ID", 74 | "Type": "MultiNodeID" 75 | }, 76 | { 77 | "Address": "0x18", 78 | "Bus": 1, 79 | "Name": "Multi Node Presence Detector", 80 | "Type": "MultiNodePresence" 81 | } 82 | ], 83 | "Name": "BNP Baseboard", 84 | "Probe": "xyz.openbmc_project.FruDevice({'PRODUCT_PRODUCT_NAME': '.*BNP'})", 85 | "Type": "Board", 86 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 87 | "Manufacturer": "$PRODUCT_MANUFACTURER", 88 | "Model": "$PRODUCT_PRODUCT_NAME", 89 | "PartNumber": "$PRODUCT_PART_NUMBER", 90 | "SerialNumber": "$PRODUCT_SERIAL_NUMBER" 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /configurations/meta/minerva/minerva_cmm_misc_boards.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [], 4 | "Name": "$Name", 5 | "Probe": [ 6 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': 'CableCartridgeTop'})" 7 | ], 8 | "Type": "Board", 9 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 10 | "Manufacturer": "Unknown", 11 | "Model": "Unknown", 12 | "PartNumber": "Unknown", 13 | "SerialNumber": "Unknown", 14 | "SparePartNumber": "07-100127" 15 | } 16 | }, 17 | { 18 | "Exposes": [], 19 | "Name": "$Name", 20 | "Probe": [ 21 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': 'CableCartridgeBottom'})" 22 | ], 23 | "Type": "Board", 24 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 25 | "Manufacturer": "Unknown", 26 | "Model": "Unknown", 27 | "PartNumber": "Unknown", 28 | "SerialNumber": "Unknown", 29 | "SparePartNumber": "07-100126" 30 | } 31 | }, 32 | { 33 | "Exposes": [], 34 | "Name": "$Name", 35 | "Probe": [ 36 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': 'BCBCableTop'})" 37 | ], 38 | "Type": "Cable", 39 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 40 | "Manufacturer": "Unknown", 41 | "Model": "Unknown", 42 | "PartNumber": "Unknown", 43 | "SerialNumber": "Unknown", 44 | "SparePartNumber": "07-100093" 45 | } 46 | }, 47 | { 48 | "Exposes": [], 49 | "Name": "$Name", 50 | "Probe": [ 51 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': 'BCBCableBottom'})" 52 | ], 53 | "Type": "Cable", 54 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 55 | "Manufacturer": "Unknown", 56 | "Model": "Unknown", 57 | "PartNumber": "Unknown", 58 | "SerialNumber": "Unknown", 59 | "SparePartNumber": "07-100157" 60 | } 61 | }, 62 | { 63 | "Exposes": [], 64 | "Name": "$Name", 65 | "Probe": [ 66 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': 'RpuLink'})", 67 | "OR", 68 | "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': 'SpareRpuLink'})" 69 | ], 70 | "Type": "Cable", 71 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 72 | "Manufacturer": "Unknown", 73 | "Model": "Unknown", 74 | "PartNumber": "Unknown", 75 | "SerialNumber": "Unknown", 76 | "SparePartNumber": "Unknown" 77 | } 78 | } 79 | ] 80 | -------------------------------------------------------------------------------- /test/meson.build: -------------------------------------------------------------------------------- 1 | test_boost_args = boost_args + ['-DBOOST_ASIO_DISABLE_THREADS'] + [ 2 | '-DENABLE_FRU_UPDATE_PROPERTY=1', 3 | ] 4 | gtest = dependency('gtest', main: true, disabler: true, required: false) 5 | gmock = dependency('gmock', disabler: true, required: false) 6 | 7 | if not (gtest.found() and gmock.found()) 8 | cmake = import('cmake') 9 | gtest_subproject = cmake.subproject('gtest') 10 | cm_gtest = gtest_subproject.dependency('gtest') 11 | cm_gtest_main = gtest_subproject.dependency('gtest_main') 12 | gtest = declare_dependency(dependencies: [cm_gtest, cm_gtest_main, threads]) 13 | gmock = gtest_subproject.dependency('gmock') 14 | 15 | endif 16 | 17 | test_include_dir = include_directories('../src') 18 | 19 | subdir('entity_manager') 20 | 21 | test( 22 | 'test_fru_utils', 23 | executable( 24 | 'test_fru_utils', 25 | 'test_fru-utils.cpp', 26 | 'test_gzip-utils.cpp', 27 | '../src/fru_device/fru_utils.cpp', 28 | '../src/fru_device/fru_reader.cpp', 29 | '../src/fru_device/gzip_utils.cpp', 30 | cpp_args: test_boost_args, 31 | dependencies: [ 32 | boost, 33 | gmock, 34 | gtest, 35 | libxml2_dep, 36 | phosphor_logging_dep, 37 | sdbusplus, 38 | zlib_dep, 39 | ], 40 | include_directories: test_include_dir, 41 | ), 42 | ) 43 | 44 | test( 45 | 'test_topology', 46 | executable( 47 | 'test_topology', 48 | 'test_topology.cpp', 49 | '../src/entity_manager/topology.cpp', 50 | cpp_args: test_boost_args, 51 | dependencies: [gtest, gmock, nlohmann_json_dep, phosphor_logging_dep], 52 | include_directories: test_include_dir, 53 | ), 54 | ) 55 | 56 | test( 57 | 'test_gpio_presence', 58 | executable( 59 | 'test_gpio_presence', 60 | 'test_gpio_presence.cpp', 61 | cpp_args: test_boost_args, 62 | include_directories: test_include_dir, 63 | dependencies: [boost, gtest, gmock, phosphor_logging_dep, libgpio_dep], 64 | link_with: gpio_presence_lib, 65 | ), 66 | ) 67 | 68 | test( 69 | 'test_utils', 70 | executable( 71 | 'test_utils', 72 | 'test_utils.cpp', 73 | '../src/utils.cpp', 74 | include_directories: test_include_dir, 75 | dependencies: [gtest, phosphor_logging_dep, sdbusplus], 76 | ), 77 | ) 78 | 79 | test( 80 | 'test_gpio_presence_state', 81 | executable( 82 | 'test_gpio_presence_state', 83 | 'test_gpio_presence_state.cpp', 84 | cpp_args: test_boost_args, 85 | include_directories: test_include_dir, 86 | dependencies: [boost, gtest, gmock, phosphor_logging_dep, libgpio_dep], 87 | link_with: gpio_presence_lib, 88 | ), 89 | ) 90 | -------------------------------------------------------------------------------- /configurations/ampere/mtjefferson_bp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Jefferson BP_EEPROM$ADDRESS / 82 + 1", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "$ADDRESS % 80 + 24", 11 | "Bus": "$bus", 12 | "Name": "FrontBPTemp$ADDRESS / 82 + 1", 13 | "Type": "JC42" 14 | }, 15 | { 16 | "Address": "0x6a", 17 | "Bus": "$ADDRESS / 82 * 8 + 48 + 0", 18 | "Name": "nvme$ADDRESS / 82 * 8 + 0", 19 | "Type": "NVME1000" 20 | }, 21 | { 22 | "Address": "0x6a", 23 | "Bus": "$ADDRESS / 82 * 8 + 48 + 1", 24 | "Name": "nvme$ADDRESS / 82 * 8 + 1", 25 | "Type": "NVME1000" 26 | }, 27 | { 28 | "Address": "0x6a", 29 | "Bus": "$ADDRESS / 82 * 8 + 48 + 2", 30 | "Name": "nvme$ADDRESS / 82 * 8 + 2", 31 | "Type": "NVME1000" 32 | }, 33 | { 34 | "Address": "0x6a", 35 | "Bus": "$ADDRESS / 82 * 8 + 48 + 3", 36 | "Name": "nvme$ADDRESS / 82 * 8 + 3", 37 | "Type": "NVME1000" 38 | }, 39 | { 40 | "Address": "0x6a", 41 | "Bus": "$ADDRESS / 82 * 8 + 48 + 4", 42 | "Name": "nvme$ADDRESS / 82 * 8 + 4", 43 | "Type": "NVME1000" 44 | }, 45 | { 46 | "Address": "0x6a", 47 | "Bus": "$ADDRESS / 82 * 8 + 48 + 5", 48 | "Name": "nvme$ADDRESS / 82 * 8 + 5", 49 | "Type": "NVME1000" 50 | }, 51 | { 52 | "Address": "0x6a", 53 | "Bus": "$ADDRESS / 82 * 8 + 48 + 6", 54 | "Name": "nvme$ADDRESS / 82 * 8 + 6", 55 | "Type": "NVME1000" 56 | }, 57 | { 58 | "Address": "0x6a", 59 | "Bus": "$ADDRESS / 82 * 8 + 48 + 7", 60 | "Name": "nvme$ADDRESS / 82 * 8 + 7", 61 | "Type": "NVME1000" 62 | } 63 | ], 64 | "Name": "Jefferson BP_$ADDRESS / 82 + 1", 65 | "Probe": [ 66 | "xyz.openbmc_project.FruDevice({'BOARD_PART_NUMBER': 'CBP2980'})", 67 | "AND", 68 | "FOUND('Mt.Jefferson_Motherboard')" 69 | ], 70 | "Type": "Board", 71 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 72 | "Manufacturer": "$BOARD_MANUFACTURER", 73 | "Model": "$BOARD_PRODUCT_NAME", 74 | "PartNumber": "$BOARD_PART_NUMBER", 75 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 76 | }, 77 | "xyz.openbmc_project.Inventory.Decorator.Replaceable": { 78 | "FieldReplaceable": false, 79 | "HotPluggable": false 80 | }, 81 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 82 | "Version": "$BOARD_INFO_AM1" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /configurations/ampere/mtjefferson_bmc.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "EntityId": 19, 5 | "EntityInstance": 45, 6 | "Index": 2, 7 | "MaxValue": 4.4, 8 | "MinValue": 0, 9 | "Name": "3V3_SB_BMC", 10 | "PollRate": 10, 11 | "ScaleFactor": 0.5, 12 | "Thresholds": [ 13 | { 14 | "Direction": "greater than", 15 | "Name": "upper critical", 16 | "Severity": 1, 17 | "Value": 3.944 18 | }, 19 | { 20 | "Direction": "greater than", 21 | "Name": "upper non critical", 22 | "Severity": 0, 23 | "Value": 3.789 24 | }, 25 | { 26 | "Direction": "less than", 27 | "Name": "lower critical", 28 | "Severity": 1, 29 | "Value": 2.647 30 | }, 31 | { 32 | "Direction": "less than", 33 | "Name": "lower non critical", 34 | "Severity": 0, 35 | "Value": 2.82 36 | } 37 | ], 38 | "Type": "ADC" 39 | }, 40 | { 41 | "Address": "0x48", 42 | "Bus": 14, 43 | "EntityId": 7, 44 | "EntityInstance": 1, 45 | "MaxValue": 127, 46 | "MinValue": 0, 47 | "Name": "AST2600CPUTemp", 48 | "Thresholds": [ 49 | { 50 | "Direction": "less than", 51 | "Name": "lower critical", 52 | "Severity": 1, 53 | "Value": 0.0 54 | }, 55 | { 56 | "Direction": "less than", 57 | "Name": "lower non critical", 58 | "Severity": 0, 59 | "Value": 5.489 60 | } 61 | ], 62 | "Type": "TMP75" 63 | } 64 | ], 65 | "Name": "Mt.Jefferson_BMC", 66 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Jefferson DC-SCM 2.0'})", 67 | "Type": "Board", 68 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 69 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 70 | "Manufacturer": "$BOARD_MANUFACTURER", 71 | "Model": "$BOARD_PRODUCT_NAME", 72 | "PartNumber": "$BOARD_PART_NUMBER", 73 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 74 | }, 75 | "xyz.openbmc_project.Inventory.Decorator.Replaceable": { 76 | "FieldReplaceable": false, 77 | "HotPluggable": false 78 | }, 79 | "xyz.openbmc_project.Inventory.Item.Bmc": {}, 80 | "xyz.openbmc_project.Inventory.Item.NetworkInterface": { 81 | "MACAddress": "$BOARD_INFO_AM1" 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/gpio-presence/README.md: -------------------------------------------------------------------------------- 1 | # gpio-presence-sensor 2 | 3 | This program was originally implemented following the [design][]. 4 | 5 | ## Configuration 6 | 7 | See the full [design][] for more details. 8 | 9 | Example EM config fragments: 10 | 11 | ```json 12 | { 13 | Exposes: 14 | [ 15 | { 16 | "Name": "com.meta.Hardware.Yv4.cable0", 17 | "PresencePinNames": ["presence-cable0"], 18 | "PresencePinValues": [1], 19 | "Type": "GPIODeviceDetect" 20 | }, 21 | { 22 | "Name": "com.meta.Hardware.Yv4.ComputeCard", 23 | "PresencePinNames": ["presence-slot0a", "presence-slot0b"], 24 | "PresencePinValues": [0, 1], 25 | "Type": "GPIODeviceDetect" 26 | }, 27 | { 28 | "Name": "com.meta.Hardware.Yv4.SidecarExpansion", 29 | "PresencePinNames": ["presence-slot0a", "presence-slot0b"], 30 | "PresencePinValues": [1, 0], 31 | "Type": "GPIODeviceDetect" 32 | }, 33 | { 34 | "Name": "com.meta.Hardware.Yv4.AirBlocker", 35 | "PresencePinNames": ["presence-slot0a", "presence-slot0b"], 36 | "PresencePinValues": [1, 1], 37 | "Type": "GPIODeviceDetect" 38 | }, 39 | { 40 | "Name": "com.meta.Hardware.Yv4.fanboard0", 41 | "PresencePinNames": ["presence-fanboard0"], 42 | "PresencePinValues": [0], 43 | "Type": "GPIODeviceDetect" 44 | }, 45 | ... 46 | ], 47 | ... 48 | "Name": "My Chassis", 49 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'MYBOARDPRODUCT*'})", 50 | "Type": "Board", 51 | } 52 | ``` 53 | 54 | The above configuration can then cause a Probe match in another configuration, 55 | like below: 56 | 57 | ```json 58 | { 59 | Exposes: 60 | [ 61 | { 62 | "Address": "0x28", 63 | "Bus": 5, 64 | "EntityId": 7, 65 | "EntityInstance": 0, 66 | "Name": "fanboard_air_inlet", 67 | "Name1": "fanboard_air_outlet", 68 | "Type": "NCT7802" 69 | }, 70 | ... 71 | ], 72 | ... 73 | "Name": "My Fan Board 0", 74 | "Probe": "xyz.openbmc_project.Inventory.Source.DevicePresence({'Name': 'com.meta.Hardware.Yv4.fanboard0'})", 75 | "Type": "Board", 76 | } 77 | ``` 78 | 79 | Notice the **xyz.openbmc_project.Inventory.Source.DevicePresence** interface. 80 | This is what the gpio-presence daemon exposes on dbus when the hardware is 81 | detected as present. The **Name** property in the Probe statement is the same as 82 | configured as in the first json fragment. 83 | 84 | ## Applications 85 | 86 | Applications include detecting fan boards, air blockers, cables and other simple 87 | components for which no standard / well-defined way exists to detect them 88 | otherwise. 89 | 90 | It can also be used as detection redundancy in case another detection mechanism 91 | like FRU eeprom is corrupted or unavailable. 92 | 93 | ## References 94 | 95 | [design]: 96 | https://github.com/openbmc/docs/blob/master/designs/inventory/gpio-based-hardware-inventory.md 97 | -------------------------------------------------------------------------------- /configurations/ampere/mtmitchell_bp.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "Mitchell BP_$BUS % 100 + 1", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x6a", 11 | "Bus": "$BUS % 100 * 8 + 48 + 0", 12 | "Name": "nvme$BUS % 100 * 8 + 0", 13 | "Type": "NVME1000" 14 | }, 15 | { 16 | "Address": "0x6a", 17 | "Bus": "$BUS % 100 * 8 + 48 + 1", 18 | "Name": "nvme$BUS % 100 * 8 + 1", 19 | "Type": "NVME1000" 20 | }, 21 | { 22 | "Address": "0x6a", 23 | "Bus": "$BUS % 100 * 8 + 48 + 2", 24 | "Name": "nvme$BUS % 100 * 8 + 2", 25 | "Type": "NVME1000" 26 | }, 27 | { 28 | "Address": "0x6a", 29 | "Bus": "$BUS % 100 * 8 + 48 + 3", 30 | "Name": "nvme$BUS % 100 * 8 + 3", 31 | "Type": "NVME1000" 32 | }, 33 | { 34 | "Address": "0x6a", 35 | "Bus": "$BUS % 100 * 8 + 48 + 4", 36 | "Name": "nvme$BUS % 100 * 8 + 4", 37 | "Type": "NVME1000" 38 | }, 39 | { 40 | "Address": "0x6a", 41 | "Bus": "$BUS % 100 * 8 + 48 + 5", 42 | "Name": "nvme$BUS % 100 * 8 + 5", 43 | "Type": "NVME1000" 44 | }, 45 | { 46 | "Address": "0x6a", 47 | "Bus": "$BUS % 100 * 8 + 48 + 6", 48 | "Name": "nvme$BUS % 100 * 8 + 6", 49 | "Type": "NVME1000" 50 | }, 51 | { 52 | "Address": "0x6a", 53 | "Bus": "$BUS % 100 * 8 + 48 + 7", 54 | "Name": "nvme$BUS % 100 * 8 + 7", 55 | "Type": "NVME1000" 56 | }, 57 | { 58 | "Address": "0x4C", 59 | "Bus": "$bus", 60 | "Name": "FrontBPTemp$BUS % 100 + 1", 61 | "Type": "TMP75" 62 | } 63 | ], 64 | "Name": "Mitchell BP_$BUS % 100", 65 | "Probe": [ 66 | "xyz.openbmc_project.FruDevice({'BOARD_PART_NUMBER': 'YZBB-01650-105'})", 67 | "OR", 68 | "xyz.openbmc_project.FruDevice({'BOARD_PART_NUMBER': 'YZBB-02856-102'})", 69 | "AND", 70 | "FOUND('Mt.Mitchell_Motherboard')" 71 | ], 72 | "Type": "Board", 73 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 74 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 75 | "Manufacturer": "$BOARD_MANUFACTURER", 76 | "Model": "$BOARD_PRODUCT_NAME", 77 | "PartNumber": "$BOARD_PART_NUMBER", 78 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 79 | }, 80 | "xyz.openbmc_project.Inventory.Decorator.Replaceable": { 81 | "FieldReplaceable": false, 82 | "HotPluggable": false 83 | }, 84 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 85 | "Version": "$BOARD_INFO_AM1" 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /configurations/meta/minerva/minerva_janga_smb.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [ 4 | { 5 | "Address": "$address", 6 | "Bus": "$bus", 7 | "Name": "Minerva Janga SMB $bus - 39 FRU", 8 | "Type": "EEPROM" 9 | } 10 | ], 11 | "Name": "Minerva Janga SMB $bus - 39", 12 | "Probe": [ 13 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Janga SMB', 'BUS': 40})", 14 | "OR", 15 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Janga SMB', 'BUS': 41})", 16 | "OR", 17 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Janga SMB', 'BUS': 42})", 18 | "AND", 19 | "FOUND('Minerva CMM')" 20 | ], 21 | "Type": "Board", 22 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 23 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 24 | "Manufacturer": "$BOARD_MANUFACTURER", 25 | "Model": "$BOARD_PRODUCT_NAME", 26 | "PartNumber": "$BOARD_PART_NUMBER", 27 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 28 | "SparePartNumber": "$BOARD_INFO_AM1" 29 | }, 30 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 31 | "AssetTag": "$PRODUCT_ASSET_TAG" 32 | }, 33 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 34 | "Version": "$PRODUCT_VERSION" 35 | } 36 | }, 37 | { 38 | "Exposes": [ 39 | { 40 | "Address": "$address", 41 | "Bus": "$bus", 42 | "Name": "Minerva Janga SMB $bus - 40 FRU", 43 | "Type": "EEPROM" 44 | } 45 | ], 46 | "Name": "Minerva Janga SMB $bus - 40", 47 | "Probe": [ 48 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Janga SMB', 'BUS': 44})", 49 | "OR", 50 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Janga SMB', 'BUS': 45})", 51 | "OR", 52 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Janga SMB', 'BUS': 46})", 53 | "AND", 54 | "FOUND('Minerva CMM')" 55 | ], 56 | "Type": "Board", 57 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 58 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 59 | "Manufacturer": "$BOARD_MANUFACTURER", 60 | "Model": "$BOARD_PRODUCT_NAME", 61 | "PartNumber": "$BOARD_PART_NUMBER", 62 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 63 | "SparePartNumber": "$BOARD_INFO_AM1" 64 | }, 65 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 66 | "AssetTag": "$PRODUCT_ASSET_TAG" 67 | }, 68 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 69 | "Version": "$PRODUCT_VERSION" 70 | } 71 | } 72 | ] 73 | -------------------------------------------------------------------------------- /configurations/meta/minerva/minerva_tahan_smb.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Exposes": [ 4 | { 5 | "Address": "$address", 6 | "Bus": "$bus", 7 | "Name": "Minerva Tahan SMB $bus - 39 FRU", 8 | "Type": "EEPROM" 9 | } 10 | ], 11 | "Name": "Minerva Tahan SMB $bus - 39", 12 | "Probe": [ 13 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Tahan SMB', 'BUS': 40})", 14 | "OR", 15 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Tahan SMB', 'BUS': 41})", 16 | "OR", 17 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Tahan SMB', 'BUS': 42})", 18 | "AND", 19 | "FOUND('Minerva CMM')" 20 | ], 21 | "Type": "Board", 22 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 23 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 24 | "Manufacturer": "$BOARD_MANUFACTURER", 25 | "Model": "$BOARD_PRODUCT_NAME", 26 | "PartNumber": "$BOARD_PART_NUMBER", 27 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 28 | "SparePartNumber": "$BOARD_INFO_AM1" 29 | }, 30 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 31 | "AssetTag": "$PRODUCT_ASSET_TAG" 32 | }, 33 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 34 | "Version": "$PRODUCT_VERSION" 35 | } 36 | }, 37 | { 38 | "Exposes": [ 39 | { 40 | "Address": "$address", 41 | "Bus": "$bus", 42 | "Name": "Minerva Tahan SMB $bus - 40 FRU", 43 | "Type": "EEPROM" 44 | } 45 | ], 46 | "Name": "Minerva Tahan SMB $bus - 40", 47 | "Probe": [ 48 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Tahan SMB', 'BUS': 44})", 49 | "OR", 50 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Tahan SMB', 'BUS': 45})", 51 | "OR", 52 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Minerva Tahan SMB', 'BUS': 46})", 53 | "AND", 54 | "FOUND('Minerva CMM')" 55 | ], 56 | "Type": "Board", 57 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 58 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 59 | "Manufacturer": "$BOARD_MANUFACTURER", 60 | "Model": "$BOARD_PRODUCT_NAME", 61 | "PartNumber": "$BOARD_PART_NUMBER", 62 | "SerialNumber": "$BOARD_SERIAL_NUMBER", 63 | "SparePartNumber": "$BOARD_INFO_AM1" 64 | }, 65 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 66 | "AssetTag": "$PRODUCT_ASSET_TAG" 67 | }, 68 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 69 | "Version": "$PRODUCT_VERSION" 70 | } 71 | } 72 | ] 73 | -------------------------------------------------------------------------------- /configurations/intel/axx2prthdhd.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "PCIe Retimer $index FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x74", 11 | "Bus": "$bus", 12 | "ChannelNames": [ 13 | "MiniSASHD1", 14 | "MiniSASHD2", 15 | "MiniSASHD3", 16 | "MiniSASHD4" 17 | ], 18 | "Name": "PCIe Retimer $index Mux", 19 | "Type": "PCA9544Mux" 20 | }, 21 | { 22 | "Class": "temp", 23 | "FFGainCoefficient": 0.0, 24 | "FFOffCoefficient": 0.0, 25 | "ICoefficient": -0.1, 26 | "ILimitMax": 100, 27 | "ILimitMin": 30, 28 | "Inputs": [ 29 | "PCIE Retimer Temp" 30 | ], 31 | "Name": "PCIE Retimer Temp", 32 | "OutLimitMax": 100, 33 | "OutLimitMin": 30, 34 | "Outputs": [], 35 | "PCoefficient": -0.15, 36 | "SetPoint": 45.0, 37 | "SlewNeg": -1, 38 | "SlewPos": 0.0, 39 | "Type": "Pid", 40 | "Zones": [ 41 | "Zone 1", 42 | "Zone 2", 43 | "Zone 3", 44 | "Zone 4", 45 | "Zone 5", 46 | "Zone 6" 47 | ] 48 | }, 49 | { 50 | "Address": "0x4F", 51 | "Bus": "$bus", 52 | "Name": "PCIE Retimer Temp", 53 | "Thresholds": [ 54 | { 55 | "Direction": "greater than", 56 | "Name": "upper critical", 57 | "Severity": 1, 58 | "Value": 115 59 | }, 60 | { 61 | "Direction": "greater than", 62 | "Name": "upper non critical", 63 | "Severity": 0, 64 | "Value": 110 65 | }, 66 | { 67 | "Direction": "less than", 68 | "Name": "lower non critical", 69 | "Severity": 0, 70 | "Value": 5 71 | }, 72 | { 73 | "Direction": "less than", 74 | "Name": "lower critical", 75 | "Severity": 1, 76 | "Value": 0 77 | } 78 | ], 79 | "Type": "TMP75" 80 | } 81 | ], 82 | "Name": "PCIE Retimer", 83 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'AXX2PRTHDHD'})", 84 | "Type": "Board", 85 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 86 | "Manufacturer": "$BOARD_MANUFACTURER", 87 | "Model": "$BOARD_PRODUCT_NAME", 88 | "PartNumber": "$BOARD_PART_NUMBER", 89 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /configurations/nvidia/cx8_mezzanine_module.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$address", 5 | "Bus": "$bus", 6 | "Name": "NVIDIA GB300 IO Board $bus - 29 % 11 FRU", 7 | "Type": "EEPROM" 8 | }, 9 | { 10 | "Address": "0x1f", 11 | "Bus": "$bus + 3", 12 | "Labels": [ 13 | "temp2" 14 | ], 15 | "Name": "IOB$bus - 29 % 11 NIC0_TEMP_C", 16 | "Name1": "IOB$bus - 29 % 11 NIC0_TEMP_C", 17 | "PowerState": "On", 18 | "Thresholds": [ 19 | { 20 | "Direction": "greater than", 21 | "Index": 2, 22 | "Name": "upper non recoverable", 23 | "Severity": 4, 24 | "Value": 115 25 | }, 26 | { 27 | "Direction": "greater than", 28 | "Index": 2, 29 | "Name": "upper critical", 30 | "Severity": 1, 31 | "Value": 97 32 | } 33 | ], 34 | "Type": "TMP421" 35 | }, 36 | { 37 | "Address": "0x1f", 38 | "Bus": "$bus + 6", 39 | "Labels": [ 40 | "temp2" 41 | ], 42 | "Name": "IOB$bus - 29 % 11 NIC1_TEMP_C", 43 | "Name1": "IOB$bus - 29 % 11 NIC1_TEMP_C", 44 | "PowerState": "On", 45 | "Thresholds": [ 46 | { 47 | "Direction": "greater than", 48 | "Index": 2, 49 | "Name": "upper non recoverable", 50 | "Severity": 4, 51 | "Value": 115 52 | }, 53 | { 54 | "Direction": "greater than", 55 | "Index": 2, 56 | "Name": "upper critical", 57 | "Severity": 1, 58 | "Value": 97 59 | } 60 | ], 61 | "Type": "TMP421" 62 | } 63 | ], 64 | "Name": "NVIDIA GB300 IO Board $bus - 29 % 11", 65 | "Probe": [ 66 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': '2x ConnectX-8 GB300 Mezz', 'BOARD_MANUFACTURER': '(Nvidia|NVIDIA)'})", 67 | "OR", 68 | "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'ConnectX-8 800GE 2P NIC', 'BOARD_MANUFACTURER': '(Nvidia|NVIDIA)'})" 69 | ], 70 | "Type": "Board", 71 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 72 | "BuildDate": "$BOARD_MANUFACTURE_DATE", 73 | "Manufacturer": "$BOARD_MANUFACTURER", 74 | "Model": "$BOARD_PRODUCT_NAME", 75 | "PartNumber": "$BOARD_PART_NUMBER", 76 | "SerialNumber": "$BOARD_SERIAL_NUMBER" 77 | }, 78 | "xyz.openbmc_project.Inventory.Decorator.AssetTag": { 79 | "AssetTag": "$PRODUCT_ASSET_TAG" 80 | }, 81 | "xyz.openbmc_project.Inventory.Decorator.Revision": { 82 | "Version": "$PRODUCT_VERSION" 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /schemas/virtual_sensor.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-07/schema#", 3 | "$defs": { 4 | "VirtualSensor": { 5 | "additionalProperties": false, 6 | "title": "phosphor-virtual-sensor configuration", 7 | "description": "The configuration used by the virtual-sensor daemon in the phosphor-virtual-sensor repository. Virtual sensors are xyz.openbmc_project.Sensor.Value D-Bus objects that have sensor values calculated from the D-Bus sensors listed here.", 8 | "type": "object", 9 | "properties": { 10 | "MaxValidInput": { 11 | "description": "Maximum valid value of an input sensor", 12 | "type": "number" 13 | }, 14 | "MaxValue": { 15 | "description": "Maximum sensor value", 16 | "$ref": "legacy.json#/$defs/Types/MaxValue" 17 | }, 18 | "MinValidInput": { 19 | "description": "Miniumum valid value of an input sensor", 20 | "type": "number" 21 | }, 22 | "MinValue": { 23 | "description": "Minimum sensor value", 24 | "$ref": "legacy.json#/$defs/Types/MinValue" 25 | }, 26 | "Name": { 27 | "type": "string" 28 | }, 29 | "PowerState": { 30 | "$ref": "legacy.json#/$defs/Types/PowerState" 31 | }, 32 | "EntityId": { 33 | "$ref": "legacy.json#/$defs/Types/EntityId" 34 | }, 35 | "EntityInstance": { 36 | "$ref": "legacy.json#/$defs/Types/EntityInstance" 37 | }, 38 | "Sensors": { 39 | "description": "Any DBus sensors whose values are used to determine the value of the virtual sensor.", 40 | "items": { 41 | "type": "string" 42 | }, 43 | "type": "array" 44 | }, 45 | "Thresholds": { 46 | "description": "Threshold values used to set and clear alarms", 47 | "$ref": "legacy.json#/$defs/Types/Thresholds" 48 | }, 49 | "Type": { 50 | "description": "The type of calculation this sensor uses.", 51 | "type": "string", 52 | "enum": [ 53 | "Average", 54 | "Maximum", 55 | "Minimum", 56 | "Sum", 57 | "ModifiedMedian" 58 | ] 59 | }, 60 | "Units": { 61 | "description": "The sensor type, as it shows up in the D-Bus object name.", 62 | "$ref": "legacy.json#/$defs/Types/Units" 63 | } 64 | }, 65 | "required": ["Name", "Sensors", "Type", "Units"] 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/entity_manager/expression.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // SPDX-FileCopyrightText: Copyright 2017 Intel Corporation, 2022 IBM Corp. 3 | 4 | #include "expression.hpp" 5 | 6 | #include 7 | 8 | #include 9 | 10 | namespace expression 11 | { 12 | std::optional parseOperation(std::string& op) 13 | { 14 | if (op == "+") 15 | { 16 | return Operation::addition; 17 | } 18 | if (op == "-") 19 | { 20 | return Operation::subtraction; 21 | } 22 | if (op == "*") 23 | { 24 | return Operation::multiplication; 25 | } 26 | if (op == R"(%)") 27 | { 28 | return Operation::modulo; 29 | } 30 | if (op == R"(/)") 31 | { 32 | return Operation::division; 33 | } 34 | 35 | return std::nullopt; 36 | } 37 | 38 | int evaluate(int a, Operation op, int b) 39 | { 40 | switch (op) 41 | { 42 | case Operation::addition: 43 | { 44 | return a + b; 45 | } 46 | case Operation::subtraction: 47 | { 48 | return a - b; 49 | } 50 | case Operation::multiplication: 51 | { 52 | return a * b; 53 | } 54 | case Operation::division: 55 | { 56 | if (b == 0) 57 | { 58 | throw std::runtime_error( 59 | "Math error: Attempted to divide by Zero\n"); 60 | } 61 | return a / b; 62 | } 63 | case Operation::modulo: 64 | { 65 | if (b == 0) 66 | { 67 | throw std::runtime_error( 68 | "Math error: Attempted to divide by Zero\n"); 69 | } 70 | return a % b; 71 | } 72 | 73 | default: 74 | throw std::invalid_argument("Unrecognised operation"); 75 | } 76 | } 77 | 78 | int evaluate(int substitute, std::vector::iterator curr, 79 | std::vector::iterator& end) 80 | { 81 | bool isOperator = true; 82 | std::optional next = Operation::addition; 83 | 84 | for (; curr != end; curr++) 85 | { 86 | if (isOperator) 87 | { 88 | next = expression::parseOperation(*curr); 89 | if (!next) 90 | { 91 | break; 92 | } 93 | } 94 | else 95 | { 96 | try 97 | { 98 | int constant = std::stoi(*curr); 99 | substitute = evaluate(substitute, *next, constant); 100 | } 101 | catch (const std::invalid_argument&) 102 | { 103 | lg2::error("Parameter not supported for templates {STR}", "STR", 104 | *curr); 105 | continue; 106 | } 107 | } 108 | isOperator = !isOperator; 109 | } 110 | 111 | end = curr; 112 | return substitute; 113 | } 114 | } // namespace expression 115 | -------------------------------------------------------------------------------- /docs/associations.md: -------------------------------------------------------------------------------- 1 | # Associations 2 | 3 | Entity Manager will create [associations][1] between entities in certain cases. 4 | The associations are needed as part of [2]. 5 | 6 | ## Configuring Associations between Entities 7 | 8 | The configuration record has `Name` field which is used to connect 2 ports for 9 | an association definition. 10 | 11 | If a matching element with `Name` is not found, that is not an error, it simply 12 | means the component we want to associate to is not present. 13 | 14 | The `PortType` describes which association to create. This is limited to 15 | pre-defined values. It also defines the direction of the association. 16 | 17 | ### containing Association 18 | 19 | Baseboard configuration. 20 | 21 | ```json 22 | { 23 | "Exposes": [ 24 | { 25 | "Name": "ContainingPort", 26 | "PortType": "contained_by" 27 | "Type": "Port" 28 | } 29 | ], 30 | "Name": "Tyan S8030 Baseboard" 31 | } 32 | ``` 33 | 34 | Chassis configuration. 35 | 36 | ```json 37 | { 38 | "Exposes": [ 39 | { 40 | "Name": "ContainingPort", 41 | "PortType": "containing" 42 | "Type": "Port" 43 | } 44 | ], 45 | "Name": "MBX Chassis" 46 | } 47 | ``` 48 | 49 | ### powering Association 50 | 51 | Baseboard configuration. This baseboard accepts one of several generic PSUs. 52 | 53 | ```json 54 | { 55 | "Exposes": [ 56 | { 57 | "Name": "GenericPowerPort", 58 | "PortType": "powered_by" 59 | "Type": "Port" 60 | } 61 | ], 62 | "Name": "Tyan S8030 Baseboard" 63 | } 64 | ``` 65 | 66 | PSU configuration. This example PSU is generic and can be used on different 67 | servers. 68 | 69 | ```json 70 | { 71 | "Exposes": [ 72 | { 73 | "Name": "GenericPowerPort", 74 | "PortType": "powering" 75 | "Type": "Port" 76 | } 77 | ], 78 | "Name": "Generic Supermicro PSU" 79 | } 80 | ``` 81 | 82 | ### probing Association 83 | 84 | The probing association matches an entry in the inventory to a probed path and 85 | depends on the 'Probe' statement of an EM configuration. If the 'Probe' 86 | statement matches properties to a path, this path is set as the probed path in 87 | the inventory item. 88 | 89 | For example 'yosemite4.json': 90 | 91 | ```json 92 | { 93 | "Exposes": [ 94 | ... 95 | ], 96 | "Name": "Yosemite 4 Management Board", 97 | "Probe": "xyz.openbmc_project.FruDevice({'BOARD_PRODUCT_NAME': 'Management Board wBMC', 'PRODUCT_PRODUCT_NAME': 'Yosemite V4'})", 98 | "Type": "Board", 99 | ... 100 | } 101 | ``` 102 | 103 | This configuration queries the object mapper to find an FruDevice interface with 104 | with the stated property values (BOARD_PRODUCT_NAME, PRODUCT_NAME). The path 105 | `/xyz/openbmc_project/FruDevice/Management_Board_wBMC` is found, which means EM 106 | loads the configuration. The found path is the probed path and is placed as the 107 | probing/probed_by association property in the inventory item of the 108 | configuration. 109 | 110 | [1]: 111 | https://github.com/openbmc/docs/blob/master/architecture/object-mapper.md#associations 112 | [2]: https://github.com/openbmc/docs/blob/master/designs/physical-topology.md 113 | -------------------------------------------------------------------------------- /configurations/meta/ventura/delta_reservoir_pump_unit.json: -------------------------------------------------------------------------------- 1 | { 2 | "Exposes": [ 3 | { 4 | "Address": "$Address", 5 | "BaudRate": 19200, 6 | "DataParity": "None", 7 | "FirmwareRegisters": [ 8 | { 9 | "Address": 6632, 10 | "Name": "RPU_PLC_FW_Revision", 11 | "RegisterType": "Version", 12 | "Size": 4 13 | } 14 | ], 15 | "Name": "$Name", 16 | "SensorRegisters": [ 17 | { 18 | "Address": 36866, 19 | "Format": "Float", 20 | "Name": "RPU_Coolant_Inlet_Temp_C", 21 | "Precision": 0, 22 | "RegisterType": "Temperature", 23 | "Scale": 0.1, 24 | "Shift": 0.0, 25 | "Signed": true, 26 | "Size": 1 27 | }, 28 | { 29 | "Address": 36865, 30 | "Format": "Float", 31 | "Name": "RPU_Coolant_Outlet_Temp_C", 32 | "Precision": 0, 33 | "RegisterType": "Temperature", 34 | "Scale": 0.1, 35 | "Shift": 0.0, 36 | "Signed": true, 37 | "Size": 1 38 | } 39 | ], 40 | "SerialPort": "$LinkTTY", 41 | "StatusBits": [ 42 | { 43 | "Address": 37377, 44 | "BitPosition": 2, 45 | "Name": "RPU_Coolant_Inlet_Temp_C", 46 | "StatusType": "SensorReadingCritical", 47 | "Value": true 48 | }, 49 | { 50 | "Address": 37377, 51 | "BitPosition": 1, 52 | "Name": "RPU_Coolant_Outlet_Temp_C", 53 | "StatusType": "SensorReadingCritical", 54 | "Value": true 55 | }, 56 | { 57 | "Address": 37376, 58 | "BitPosition": 0, 59 | "Name": "RPU_Coolant_Inlet_Temp_C", 60 | "StatusType": "SensorFailure", 61 | "Value": true 62 | }, 63 | { 64 | "Address": 37376, 65 | "BitPosition": 1, 66 | "Name": "RPU_Coolant_Outlet_Temp_C", 67 | "StatusType": "SensorFailure", 68 | "Value": true 69 | } 70 | ], 71 | "Type": "ModbusRDF040DSS5193E0ReservoirPumpUnit" 72 | } 73 | ], 74 | "Name": "$Name", 75 | "Probe": "xyz.openbmc_project.Inventory.Source.Modbus.FRU({'Name': 'Reservoir Pumping Unit.*'})", 76 | "Type": "Chassis", 77 | "xyz.openbmc_project.Inventory.Decorator.Asset": { 78 | "BuildDate": "$BuildDate", 79 | "Manufacturer": "$Manufacturer", 80 | "Model": "$Model", 81 | "PartNumber": "$PartNumber", 82 | "SerialNumber": "$SerialNumber", 83 | "SparePartNumber": "$SparePartNumber" 84 | } 85 | } 86 | --------------------------------------------------------------------------------