meta-amd: Enable hwmon to monitor thermal sensors and fan

This patch adds the thermal sensor details including type, thresholds,
etc and enables phosphor-hwmon application to monitor the thermal
sensors.

Also, this patch describes the fan details present on EthnaolX platform.

Change-Id: Ic748f19d097643c7331acfddca276888cb76db32
Signed-off-by: Supreeth Venkatesh <supreeth.venkatesh@amd.com>
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@48.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@48.conf
new file mode 100644
index 0000000..9cd98bb
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@48.conf
@@ -0,0 +1,8 @@
+LABEL_temp1= "BMC"
+WARNLO_temp1= "5000"
+WARNHI_temp1= "38000"
+CRITHI_temp1 = "40000"
+CRITLO_temp1 = "0"
+MINVALUE_temp1 = "-128"
+MAXVALUE_temp1 = "127"
+EVENT_temp1= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@49.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@49.conf
new file mode 100644
index 0000000..8e4a2af
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@49.conf
@@ -0,0 +1,8 @@
+LABEL_temp1= "DIMM_P0_ABCD_P1_EFGH"
+WARNLO_temp1= "5000"
+WARNHI_temp1= "38000"
+CRITHI_temp1 = "40000"
+CRITLO_temp1 = "0"
+MINVALUE_temp1 = "-128"
+MAXVALUE_temp1 = "127"
+EVENT_temp1= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4a.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4a.conf
new file mode 100644
index 0000000..5c5c230
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4a.conf
@@ -0,0 +1,8 @@
+LABEL_temp1= "DIMM_P1_EFGH"
+WARNLO_temp1= "5000"
+WARNHI_temp1= "38000"
+CRITHI_temp1 = "40000"
+CRITLO_temp1 = "0"
+MINVALUE_temp1 = "-128"
+MAXVALUE_temp1 = "127"
+EVENT_temp1= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4b.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4b.conf
new file mode 100644
index 0000000..3570aaf
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4b.conf
@@ -0,0 +1,8 @@
+LABEL_temp1= "PCIe_Slots"
+WARNLO_temp1= "5000"
+WARNHI_temp1= "38000"
+CRITHI_temp1 = "40000"
+CRITLO_temp1 = "0"
+MINVALUE_temp1 = "-128"
+MAXVALUE_temp1 = "127"
+EVENT_temp1= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4c.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4c.conf
new file mode 100644
index 0000000..6814329
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4c.conf
@@ -0,0 +1,8 @@
+LABEL_temp1= "DIMM_P0_EFGH_P1_ABCD"
+WARNLO_temp1= "5000"
+WARNHI_temp1= "38000"
+CRITHI_temp1 = "40000"
+CRITLO_temp1 = "0"
+MINVALUE_temp1 = "-128"
+MAXVALUE_temp1 = "127"
+EVENT_temp1= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4d.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4d.conf
new file mode 100644
index 0000000..51a5e29
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4d.conf
@@ -0,0 +1,8 @@
+LABEL_temp1= "DIMM_P1_ABCD"
+WARNLO_temp1= "5000"
+WARNHI_temp1= "38000"
+CRITHI_temp1 = "40000"
+CRITLO_temp1 = "0"
+MINVALUE_temp1 = "-128"
+MAXVALUE_temp1 = "127"
+EVENT_temp1= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4e.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4e.conf
new file mode 100644
index 0000000..0c28e5d
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4e.conf
@@ -0,0 +1,8 @@
+LABEL_temp1= "DIMM_P0_EFGH"
+WARNLO_temp1= "5000"
+WARNHI_temp1= "38000"
+CRITHI_temp1 = "40000"
+CRITLO_temp1 = "0"
+MINVALUE_temp1 = "-128"
+MAXVALUE_temp1 = "127"
+EVENT_temp1= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4f.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4f.conf
new file mode 100644
index 0000000..9a0eb75
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/bus@1e78a000/i2c-bus@300/lm75a@4f.conf
@@ -0,0 +1,8 @@
+LABEL_temp1= "DIMM_P0_ABCD"
+WARNLO_temp1= "5000"
+WARNHI_temp1= "38000"
+CRITHI_temp1 = "40000"
+CRITLO_temp1 = "0"
+MINVALUE_temp1 = "-128"
+MAXVALUE_temp1 = "127"
+EVENT_temp1= "WARNHI,WARNLO,CRITHI,CRITLO"
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf
new file mode 100644
index 0000000..a781bcf
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon/obmc/hwmon/ahb/apb/pwm-tacho-controller@1e786000.conf
@@ -0,0 +1,7 @@
+# EthanolX has 8 fan ports but only 2 are standard 4-wire fans with PWM and TACH.
+LABEL_fan1 = "P0 fan"
+LABEL_fan2 = "P1 fan"
+
+PWM_TARGET_fan1 = "1"
+PWM_TARGET_fan2 = "2"
+
diff --git a/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
new file mode 100644
index 0000000..fc565dc
--- /dev/null
+++ b/meta-ethanolx/recipes-phosphor/sensors/phosphor-hwmon_%.bbappend
@@ -0,0 +1,20 @@
+FILESEXTRAPATHS_prepend_ethanolx := "${THISDIR}/${PN}:"
+EXTRA_OECONF_append_ethanolx = " --enable-negative-errno-on-fail"
+
+
+CHIPS = " \
+        bus@1e78a000/i2c-bus@300/lm75a@48 \
+        bus@1e78a000/i2c-bus@300/lm75a@49 \
+        bus@1e78a000/i2c-bus@300/lm75a@4a \
+        bus@1e78a000/i2c-bus@300/lm75a@4b \
+        bus@1e78a000/i2c-bus@300/lm75a@4c \
+        bus@1e78a000/i2c-bus@300/lm75a@4d \
+        bus@1e78a000/i2c-bus@300/lm75a@4e \
+        bus@1e78a000/i2c-bus@300/lm75a@4f \
+        pwm-tacho-controller@1e786000 \
+        "
+ITEMSFMT = "ahb/apb/{0}.conf"
+ITEMS = "${@compose_list(d, 'ITEMSFMT', 'CHIPS')}"
+
+ENVS = "obmc/hwmon/{0}"
+SYSTEMD_ENVIRONMENT_FILE_${PN}_append_ethanolx = " ${@compose_list(d, 'ENVS', 'ITEMS')}"