diff options
| author | Sandeep Gundlupet Raju <sandeep.gundlupet-raju@xilinx.com> | 2022-04-28 20:50:49 -0600 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2022-07-23 14:56:11 -0700 |
| commit | 7efae5654f5fca3c1b706ecbd57752efdb65a7b6 (patch) | |
| tree | ea26cc944a0338a8f9045c314f225634941253ab | |
| parent | b4e59d665663f6d792b153c46b098da460d12a07 (diff) | |
| download | meta-xilinx-7efae5654f5fca3c1b706ecbd57752efdb65a7b6.tar.gz | |
recipes-kernel: Add udev rules files for linux-xlnx in-tree drivers
This recipe is to add generic udev rules files for linux-xlnx in-tree
drivers.
- Create a new aie group.
- Add udev rules for aie devices and change permissions and
ownership group to "aie" so that any new user added to aie groups can
access aie devices(/dev/aie0) from linux userspace.
Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@xilinx.com>
Signed-off-by: Mark Hatle <mhatle@xilinx.com>
| -rw-r--r-- | meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb | 37 | ||||
| -rw-r--r-- | meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-aie-device.rules | 2 |
2 files changed, 39 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb new file mode 100644 index 00000000..f5b0ff95 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules.bb | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | SUMMARY = "Udev rules files for Linux drivers" | ||
| 2 | DESCRIPTION = "Generic udev rules recipe for Xilinx Linux in tree drivers" | ||
| 3 | LICENSE = "MIT" | ||
| 4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 5 | |||
| 6 | SRC_URI = "\ | ||
| 7 | file://99-aie-device.rules \ | ||
| 8 | " | ||
| 9 | |||
| 10 | S = "${WORKDIR}" | ||
| 11 | |||
| 12 | inherit useradd | ||
| 13 | |||
| 14 | COMPATIBLE_MACHINE ?= "^$" | ||
| 15 | COMPATIBLE_MACHINE:zynq = ".*" | ||
| 16 | COMPATIBLE_MACHINE:zynqmp = ".*" | ||
| 17 | COMPATIBLE_MACHINE:microblaze = ".*" | ||
| 18 | COMPATIBLE_MACHINE:versal = ".*" | ||
| 19 | |||
| 20 | do_configure[noexec] = '1' | ||
| 21 | do_compile[noexec] = '1' | ||
| 22 | |||
| 23 | do_install () { | ||
| 24 | install -d ${D}${sysconfdir}/udev/rules.d | ||
| 25 | for rule in $(find ${WORKDIR} -maxdepth 1 -type f -name "*.rules"); do | ||
| 26 | if ${@bb.utils.contains_any('SOC_VARIANT', ['ai-core', 'ai-edge'], 'true', 'false' ,d)}; then | ||
| 27 | install -m 0644 ${WORKDIR}/99-aie-device.rules ${D}${sysconfdir}/udev/rules.d/ | ||
| 28 | fi | ||
| 29 | install -m 0644 $rule ${D}${sysconfdir}/udev/rules.d/ | ||
| 30 | done | ||
| 31 | } | ||
| 32 | |||
| 33 | USERADD_PACKAGES = "${PN}" | ||
| 34 | GROUPADD_PARAM:${PN} += "${@bb.utils.contains_any('SOC_VARIANT', ['ai-core', 'ai-edge'], '-r aie;', '', d)}" | ||
| 35 | |||
| 36 | FILES:${PN} += "${sysconfdir}/udev/rules.d/*" | ||
| 37 | |||
diff --git a/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-aie-device.rules b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-aie-device.rules new file mode 100644 index 00000000..fffcf6e6 --- /dev/null +++ b/meta-xilinx-core/recipes-kernel/linux-xlnx-udev-rules/linux-xlnx-udev-rules/99-aie-device.rules | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | # Device rules for AIE drivers. | ||
| 2 | ACTION=="add", SUBSYSTEM=="aie", KERNEL=="aie[0-9]*", MODE="0660", GROUP="aie" | ||
