meta-nicole: Initial version

NICOLE is a new storage controller for TATLIN server.
It based on IBM Romulus reference design (POWER9)
and uses an AST2500 BMC SoC.

(From meta-yadro rev: 13af90da095c5eb6874ce6f89a8b66a7932e6c50)

Change-Id: I4685be88448e1de8a1a716ad3f59ef09e168a1df
Signed-off-by: Alexander Soldatov <a.soldatov@yadro.com>
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control.sh b/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control.sh
new file mode 100755
index 0000000..0330b22
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/chassis/avsbus-control/avsbus-control.sh
@@ -0,0 +1,31 @@
+#!/bin/sh -eu
+
+function override_avs_settings()
+{
+    BUS=$1
+
+    i2cset -y ${BUS} 0x44 0x00 0x00 b    # VCS
+    i2cset -y ${BUS} 0x44 0x24 0x044C w  # VOUT_MAX 1100mV
+    i2cset -y ${BUS} 0x44 0x40 0x0456 w  # VOUT_OV_FAULT_LIMIT 1110mV
+    i2cset -y ${BUS} 0x44 0x25 0x0438 w  # VOUT_MARGING_HIGH 1080mV
+    i2cset -y ${BUS} 0x44 0x26 0x03D4 w  # VOUT_MARGING_LOW 980mV
+    i2cset -y ${BUS} 0x44 0x44 0x024E w  # VOUT_UV_FAULT_LIMIT 590mV
+    i2cset -y ${BUS} 0x44 0x2B 0x0258 w  # VOUT_MIN 600mV
+
+    i2cset -y ${BUS} 0x44 0x00 0x01 b    # VDD
+    i2cset -y ${BUS} 0x44 0x24 0x044C w  # VOUT_MAX 1100mV
+    i2cset -y ${BUS} 0x44 0x40 0x0456 w  # VOUT_OV_FAULT_LIMIT 1110mV
+    i2cset -y ${BUS} 0x44 0x25 0x041A w  # VOUT_MARGING_HIGH 1050mV
+    i2cset -y ${BUS} 0x44 0x26 0x03B6 w  # VOUT_MARGING_LOW 950mV
+    i2cset -y ${BUS} 0x44 0x44 0x024E w  # VOUT_UV_FAULT_LIMIT 590mV
+    i2cset -y ${BUS} 0x44 0x2B 0x0258 w  # VOUT_MIN 600mV
+
+    i2cset -y ${BUS} 0x44 0x00 0xFF b   # All pages (VCS & VDD)
+    i2cset -y ${BUS} 0x44 0x01 0xB0 b   # Enable
+
+    i2cset -y ${BUS} 0x46 0x00 0x01 b    # VDN
+    i2cset -y ${BUS} 0x46 0x01 0xB0 b    # Enable
+}
+
+override_avs_settings 4
+override_avs_settings 5