romed8hm3: Add phosphor-regulators config

The default configuration of the VRM that supplies the VDDCR_CPU supply
rail (ISL96147) provides a voltage that's significantly too high; we
need to twiddle some magic bits in a specific register to bring it into
spec (no public documentation of this particular VRM is available as far
as I've been able to find, unfortunately).

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I44d607b827e0fc7c18b9c336e63d0188e0955fd1
diff --git a/meta-asrock/meta-romed8hm3/recipes-phosphor/power/phosphor-power/config.json b/meta-asrock/meta-romed8hm3/recipes-phosphor/power/phosphor-power/config.json
new file mode 100644
index 0000000..33a7666
--- /dev/null
+++ b/meta-asrock/meta-romed8hm3/recipes-phosphor/power/phosphor-power/config.json
@@ -0,0 +1,32 @@
+{
+  "comments": [ "Config file for ASRock Rack ROMED8HM3" ],
+  "chassis": [
+    {
+      "comments": [ "Chassis number 1 containing CPUs and memory" ],
+      "number": 1,
+      "inventory_path": "system/chassis",
+      "devices": [
+        {
+          "comments": [ "ISL96147 regulator producing the VDDCR_CPU rail" ],
+          "id": "vddcr_cpu_regulator",
+          "is_regulator": true,
+          "fru": "system/board/ASRock_ROMED8HM3",
+          "i2c_interface": {
+            "bus": 6,
+            "address": "0x60"
+          },
+          "configuration": {
+            "actions": [
+              {
+                "i2c_write_bytes": {
+                  "register": "0xf0",
+                  "values": [ "0x07", "0x31" ]
+                }
+              }
+            ]
+          }
+        }
+      ]
+    }
+  ]
+}
diff --git a/meta-asrock/meta-romed8hm3/recipes-phosphor/power/phosphor-power_%.bbappend b/meta-asrock/meta-romed8hm3/recipes-phosphor/power/phosphor-power_%.bbappend
new file mode 100644
index 0000000..c3c12bf
--- /dev/null
+++ b/meta-asrock/meta-romed8hm3/recipes-phosphor/power/phosphor-power_%.bbappend
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS:append := ":${THISDIR}/${PN}"
+SRC_URI += "file://config.json"
+
+inherit obmc-phosphor-systemd
+SYSTEMD_LINK:${PN}-regulators += " ../${REGS_CONF_SVC}:xyz.openbmc_project.Chassis.Control.Power@0.service.requires/${REGS_CONF_SVC}"
+
+do_install:append() {
+    PR_CFGDIR=${D}/${datadir}/phosphor-regulators
+    install -d "$PR_CFGDIR"
+    install -m 0644 ${WORKDIR}/config.json "$PR_CFGDIR"
+}