blob: 41e0ce9f15ede520469760c6279ab2d487472ac5 [file] [log] [blame]
Allen.Wang4a0948d2021-12-15 13:41:18 +08001SUMMARY = "Bletchley Motor control"
2PR = "r1"
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
5
6inherit obmc-phosphor-systemd
7
8RDEPENDS:${PN} += "bash"
Allen.Wang4a0948d2021-12-15 13:41:18 +08009RDEPENDS:${PN} += "i2c-tools"
Patrick Williamsb068a532022-01-19 10:27:13 -060010RDEPENDS:${PN} += "libgpiod-tools"
Allen.Wang4a0948d2021-12-15 13:41:18 +080011
12S = "${WORKDIR}"
Patrick Williamsb068a532022-01-19 10:27:13 -060013SRC_URI += " \
14 file://motor-ctrl \
15 file://motor-init \
16 file://power-ctrl \
17 "
Allen.Wang4a0948d2021-12-15 13:41:18 +080018
19do_install() {
20 install -d ${D}${sbindir}
21 install -m 0755 ${WORKDIR}/power-ctrl ${D}${sbindir}
22
23 install -d ${D}${libexecdir}
Allen.Wang4a0948d2021-12-15 13:41:18 +080024 install -m 0755 ${WORKDIR}/motor-ctrl ${D}${libexecdir}
Patrick Williamsb068a532022-01-19 10:27:13 -060025 install -m 0755 ${WORKDIR}/motor-init ${D}${libexecdir}
Allen.Wang4a0948d2021-12-15 13:41:18 +080026}
27
Allen.Wang89418182022-01-26 10:54:09 +080028TGT = "${SYSTEMD_DEFAULT_TARGET}"
29MOTOR_INIT_INSTFMT="../motor-init-calibration@.service:${TGT}.wants/motor-init-calibration@{0}.service"
Allen.Wang4a0948d2021-12-15 13:41:18 +080030PWR_ON_INSTFMT="host-poweron@.service:host-poweron@{0}.service"
31PWR_OFF_INSTFMT="host-poweroff@.service:host-poweroff@{0}.service"
Allen.Wang89418182022-01-26 10:54:09 +080032AC_ON_INSTFMT="../host-ac-on@.service:${TGT}.wants/host-ac-on@{0}.service"
Potin Lai016db312022-01-17 22:32:02 +080033AC_OFF_INSTFMT="host-ac-off@.service:host-ac-off@{0}.service"
Allen.Wang4a0948d2021-12-15 13:41:18 +080034
Patrick Williamsb068a532022-01-19 10:27:13 -060035SYSTEMD_SERVICE:${PN} += "motor-init-calibration@.service"
36SYSTEMD_LINK:${PN} += "${@compose_list(d, 'MOTOR_INIT_INSTFMT', 'OBMC_HOST_INSTANCES')}"
Allen.Wang4a0948d2021-12-15 13:41:18 +080037
Patrick Williamsb068a532022-01-19 10:27:13 -060038SYSTEMD_SERVICE:${PN} += "host-poweron@.service"
Allen.Wang4a0948d2021-12-15 13:41:18 +080039SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_ON_INSTFMT', 'OBMC_HOST_INSTANCES')}"
40
Patrick Williamsb068a532022-01-19 10:27:13 -060041SYSTEMD_SERVICE:${PN} += "host-poweroff@.service"
Allen.Wang4a0948d2021-12-15 13:41:18 +080042SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_OFF_INSTFMT', 'OBMC_HOST_INSTANCES')}"
Potin Lai016db312022-01-17 22:32:02 +080043
Patrick Williamsb068a532022-01-19 10:27:13 -060044SYSTEMD_SERVICE:${PN} += "host-ac-on@.service"
45SYSTEMD_LINK:${PN} += "${@compose_list(d, 'AC_ON_INSTFMT', 'OBMC_HOST_INSTANCES')}"
Potin Lai016db312022-01-17 22:32:02 +080046
Patrick Williamsb068a532022-01-19 10:27:13 -060047SYSTEMD_SERVICE:${PN} += "host-ac-off@.service"
Potin Lai016db312022-01-17 22:32:02 +080048SYSTEMD_LINK:${PN} += "${@compose_list(d, 'AC_OFF_INSTFMT', 'OBMC_HOST_INSTANCES')}"