Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 1 | SUMMARY = "Bletchley Motor control" |
| 2 | PR = "r1" |
| 3 | LICENSE = "Apache-2.0" |
| 4 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
| 5 | |
| 6 | inherit obmc-phosphor-systemd |
| 7 | |
| 8 | RDEPENDS:${PN} += "bash" |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 9 | RDEPENDS:${PN} += "i2c-tools" |
Patrick Williams | b068a53 | 2022-01-19 10:27:13 -0600 | [diff] [blame] | 10 | RDEPENDS:${PN} += "libgpiod-tools" |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 11 | |
| 12 | S = "${WORKDIR}" |
Patrick Williams | b068a53 | 2022-01-19 10:27:13 -0600 | [diff] [blame] | 13 | SRC_URI += " \ |
| 14 | file://motor-ctrl \ |
| 15 | file://motor-init \ |
| 16 | file://power-ctrl \ |
| 17 | " |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 18 | |
| 19 | do_install() { |
| 20 | install -d ${D}${sbindir} |
| 21 | install -m 0755 ${WORKDIR}/power-ctrl ${D}${sbindir} |
| 22 | |
| 23 | install -d ${D}${libexecdir} |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 24 | install -m 0755 ${WORKDIR}/motor-ctrl ${D}${libexecdir} |
Patrick Williams | b068a53 | 2022-01-19 10:27:13 -0600 | [diff] [blame] | 25 | install -m 0755 ${WORKDIR}/motor-init ${D}${libexecdir} |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 26 | } |
| 27 | |
Allen.Wang | 8941818 | 2022-01-26 10:54:09 +0800 | [diff] [blame^] | 28 | TGT = "${SYSTEMD_DEFAULT_TARGET}" |
| 29 | MOTOR_INIT_INSTFMT="../motor-init-calibration@.service:${TGT}.wants/motor-init-calibration@{0}.service" |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 30 | PWR_ON_INSTFMT="host-poweron@.service:host-poweron@{0}.service" |
| 31 | PWR_OFF_INSTFMT="host-poweroff@.service:host-poweroff@{0}.service" |
Allen.Wang | 8941818 | 2022-01-26 10:54:09 +0800 | [diff] [blame^] | 32 | AC_ON_INSTFMT="../host-ac-on@.service:${TGT}.wants/host-ac-on@{0}.service" |
Potin Lai | 016db31 | 2022-01-17 22:32:02 +0800 | [diff] [blame] | 33 | AC_OFF_INSTFMT="host-ac-off@.service:host-ac-off@{0}.service" |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 34 | |
Patrick Williams | b068a53 | 2022-01-19 10:27:13 -0600 | [diff] [blame] | 35 | SYSTEMD_SERVICE:${PN} += "motor-init-calibration@.service" |
| 36 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'MOTOR_INIT_INSTFMT', 'OBMC_HOST_INSTANCES')}" |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 37 | |
Patrick Williams | b068a53 | 2022-01-19 10:27:13 -0600 | [diff] [blame] | 38 | SYSTEMD_SERVICE:${PN} += "host-poweron@.service" |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 39 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_ON_INSTFMT', 'OBMC_HOST_INSTANCES')}" |
| 40 | |
Patrick Williams | b068a53 | 2022-01-19 10:27:13 -0600 | [diff] [blame] | 41 | SYSTEMD_SERVICE:${PN} += "host-poweroff@.service" |
Allen.Wang | 4a0948d | 2021-12-15 13:41:18 +0800 | [diff] [blame] | 42 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'PWR_OFF_INSTFMT', 'OBMC_HOST_INSTANCES')}" |
Potin Lai | 016db31 | 2022-01-17 22:32:02 +0800 | [diff] [blame] | 43 | |
Patrick Williams | b068a53 | 2022-01-19 10:27:13 -0600 | [diff] [blame] | 44 | SYSTEMD_SERVICE:${PN} += "host-ac-on@.service" |
| 45 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'AC_ON_INSTFMT', 'OBMC_HOST_INSTANCES')}" |
Potin Lai | 016db31 | 2022-01-17 22:32:02 +0800 | [diff] [blame] | 46 | |
Patrick Williams | b068a53 | 2022-01-19 10:27:13 -0600 | [diff] [blame] | 47 | SYSTEMD_SERVICE:${PN} += "host-ac-off@.service" |
Potin Lai | 016db31 | 2022-01-17 22:32:02 +0800 | [diff] [blame] | 48 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'AC_OFF_INSTFMT', 'OBMC_HOST_INSTANCES')}" |