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,5 @@
OBMC_IMAGE_EXTRA_INSTALL:append:quanta-q71l = " quanta-powerctrl"
# dts for q71l includes snooping, so let's leverage that.
OBMC_IMAGE_EXTRA_INSTALL:append:quanta-q71l = " phosphor-host-postd"
@@ -0,0 +1,2 @@
SYSFS_PATH=/sys/bus/i2c/devices/8-0050/eeprom
FRUID=50
@@ -0,0 +1,2 @@
SYSFS_PATH=/sys/bus/i2c/devices/1-0057/eeprom
FRUID=57
@@ -0,0 +1,2 @@
SYSFS_PATH=/sys/bus/i2c/devices/1-0054/eeprom
FRUID=56
@@ -0,0 +1,2 @@
SYSFS_PATH=/sys/bus/i2c/devices/7-0052/eeprom
FRUID=52
@@ -0,0 +1,20 @@
inherit obmc-phosphor-systemd
FILESEXTRAPATHS:prepend:quanta-q71l := "${THISDIR}/${PN}:"
EEPROM_NAMES = "motherboard pdb fp bmc"
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:quanta-q71l := " ${@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:quanta-q71l := " ${@compose_list(d, 'FMT', 'EEPROMS_ESCAPED')}"
@@ -0,0 +1,16 @@
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit native
DEPENDS += "virtual/phosphor-ipmi-fru-inventory"
PROVIDES += "virtual/phosphor-ipmi-fru-merge-config"
# Put the fru_config in the right place with the right name.
# Pull the IPMI FRU YAML config to use it in the IPMI HOST YAML.
do_install:append() {
IPMI_FRU_SRC=${datadir}/phosphor-ipmi-fru/config
IPMI_HOST_DEST=${D}${datadir}/phosphor-ipmi-host/config
install -d ${IPMI_HOST_DEST}
cat ${IPMI_FRU_SRC}/config.yaml > ${IPMI_HOST_DEST}/fru_config.yaml
}
@@ -0,0 +1,20 @@
SUMMARY = "Quanta-Q71l IPMI to DBus Inventory mapping."
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit phosphor-ipmi-fru
inherit native
SRC_URI += "file://config.yaml"
PROVIDES += "virtual/phosphor-ipmi-fru-inventory"
S = "${WORKDIR}"
do_install() {
DEST=${D}${config_datadir}
install -d ${DEST}
install config.yaml ${DEST}
}
@@ -0,0 +1,202 @@
0x56:
/system/chassis/motherboard:
entityID: 7
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
/system:
entityID: 23
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Decorator.Asset:
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Chassis
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Chassis
Model:
IPMIFruProperty: Type
IPMIFruSection: Chassis
0x50:
/system/chassis/motherboard/bmc:
entityID: 6
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Asset:
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
0x52:
/system/chassis/pdb:
entityID: 21
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Asset:
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
Model:
IPMIFruProperty: Model Number
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
0x57:
/system/chassis/fp:
entityID: 2
entityInstance: 1
interfaces:
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Asset:
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
Model:
IPMIFruProperty: Model Number
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
0x20:
/system/chassis/motherboard/mezzanine8/memory_riser:
entityID: 8
entityInstance: 1
interfaces: &riser
xyz.openbmc_project.Inventory.Item:
PrettyName:
IPMIFruProperty: Name
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Asset:
SerialNumber:
IPMIFruProperty: Serial Number
IPMIFruSection: Board
Manufacturer:
IPMIFruProperty: Manufacturer
IPMIFruSection: Board
PartNumber:
IPMIFruProperty: Part Number
IPMIFruSection: Board
BuildDate:
IPMIFruProperty: Mfg Date
IPMIFruSection: Board
Model:
IPMIFruProperty: Model Number
IPMIFruSection: Board
xyz.openbmc_project.Inventory.Decorator.Revision:
Version:
IPMIFruProperty: FRU File ID
IPMIFruSection: Board
0x21:
/system/chassis/motherboard/mezzanine7/memory_riser:
entityID: 8
entityInstance: 2
interfaces:
<<: *riser
0x22:
/system/chassis/motherboard/mezzanine6/memory_riser:
entityID: 8
entityInstance: 3
interfaces:
<<: *riser
0x23:
/system/chassis/motherboard/mezzanine5/memory_riser:
entityID: 8
entityInstance: 4
interfaces:
<<: *riser
0x24:
/system/chassis/motherboard/mezzanine4/memory_riser:
entityID: 8
entityInstance: 5
interfaces:
<<: *riser
0x25:
/system/chassis/motherboard/mezzanine3/memory_riser:
entityID: 8
entityInstance: 6
interfaces:
<<: *riser
0x26:
/system/chassis/motherboard/mezzanine2/memory_riser:
entityID: 8
entityInstance: 7
interfaces:
<<: *riser
0x27:
/system/chassis/motherboard/mezzanine1/memory_riser:
entityID: 8
entityInstance: 8
interfaces:
<<: *riser
@@ -0,0 +1,19 @@
SUMMARY = "Quanta Q71l IPMI to DBus Sensor mapping."
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit phosphor-ipmi-host
inherit native
PROVIDES += "virtual/phosphor-ipmi-sensor-inventory"
SRC_URI += "file://config.yaml"
S = "${WORKDIR}"
do_install() {
DEST=${D}${sensor_datadir}
install -d ${DEST}
install config.yaml ${DEST}/sensor.yaml
}
@@ -0,0 +1,519 @@
0xD0:
sensorType: 0x01
path: /xyz/openbmc_project/extsensors/margin/fleeting0
sensorReadingType: 0x01
multiplierM: 511
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC
rExp: -3
mutability: Mutability::Write|Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0xFF:
type: double
0xF0:
sensorType: 0x01
path: /xyz/openbmc_project/sensors/temperature/temp2_inlet
sensorReadingType: 0x01
multiplierM: 511
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xF1:
sensorType: 0x01
path: /xyz/openbmc_project/sensors/temperature/temp1
sensorReadingType: 0x01
multiplierM: 511
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xF2:
sensorType: 0x01
path: /xyz/openbmc_project/sensors/temperature/temp3
sensorReadingType: 0x01
multiplierM: 511
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xB0:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan1
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
rExp: 0
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xC0:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan1
sensorReadingType: 0x01
multiplierM: 1
offsetB: 0
bExp: 0
mutability: Mutability::Write
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Control.FanPwm:
Target:
Offsets:
0xFF:
type: uint64_t
0xB1:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan2
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
rExp: 0
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xC1:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan2
sensorReadingType: 0x01
multiplierM: 1
offsetB: 0
bExp: 0
mutability: Mutability::Write
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Control.FanPwm:
Target:
Offsets:
0xFF:
type: uint64_t
0xB2:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan3
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
rExp: 0
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xC2:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan3
sensorReadingType: 0x01
multiplierM: 1
offsetB: 0
bExp: 0
mutability: Mutability::Write
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Control.FanPwm:
Target:
Offsets:
0xFF:
type: uint64_t
0xB3:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan4
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
rExp: 0
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xC3:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan4
sensorReadingType: 0x01
multiplierM: 1
offsetB: 0
bExp: 0
mutability: Mutability::Write
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Control.FanPwm:
Target:
Offsets:
0xFF:
type: uint64_t
0xB4:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan5
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
rExp: 0
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xB5:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan6
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
rExp: 0
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xB6:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan7
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xB7:
sensorType: 0x04
path: /xyz/openbmc_project/sensors/fan_tach/fan8
sensorReadingType: 0x01
multiplierM: 100
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.RPMS
rExp: 0
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE0:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/p3v3_scaled
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE1:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/p5v_scaled
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE2:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/p12v_aux_scaled
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE3:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/p1v1_ssb
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE4:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/pvcc_cpu0
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE5:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/pvcc_cpu1
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE6:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/p3v3_aux_scaled
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE7:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/p5v_aux_scaled
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE8:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/pvcc_cpu2
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xE9:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/pvcc_cpu3
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xEA:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/p12v_scaled
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
0xEB:
sensorType: 0x02
path: /xyz/openbmc_project/sensors/voltage/p3v_vbat
sensorReadingType: 0x01
multiplierM: 64
offsetB: 0
bExp: 0
unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
rExp: -3
mutability: Mutability::Read
serviceInterface: org.freedesktop.DBus.Properties
readingType: readingData
interfaces:
xyz.openbmc_project.Sensor.Value:
Value:
Offsets:
0x0:
type: double
@@ -0,0 +1,9 @@
[Unit]
Description=Configure GPIOs for Host Power Control
[Service]
Restart=no
RemainAfterExit=true
Type=oneshot
ExecStart=/usr/bin/env init_once.sh
SyslogIdentifier=init_once.sh
@@ -0,0 +1,14 @@
[Unit]
Description=Stop Host
Requires=host-gpio.service
After=host-gpio.service
Conflicts=obmc-chassis-power-on@0.target
[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/usr/bin/env poweroff.sh
SyslogIdentifier=poweroff.sh
[Install]
WantedBy=obmc-chassis-power-off@0.target
@@ -0,0 +1,14 @@
[Unit]
Description=Start Host
Requires=host-gpio.service
After=host-gpio.service
Conflicts=obmc-chassis-poweroff@0.target
[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/usr/bin/env poweron.sh
SyslogIdentifier=poweron.sh
[Install]
WantedBy=obmc-chassis-poweron@0.target
@@ -0,0 +1,32 @@
#!/bin/bash
# Set all output GPIOs as such and drive them with reasonable values.
function set_gpio_active_low() {
if [ $# -ne 2 ]; then
echo "set_gpio_active_low: need both GPIO# and initial level";
return;
fi
echo "$1" > /sys/class/gpio/export
echo 1 > "/sys/class/gpio/gpio$1/active_low"
echo "$2" > "/sys/class/gpio/gpio$1/direction"
}
GPIO_BASE=$(cat /sys/devices/platform/ahb/ahb:apb/1e780000.gpio/gpio/*/base)
# FM_BMC_READY_N, GPIO Q4, active low
set_gpio_active_low $((GPIO_BASE + 128 + 4)) high
# FM_BMC_SSB_SMI_LPC_N, GPIO Q6, active low
set_gpio_active_low $((GPIO_BASE + 128 + 6)) high
# FM_BMC_SYS_THROTTLE_N, GPIO A3, active low
set_gpio_active_low $((GPIO_BASE + 0 + 3)) high
# FM_BMC_SSB_SCI_LPC_N, GPIO E4, active low
set_gpio_active_low $((GPIO_BASE + 32 + 4)) high
# FP_PWR_BTN_PASS_R_N, GPIO D3, active low
set_gpio_active_low $((GPIO_BASE + 24 + 3)) high
exit 0;
@@ -0,0 +1,10 @@
#!/bin/bash
GPIO_BASE=$(cat /sys/devices/platform/ahb/ahb:apb/1e780000.gpio/gpio/*/base)
GPIO_NUM=$((GPIO_BASE + 24 + 3))
echo 1 > /sys/class/gpio/gpio${GPIO_NUM}/value
sleep 5
echo 0 > /sys/class/gpio/gpio${GPIO_NUM}/value
exit 0;
@@ -0,0 +1,10 @@
#!/bin/bash
GPIO_BASE=$(cat /sys/devices/platform/ahb/ahb:apb/1e780000.gpio/gpio/*/base)
GPIO_NUM=$((GPIO_BASE + 24 + 3))
echo 1 > /sys/class/gpio/gpio${GPIO_NUM}/value
sleep 1
echo 0 > /sys/class/gpio/gpio${GPIO_NUM}/value
exit 0;
@@ -0,0 +1,28 @@
FILESEXTRAPATHS:append := "${THISDIR}/files:"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit systemd
inherit obmc-phosphor-systemd
S = "${WORKDIR}"
SRC_URI = "file://init_once.sh \
file://poweroff.sh \
file://poweron.sh \
file://host-gpio.service \
file://host-poweroff.service \
file://host-poweron.service"
DEPENDS = "systemd"
RDEPENDS:${PN} = "bash"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "host-gpio.service host-poweron.service host-poweroff.service"
do_install() {
install -d ${D}/${bindir}
install -m 0755 ${S}/init_once.sh ${D}/${bindir}/
install -m 0755 ${S}/poweroff.sh ${D}/${bindir}/
install -m 0755 ${S}/poweron.sh ${D}/${bindir}/
}
@@ -0,0 +1,15 @@
# PSU4
LABEL_in1=psu4_vin
LABEL_curr1=psu4_iin
LABEL_power1=psu4_pin
LABEL_in2=psu4_vout
#GAIN_in2=0.001953125
#GAIN is only required for AC PSUs.
LABEL_curr2=psu4_iout
LABEL_power2=psu4_pout
LABEL_temp1=psu4_temp1
LABEL_temp2=psu4_temp2
LABEL_temp3=psu4_temp3
LABEL_fan1=psu4_fan
# 1 minute interval
INTERVAL=60000000
@@ -0,0 +1,15 @@
# PSU1
LABEL_in1=psu1_vin
LABEL_curr1=psu1_iin
LABEL_power1=psu1_pin
LABEL_in2=psu1_vout
#GAIN_in2=0.001953125
#GAIN only required for AC PSUs.
LABEL_curr2=psu1_iout
LABEL_power2=psu1_pout
LABEL_temp1=psu1_temp1
LABEL_temp2=psu1_temp2
LABEL_temp3=psu1_temp3
LABEL_fan1=psu1_fan
# 1 minute interval
INTERVAL=60000000
@@ -0,0 +1,15 @@
# PSU3
LABEL_in1=psu3_vin
LABEL_curr1=psu3_iin
LABEL_power1=psu3_pin
LABEL_in2=psu3_vout
#GAIN_in2=0.001953125
#GAIN only required for AC PSUs
LABEL_curr2=psu3_iout
LABEL_power2=psu3_pout
LABEL_temp1=psu3_temp1
LABEL_temp2=psu3_temp2
LABEL_temp3=psu3_temp3
LABEL_fan1=psu3_fan
# 1 minute interval
INTERVAL=60000000
@@ -0,0 +1,15 @@
# PSU2
LABEL_in1=psu2_vin
LABEL_curr1=psu2_iin
LABEL_power1=psu2_pin
LABEL_in2=psu2_vout
#GAIN_in2=0.001953125
#GAIN is only required for AC PSUs.
LABEL_curr2=psu2_iout
LABEL_power2=psu2_pout
LABEL_temp1=psu2_temp1
LABEL_temp2=psu2_temp2
LABEL_temp3=psu2_temp3
LABEL_fan1=psu2_fan
# 1 minute interval
INTERVAL=60000000
@@ -0,0 +1,9 @@
LABEL_fan1=fan1
LABEL_fan2=fan2
LABEL_fan3=fan3
LABEL_fan4=fan4
LABEL_fan5=fan5
LABEL_fan6=fan6
LABEL_fan7=fan7
LABEL_fan8=fan8
@@ -0,0 +1,7 @@
LABEL_in1=p3v_vbat
GAIN_in1=3.000
# The battery read is controlled by G5
GPIOCHIP_in1=0
GPIO_in1=53
# Sleep in microseconds (stored into a uint64_t)
INTERVAL=86400000000
@@ -0,0 +1,19 @@
LABEL_in1=p3v3_scaled
GAIN_in1=1.62
LABEL_in2=p5v_scaled
GAIN_in2=2.47
LABEL_in3=p12v_aux_scaled
GAIN_in3=6.01
LABEL_in4=p1v1_ssb
LABEL_in5=pvcc_cpu0
LABEL_in6=pvcc_cpu1
LABEL_in7=p3v3_aux_scaled
GAIN_in7=1.62
LABEL_in8=p5v_aux_scaled
GAIN_in8=2.47
LABEL_in9=pvcc_cpu2
LABEL_in10=pvcc_cpu3
LABEL_in11=p12v_scaled
GAIN_in11=6.01
LABEL_in12=p3v_vbat
GAIN_in12=1.4992504
@@ -0,0 +1,26 @@
inherit obmc-phosphor-utils
FILESEXTRAPATHS:prepend:quanta-q71l := "${THISDIR}/${PN}:"
# More conf files can be added as sensors are added.
Q71L_PWM = "pwm-tacho-controller@1e786000"
Q71L_PWM_BASE = "ahb/apb/{0}.conf"
Q71L_ITEMS += "${@compose_list(d, 'Q71L_PWM_BASE', 'Q71L_PWM')}"
Q71L_TEMPS = "tmp75@4c tmp75@4e tmp75@4f"
Q71L_TEMPBASE = "ahb/apb/bus@1e78a000/i2c-bus@80/{0}.conf"
Q71L_ITEMS += "${@compose_list(d, 'Q71L_TEMPBASE', 'Q71L_TEMPS')}"
Q71L_ITEMS += "iio-hwmon.conf"
Q71L_ITEMS += "iio-hwmon-battery.conf"
Q71L_PSUS = "0/psu@59 1/psu@58 2/psu@58 3/psu@59"
Q71L_PSUBASE = "ahb/apb/bus@1e78a000/i2c-bus@300/i2c-switch@70/i2c@{0}.conf"
Q71L_ITEMS += "${@compose_list(d, 'Q71L_PSUBASE', 'Q71L_PSUS')}"
ENVS = "obmc/hwmon/{0}"
SYSTEMD_ENVIRONMENT_FILE:${PN}:append:quanta-q71l := " ${@compose_list(d, 'ENVS', 'Q71L_ITEMS')}"
EXTRA_OEMESON:append:quanta-q71l = " -Dnegative-errno-on-fail=true"