Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,3 @@
{
"buses": [0, 1, 2, 8, 10]
}
@@ -0,0 +1,7 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " file://blacklist.json"
do_install:append () {
install -m 0644 -D ${WORKDIR}/blacklist.json ${D}${datadir}/${PN}/blacklist.json
}
@@ -0,0 +1,33 @@
SUMMARY = "YAML configuration for NCPLite"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit allarch
SRC_URI = " \
file://ncplite-ipmi-fru.yaml \
file://ncplite-ipmi-fru-properties.yaml \
file://ncplite-ipmi-sensors.yaml \
file://ncplite-ipmi-inventory-sensors.yaml \
"
S = "${WORKDIR}"
do_install() {
install -m 0644 -D ncplite-ipmi-fru.yaml \
${D}${datadir}/${BPN}/ipmi-fru-read.yaml
install -m 0644 -D ncplite-ipmi-fru-properties.yaml \
${D}${datadir}/${BPN}/ipmi-extra-properties.yaml
install -m 0644 -D ncplite-ipmi-sensors.yaml \
${D}${datadir}/${BPN}/ipmi-sensors.yaml
install -m 0644 -D ncplite-ipmi-inventory-sensors.yaml \
${D}${datadir}/${BPN}/ipmi-inventory-sensors.yaml
}
FILES:${PN}-dev = " \
${datadir}/${BPN}/ipmi-fru-read.yaml \
${datadir}/${BPN}/ipmi-extra-properties.yaml \
${datadir}/${BPN}/ipmi-sensors.yaml \
${datadir}/${BPN}/ipmi-inventory-sensors.yaml \
"
@@ -0,0 +1,35 @@
/system/chassis/motherboard:
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: "true"
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: "true"
xyz.openbmc_project.Inventory.Item:
Present: "true"
/system:
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: "true"
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: "true"
xyz.openbmc_project.Inventory.Item:
Present: "true"
/system/chassis:
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: "false"
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: "false"
xyz.openbmc_project.Inventory.Item:
Present: "true"
/system/chassis/psu0:
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: "false"
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: "true"
xyz.openbmc_project.Inventory.Item:
Present: "true"
/system/chassis/psu1:
xyz.openbmc_project.Inventory.Decorator.Cacheable:
Cached: "false"
xyz.openbmc_project.Inventory.Decorator.Replaceable:
FieldReplaceable: "true"
xyz.openbmc_project.Inventory.Item:
Present: "true"
@@ -0,0 +1,118 @@
0:
/system/chassis:
entityID: 23
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
Model:
IPMIFruProperty: Type
IPMIFruSection: Chassis
/system/chassis/motherboard:
entityID: 7
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
/system:
entityID: 7
entityInstance: 2
interfaces:
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.Asset:
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Product
PartNumber:
IPMIFruProperty: Model Number
IPMIFruSection: Product
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: Version
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.AssetTag:
AssetTag:
IPMIFruProperty: Asset Tag
IPMIFruSection: Product
1:
/system/chassis/psu0:
entityID: 0x13
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Product
PartNumber:
IPMIFruProperty: Model Number
IPMIFruSection: Product
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: Version
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.AssetTag:
AssetTag:
IPMIFruProperty: Asset Tag
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.VendorInformation:
CustomField1:
IPMIFruProperty: FRU File ID
IPMIFruSection: Product
2:
/system/chassis/psu1:
entityID: 0x13
entityInstance: 2
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Product
PartNumber:
IPMIFruProperty: Model Number
IPMIFruSection: Product
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: Version
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.AssetTag:
AssetTag:
IPMIFruProperty: Asset Tag
IPMIFruSection: Product
xyz.openbmc_project.Inventory.Decorator.VendorInformation:
CustomField1:
IPMIFruProperty: FRU File ID
IPMIFruSection: Product
@@ -0,0 +1,245 @@
/xyz/openbmc_project/sensors/temperature/TEMP_ENV_FRONT:
sensorID: 0xf
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/TEMP_ENV_REAR:
sensorID: 0x10
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/TEMP_MAC_ENV:
sensorID: 0x11
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/TEMP_MAC_DIE:
sensorID: 0x12
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/TEMP_CPU_ENV_2:
sensorID: 0x13
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/TEMP_ENV_BMC:
sensorID: 0x14
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P3V3_ADC0:
sensorID: 0x20
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P1V8_ADC1:
sensorID: 0x21
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P1V2_ADC2:
sensorID: 0x22
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P1V2_ADC3:
sensorID: 0x23
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P0V8_ADC4:
sensorID: 0x24
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P0V8_ADC5:
sensorID: 0x25
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P1V2_ADC6:
sensorID: 0x26
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P0V88_ADC8:
sensorID: 0x27
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/P2V5_ADC9:
sensorID: 0x28
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/FAN0_RPM:
sensorID: 0x30
sensorType: 4
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/FAN1_RPM:
sensorID: 0x31
sensorType: 4
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/FAN2_RPM:
sensorID: 0x32
sensorType: 4
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/FAN3_RPM:
sensorID: 0x33
sensorType: 4
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/inventory/system/chassis/motherboard/ALL_PWR_GOOD_H:
sensorID: 0x40
sensorType: 0x15
eventReadingType: 0x03
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/FAN_STATUS_INT_L:
sensorID: 0x41
sensorType: 0x15
eventReadingType: 0x03
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/THERMAL_ALERT_L:
sensorID: 0x42
sensorType: 0x15
eventReadingType: 0x03
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/CPU_CATERR_L:
sensorID: 0x43
sensorType: 0x7
eventReadingType: 0x6f
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/CPU_THERMTEIP_L:
sensorID: 0x44
sensorType: 0x7
eventReadingType: 0x03
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/PSU0_INT_L:
sensorID: 0x45
sensorType: 0x9
eventReadingType: 0x03
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/PSU1_INT_L:
sensorID: 0x46
sensorType: 0x9
eventReadingType: 0x03
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/PSU0_POWER_OK:
sensorID: 0x47
sensorType: 0x9
eventReadingType: 0x03
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/PSU1_POWER_OK:
sensorID: 0x48
sensorType: 0x9
eventReadingType: 0x03
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/PSU0_PRSNT_L:
sensorID: 0x49
sensorType: 0x9
eventReadingType: 0x08
offset: 0x03
/xyz/openbmc_project/inventory/system/chassis/motherboard/PSU1_PRSNT_L:
sensorID: 0x4a
sensorType: 0x9
eventReadingType: 0x8
offset: 0x03
/xyz/openbmc_project/sensors/voltage/PSU0_VIN:
sensorID: 0x60
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/PSU0_VOUT:
sensorID: 0x61
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/current/PSU0_IIN:
sensorID: 0x62
sensorType: 3
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/current/PSU0_IOUT:
sensorID: 0x63
sensorType: 3
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/PSU0_FAN1:
sensorID: 0x64
sensorType: 4
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/PSU0_TEMP1:
sensorID: 0x65
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/PSU0_TEMP2:
sensorID: 0x66
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/PSU0_TEMP3:
sensorID: 0x67
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/PSU1_VIN:
sensorID: 0x70
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/voltage/PSU1_VOUT:
sensorID: 0x71
sensorType: 2
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/current/PSU1_IIN:
sensorID: 0x72
sensorType: 3
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/current/PSU1_IOUT:
sensorID: 0x73
sensorType: 3
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/fan_tach/PSU1_FAN1:
sensorID: 0x74
sensorType: 4
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/PSU1_TEMP1:
sensorID: 0x75
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/PSU1_TEMP2:
sensorID: 0x76
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/sensors/temperature/PSU1_TEMP3:
sensorID: 0x77
sensorType: 1
eventReadingType: 1
offset: 0xff
/xyz/openbmc_project/watchdog/host0:
sensorID: 0xff
sensorType: 0x23
eventReadingType: 0x6f
offset: 0xff
/xyz/openbmc_project/state/host0:
sensorID: 0xff
sensorType: 0x09
eventReadingType: 0x6f
offset: 0xff
/xyz/openbmc_project/state/chassis0:
sensorID: 0xff
sensorType: 0x14
eventReadingType: 0x6f
offset: 0xff
@@ -0,0 +1,399 @@
0xf: &temperature
entityID: 0x07
entityInstance: 0
sensorType: 0x01
path: /xyz/openbmc_project/sensors/temperature/TEMP_ENV_FRONT
sensorReadingType: 0x01
multiplierM: 1
offsetB: 0
bExp: 0
rExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
sensorNamePattern: nameLeaf
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0xFF:
type: double
0x10:
<<: *temperature
entityInstance: 1
path: /xyz/openbmc_project/sensors/temperature/TEMP_ENV_REAR
0x11:
<<: *temperature
entityInstance: 2
path: /xyz/openbmc_project/sensors/temperature/TEMP_MAC_ENV
0x12:
<<: *temperature
entityInstance: 3
path: /xyz/openbmc_project/sensors/temperature/TEMP_MAC_DIE
0x13:
<<: *temperature
entityInstance: 4
path: /xyz/openbmc_project/sensors/temperature/TEMP_CPU_ENV_2
0x14:
<<: *temperature
entityInstance: 5
path: /xyz/openbmc_project/sensors/temperature/TEMP_ENV_BMC
0x20: &voltage
entityID: 0x07
entityInstance: 5
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/P3V3_ADC0
sensorReadingType: 0x01
multiplierM: 235
offsetB: 0
bExp: 0
rExp: -4
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
sensorNamePattern: nameLeaf
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0xFF:
type: double
0x21:
<<: *voltage
entityInstance: 6
path: /xyz/openbmc_project/sensors/voltage/P1V8_ADC1
multiplierM: 71
0x22:
<<: *voltage
entityInstance: 7
path: /xyz/openbmc_project/sensors/voltage/P1V2_ADC2
multiplierM: 71
0x23:
<<: *voltage
entityInstance: 8
path: /xyz/openbmc_project/sensors/voltage/P1V2_ADC3
multiplierM: 71
0x24:
<<: *voltage
entityInstance: 9
path: /xyz/openbmc_project/sensors/voltage/P0V8_ADC4
multiplierM: 71
0x25:
<<: *voltage
entityInstance: 10
path: /xyz/openbmc_project/sensors/voltage/P0V8_ADC5
multiplierM: 71
0x26:
<<: *voltage
entityInstance: 11
path: /xyz/openbmc_project/sensors/voltage/P1V2_ADC6
multiplierM: 71
0x27:
<<: *voltage
entityInstance: 12
path: /xyz/openbmc_project/sensors/voltage/P0V88_ADC8
multiplierM: 71
0x28:
<<: *voltage
entityInstance: 13
path: /xyz/openbmc_project/sensors/voltage/P2V5_ADC9
multiplierM: 173
0x30: &fan_tach
entityID: 0x0A
entityInstance: 0
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/FAN0_RPM
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
rExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
sensorNamePattern: nameLeaf
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
255:
type: double
0x31:
<<: *fan_tach
entityInstance: 1
path: /xyz/openbmc_project/sensors/fan_tach/FAN1_RPM
0x32:
<<: *fan_tach
entityInstance: 2
path: /xyz/openbmc_project/sensors/fan_tach/FAN2_RPM
0x33:
<<: *fan_tach
entityInstance: 3
path: /xyz/openbmc_project/sensors/fan_tach/FAN3_RPM
0x40: &discrete
entityID: 0x07
entityInstance: 16
sensorType: 0x15
path: /system/chassis/motherboard/ALL_PWR_GOOD_H
sensorReadingType: 0x03
mutability: Mutability::Read
serviceInterface: xyz.openbmc_project.Inventory.Manager
readingType: assertion
interfaces:
xyz.openbmc_project.Inventory.Item:
Present:
Offsets:
0x01:
assert: true
type: bool
0x00:
assert: false
type: bool
0x41:
<<: *discrete
entityID: 0x07
entityInstance: 17
sensorType: 0x15
path: /system/chassis/motherboard/FAN_STATUS_INT_L
0x42:
<<: *discrete
entityID: 0x07
entityInstance: 18
sensorType: 0x15
path: /system/chassis/motherboard/THERMAL_ALERT_L
0x43:
<<: *discrete
entityID: 0x03
entityInstance: 0
sensorType: 0x7
path: /system/chassis/motherboard/CPU_CATERR_L
0x44:
<<: *discrete
entityID: 0x03
entityInstance: 1
sensorType: 0x7
path: /system/chassis/motherboard/CPU_THERMTEIP_L
0x45:
<<: *discrete
entityID: 0x13
entityInstance: 3
sensorType: 0x9
path: /system/chassis/motherboard/PSU0_INT_L
0x46:
<<: *discrete
entityID: 0x13
entityInstance: 4
sensorType: 0x9
path: /system/chassis/motherboard/PSU1_INT_L
0x47:
<<: *discrete
entityID: 0x13
entityInstance: 5
sensorType: 0x09
path: /system/chassis/motherboard/PSU0_POWER_OK
0x48:
<<: *discrete
entityID: 0x13
entityInstance: 6
sensorType: 0x09
path: /system/chassis/motherboard/PSU1_POWER_OK
0x49:
<<: *discrete
entityID: 0x13
entityInstance: 7
sensorType: 0x09
sensorReadingType: 0x08
path: /system/chassis/motherboard/PSU0_PRSNT_L
0x4a:
<<: *discrete
entityID: 0x13
entityInstance: 8
sensorType: 0x09
sensorReadingType: 0x08
path: /system/chassis/motherboard/PSU1_PRSNT_L
0x4b:
<<: *discrete
entityID: 0x7
entityInstance: 19
sensorType: 0x15
path: /system/chassis/motherboard/FAN0_PRSNT_L
0x4c:
<<: *discrete
entityID: 0x7
entityInstance: 20
sensorType: 0x15
path: /system/chassis/motherboard/FAN1_PRSNT_L
0x4d:
<<: *discrete
entityID: 0x7
entityInstance: 21
sensorType: 0x15
path: /system/chassis/motherboard/FAN2_PRSNT_L
0x4e:
<<: *discrete
entityID: 0x7
entityInstance: 22
sensorType: 0x15
path: /system/chassis/motherboard/FAN3_PRSNT_L
#PSU0 temperature, voltage, fan sensors
0x60:
<<: *voltage
entityID: 0x13
entityInstance: 10
path: /xyz/openbmc_project/sensors/voltage/PSU0_VIN
rExp: 0
multiplierM: 1
0x61:
<<: *voltage
entityID: 0x13
entityInstance: 11
path: /xyz/openbmc_project/sensors/voltage/PSU0_VOUT
rExp: -2
multiplierM: 5
0x62: &current
entityID: 0x13
entityInstance: 12
sensorType: 0x03
path: /xyz/openbmc_project/sensors/current/PSU0_IIN
sensorReadingType: 0x01
multiplierM: 16
offsetB: 0
bExp: 0
rExp: -3
unit: xyz.openbmc_project.Sensor.Value.Unit.Amperes
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
sensorNamePattern: nameLeaf
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0xFF:
type: double
0x63:
<<: *current
entityID: 0x13
entityInstance: 13
path: /xyz/openbmc_project/sensors/current/PSU0_IOUT
multiplierM: 70
rExp: -2
0x64:
<<: *fan_tach
entityID: 0x13
entityInstance: 14
path: /xyz/openbmc_project/sensors/fan_tach/PSU0_FAN1
0x65:
<<: *temperature
entityID: 0x13
entityInstance: 15
path: /xyz/openbmc_project/sensors/temperature/PSU0_TEMP1
0x66:
<<: *temperature
entityID: 0x13
entityInstance: 16
path: /xyz/openbmc_project/sensors/temperature/PSU0_TEMP2
0x67:
<<: *temperature
entityID: 0x13
entityInstance: 17
path: /xyz/openbmc_project/sensors/temperature/PSU0_TEMP3
#PSU1 temperature, voltage, fan sensors
0x70:
<<: *voltage
entityID: 0x13
entityInstance: 18
path: /xyz/openbmc_project/sensors/voltage/PSU1_VIN
rExp: 0
multiplierM: 1
0x71:
<<: *voltage
entityID: 0x13
entityInstance: 19
path: /xyz/openbmc_project/sensors/voltage/PSU1_VOUT
rExp: -2
multiplierM: 5
0x72:
<<: *current
entityID: 0x13
entityInstance: 20
path: /xyz/openbmc_project/sensors/current/PSU1_IIN
0x73:
<<: *current
entityID: 0x13
entityInstance: 21
path: /xyz/openbmc_project/sensors/current/PSU1_IOUT
multiplierM: 70
rExp: -2
0x74:
<<: *fan_tach
entityID: 0x13
entityInstance: 22
path: /xyz/openbmc_project/sensors/fan_tach/PSU1_FAN1
0x75:
<<: *temperature
entityID: 0x13
entityInstance: 23
path: /xyz/openbmc_project/sensors/temperature/PSU1_TEMP1
0x76:
<<: *temperature
entityID: 0x13
entityInstance: 24
path: /xyz/openbmc_project/sensors/temperature/PSU1_TEMP2
0x77:
<<: *temperature
entityID: 0x13
entityInstance: 25
path: /xyz/openbmc_project/sensors/temperature/PSU1_TEMP3
@@ -0,0 +1 @@
baud = 115200
@@ -0,0 +1,28 @@
#!/bin/bash
function usage()
{
echo "Usage: $(basename "$0") init|reset"
}
if [ "$#" -ne "1" ] ; then
usage
exit 1;
fi
UART_ROUTING_SYSFS="/sys/bus/platform/drivers/aspeed-uart-routing/1e789098.uart-routing"
case "$1" in
init)
echo -n "uart1" > ${UART_ROUTING_SYSFS}/uart4
echo -n "uart4" > ${UART_ROUTING_SYSFS}/uart1
;;
reset)
echo -n "io1" > ${UART_ROUTING_SYSFS}/uart1
echo -n "io4" > ${UART_ROUTING_SYSFS}/uart4
;;
*)
usage
exit 1;
;;
esac
@@ -0,0 +1,5 @@
[Service]
ExecStartPre=/usr/sbin/uart-routing.sh init
ExecStart=-/usr/sbin/dropbear -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key -c "/usr/bin/obmc-console-client" -i $DROPBEAR_EXTRA_ARGS
ExecStopPost=/usr/sbin/uart-routing.sh reset
StandardInput=socket
@@ -0,0 +1,17 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " file://uart-routing.sh \
file://use-socket.conf.in \
"
RDEPENDS:${PN}:append = " bash"
OBMC_CONSOLE_HOST_TTY:ncplite = "ttyS3"
do_install:append() {
install -d ${D}${sbindir}
install -m 0755 ${WORKDIR}/uart-routing.sh -D ${D}${sbindir}/uart-routing.sh
install -d ${D}${systemd_system_unitdir}
install -m 0755 ${WORKDIR}/use-socket.conf.in -D ${D}${systemd_system_unitdir}/obmc-console-ssh@.service.d/use-socket.conf
}
@@ -0,0 +1,177 @@
{
"sensors": [
{
"name": "FAN0_RPM",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/FAN0_RPM",
"writePath": "/sys/devices/platform/pwm-fan0/hwmon/**/pwm1",
"ignoreDbusMinMax": true,
"min": 0,
"max": 255
},
{
"name": "FAN1_RPM",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/FAN1_RPM",
"writePath": "/sys/devices/platform/pwm-fan0/hwmon/**/pwm1",
"ignoreDbusMinMax": true,
"min": 0,
"max": 255
},
{
"name": "FAN2_RPM",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/FAN2_RPM",
"writePath": "/sys/devices/platform/pwm-fan1/hwmon/**/pwm1",
"ignoreDbusMinMax": true,
"min": 0,
"max": 255
},
{
"name": "FAN3_RPM",
"type": "fan",
"readPath": "/xyz/openbmc_project/sensors/fan_tach/FAN3_RPM",
"writePath": "/sys/devices/platform/pwm-fan1/hwmon/**/pwm1",
"ignoreDbusMinMax": true,
"min": 0,
"max": 255
},
{
"name": "TEMP_MAC_ENV",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/TEMP_MAC_ENV",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
},
{
"name": "TEMP_MAC_DIE",
"type": "temp",
"readPath": "/xyz/openbmc_project/sensors/temperature/TEMP_MAC_DIE",
"writePath": "",
"min": 0,
"max": 0,
"ignoreDbusMinMax": true,
"timeout": 0
}
],
"zones": [
{
"id": 1,
"minThermalOutput": 0.0,
"failsafePercent": 100.0,
"pids": [
{
"name": "FAN0_RPM",
"type": "fan",
"inputs": ["FAN0_RPM"],
"setpoint": 30.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"derivativeCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 1.0,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 0.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "FAN1_RPM",
"type": "fan",
"inputs": ["FAN1_RPM"],
"setpoint": 30.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"derivativeCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 1.0,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 0.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "FAN2_RPM",
"type": "fan",
"inputs": ["FAN2_RPM"],
"setpoint": 30.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"derivativeCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 1.0,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 0.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "FAN3_RPM",
"type": "fan",
"inputs": ["FAN3_RPM"],
"setpoint": 30.0,
"pid": {
"samplePeriod": 1.0,
"proportionalCoeff": 0.0,
"integralCoeff": 0.0,
"derivativeCoeff": 0.0,
"feedFwdOffsetCoeff": 0.0,
"feedFwdGainCoeff": 1.0,
"integralLimit_min": 0.0,
"integralLimit_max": 0.0,
"outLim_min": 0.0,
"outLim_max": 100.0,
"slewNeg": 0.0,
"slewPos": 0.0
}
},
{
"name": "TEMP_MAC_DIE",
"type": "stepwise",
"inputs": ["TEMP_MAC_DIE"],
"setpoint": 30.0,
"pid": {
"samplePeriod": 1.0,
"positiveHysteresis": 1.0,
"negativeHysteresis": 1.0,
"isCeiling": false,
"reading": {
"0": 25,
"1": 40,
"2": 50,
"3": 60,
"4": 70,
"5": 80
},
"output": {
"0": 45,
"1": 60,
"2": 75,
"3": 85,
"4": 90,
"5": 100
}
}
}
]
}
]
}
@@ -0,0 +1,10 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " file://config.json"
FILES:${PN}:append = " ${datadir}/swampd/config.json"
do_install:append:ncplite() {
install -d ${D}${datadir}/swampd
install -m 0644 -D ${WORKDIR}/config.json ${D}${datadir}/swampd/config.json
}
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/ALL_PWR_GOOD_H
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=172
NAME=ALL_PWR_GOOD_H
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/FAN_STATUS_INT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=98
NAME=FAN_STATUS_INT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/PSU1_PRSNT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=47
NAME=PSU1_PRSNT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/FAN0_PRSNT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-polled-event
KEY=2
NAME=FAN0_PRSNT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/FAN1_PRSNT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-polled-event
KEY=6
NAME=FAN1_PRSNT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/FAN2_PRSNT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-polled-event
KEY=10
NAME=FAN2_PRSNT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/FAN3_PRSNT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-polled-event
KEY=14
NAME=FAN3_PRSNT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/THERMAL_ALERT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=122
NAME=THERMAL_ALERT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/CPU_CATERR_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=107
NAME=CPU_CATERR_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/CPU_THERMTEIP_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=173
NAME=CPU_THERMTEIP_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/PSU0_INT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=169
NAME=PSU0_INT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/PSU1_INT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=170
NAME=PSU1_INT_L
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/PSU0_POWER_OK
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=100
NAME=PSU0_POWER_OK
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/PSU1_POWER_OK
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=101
NAME=PSU1_POWER_OK
@@ -0,0 +1,4 @@
INVENTORY=/system/chassis/motherboard/PSU0_PRSNT_L
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=46
NAME=PSU0_PRSNT_L
@@ -0,0 +1,13 @@
[Unit]
Description=Phosphor GPIO %I Presence
Wants=mapper-wait@-xyz-openbmc_project-inventory.service
After=mapper-wait@-xyz-openbmc_project-inventory.service
ConditionPathExists={envfiledir}/obmc/gpio/gpio-%i.conf
[Service]
EnvironmentFile={envfiledir}/obmc/gpio/gpio-%i.conf
ExecStart=/usr/bin/phosphor-gpio-presence --path=${{DEVPATH}} --inventory=${{INVENTORY}} --key=${{KEY}} --name=${{NAME}}
SyslogIdentifier=phosphor-gpio-presence
[Install]
RequiredBy=multi-user.target
@@ -0,0 +1,12 @@
FILESEXTRAPATHS:append:ncplite := "${THISDIR}/${PN}:"
NCPLITE_OBMC_GPIO_INSTANCES = "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14"
NCPLITE_OBMC_GPIO_ENV_FMT = "obmc/gpio/gpio-{0}.conf"
TMPL = "phosphor-gpio-presence@.service"
INSTFMT = "phosphor-gpio-presence@{0}.service"
TGT = "multi-user.target"
FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
SYSTEMD_LINK:${PN}-presence:append:ncplite = " ${@compose_list(d, 'FMT', 'NCPLITE_OBMC_GPIO_INSTANCES')}"
SYSTEMD_ENVIRONMENT_FILE:${PN}-presence:append:ncplite = " ${@compose_list(d, 'NCPLITE_OBMC_GPIO_ENV_FMT', 'NCPLITE_OBMC_GPIO_INSTANCES')}"
@@ -0,0 +1,5 @@
OBMC_IMAGE_EXTRA_INSTALL:append = " \
ipmitool \
usbutils \
ethtool \
"
@@ -0,0 +1,4 @@
EXTRA_OEMESON:append = " \
-Dredfish-dbus-log=enabled \
-Dkvm=disabled \
"
@@ -0,0 +1,17 @@
SUMMARY = "Copy the inventory cleanup yaml for inventory manager"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit allarch
inherit phosphor-inventory-manager
S = "${WORKDIR}"
SRC_URI = "file://inventory-cleanup.yaml"
do_install() {
install -D inventory-cleanup.yaml ${D}${base_datadir}/events.d/inventory-cleanup.yaml
}
FILES:${PN} += "${base_datadir}/events.d/inventory-cleanup.yaml"
@@ -0,0 +1,16 @@
description: >
NCPLITE inventory fixups
events:
- name: Add Chassis interface
description: >
Add the chassis interface on the chassis inventory path
type: startup
actions:
- name: createObjects
objs:
/system/chassis:
xyz.openbmc_project.Inventory.Item.Chassis:
Type:
value: "xyz.openbmc_project.Inventory.Item.Chassis.ChassisType.RackMount"
type: string
@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
@@ -0,0 +1,8 @@
{
"id": 32,
"revision": 1,
"addn_dev_support": 143,
"manuf_id": 51242,
"prod_id": 9600,
"aux": 0
}
@@ -0,0 +1,17 @@
[Unit]
Description=Read %I EEPROM
Wants=mapper-wait@-xyz-openbmc_project-inventory.service
After=mapper-wait@-xyz-openbmc_project-inventory.service
StartLimitInterval=120
StartLimitBurst=10
[Service]
Restart=on-failure
RestartSec=10
EnvironmentFile={envfiledir}/obmc/eeproms/%I
ExecStartPre={bindir}/of-name-to-eeprom.sh {envfiledir}/obmc/eeproms/%I
ExecStart=/usr/bin/env phosphor-read-eeprom --eeprom $SYSFS_PATH --fruid $FRUID
SyslogIdentifier=phosphor-read-eeprom
[Install]
WantedBy=multi-user.target
@@ -0,0 +1,2 @@
SYSFS_PATH=/sys/bus/i2c/devices/3-0050/eeprom
FRUID=0
@@ -0,0 +1,2 @@
SYSFS_PATH=/sys/bus/i2c/devices/4-0050/eeprom
FRUID=1
@@ -0,0 +1,2 @@
SYSFS_PATH=/sys/bus/i2c/devices/5-0050/eeprom
FRUID=2
@@ -0,0 +1,34 @@
inherit obmc-phosphor-systemd
DEPENDS:append:ncplite = " ncplite-yaml-config"
FILESEXTRAPATHS:prepend:ncplite := "${THISDIR}/${PN}:"
SRC_URI:append:ncplite = " file://ncplite-obmc-read-eeprom@.service \
"
IPMI_FRU_YAML:ncplite="${STAGING_DIR_HOST}${datadir}/ncplite-yaml-config/ipmi-fru-read.yaml"
IPMI_FRU_PROP_YAML:ncplite="${STAGING_DIR_HOST}${datadir}/ncplite-yaml-config/ipmi-extra-properties.yaml"
EEPROM_NAMES = "motherboard psu1 psu0"
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:ncplite := " ${@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:ncplite := " ${@compose_list(d, 'FMT', 'EEPROMS_ESCAPED')}"
do_install:append:ncplite() {
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/ncplite-obmc-read-eeprom@.service ${D}${systemd_system_unitdir}/obmc-read-eeprom@.service
}
@@ -0,0 +1,4 @@
#!/bin/bash
echo "Ufi_Bmc: Trigger soft off the host"
exit 0
@@ -0,0 +1,13 @@
[Unit]
Description=Soft power off of the host
Wants=obmc-host-stop-pre@0.target
Before=obmc-host-stop-pre@0.target
Conflicts=obmc-host-start@0.target
ConditionPathExists=!/run/openbmc/host@0-request
ConditionPathExists=!/lib/systemd/system/pldmSoftPowerOff.service
[Service]
Restart=no
ExecStart=/usr/bin/env phosphor-softpoweroff
SyslogIdentifier=phosphor-softpoweroff
Type=oneshot
@@ -0,0 +1,20 @@
FILESEXTRAPATHS:append:ncplite := "${THISDIR}/${PN}:"
DEPENDS:append:ncplite = " ncplite-yaml-config"
EXTRA_OEMESON:ncplite = " \
-Dsensor-yaml-gen=${STAGING_DIR_HOST}${datadir}/ncplite-yaml-config/ipmi-sensors.yaml \
-Dfru-yaml-gen=${STAGING_DIR_HOST}${datadir}/ncplite-yaml-config/ipmi-fru-read.yaml \
-Dinvsensor-yaml-gen=${STAGING_DIR_HOST}${datadir}/ncplite-yaml-config/ipmi-inventory-sensors.yaml \
"
RDEPENDS:${PN} += "bash"
SRC_URI += "file://phosphor-softpoweroff \
file://xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \
"
do_install:append:ncplite (){
install -m 0755 ${WORKDIR}/phosphor-softpoweroff ${D}/${bindir}/phosphor-softpoweroff
install -m 0644 ${WORKDIR}/${SOFT_SVC} ${D}${systemd_unitdir}/system/${SOFT_SVC}
}
@@ -0,0 +1,18 @@
SUMMARY = "Phosphor LED Group Management for NCPLite"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit native
PROVIDES += "virtual/phosphor-led-manager-config-native"
SRC_URI += "file://led.yaml"
S = "${WORKDIR}"
# Copies example led layout yaml file
do_install() {
SRC=${S}
DEST=${D}${datadir}/phosphor-led-manager
install -D ${SRC}/led.yaml ${DEST}/led.yaml
}
@@ -0,0 +1,19 @@
bmc_booted:
power_on:
fan0_good:
fan0_fault:
fan1_good:
fan1_fault:
fan2_good:
fan2_fault:
fan3_good:
fan3_fault:
@@ -0,0 +1 @@
ERR_INFO_CAP = "256"
@@ -0,0 +1,7 @@
RDEPENDS:${PN}-inventory:append:ncplite = " phosphor-gpio-monitor-presence"
RDEPENDS:${PN}-chassis-state-mgmt:append:ncplite = " phosphor-state-manager-ncplite"
RDEPENDS:${PN}-extras:append:ncplite = " entity-manager \
dbus-sensors \
ncplite-inventory-log \
ncplite-led \
"
@@ -0,0 +1 @@
PACKAGECONFIG:append:ncplite = " log-threshold log-watchdog log-alarm send-to-logger"
@@ -0,0 +1 @@
PACKAGECONFIG:remove = " intrusionsensor ipmbsensor external nvmesensor"
@@ -0,0 +1,21 @@
/xyz/openbmc_project/ipmi/sol/eth0:
- Interface: xyz.openbmc_project.Ipmi.SOL
Properties:
Enable:
Default: 'true'
Privilege:
Default: 4
Progress:
Default: 0
RetryCount:
Default: 7
RetryIntervalMS:
Default: 100
Threshold:
Default: 1
/xyz/openbmc_project/control/host0/power_restore_policy:
- Interface: xyz.openbmc_project.Control.Power.RestorePolicy
Properties:
PowerRestorePolicy:
Default: RestorePolicy::Policy::AlwaysOn
@@ -0,0 +1,2 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append:ncplite = " file://ncplite_settings.override.yml"
@@ -0,0 +1,17 @@
{
"gpio_configs": {
"power_config": {
"power_good_in": "CPU_PWRGD",
"power_up_outs": [],
"reset_outs": []
}
},
"gpio_definitions": [
{
"name": "CPU_PWRGD",
"pin": "F0",
"direction": "in"
}
]
}
@@ -0,0 +1 @@
FILESEXTRAPATHS:prepend:ncplite := "${THISDIR}/${PN}:"
@@ -0,0 +1,3 @@
PACKAGECONFIG:append = " smbios-ipmi-blob"
PACKAGECONFIG:remove = " cpuinfo"
@@ -0,0 +1,59 @@
#!/bin/bash
# Usage of this utility
usage() {
echo "Usage: $(basename "$0") [on|off|forceoff]";
}
#Check CPU boot done pin drop in 30s
timeout=30
wait_graceful_off(){
echo "Wait for host shutdown in ${timeout}s"
while [ "${timeout}" -gt 0 ]; do
host_state=$(gpioget --numeric host0-ready)
timeout=$((timeout-1))
if [ "${host_state}" -eq 0 ]; then
echo "Host is graceful off"
return 0
fi
sleep 1
done
echo "Host still on, but reach timeout"
}
set_gpio_power_off() {
echo "Set GPIO to power off chassis"
gpioset --hold-period 50ms -t0 power-chassis-control0=1
gpioset --hold-period 50ms -t0 power-chassis-control1=1
}
set_gpio_power_on() {
echo "Set GPIO to power on chassis"
val=$(gpioget --numeric host0-ready)
if [ "$val" == 1 ]; then
exit 0
fi
gpioset --hold-period 50ms -t0 power-chassis-control0=0
gpioset --hold-period 50ms -t0 power-chassis-control1=0
#Record IPMI power cycle SEL
busctl call xyz.openbmc_project.Logging.IPMI \
/xyz/openbmc_project/Logging/IPMI \
xyz.openbmc_project.Logging.IPMI IpmiSelAdd ssaybq \
"Power Cycle" "/xyz/openbmc_project/state/host0" \
3 0x01 0xff 0xff true 0x0020
}
if [ "$1" == "on" ]; then
set_gpio_power_on
elif [ "$1" == "off" ]; then
wait_graceful_off
set_gpio_power_off
elif [ "$1" == "forceoff" ]; then
set_gpio_power_off
else
echo "Invalid parameter"
usage
fi
exit 0
@@ -0,0 +1,32 @@
#!/bin/bash
# Usage of this utility
usage() {
echo "Usage: $(basename "$0") [reset|gracefuloff]"
}
graceful_off() {
echo "Set GPIO to graceful shutdown Host"
gpioset --hold-period 50ms -t0 power-button=1
sleep 0.1
gpioset --hold-period 50ms -t0 power-button=0
gpioget power-button >/dev/null 2>&1
}
force_reset() {
echo "Set GPIO to reset Host"
gpioset --hold-period 50ms -t0 reset-button=0
sleep 0.1
gpioset --hold-period 50ms -t0 reset-button=1
gpioget reset-button >/dev/null 2>&1
}
if [ "$1" == "reset" ]; then
force_reset
elif [ "$1" == "gracefuloff" ]; then
graceful_off
else
echo "Invalid parameter"
usage
fi
exit 0
@@ -0,0 +1,15 @@
[Unit]
Description=NCPLite Chassis Power Off
Before=phosphor-wait-power-off@%i.service
Conflicts=ncplite-chassis-poweron@%i.target
[Service]
Type=oneshot
ExecStart=@SBINDIR@/chassis-control off
ExecStartPost=/bin/sh -c "busctl call xyz.openbmc_project.Logging.IPMI \
/xyz/openbmc_project/Logging/IPMI \
xyz.openbmc_project.Logging.IPMI IpmiSelAdd ssaybq \
'Power Off' '/xyz/openbmc_project/state/host0' \
3 0x00 0xff 0xff true 0x0020"
ExecStartPost=/bin/sleep 10
SyslogIdentifier=chassis-control
@@ -0,0 +1,10 @@
[Unit]
Description=NCPLite Chassis Power on
Before=phosphor-wait-power-on@%i.service
After=obmc-power-start-pre@%i.target
Conflicts=ncplite-chassis-poweroff@%i.target
[Service]
Type=oneshot
ExecStart=@SBINDIR@/chassis-control on
SyslogIdentifier=chassis-control
@@ -0,0 +1,15 @@
[Unit]
Description=NCPLite Force Reset Host%i
Wants=phosphor-reboot-host@%i.service
Conflicts=obmc-chassis-poweroff@%i.target
OnFailure=obmc-chassis-powerreset@%i.target
[Service]
RemainAfterExit=no
Type=oneshot
ExecStart=@SBINDIR@/host-control reset
ExecStartPost=/bin/sh -c "busctl call xyz.openbmc_project.Logging.IPMI /xyz/openbmc_project/Logging/IPMI xyz.openbmc_project.Logging.IPMI IpmiSelAdd ssaybq 'Reset Button Pressed' '/xyz/openbmc_project/state/chassis0' 3 0x02 0xff 0xff true 0x0020"
SyslogIdentifier=host-control
[Install]
WantedBy=obmc-host-force-warm-reboot@%i.target
@@ -0,0 +1,16 @@
[Unit]
Description=NCPLite Host%i Off
Before=obmc-chassis-hard-poweroff@%i.target
Before=obmc-chassis-poweroff@%i.target
Conflicts=obmc-host-startmin@%i.target
OnFailure=obmc-chassis-poweroff@%i.target
OnFailureJobMode=flush
[Service]
Type=oneshot
ExecStart=@SBINDIR@/host-control gracefuloff
ExecStartPost=/bin/sh -c "busctl call xyz.openbmc_project.Logging.IPMI \
/xyz/openbmc_project/Logging/IPMI \
xyz.openbmc_project.Logging.IPMI IpmiSelAdd ssaybq \
'Power Button Pressed' '/xyz/openbmc_project/state/chassis0' \
3 0x00 0xff 0xff true 0x0020"
@@ -0,0 +1,81 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
DEPENDS += "gpioplus"
DEPENDS += "systemd"
EXTRA_OEMESON:append = " -Dhost-gpios=enabled"
SRC_URI += " \
file://host-control \
file://chassis-control \
file://ncplite-chassis-poweroff@.service \
file://ncplite-chassis-poweron@.service \
file://ncplite-host-off@.service \
file://ncplite-host-force-reset@.service \
"
RDEPENDS:${PN}:append = " bash"
DBUS_PACKAGES:append = "${PN}-ncplite"
PACKAGE_BEFORE_PN += "${PN}-ncplite"
SYSTEMD_PACKAGES += "${PN}-ncplite"
SYSTEMD_SERVICE:${PN}-ncplite += "ncplite-chassis-poweron@.service"
SYSTEMD_SERVICE:${PN}-ncplite += "ncplite-chassis-poweroff@.service"
SYSTEMD_SERVICE:${PN}-ncplite += "ncplite-host-off@.service"
SYSTEMD_SERVICE:${PN}-ncplite += "ncplite-host-force-reset@.service"
# Chassis power on
CHASSIS_POWERON_SVC = "ncplite-chassis-poweron@.service"
CHASSIS_POWERON_INSTMPL = "ncplite-chassis-poweron@{0}.service"
CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target"
CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_INSTMPL}"
SYSTEMD_LINK:${PN}-ncplite += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
# Chassis power off
CHASSIS_POWEROFF_SVC = "ncplite-chassis-poweroff@.service"
CHASSIS_POWEROFF_INSTMPL = "ncplite-chassis-poweroff@{0}.service"
CHASSIS_POWEROFF_TGTFMT = "obmc-chassis-poweroff@{0}.target"
CHASSIS_POWEROFF_FMT = "../${CHASSIS_POWEROFF_SVC}:${CHASSIS_POWEROFF_TGTFMT}.requires/${CHASSIS_POWEROFF_INSTMPL}"
SYSTEMD_LINK:${PN}-ncplite += "${@compose_list_zip(d, 'CHASSIS_POWEROFF_FMT', 'OBMC_CHASSIS_INSTANCES')}"
# Host off
HOST_OFF_SVC = "ncplite-host-off@.service"
HOST_OFF_INSTMPL = "ncplite-host-off@{0}.service"
HOST_OFF_TGTFMT = "obmc-host-shutdown@{0}.target"
HOST_OFF_FMT = "../${HOST_OFF_SVC}:${HOST_OFF_TGTFMT}.requires/${HOST_OFF_INSTMPL}"
SYSTEMD_LINK:${PN}-ncplite += "${@compose_list_zip(d, 'HOST_OFF_FMT', 'OBMC_HOST_INSTANCES')}"
# Host force reboot
HOST_FORCE_RESET_SVC = "ncplite-host-force-reset@.service"
HOST_FORCE_RESET_INSTMPL = "ncplite-host-force-reset@{0}.service"
HOST_FORCE_RESET_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
HOST_FORCE_RESET_TARGET_FMT = "../${HOST_FORCE_RESET_SVC}:${HOST_FORCE_RESET_TGTFMT}.requires/${HOST_FORCE_RESET_INSTMPL}"
SYSTEMD_LINK:${PN}-ncplite += "${@compose_list_zip(d, 'HOST_FORCE_RESET_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
# Chassis hard power off require host off in our machine
CHASSIS_HARD_POWEROFF_TGTFMT = "obmc-chassis-hard-poweroff@{0}.target"
CHASSIS_HOST_OFF_FMT = "../${HOST_OFF_SVC}:${CHASSIS_HARD_POWEROFF_TGTFMT}.requires/${HOST_OFF_INSTMPL}"
SYSTEMD_LINK:${PN}-ncplite += "${@compose_list_zip(d, 'CHASSIS_HOST_OFF_FMT', 'OBMC_CHASSIS_INSTANCES')}"
do_install:append() {
install -d ${D}${sbindir}
install -m 0744 ${WORKDIR}/host-control ${D}${sbindir}/
install -m 0744 ${WORKDIR}/chassis-control ${D}${sbindir}/
}
FILES:${PN} += "${systemd_system_unitdir}/*"
FILES:${PN}-host += "${bindir}/phosphor-host-condition-gpio"
SYSTEMD_SERVICE:${PN}-host += "phosphor-host-condition-gpio@.service"
pkg_postinst:${PN}-obmc-targets:prepend() {
mkdir -p $D$systemd_system_unitdir/multi-user.target.requires
LINK="$D$systemd_system_unitdir/multi-user.target.requires/phosphor-host-condition-gpio@0.service"
TARGET="../phosphor-host-condition-gpio@.service"
ln -s $TARGET $LINK
}
pkg_prerm:${PN}-obmc-targets:prepend() {
LINK="$D$systemd_system_unitdir/multi-user.target.requires/phosphor-host-condition-gpio@0.service"
rm $LINK
}
@@ -0,0 +1,7 @@
[Unit]
Description=Watchdog Power Cycle
[Service]
Type=oneshot
ExecStart=/bin/sh -c "busctl set-property xyz.openbmc_project.State.Host /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Host RequestedHostTransition s 'xyz.openbmc_project.State.Host.Transition.Reboot'"
SyslogIdentifier=phosphor-watchdog"
@@ -0,0 +1,7 @@
[Unit]
Description=Watchdog Power Off
[Service]
Type=oneshot
ExecStart=/bin/sh -c "busctl set-property xyz.openbmc_project.State.Chassis /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis RequestedPowerTransition s xyz.openbmc_project.State.Chassis.Transition.Off"
SyslogIdentifier=phosphor-watchdog
@@ -0,0 +1,7 @@
[Unit]
Description=Watchdog Reset Host
[Service]
Type=oneshot
ExecStart=/bin/sh -c "busctl set-property xyz.openbmc_project.State.Host /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Host RequestedHostTransition s xyz.openbmc_project.State.Host.Transition.ForceWarmReboot"
SyslogIdentifier=phosphor-watchdog
@@ -0,0 +1,16 @@
[Unit]
Description=Phosphor Watchdog
[Service]
ExecStart=/usr/bin/phosphor-watchdog --continue --service=xyz.openbmc_project.Watchdog \
--path=/xyz/openbmc_project/watchdog/host0 \
--action_target=xyz.openbmc_project.State.Watchdog.Action.HardReset=phosphor-watchdog-host-reset.service \
--action_target=xyz.openbmc_project.State.Watchdog.Action.PowerOff=phosphor-watchdog-host-poweroff.service \
--action_target=xyz.openbmc_project.State.Watchdog.Action.PowerCycle=phosphor-watchdog-host-cycle.service \
SyslogIdentifier=phosphor-watchdog
BusName=xyz.openbmc_project.Watchdog
Type=dbus
[Install]
WantedBy=basic.target
@@ -0,0 +1,9 @@
FILESEXTRAPATHS:prepend:ncplite := "${THISDIR}/${PN}:"
# Remove the override to keep service running after DC cycle
SYSTEMD_OVERRIDE:${PN}:remove:ncplite = "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf"
SYSTEMD_SERVICE:${PN}:ncplite = " phosphor-watchdog.service \
phosphor-watchdog-host-poweroff.service \
phosphor-watchdog-host-cycle.service\
phosphor-watchdog-host-reset.service\
"