diff options
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-phosphor/ipmi')
15 files changed, 329 insertions, 0 deletions
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json new file mode 100644 index 000000000..4ad11bc6e --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore/config.json @@ -0,0 +1,5 @@ +[{ + "blobBaseId": "/skm/hss/", + "sysFilePath": "/sys/class/i2c-adapter/i2c-5/5-0050/5-00500/nvmem", + "offsetBytes": 256 +}] diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore_%.bbappend new file mode 100644 index 000000000..1dba2ec35 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-blobs-binarystore_%.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" +SRC_URI_append_gbs = " file://config.json" +FILES_${PN}_append_gbs = " ${datadir}/binaryblob/config.json" + +do_install_append_gbs() { + install -d ${D}${datadir}/binaryblob/ + install ${WORKDIR}/config.json ${D}${datadir}/binaryblob/config.json +} diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend new file mode 100644 index 000000000..ca7172498 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json new file mode 100644 index 000000000..bc98176b5 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json @@ -0,0 +1,2 @@ +{"id": 32, "revision": 129, "addn_dev_support": 141, + "manuf_id": 7244, "prod_id": 14401, "aux": 0} diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config/entity-map.json b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config/entity-map.json new file mode 100644 index 000000000..cb08553b3 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-config/entity-map.json @@ -0,0 +1,28 @@ +[ + { + "id": 1, + "containerEntityId" : 30, + "containerEntityInstance" : 0, + "isList" : false, + "isLinked" : false, + "entities" : [ + {"id" : 11, "instance" : 0}, + {"id" : 11, "instance" : 1}, + {"id" : 29, "instance" : 0}, + {"id" : 29, "instance" : 1} + ] + }, + { + "id": 2, + "containerEntityId" : 30, + "containerEntityInstance" : 1, + "isList" : false, + "isLinked" : false, + "entities" : [ + {"id" : 29, "instance" : 2}, + {"id" : 29, "instance" : 4}, + {"id" : 0, "instance" : 0}, + {"id" : 0, "instance" : 0} + ] + } +] diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-flash_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-flash_%.bbappend new file mode 100644 index 000000000..9f4c89026 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-flash_%.bbappend @@ -0,0 +1,5 @@ +NUVOTON_FLASH_PCIMBOX = "0xF0848000" + +EXTRA_OECONF_append_gbs = " --enable-nuvoton-p2a-mbox" + +IPMI_FLASH_BMC_ADDRESS_gbs = "${NUVOTON_FLASH_PCIMBOX}" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/fan b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/fan new file mode 100644 index 000000000..9bb4f2c09 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/fan @@ -0,0 +1,3 @@ +OF_NAME=fan_fru +SYSFS_PATH=/no-such-path/eeprom +FRUID=0x02 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/hsbp b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/hsbp new file mode 100644 index 000000000..cb099974c --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/hsbp @@ -0,0 +1,3 @@ +OF_NAME=hsbp_fru +SYSFS_PATH=/no-such-path/eeprom +FRUID=0x01 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/motherboard b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/motherboard new file mode 100644 index 000000000..0b36379f7 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc/eeproms/system/chassis/motherboard @@ -0,0 +1,3 @@ +OF_NAME=mb_fru +SYSFS_PATH=/sys/bus/i2c/devices/5-0050/eeprom +FRUID=0x00 diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend new file mode 100644 index 000000000..877129716 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-fru_%.bbappend @@ -0,0 +1,26 @@ +inherit obmc-phosphor-systemd +DEPENDS_append_gbs = " gbs-yaml-config" + +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" + +EEPROM_NAMES = "motherboard hsbp fan" + +EEPROMFMT = "system/chassis/{0}" +EEPROM_ESCAPEDFMT = "system-chassis-{0}" +EEPROMS = "${@compose_list(d, 'EEPROMFMT', 'EEPROM_NAMES')}" +EEPROMS_ESCAPED = "${@compose_list(d, 'EEPROM_ESCAPEDFMT', 'EEPROM_NAMES')}" + +ENVFMT = "obmc/eeproms/{0}" +SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs := " ${@compose_list(d, 'ENVFMT', 'EEPROMS')}" + +TMPL = "obmc-read-eeprom@.service" +TGT = "multi-user.target" +INSTFMT = "obmc-read-eeprom@{0}.service" +FMT = "../${TMPL}:${TGT}.wants/${INSTFMT}" + +SYSTEMD_LINK_${PN}_append_gbs := " ${@compose_list(d, 'FMT', 'EEPROMS_ESCAPED')}" + +EXTRA_OECONF_append_gbs = " \ + YAML_GEN=${STAGING_DIR_HOST}${datadir}/gbs-yaml-config/ipmi-fru-read.yaml \ + PROP_YAML=${STAGING_DIR_HOST}${datadir}/gbs-yaml-config/ipmi-extra-properties.yaml \ + " diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch new file mode 100644 index 000000000..d815cde72 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch @@ -0,0 +1,138 @@ +From 9deb72959477700216326c033c930236e58f965f Mon Sep 17 00:00:00 2001 +From: Ren Yu <yux.ren@intel.com> +Date: Tue, 28 May 2019 17:11:17 +0800 +Subject: [PATCH] Save the pre-timeout interrupt in dbus property + +Get the watchdog pre-timeout interrupt value from ipmi watchdog set command, +and store it into dbus property. + +Tested: +Config IPMI watchdog: BIOS FRB2 Power Cycle after 1 seconds: +ipmitool raw 0x06 0x24 0x01 0x13 0x0 0x2 0xa 0x00 +Start watchdog: +Ipmitool mc watchdog reset +Check the watchdog pre-timeout interrupt in below: +https://BMCIP/redfish/v1/Systems/system/LogServices/EventLog/Entries + +Signed-off-by: Ren Yu <yux.ren@intel.com> + +--- + app/watchdog.cpp | 47 ++++++++++++++++++++++++++++++++++++++++ + app/watchdog_service.cpp | 6 +++++ + app/watchdog_service.hpp | 9 ++++++++ + 3 files changed, 62 insertions(+) + +diff --git a/app/watchdog.cpp b/app/watchdog.cpp +index 03c373e..cb0b1fd 100644 +--- a/app/watchdog.cpp ++++ b/app/watchdog.cpp +@@ -80,6 +80,7 @@ ipmi::RspType<> ipmiAppResetWatchdogTimer() + + static constexpr uint8_t wd_dont_stop = 0x1 << 6; + static constexpr uint8_t wd_timeout_action_mask = 0x3; ++static constexpr uint8_t wdPreTimeoutInterruptMask = 0x3; + + static constexpr uint8_t wdTimerUseResTimer1 = 0x0; + static constexpr uint8_t wdTimerUseResTimer2 = 0x6; +@@ -127,6 +128,45 @@ WatchdogService::Action ipmiActionToWdAction(IpmiAction ipmi_action) + } + } + ++enum class IpmiPreTimeoutInterrupt : uint8_t ++{ ++ None = 0x0, ++ SMI = 0x1, ++ NMI = 0x2, ++ MI = 0x3, ++}; ++/** @brief Converts an IPMI Watchdog PreTimeoutInterrupt to DBUS defined action ++ * @param[in] ipmi_action The IPMI Watchdog PreTimeoutInterrupt ++ * @return The Watchdog PreTimeoutInterrupt that the ipmi_action maps to ++ */ ++WatchdogService::PreTimeoutInterruptAction ipmiPreTimeoutInterruptToWdAction( ++ IpmiPreTimeoutInterrupt ipmiPreTimeOutInterrupt) ++{ ++ switch (ipmiPreTimeOutInterrupt) ++ { ++ case IpmiPreTimeoutInterrupt::None: ++ { ++ return WatchdogService::PreTimeoutInterruptAction::None; ++ } ++ case IpmiPreTimeoutInterrupt::SMI: ++ { ++ return WatchdogService::PreTimeoutInterruptAction::SMI; ++ } ++ case IpmiPreTimeoutInterrupt::NMI: ++ { ++ return WatchdogService::PreTimeoutInterruptAction::NMI; ++ } ++ case IpmiPreTimeoutInterrupt::MI: ++ { ++ return WatchdogService::PreTimeoutInterruptAction::MI; ++ } ++ default: ++ { ++ throw std::domain_error("IPMI PreTimeoutInterrupt is invalid"); ++ } ++ } ++} ++ + enum class IpmiTimerUse : uint8_t + { + Reserved = 0x0, +@@ -250,6 +290,13 @@ ipmi::RspType<> + // Mark as initialized so that future resets behave correctly + wd_service.setInitialized(true); + ++ // pretimeOutAction ++ const auto ipmiPreTimeoutInterrupt = ++ static_cast<IpmiPreTimeoutInterrupt>(wdPreTimeoutInterruptMask & ++ (static_cast<uint8_t>(preTimeoutInterrupt))); ++ wd_service.setPreTimeoutInterrupt( ++ ipmiPreTimeoutInterruptToWdAction(ipmiPreTimeoutInterrupt)); ++ + lastCallSuccessful = true; + return ipmi::responseSuccess(); + } +diff --git a/app/watchdog_service.cpp b/app/watchdog_service.cpp +index 3534e89..4df1ab6 100644 +--- a/app/watchdog_service.cpp ++++ b/app/watchdog_service.cpp +@@ -198,3 +198,9 @@ void WatchdogService::setInterval(uint64_t interval) + { + setProperty("Interval", interval); + } ++ ++void WatchdogService::setPreTimeoutInterrupt( ++ PreTimeoutInterruptAction preTimeoutInterrupt) ++{ ++ setProperty("PreTimeoutInterrupt", convertForMessage(preTimeoutInterrupt)); ++} +\ No newline at end of file +diff --git a/app/watchdog_service.hpp b/app/watchdog_service.hpp +index 141bdb7..32b7461 100644 +--- a/app/watchdog_service.hpp ++++ b/app/watchdog_service.hpp +@@ -15,6 +15,8 @@ class WatchdogService + + using Action = + sdbusplus::xyz::openbmc_project::State::server::Watchdog::Action; ++ using PreTimeoutInterruptAction = sdbusplus::xyz::openbmc_project::State:: ++ server::Watchdog::PreTimeoutInterruptAction; + using TimerUse = + sdbusplus::xyz::openbmc_project::State::server::Watchdog::TimerUse; + +@@ -92,6 +94,13 @@ class WatchdogService + */ + void setInterval(uint64_t interval); + ++ /** @brief Sets the value of the PreTimeoutInterrupt property on the host ++ * watchdog ++ * ++ * @param[in] PreTimeoutInterrupt - The new PreTimeoutInterrupt value ++ */ ++ void setPreTimeoutInterrupt(PreTimeoutInterruptAction preTimeoutInterrupt); ++ + private: + /** @brief sdbusplus handle */ + sdbusplus::bus::bus bus; diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/gbs-ipmid-whitelist.conf b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/gbs-ipmid-whitelist.conf new file mode 100644 index 000000000..359c7dbeb --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host/gbs-ipmid-whitelist.conf @@ -0,0 +1,79 @@ +#<NetFn>:<Command> +0x00:0x00 //<Chassis>:<Chassis Capabiliti> +0x00:0x01 //<Chassis>:<Get Chassis Status> +0x00:0x02 //<Chassis>:<Chassis Control> +0x00:0x04 //<Chassis>:<Chassis Identify> +0x00:0x05 //<Chassis>:<Set Chassis Capabilities> +0x00:0x06 //<Chassis>:<Set Power Restore Policy> +0x00:0x08 //<Chassis>:<Set System Boot Options> +0x00:0x09 //<Chassis>:<Get System Boot Options> +0x00:0x0F //<Chassis>:<Get POH Counter> +0x04:0x02 //<Sensor/Event>:<Platform Event> +0x04:0x20 //<Sensor/Event>:<Get Device SDR Info> +0x04:0x21 //<Sensor/Event>:<Get Device SDR> +0x04:0x22 //<Sensor/Event>:<Reserve Device SDR Repository> +0x04:0x27 //<Sensor/Event>:<Get Sensor Threshold> +0x04:0x29 //<Sensor/Event>:<Get Sensor Event Enable> +0x04:0x2B //<Sensor/Event>:<Get Sensor Event Status> +0x04:0x2D //<Sensor/Event>:<Get Sensor Reading> +0x04:0x2F //<Sensor/Event>:<Get Sensor Type> +0x04:0x30 //<Sensor/Event>:<Set Sensor Reading and Event Status> +0x06:0x01 //<App>:<Get Device ID> +0x06:0x02 //<App>:<Cold Reset> +0x06:0x03 //<App>:<Warm Reset> +0x06:0x04 //<App>:<Get Self Test Results> +0x06:0x06 //<App>:<Set ACPI Power State> +0x06:0x07 //<App>:<Get ACPI Power State> +0x06:0x08 //<App>:<Get Device GUID> +0x06:0x22 //<App>:<Reset Watchdog Timer> +0x06:0x24 //<App>:<Set Watchdog Timer> +0x06:0x25 //<App>:<Get Watchdog Timer> +0x06:0x35 //<App>:<Read Event Message Buffer> +0x06:0x3D //<App>:<Get Session Info> +0x06:0x40 //<App>:<Set Channel Access> +0x06:0x41 //<App>:<Get Channel Access> +0x06:0x42 //<App>:<Get Channel Info> +0x06:0x43 //<App>:<Set User Access> +0x06:0x44 //<App>:<Get User Access> +0x06:0x45 //<App>:<Set User Name> +0x06:0x46 //<App>:<Get User Name> +0x06:0x47 //<App>:<Set User Password> +0x06:0x48 //<App>:<Activate Payload> +0x06:0x49 //<App>:<Deactivate Payload> +0x06:0x4A //<App>:<Get Payload Activation Status> +0x06:0x4B //<App>:<Get Payload Instance Info> +0x06:0x54 //<App>:<Get Channel Cipher Suites> +0x06:0x58 //<App>:<Set System Info Parameters> +0x06:0x59 //<App>:<Get System Info Parameters> +0x0A:0x10 //<Storage>:<Get FRU Inventory Area Info> +0x0A:0x11 //<Storage>:<Read FRU Data> +0x0A:0x20 //<Storage>:<Get SDR Repository Info> +0x0A:0x22 //<Storage>:<Reserve SDR Repository> +0x0A:0x23 //<Storage>:<Get SDR> +0x0A:0x40 //<Storage>:<Get SEL Info> +0x0A:0x42 //<Storage>:<Reserve SEL> +0x0A:0x43 //<Storage>:<Get SEL Entry> +0x0A:0x44 //<Storage>:<Add SEL Entry> +0x0A:0x46 //<Storage>:<Delete SEL Entry> +0x0A:0x47 //<Storage>:<Clear SEL> +0x0A:0x48 //<Storage>:<Get SEL Time> +0x0A:0x49 //<Storage>:<Set SEL Time> +0x0C:0x01 //<Transport>:<Set LAN Configuration Parameters> +0x0C:0x02 //<Transport>:<Get LAN Configuration Parameters> +0x2C:0x00 //<Group Extension>:<Group Extension Command> +0x2C:0x01 //<Group Extension>:<Get DCMI Capabilities> +0x2C:0x02 //<Group Extension>:<Get Power Reading> +0x2C:0x03 //<Group Extension>:<Get Power Limit> +0x2C:0x06 //<Group Extension>:<Get Asset Tag> +0x2C:0x07 //<Group Extension>:<Get Sensor Info> +0x2C:0x09 //<Group Extension>:<Get Management Controller Identifier String> +0x2C:0x0A //<Group Extension>:<Set Management Controller Identifier String> +0x2C:0x10 //<Group Extension>:<Get Temperature Readings> +0x2C:0x12 //<Group Extension>:<Set DCMI Configuration Parameters> +0x2C:0x13 //<Group Extension>:<Get DCMI Configuration Parameters> +0x2C:0x3E //<Group Extension>:<Get HPM.x Capabilities> +0x2E:0x02 //<Google OEM>:<I2C via Proxy Adapter> +0x2E:0x04 //<Google OEM>:<Fan Manual Control Mode> +0x2E:0x30 //<Google OEM>:<Ethernet Statistics> +0x2E:0x32 //<Google OEM>:<Sys Commands> +0x2E:0x80 //<Google OEM>:<Blob Commands> diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend new file mode 100644 index 000000000..bf2986c47 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-host_%.bbappend @@ -0,0 +1,18 @@ +DEPENDS_append_gbs = " gbs-yaml-config" + +SRC_URI_remove_gbs = "git://github.com/openbmc/phosphor-host-ipmid" +SRC_URI_prepend_gbs = "git://github.com/quanta-bmc/phosphor-host-ipmid.git" + +SRCREV_gbs = "257ea262809c52e51f1f592e047d27125f0273b3" + +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" +SRC_URI_append_gbs = " file://gbs-ipmid-whitelist.conf \ + file://0063-Save-the-pre-timeout-interrupt-in-dbus-property.patch \ + " + +WHITELIST_CONF_gbs = "${WORKDIR}/gbs-ipmid-whitelist.conf" + +EXTRA_OECONF_append_gbs = " --with-journal-sel \ + SENSOR_YAML_GEN=${STAGING_DIR_HOST}${datadir}/gbs-yaml-config/ipmi-sensors.yaml \ + FRU_YAML_GEN=${STAGING_DIR_HOST}${datadir}/gbs-yaml-config/ipmi-fru-read.yaml \ + " diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules new file mode 100644 index 000000000..1de5562c3 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules @@ -0,0 +1 @@ +KERNEL=="ipmi-kcs1", SYMLINK+="ipmi_kcs1" diff --git a/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend new file mode 100644 index 000000000..a7f60d4cc --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend @@ -0,0 +1,9 @@ +KCS_DEVICE_gbs = "ipmi_kcs1" + +FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" +SRC_URI_append_gbs = " file://99-ipmi-kcs.rules" + +do_install_append_gbs() { + install -d ${D}/lib/udev/rules.d + install -m 0644 ${WORKDIR}/99-ipmi-kcs.rules ${D}/lib/udev/rules.d +} |