phosphor-power: Add phosphor power control bit bake files

Add bb files to support phosphor-power-control application in p10bmc
image. Remove skeleton power control application and phosphor-power
power sequencer application from image.

Signed-off-by: Jim Wright <jlwright@us.ibm.com>
Change-Id: Ib1c3cb5ba6880ea73265332107503b61def1a2ef
diff --git a/meta-ibm/recipes-phosphor/chassis/obmc-op-control-power_%.bbappend b/meta-ibm/recipes-phosphor/chassis/obmc-op-control-power_%.bbappend
index 4fc41d0..8bfef20 100644
--- a/meta-ibm/recipes-phosphor/chassis/obmc-op-control-power_%.bbappend
+++ b/meta-ibm/recipes-phosphor/chassis/obmc-op-control-power_%.bbappend
@@ -1 +1,6 @@
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+# Remove, from the p10bmc image, the service file that starts the skeleton power
+# control application. That image will use the power control application
+# included in the phosphor-power repository.
+DBUS_SERVICE:${PN}:remove:p10bmc = "${@compose_list(d, 'FMT', 'OBMC_POWER_INSTANCES')}"
diff --git a/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend b/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
index c6e0982..42f56cb 100644
--- a/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
+++ b/meta-ibm/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bbappend
@@ -9,8 +9,7 @@
 
 # P10 does not need/want the old PSU monitor
 POWER_SERVICE_PACKAGES_P10 = " \
-    phosphor-power-sequencer \
-    phosphor-power-systemd-links-sequencer \
+    phosphor-power-control \
     phosphor-power-utils \
     phosphor-power \
     phosphor-power-regulators \
@@ -24,6 +23,7 @@
 EXTRA_IBM_LOGGING_PKGS:p10bmc = " \
     python3-sbe-log-parsers \
 "
+
 RDEPENDS:${PN}-inventory:append:ibm-ac-server = " openpower-fru-vpd openpower-occ-control phosphor-cooling-type virtual/obmc-gpio-presence"
 RDEPENDS:${PN}-inventory:append:p10bmc = " openpower-fru-vpd openpower-occ-control virtual/obmc-gpio-presence"
 RDEPENDS:${PN}-inventory:append:mihawk = " openpower-fru-vpd openpower-occ-control virtual/obmc-gpio-presence id-button phosphor-cooling-type"
diff --git a/meta-ibm/recipes-phosphor/power/phosphor-power_%.bbappend b/meta-ibm/recipes-phosphor/power/phosphor-power_%.bbappend
index c8d6a46..17d25a1 100644
--- a/meta-ibm/recipes-phosphor/power/phosphor-power_%.bbappend
+++ b/meta-ibm/recipes-phosphor/power/phosphor-power_%.bbappend
@@ -5,7 +5,7 @@
 SRC_URI += "file://psu.json"
 
 EXTRA_OEMESON:append:ibm-ac-server = " -Ducd90160-yaml=${STAGING_DIR_HOST}${datadir}/power-sequencer/ucd90160.yaml"
-EXTRA_OEMESON:append:p10bmc = " -Ducd90160-yaml=${STAGING_DIR_HOST}${datadir}/power-sequencer/ucd90160.yaml -Dibm-vpd=true"
+EXTRA_OEMESON:append:p10bmc = " -Dibm-vpd=true"
 EXTRA_OEMESON:append:mihawk = " -Dpower_sequencer=mihawk-cpld"
 
 DEPENDS:append:ibm-ac-server = " power-sequencer"
diff --git a/meta-ibm/recipes-phosphor/power/power-sequencer.bb b/meta-ibm/recipes-phosphor/power/power-sequencer.bb
index 17ff4c2..57054ba 100644
--- a/meta-ibm/recipes-phosphor/power/power-sequencer.bb
+++ b/meta-ibm/recipes-phosphor/power/power-sequencer.bb
@@ -6,10 +6,8 @@
 inherit allarch
 
 SRC_URI:append:ibm-ac-server = " file://ucd90160.yaml"
-SRC_URI:append:p10bmc = " file://ucd90160.yaml"
 
 FILES:${PN}:append:ibm-ac-server = " ${datadir}/power-sequencer/ucd90160.yaml"
-FILES:${PN}:append:p10bmc = " ${datadir}/power-sequencer/ucd90160.yaml"
 
 S = "${WORKDIR}"
 
@@ -19,8 +17,3 @@
     install -D ucd90160.yaml ${DEST}/ucd90160.yaml
 }
 
