meta-bletchley: move chassis and host power control service into phosphor-state-manager

Move chassis and host power control services as part of PSM package to
align with other platforms in meta-facebook.

Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I6e6afc0ad62d3b872b330202a4696b704d245911
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/detect-gpio-present/files/bletchley-sled-insertion@.target b/meta-facebook/meta-bletchley/recipes-bletchley/detect-gpio-present/files/bletchley-sled-insertion@.target
index 6fef027..6b516a1 100644
--- a/meta-facebook/meta-bletchley/recipes-bletchley/detect-gpio-present/files/bletchley-sled-insertion@.target
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/detect-gpio-present/files/bletchley-sled-insertion@.target
@@ -1,8 +1,8 @@
 [Unit]
 Description=Bletchlet SLED%i insertion target
 
-Requires=host-ac-on@%i.service
-After=host-ac-on@%i.service
+Requires=chassis-poweron@%i.service
+After=chassis-poweron@%i.service
 Requires=motor-init-calibration@%i.service
 After=motor-init-calibration@%i.service
 Conflicts=bletchley-sled-removed@%i.target
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/detect-gpio-present/files/bletchley-sled-removal@.target b/meta-facebook/meta-bletchley/recipes-bletchley/detect-gpio-present/files/bletchley-sled-removal@.target
index 55fd5c3..4fd5918 100644
--- a/meta-facebook/meta-bletchley/recipes-bletchley/detect-gpio-present/files/bletchley-sled-removal@.target
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/detect-gpio-present/files/bletchley-sled-removal@.target
@@ -2,7 +2,7 @@
 Description=Bletchlet SLED%i removal target
 
 Conflicts=motor-init-calibration@%i.service
-Conflicts=host-ac-on@%i.service
+Conflicts=chassis-poweron@%i.service
 Conflicts=bletchley-sled-insertion@%i.target
 
 RefuseManualStop=yes
\ No newline at end of file
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-off@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-off@.service
deleted file mode 100644
index 6b42f8f..0000000
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-off@.service
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=Turn off AC at Sled%i
-Conflicts=host-ac-on@%i.service
-After=host-poweroff@%i.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/power-ctrl sled%i ac-off
-SyslogIdentifier=power-ctrl
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-on@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-on@.service
deleted file mode 100644
index 657b2a8..0000000
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-ac-on@.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=Turn on AC at Sled%i
-Requires=motor-init-calibration@%i.service
-After=motor-init-calibration@%i.service
-Conflicts=host-ac-off@%i.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/power-ctrl sled%i ac-on
-SyslogIdentifier=power-ctrl
-ExecStartPost=/bin/systemctl restart phosphor-discover-system-state@%i.service
-
-[Install]
-WantedBy=multi-user.target
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-cycle@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-cycle@.service
deleted file mode 100644
index 2fb7d9d..0000000
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-cycle@.service
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=Sled%i Host Power Cycle
-Requires=motor-init-calibration@%i.service
-After=motor-init-calibration@%i.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/power-ctrl sled%i cycle
-SyslogIdentifier=power-ctrl
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweroff@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweroff@.service
deleted file mode 100644
index c81f6d6..0000000
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweroff@.service
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Power off System in Sled%i by Step Motor
-Requires=motor-init-calibration@%i.service
-After=motor-init-calibration@%i.service
-Conflicts=host-poweron@%i.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/power-ctrl sled%i off
-SyslogIdentifier=power-ctrl
-
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweron@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweron@.service
deleted file mode 100644
index fd0cbd9..0000000
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-poweron@.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Power on System in Sled%i by Step Motor
-Requires=motor-init-calibration@%i.service
-After=motor-init-calibration@%i.service
-Requires=host-ac-on@%i.service
-After=host-ac-on@%i.service
-Conflicts=host-poweroff@%i.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/power-ctrl sled%i boot-from-bootmode
-SyslogIdentifier=power-ctrl
-
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-reset@.service b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-reset@.service
deleted file mode 100644
index a8b6a08..0000000
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/files/host-reset@.service
+++ /dev/null
@@ -1,9 +0,0 @@
-[Unit]
-Description=Sled%i Host Power Reset
-Requires=motor-init-calibration@%i.service
-After=motor-init-calibration@%i.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/sbin/power-ctrl sled%i reset
-SyslogIdentifier=power-ctrl
diff --git a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
index 329c6f8..a0e85bd 100644
--- a/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
+++ b/meta-facebook/meta-bletchley/recipes-bletchley/motor-ctrl/motor-ctrl_0.1.bb
@@ -29,31 +29,5 @@
 
 TGT = "${SYSTEMD_DEFAULT_TARGET}"
 MOTOR_INIT_INSTFMT="../motor-init-calibration@.service:${TGT}.wants/motor-init-calibration@{0}.service"
-PWR_ON_INSTFMT="../host-poweron@.service:obmc-host-starting@{0}.target.wants/host-poweron@{0}.service"
-PWR_OFF_INSTFMT="../host-poweroff@.service:obmc-host-stopping@{0}.target.wants/host-poweroff@{0}.service"
-PWR_RESET_INSTFMT="host-reset@.service:host-reset@{0}.service"
-PWR_CYCLE_INSTFMT="host-cycle@.service:host-cycle@{0}.service"
-AC_ON_INSTFMT="../host-ac-on@.service:obmc-chassis-poweron@{0}.target.requires/host-ac-on@{0}.service"
-AC_OFF_INSTFMT="../host-ac-off@.service:obmc-chassis-poweroff@{0}.target.requires/host-ac-off@{0}.service"
-
 SYSTEMD_SERVICE:${PN} += "motor-init-calibration@.service"
 SYSTEMD_LINK:${PN} += "${@compose_list(d, 'MOTOR_INIT_INSTFMT', 'OBMC_HOST_INSTANCES')}"
-
-SYSTEMD_SERVICE:${PN} += "host-poweron@.service"
-SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_ON_INSTFMT', 'OBMC_HOST_INSTANCES')}"
-
-SYSTEMD_SERVICE:${PN} += "host-poweroff@.service"
-SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_OFF_INSTFMT', 'OBMC_HOST_INSTANCES')}"
-
-SYSTEMD_SERVICE:${PN} += "host-reset@.service"
-SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_RESET_INSTFMT', 'OBMC_HOST_INSTANCES')}"
-
-SYSTEMD_SERVICE:${PN} += "host-cycle@.service"
-SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_CYCLE_INSTFMT', 'OBMC_HOST_INSTANCES')}"
-
-SYSTEMD_SERVICE:${PN} += "host-ac-on@.service"
-SYSTEMD_LINK:${PN} += "${@compose_list(d, 'AC_ON_INSTFMT', 'OBMC_HOST_INSTANCES')}"
-
-SYSTEMD_SERVICE:${PN} += "host-ac-off@.service"
-SYSTEMD_LINK:${PN} += "${@compose_list(d, 'AC_OFF_INSTFMT', 'OBMC_HOST_INSTANCES')}"
-