blob: 6cba8537d9dd3ccacf577740988484ca70e98437 [file] [log] [blame]
Brandon Wyman37a50502017-05-22 17:35:07 -05001FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
Ben_Pai2e396332019-09-04 15:48:18 +08003EXTRA_OECONF_append_mihawk = " --enable-negative-errno-on-fail"
4
Brad Bishopbb0e1d02019-07-17 17:35:55 -04005SRC_URI_append_ibm-ac-server = " \
Matt Spinler055e8612018-04-25 11:26:08 -05006 file://70-hwmon.rules \
7 file://70-max31785-hwmon.rules \
Matt Spinler0066e312018-04-25 10:53:41 -05008 file://start_max31785_hwmon.sh \
9 "
10
Matt Spinlerb9cd4832019-10-02 16:46:32 -050011CHIPS_witherspoon = " \
12 bus@1e78a000/i2c-bus@100/max31785@52_air \
13 bus@1e78a000/i2c-bus@100/max31785@52_water \
14 bus@1e78a000/i2c-bus@100/power-supply@68 \
15 bus@1e78a000/i2c-bus@100/power-supply@69 \
Matt Spinler706307d2019-03-22 09:57:13 -050016 bus@1e78a000/i2c-bus@100/bmp280@77 \
17 bus@1e78a000/i2c-bus@100/dps310@76 \
Matt Spinler706307d2019-03-22 09:57:13 -050018 bus@1e78a000/i2c-bus@140/ir35221@70 \
19 bus@1e78a000/i2c-bus@140/ir35221@71 \
20 bus@1e78a000/i2c-bus@180/ir35221@70 \
21 bus@1e78a000/i2c-bus@180/ir35221@71 \
22 bus@1e78a000/i2c-bus@380/tmp275@4a \
Andrew Geissler30077452017-05-23 15:48:33 -050023 "
Matt Spinlerb9cd4832019-10-02 16:46:32 -050024CHIPS_swift = " \
25 bus@1e78a000/i2c-bus@100/max31785@52_air \
26 bus@1e78a000/i2c-bus@100/max31785@52_water \
27 bus@1e78a000/i2c-bus@100/power-supply@68 \
28 bus@1e78a000/i2c-bus@100/power-supply@69 \
Matt Spinlerbd2a3a22019-04-26 11:37:13 -050029 bus@1e78a000/i2c-bus@440/tmp275@4a \
30 bus@1e78a000/i2c-bus@440/tmp275@48 \
Matthew Barth51daebf2019-05-31 13:30:53 -050031 bus@1e78a000/i2c-bus@300/tmp275@48 \
Matthew Barthb86d99a2019-05-31 13:39:52 -050032 bus@1e78a000/i2c-bus@300/dps310@76 \
Matthew Barth44d15152019-05-31 13:44:13 -050033 bus@1e78a000/i2c-bus@300/si7021a20@20 \
Matthew Barthe21e2d22019-05-31 16:27:24 -050034 bus@1e78a000/i2c-bus@380/ir35219@70 \
35 bus@1e78a000/i2c-bus@380/ir35221@71 \
36 bus@1e78a000/i2c-bus@380/ir35221@72 \
Matthew Bartha296aa32019-05-31 16:37:16 -050037 bus@1e78a000/i2c-bus@3c0/ir35219@70 \
38 bus@1e78a000/i2c-bus@3c0/ir35221@71 \
39 bus@1e78a000/i2c-bus@3c0/ir35221@72 \
Matt Spinlerbd2a3a22019-04-26 11:37:13 -050040 "
Ben_Pai949f9142019-08-05 18:34:34 +080041CHIPS_mihawk = " \
42 bus@1e78a000/i2c-bus@100/power-supply@58 \
43 bus@1e78a000/i2c-bus@100/power-supply@5b \
44 bus@1e78a000/i2c-bus@140/ir35221@70 \
45 bus@1e78a000/i2c-bus@140/ir35221@72 \
46 bus@1e78a000/i2c-bus@180/ir35221@70 \
47 bus@1e78a000/i2c-bus@180/ir35221@72 \
Ben Pai731297e2020-09-29 20:01:12 +080048 bus@1e78a000/i2c-bus@380/pca9545riser@70/i2c@0/tmp431@4c \
49 bus@1e78a000/i2c-bus@380/pca9545riser@70/i2c@1/tmp431@4c \
Ben Pai74b75572020-06-11 16:40:40 +080050 bus@1e78a000/i2c-bus@380/pca9545@71/i2c@0/tmp431@4c \
51 bus@1e78a000/i2c-bus@380/pca9545@71/i2c@1/tmp431@4c \
Ben Pai731297e2020-09-29 20:01:12 +080052 bus@1e78a000/i2c-bus@3c0/pca9545riser@70/i2c@0/tmp431@4c \
53 bus@1e78a000/i2c-bus@3c0/pca9545riser@70/i2c@1/tmp431@4c \
Ben Pai74b75572020-06-11 16:40:40 +080054 bus@1e78a000/i2c-bus@3c0/pca9545@71/i2c@0/tmp431@4c \
55 bus@1e78a000/i2c-bus@3c0/pca9545@71/i2c@1/tmp431@4c \
Ben_Pai949f9142019-08-05 18:34:34 +080056 bus@1e78a000/i2c-bus@400/tmp275@48 \
57 bus@1e78a000/i2c-bus@400/tmp275@49 \
58 pwm-tacho-controller@1e786000 \
59 bus@1e78a000/i2c-bus@400/emc1403@4c \
60 bus@1e78a000/i2c-bus@440/pca9545@70/i2c@3/tmp275@48 \
61 "
Brandon Wyman37a50502017-05-22 17:35:07 -050062
Matt Spinlerb9cd4832019-10-02 16:46:32 -050063CHIPS_witherspoon-tacoma = " \
64 bus@1e78a000/i2c-bus@200/max31785@52_air \
65 bus@1e78a000/i2c-bus@200/max31785@52_water \
66 bus@1e78a000/i2c-bus@200/power-supply@68 \
67 bus@1e78a000/i2c-bus@200/power-supply@69 \
68 bus@1e78a000/i2c-bus@200/bmp280@77 \
69 bus@1e78a000/i2c-bus@200/dps310@76 \
70 bus@1e78a000/i2c-bus@280/ir35221@70 \
71 bus@1e78a000/i2c-bus@280/ir35221@71 \
72 bus@1e78a000/i2c-bus@300/ir35221@70 \
73 bus@1e78a000/i2c-bus@300/ir35221@71 \
74 bus@1e78a000/i2c-bus@500/tmp275@4a \
75 "
Matthew Barth84b1f2e2019-04-15 15:44:48 -050076ITEMSFMT = "ahb/apb/{0}.conf"
Matthew Barth6dec46d2019-04-15 15:51:23 -050077ITEMS = "${@compose_list(d, 'ITEMSFMT', 'CHIPS')}"
Ben_Pai949f9142019-08-05 18:34:34 +080078ITEMS_append_mihawk += " iio-hwmon-vdd0.conf"
79ITEMS_append_mihawk += " iio-hwmon-vdd1.conf"
80ITEMS_append_mihawk += " iio-hwmon-vcs0.conf"
81ITEMS_append_mihawk += " iio-hwmon-vcs1.conf"
82ITEMS_append_mihawk += " iio-hwmon-vdn0.conf"
83ITEMS_append_mihawk += " iio-hwmon-vdn1.conf"
84ITEMS_append_mihawk += " iio-hwmon-vio0.conf"
85ITEMS_append_mihawk += " iio-hwmon-vio1.conf"
86ITEMS_append_mihawk += " iio-hwmon-vddra.conf"
87ITEMS_append_mihawk += " iio-hwmon-vddrb.conf"
88ITEMS_append_mihawk += " iio-hwmon-vddrc.conf"
89ITEMS_append_mihawk += " iio-hwmon-vddrd.conf"
90ITEMS_append_mihawk += " iio-hwmon-12v.conf"
91ITEMS_append_mihawk += " iio-hwmon-5v.conf"
92ITEMS_append_mihawk += " iio-hwmon-3v.conf"
93ITEMS_append_mihawk += " iio-hwmon-battery.conf"
Matthew Barth84b1f2e2019-04-15 15:44:48 -050094
Matthew Barth2bd366a2019-06-03 15:56:24 -050095OCCS = " \
96 00--00--00--06/sbefifo1-dev0/occ-hwmon.1 \
Matt Spinler696d1d32019-10-04 14:47:42 -050097 00--00--00--0a/fsi-master/fsi1/slave@01--00/01--01--00--06/sbefifo2-dev0/occ-hwmon.2 \
Matthew Barth2bd366a2019-06-03 15:56:24 -050098 "
Matt Spinler696d1d32019-10-04 14:47:42 -050099OCCSFMT = "devices/platform/gpio-fsi/fsi-master/fsi0/slave@00--00/{0}.conf"
Matthew Barth2bd366a2019-06-03 15:56:24 -0500100OCCITEMS = "${@compose_list(d, 'OCCSFMT', 'OCCS')}"
Andrew Geissler2e23fb62017-05-26 16:39:03 -0500101
Brandon Wyman37a50502017-05-22 17:35:07 -0500102ENVS = "obmc/hwmon/{0}"
Brad Bishopbb0e1d02019-07-17 17:35:55 -0400103SYSTEMD_ENVIRONMENT_FILE_${PN}_append_ibm-ac-server = " ${@compose_list(d, 'ENVS', 'ITEMS')}"
104SYSTEMD_ENVIRONMENT_FILE_${PN}_append_ibm-ac-server = " ${@compose_list(d, 'ENVS', 'OCCITEMS')}"
Ben_Pai949f9142019-08-05 18:34:34 +0800105SYSTEMD_ENVIRONMENT_FILE_${PN}_append_mihawk = " ${@compose_list(d, 'ENVS', 'ITEMS')}"
106SYSTEMD_ENVIRONMENT_FILE_${PN}_append_mihawk = " ${@compose_list(d, 'ENVS', 'OCCITEMS')}"
Brad Bishop59a36b62017-08-21 20:10:29 -0400107
Brad Bishopbb0e1d02019-07-17 17:35:55 -0400108SYSTEMD_ENVIRONMENT_FILE_max31785-msl_append_ibm-ac-server = " obmc/hwmon-max31785/max31785.conf"
109SYSTEMD_LINK_max31785-msl_append_ibm-ac-server = " ../phosphor-max31785-msl@.service:multi-user.target.wants/phosphor-max31785-msl@${MACHINE}.service"
Matt Spinler0066e312018-04-25 10:53:41 -0500110
Brad Bishopbb0e1d02019-07-17 17:35:55 -0400111SYSTEMD_SERVICE_${PN}_append_ibm-ac-server = " max31785-hwmon-helper@.service"
Matt Spinler2c924c52018-04-25 11:20:32 -0500112
Brad Bishopbb0e1d02019-07-17 17:35:55 -0400113do_install_append_ibm-ac-server() {
Matt Spinler055e8612018-04-25 11:26:08 -0500114 install -d ${D}/${base_libdir}/udev/rules.d/
Matthew Barth46984b52020-10-15 10:03:26 -0500115 install -m 0644 ${WORKDIR}/70-max31785-hwmon.rules ${D}/${base_libdir}/udev/rules.d/
Matt Spinler055e8612018-04-25 11:26:08 -0500116
Matt Spinler0066e312018-04-25 10:53:41 -0500117 install -d ${D}${bindir}
118 install -m 0755 ${WORKDIR}/start_max31785_hwmon.sh ${D}${bindir}
119}