-do_install:append:p10bmc() {
-    DEST=${D}${datadir}/power-sequencer
-
-    install -D ucd90160.yaml ${DEST}/ucd90160.yaml
-}
diff --git a/meta-ibm/recipes-phosphor/power/power-sequencer/p10bmc/ucd90160.yaml b/meta-ibm/recipes-phosphor/power/power-sequencer/p10bmc/ucd90160.yaml
deleted file mode 100644
index a6bba44..0000000
--- a/meta-ibm/recipes-phosphor/power/power-sequencer/p10bmc/ucd90160.yaml
+++ /dev/null
@@ -1,201 +0,0 @@
-- Device:
-  index: 0
-  # Linux sysfs path for this power sequencer (0x22 8-bit address)
-  path:  /sys/bus/i2c/devices/i2c-8/8-0011
-  RailNames:
-      - "12.0V"
-      - "5.0V_USB"
-      - "5.0V_DASD"
-      - "3.3VA"
-      - "3.3VB"
-      - "1.5V"
-      - "1.1V"
-      - "VDDA_DCM0"
-      - "VDDB_DCM0"
-      - "VDDA_DCM1"
-      - "VDDB_DCM1"
-      - "12.0VCS"
-      - "3.3VCS"
-      - "1.1V_Current"
-      - "5.0V_USB_Current"
-      - "5.0V_DASD_Current"
-      - "12.0VN"
-      - "12.0VP"
-      - "12.0VQ"
-      - "12.0VR"
-      - "ThermalDiode1"
-      - "ThermalDiode2"
-      - "ThermalDiode3"
-      - "ThermalDiode4"
-  GPIConfigs:
-      - name:            PCIE_SLOT0
-        gpi:             1
-        pinID:           44
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT1
-        gpi:             2
-        pinID:           45
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT2
-        gpi:             3
-        pinID:           46
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT3
-        gpi:             4
-        pinID:           47
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT4
-        gpi:             5
-        pinID:           48
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT7
-        gpi:             6
-        pinID:           49
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT8
-        gpi:             7
-        pinID:           50
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT9
-        gpi:             8
-        pinID:           51
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT10
-        gpi:             9
-        pinID:           52
-        poll:            false
-        analysis:        none
-      - name:            PCIE_SLOT11
-        gpi:             10
-        pinID:           53
-        poll:            false
-        analysis:        none
-      - name:            SOFTWARE_PGOOD
-        gpi:             11
-        pinID:           55
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12A
-        gpi:             12
-        pinID:           56
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12B
-        gpi:             13
-        pinID:           57
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12C
-        gpi:             14
-        pinID:           58
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12D
-        gpi:             15
-        pinID:           59
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12L
-        gpi:             16
-        pinID:           60
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12M
-        gpi:             17
-        pinID:           61
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12N
-        gpi:             18
-        pinID:           62
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12P
-        gpi:             19
-        pinID:           63
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12PCIE
-        gpi:             20
-        pinID:           64
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12Q
-        gpi:             21
-        pinID:           65
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_12R
-        gpi:             22
-        pinID:           66
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_VDN_DCM0
-        gpi:             23
-        pinID:           72
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_VDN_DCM1
-        gpi:             24
-        pinID:           73
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_VCS_DCM0
-        gpi:             25
-        pinID:           74
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_VCS_DCM1
-        gpi:             26
-        pinID:           75
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_VIO_DCM0
-        gpi:             27
-        pinID:           76
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_VIO_DCM1
-        gpi:             28
-        pinID:           77
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_VPCIE_DCM0
-        gpi:             29
-        pinID:           78
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_VPCIE_DCM1
-        gpi:             30
-        pinID:           79
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_PSU1
-        gpi:             31
-        pinID:           80
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_PSU2
-        gpi:             32
-        pinID:           81
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_PSU3
-        gpi:             33
-        pinID:           82
-        poll:            false
-        analysis:        none
-      - name:            PGOOD_PSU4
-        gpi:             34
-        pinID:           83
-        poll:            false
-        analysis:        none
-
diff --git a/meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb b/meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb
index 3db26f9..a9bc167 100644
--- a/meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb
+++ b/meta-phosphor/recipes-phosphor/power/phosphor-power_git.bb
@@ -19,6 +19,7 @@
     ${PN}-psu-monitor \
     ${PN}-regulators \
     ${PN}-sequencer \
+    ${PN}-control \
 "
 POWER_UTIL_PACKAGES = "${PN}-utils"
 
@@ -54,11 +55,13 @@
 REGS_CONF_SVC = "phosphor-regulators-config.service"
 REGS_MON_ENA_SVC = "phosphor-regulators-monitor-enable.service"
 REGS_MON_DIS_SVC = "phosphor-regulators-monitor-disable.service"
+POWER_CONTROL_SVC = "phosphor-power-control.service"
 
 SYSTEMD_SERVICE:${PN}-sequencer = "${SEQ_MONITOR_SVC} ${SEQ_PGOOD_SVC}"
 SYSTEMD_SERVICE:${PN}-monitor = "${@bb.utils.contains('PACKAGECONFIG', 'monitor', '${PSU_MONITOR_TMPL}', '', d)}"
 SYSTEMD_SERVICE:${PN}-psu-monitor = "${PSU_MONITOR_SVC}"
 SYSTEMD_SERVICE:${PN}-regulators = "${REGS_SVC} ${REGS_CONF_SVC} ${REGS_MON_ENA_SVC} ${REGS_MON_DIS_SVC}"
+SYSTEMD_SERVICE:${PN}-control = "${POWER_CONTROL_SVC}"
 
 
 # TODO: cold-redundancy is not installed in the repo yet
@@ -69,4 +72,5 @@
 FILES:${PN}-regulators = "${bindir}/phosphor-regulators ${datadir}/phosphor-regulators"
 FILES:${PN}-regulators += "${bindir}/regsctl"
 FILES:${PN}-sequencer = "${bindir}/pseq-monitor"
+FILES:${PN}-control = "${bindir}/phosphor-power-control ${datadir}/phosphor-power-sequencer"
 FILES:${PN}-utils = "${bindir}/psutils"