meta-lenovo: hr630: Add sensor configs
temperature sensors inlet and outlet of tmp75, adc voltage sensors
and fan-tach sensors.
Tested: Build it in hr630 image, load on hr630 platform,
make sure it could show these sensors correctly with command:
ipmitool sdr list.
(From meta-lenovo rev: 8cd1949d5b4c66682baf951bb8c060320032ad0b)
Signed-off-by: Lisa Liu <liuyj19@lenovo.com>
Change-Id: Idfd89ea40642130daddbb9e8c0384004c076638a
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@40/tmp75@4e.conf b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@40/tmp75@4e.conf
new file mode 100644
index 0000000..ef316c1
--- /dev/null
+++ b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@40/tmp75@4e.conf
@@ -0,0 +1,8 @@
+#"Copyright (c) 2019-present Lenovo
+#Licensed under BSD-3, see COPYING.BSD file for details."
+
+LABEL_temp1 = "inlet"
+WARNHI_temp1 = "60000"
+WARNLO_temp1 = "0"
+CRITHI_temp1 = "70000"
+CRITLO_temp1 = "0"
diff --git a/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@80/tmp75@4d.conf b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@80/tmp75@4d.conf
new file mode 100644
index 0000000..98ed39b
--- /dev/null
+++ b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@80/tmp75@4d.conf
@@ -0,0 +1,8 @@
+#"Copyright (c) 2019-present Lenovo
+#Licensed under BSD-3, see COPYING.BSD file for details."
+
+LABEL_temp1 = "outlet"
+WARNHI_temp1 = "60000"
+WARNLO_temp1 = "0"
+CRITHI_temp1 = "70000"
+CRITLO_temp1 = "0"
diff --git a/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf
new file mode 100644
index 0000000..d91006d
--- /dev/null
+++ b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf
@@ -0,0 +1,33 @@
+#"Copyright (c) 2019-present Lenovo
+#Licensed under BSD-3, see COPYING.BSD file for details."
+
+# hr630x has 14 fan ports
+LABEL_fan1 = "fan1"
+LABEL_fan2 = "fan2"
+LABEL_fan3 = "fan3"
+LABEL_fan4 = "fan4"
+LABEL_fan5 = "fan5"
+LABEL_fan6 = "fan6"
+LABEL_fan7 = "fan7"
+LABEL_fan8 = "fan8"
+LABEL_fan9 = "fan9"
+LABEL_fan10 = "fan10"
+LABEL_fan11 = "fan11"
+LABEL_fan12 = "fan12"
+LABEL_fan13 = "fan13"
+LABEL_fan14 = "fan14"
+
+PWM_TARGET_fan1 = "1"
+PWM_TARGET_fan2 = "1"
+PWM_TARGET_fan3 = "2"
+PWM_TARGET_fan4 = "2"
+PWM_TARGET_fan5 = "3"
+PWM_TARGET_fan6 = "3"
+PWM_TARGET_fan7 = "4"
+PWM_TARGET_fan8 = "4"
+PWM_TARGET_fan9 = "5"
+PWM_TARGET_fan10 = "5"
+PWM_TARGET_fan11 = "6"
+PWM_TARGET_fan12 = "6"
+PWM_TARGET_fan13 = "7"
+PWM_TARGET_fan14 = "7"
diff --git a/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/iio-hwmon.conf b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/iio-hwmon.conf
new file mode 100644
index 0000000..299d236
--- /dev/null
+++ b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/iio-hwmon.conf
@@ -0,0 +1,25 @@
+#"Copyright (c) 2019-present Lenovo
+#Licensed under BSD-3, see COPYING.BSD file for details."
+
+LABEL_in1=P12V_AUX
+GAIN_in1=8.90
+LABEL_in2=P5V_AUX
+GAIN_in2=3.68
+LABEL_in3=P3V3_AUX
+GAIN_in3=2.47
+LABEL_in4=P1V8_PCH_AUX
+GAIN_in4=1.50
+LABEL_in5=PVNN_PCH_AUX
+LABEL_in6=P1V05_PCH_AUX
+LABEL_in7=P1V2_DDR_BMC
+LABEL_in8=P1V15_BMC
+LABEL_in9=PVCCIO_CPU2
+LABEL_in10=PVCCIO_CPU1
+LABEL_in11=P12V_STBY
+GAIN_in11=8.90
+LABEL_in12=P12V
+GAIN_in12=8.90
+LABEL_in13=P5V
+GAIN_in13=3.68
+LABEL_in14=P3V3
+GAIN_in14=2.47
diff --git a/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
new file mode 100644
index 0000000..507954d
--- /dev/null
+++ b/meta-lenovo/meta-hr630/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
@@ -0,0 +1,18 @@
+#"Copyright (c) 2019-present Lenovo
+#Licensed under BSD-3, see COPYING.BSD file for details."
+
+FILESEXTRAPATHS_prepend_hr630 := "${THISDIR}/${PN}:"
+EXTRA_OECONF_append_hr630 = " --enable-negative-errno-on-fail"
+
+CHIPS = " \
+ bus@1e78a000/i2c-bus@40/tmp75@4e \
+ bus@1e78a000/i2c-bus@80/tmp75@4d \
+ pwm-tacho-controller@1e786000 \
+ "
+ITEMSFMT = "ahb/apb/{0}.conf"
+
+ITEMS = "${@compose_list(d, 'ITEMSFMT', 'CHIPS')}"
+ITEMS += "iio-hwmon.conf"
+
+ENVS = "obmc/hwmon/{0}"
+SYSTEMD_ENVIRONMENT_FILE_${PN}_append_hr630 := "${@compose_list(d, 'ENVS', 'ITEMS')}"