meta-ethanolx: Support AST2500 internal ADC sensor

Populate ADC sensor data to the system. This change make ADC data
accessible over DBus, IPMI, Redfish and webui-vue.

The threshold values were calculated as 10% from the target values.

The "PowerState: On" entity-manager parameter on the "*_RUN" channels
is used to make thresholds active only when the board is powered on.

Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Change-Id: I5322e83fdbfa0815bed454ea81b83725a2221d2c
diff --git a/meta-amd/meta-ethanolx/recipes-phosphor/configuration/entity-manager/ethanolx-baseboard.json b/meta-amd/meta-ethanolx/recipes-phosphor/configuration/entity-manager/ethanolx-baseboard.json
index b45cdac..08d66c0 100644
--- a/meta-amd/meta-ethanolx/recipes-phosphor/configuration/entity-manager/ethanolx-baseboard.json
+++ b/meta-amd/meta-ethanolx/recipes-phosphor/configuration/entity-manager/ethanolx-baseboard.json
@@ -41,6 +41,109 @@
             "Type": "FanConnector"
         },
         {
+            "Index": 0,
+            "Name": "5_DUAL",
+            "ScaleFactor": 0.272,
+            "Thresholds": [
+                {
+                    "Direction": "greater than",
+                    "Name": "upper critical",
+                    "Severity": 1,
+                    "Value": 5.5
+                },
+                {
+                    "Direction": "less than",
+                    "Name": "lower critical",
+                    "Severity": 1,
+                    "Value": 4.5
+                }
+            ],
+            "Type": "ADC"
+        },
+        {
+            "Index": 1,
+            "Name": "33_DUAL",
+            "ScaleFactor": 0.411,
+            "Thresholds": [
+                {
+                    "Direction": "greater than",
+                    "Name": "upper critical",
+                    "Severity": 1,
+                    "Value": 3.63
+                },
+                {
+                    "Direction": "less than",
+                    "Name": "lower critical",
+                    "Severity": 1,
+                    "Value": 2.97
+                }
+            ],
+            "Type": "ADC"
+        },
+        {
+            "Index": 2,
+            "Name": "12_RUN",
+            "PowerState": "On",
+            "ScaleFactor": 0.113,
+            "Thresholds": [
+                {
+                    "Direction": "greater than",
+                    "Name": "upper critical",
+                    "Severity": 1,
+                    "Value": 13.2
+                },
+                {
+                    "Direction": "less than",
+                    "Name": "lower critical",
+                    "Severity": 1,
+                    "Value": 10.8
+                }
+            ],
+            "Type": "ADC"
+        },
+        {
+            "Index": 3,
+            "Name": "5_RUN",
+            "PowerState": "On",
+            "ScaleFactor": 0.272,
+            "Thresholds": [
+                {
+                    "Direction": "greater than",
+                    "Name": "upper critical",
+                    "Severity": 1,
+                    "Value": 5.5
+                },
+                {
+                    "Direction": "less than",
+                    "Name": "lower critical",
+                    "Severity": 1,
+                    "Value": 4.5
+                }
+            ],
+            "Type": "ADC"
+        },
+        {
+            "Index": 4,
+            "Name": "33_RUN",
+            "PowerState": "On",
+            "ScaleFactor": 0.411,
+            "Thresholds": [
+                {
+                    "Direction": "greater than",
+                    "Name": "upper critical",
+                    "Severity": 1,
+                    "Value": 3.63
+                },
+                {
+                    "Direction": "less than",
+                    "Name": "lower critical",
+                    "Severity": 1,
+                    "Value": 2.97
+                }
+            ],
+            "Type": "ADC"
+        },
+        {
             "Address": "0x61",
             "Bus": 4,
             "Labels": [
diff --git a/meta-amd/meta-ethanolx/recipes-phosphor/configuration/ethanolx-yaml-config/ethanolx-ipmi-sensors.yaml b/meta-amd/meta-ethanolx/recipes-phosphor/configuration/ethanolx-yaml-config/ethanolx-ipmi-sensors.yaml
index 820c414..4d2bbb2 100644
--- a/meta-amd/meta-ethanolx/recipes-phosphor/configuration/ethanolx-yaml-config/ethanolx-ipmi-sensors.yaml
+++ b/meta-amd/meta-ethanolx/recipes-phosphor/configuration/ethanolx-yaml-config/ethanolx-ipmi-sensors.yaml
@@ -1414,3 +1414,113 @@
         Offsets:
           0xFF:
             type: double
+
+67:
+  sensorType: 0x02
+  entityID: 0x07
+  path: /xyz/openbmc_project/sensors/voltage/5_DUAL
+  sensorName: 5_DUAL
+  sensorReadingType: 0x01
+  unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
+  multiplierM: 30
+  scale: 0
+  offsetB: 0
+  bExp: 0
+  rExp: -3
+  mutability: Mutability::Read
+  serviceInterface: org.freedesktop.DBus.Properties
+  readingType: readingData
+  interfaces:
+    xyz.openbmc_project.Sensor.Value:
+      Value:
+        Offsets:
+          0xFF:
+            type: double
+
+68:
+  sensorType: 0x02
+  entityID: 0x07
+  path: /xyz/openbmc_project/sensors/voltage/33_DUAL
+  sensorName: 33_DUAL
+  sensorReadingType: 0x01
+  unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
+  multiplierM: 15
+  scale: 0
+  offsetB: 0
+  bExp: 0
+  rExp: -3
+  mutability: Mutability::Read
+  serviceInterface: org.freedesktop.DBus.Properties
+  readingType: readingData
+  interfaces:
+    xyz.openbmc_project.Sensor.Value:
+      Value:
+        Offsets:
+          0xFF:
+            type: double
+
+69:
+  sensorType: 0x02
+  entityID: 0x07
+  path: /xyz/openbmc_project/sensors/voltage/12_RUN
+  sensorName: 12_RUN
+  sensorReadingType: 0x01
+  unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
+  multiplierM: 60
+  scale: 0
+  offsetB: 0
+  bExp: 0
+  rExp: -3
+  mutability: Mutability::Read
+  serviceInterface: org.freedesktop.DBus.Properties
+  readingType: readingData
+  interfaces:
+    xyz.openbmc_project.Sensor.Value:
+      Value:
+        Offsets:
+          0xFF:
+            type: double
+
+70:
+  sensorType: 0x02
+  entityID: 0x07
+  path: /xyz/openbmc_project/sensors/voltage/5_RUN
+  sensorName: 5_RUN
+  sensorReadingType: 0x01
+  unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
+  multiplierM: 30
+  scale: 0
+  offsetB: 0
+  bExp: 0
+  rExp: -3
+  mutability: Mutability::Read
+  serviceInterface: org.freedesktop.DBus.Properties
+  readingType: readingData
+  interfaces:
+    xyz.openbmc_project.Sensor.Value:
+      Value:
+        Offsets:
+          0xFF:
+            type: double
+
+71:
+  sensorType: 0x02
+  entityID: 0x07
+  path: /xyz/openbmc_project/sensors/voltage/33_RUN
+  sensorName: 33_RUN
+  sensorReadingType: 0x01
+  unit: xyz.openbmc_project.Sensor.Value.Unit.Volts
+  multiplierM: 15
+  scale: 0
+  offsetB: 0
+  bExp: 0
+  rExp: -3
+  mutability: Mutability::Read
+  serviceInterface: org.freedesktop.DBus.Properties
+  readingType: readingData
+  interfaces:
+    xyz.openbmc_project.Sensor.Value:
+      Value:
+        Offsets:
+          0xFF:
+            type: double
diff --git a/meta-amd/meta-ethanolx/recipes-phosphor/sensors/dbus-sensors_%.bbappend b/meta-amd/meta-ethanolx/recipes-phosphor/sensors/dbus-sensors_%.bbappend
index ee3306a..856cf10 100644
--- a/meta-amd/meta-ethanolx/recipes-phosphor/sensors/dbus-sensors_%.bbappend
+++ b/meta-amd/meta-ethanolx/recipes-phosphor/sensors/dbus-sensors_%.bbappend
@@ -2,4 +2,5 @@
     hwmontempsensor \
     fansensor \
     psusensor \
+    adcsensor \
     "