Add supporting scripts for the OpenPOWER P9 processor.

Add Witherspoon power sequencer configuration scripts.
Add P9 VCS workaround script.
Add P9 SBE start instructions script.

Partially resolves openbmc/openbmc#647

Change-Id: I0a25b2fc0fc74b2a88fd7d2c77b59aa72e0b2876
Signed-off-by: Sergey Solomin <sergey.solomin@us.ibm.com>
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host.sh b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host.sh
new file mode 100644
index 0000000..c68c9ab
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# send putcfam command to have SBE start IPL
+putcfam pu 2801 0 1 1 -ib
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround.sh b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround.sh
new file mode 100644
index 0000000..ec3cbcf
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+gpioutil -p D0 -d out -v 1   # enable fsi link
+putcfam pu 2810 15 1 0       # Unfence PLL controls
+putcfam pu 281A  1 1 f       # Assert Perv chiplet endpoint reset, just in case
+putcfam pu 281A 31 1 f       # Enable Nest PLL
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_off.sh b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_off.sh
new file mode 100644
index 0000000..b219546
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_off.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# use these commands to properly disable VCS before powering on
+# A side
+i2cset -y 4 0x70 0x00 0x01 b
+i2cset -y 4 0x70 0x02 0x16 b #respond to OPERATION
+i2cset -y 4 0x70 0x00 0x00 b
+# B side
+i2cset -y 5 0x70 0x00 0x01 b
+i2cset -y 5 0x70 0x02 0x16 b #respond to OPERATION
+i2cset -y 5 0x70 0x00 0x00 b
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_on.sh b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_on.sh
new file mode 100644
index 0000000..4837575
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/vcs_on.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# enable VCS rail with OPERATION
+# A side
+i2cset -y 4 0x70 0x00 0x01 b
+i2cset -y 4 0x70 0x02 0x1A b #respond to OPERATION
+i2cset -y 4 0x70 0x00 0x00 b
+# B side
+i2cset -y 5 0x70 0x00 0x01 b
+i2cset -y 5 0x70 0x02 0x1A b #respond to OPERATION
+i2cset -y 5 0x70 0x00 0x00 b