summaryrefslogtreecommitdiffstats
path: root/meta-openbmc-machines/meta-openpower/common
diff options
context:
space:
mode:
authorXo Wang <xow@google.com>2016-12-12 16:56:53 -0800
committerXo Wang <xow@google.com>2016-12-12 17:05:56 -0800
commit927394011a2d63a23ce65dbefd35476a260bb8a3 (patch)
treeba2edd834f84882a56295c5c09f9a53212c7be3c /meta-openbmc-machines/meta-openpower/common
parent1da3a353e58e6439f5b7c5a0634e1b382bb27bfc (diff)
downloadtalos-openbmc-927394011a2d63a23ce65dbefd35476a260bb8a3.tar.gz
talos-openbmc-927394011a2d63a23ce65dbefd35476a260bb8a3.zip
op-pdbg-host-control: Fix boot scripts for pdbg
The current scripts use ecmd-style bit ranges and call a "putcfam" function/command that doesn't exist. Use latest VCS fix and IPL start commands from Dean Sanner (including scratch register 8 value), converted to pdbg masked read-modify-write format. Add optional argument to scripts for specifying pdbg's '-d' flag. Scripts tested to boot a Zaius machine, but not tested with systemd services for sequencing. Partially resolves openbmc/openbmc#647. Signed-off-by: Xo Wang <xow@google.com> Change-Id: I87761d1454306ebf4ad597057d2160eae10dc8cb
Diffstat (limited to 'meta-openbmc-machines/meta-openpower/common')
-rwxr-xr-x[-rw-r--r--]meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/start_host.sh16
-rwxr-xr-x[-rw-r--r--]meta-openbmc-machines/meta-openpower/common/recipes-phosphor/host/op-pdbg-host-control/vcs_workaround.sh28
2 files changed, 36 insertions, 8 deletions
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
index c68c9ab69..909cde013 100644..100755
--- 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
@@ -1,4 +1,14 @@
-#!/bin/sh
+#!/bin/sh -e
+# Starts POWER9 IPL (boot)
-# send putcfam command to have SBE start IPL
-putcfam pu 2801 0 1 1 -ib
+PDBG=${PDBG:-pdbg}
+# Argument [device]: if provided, pass to pdbg as "-d [device]"
+DEVICE_OPT=${1:+-d $1}
+
+putcfam()
+{
+ $PDBG -b fsi $DEVICE_OPT putcfam $1 $2 $3
+}
+
+putcfam 0x283f 0x20000000 # Write scratch register 8
+putcfam 0x2801 0x80000000 0x80000000 # Set SBE start bit to start IPL
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
index 49d6bfbb8..4b30bfc50 100644..100755
--- 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
@@ -1,6 +1,24 @@
-#!/bin/sh
+#!/bin/sh -e
+# Apply fixes over FSI to POWER9 hosts. Required before VCS rail on.
-putcfam pu 0900 31 1 1 -ib # put the CFAM/FSI slave into async mode
-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
+PDBG=${PDBG:-pdbg}
+# Argument [device]: if provided, pass to pdbg as "-d [device]"
+DEVICE_OPT=${1:+-d $1}
+
+putcfam()
+{
+ $PDBG -b fsi $DEVICE_OPT putcfam $1 $2 $3
+}
+
+# P9 dd1 required workaround needed before powering VCS rails
+p9_dd1_vcs_workaround()
+{
+ putcfam 0x2810 0x00000000 0x00010000 && # Unfence PLL controls
+ putcfam 0x281A 0x40000000 0x40000000 && # Assert Perv chiplet endpoint reset, just in case
+ putcfam 0x281A 0x00000001 0x00000001 # Enable Nest PLL
+}
+
+# Put the CFAM/FSI slave into async mode
+putcfam 0x900 1
+
+p9_dd1_vcs_workaround
OpenPOWER on IntegriCloud