-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathuio-pruss.rules
38 lines (27 loc) · 1.32 KB
/
uio-pruss.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# vim: ft=udevrules
# apply this file only to pruss_uio devices and their children
# (unfortunately DRIVERS!="pruss_uio" doesn't work, hence this workaround)
DRIVERS=="pruss_uio", GOTO="PRUSS"
GOTO="END"
LABEL="PRUSS"
# obtain pruss instance name:
# 1. check for device tree property
# 2. try to inherit from parent
# 3. default to "pruss"
ENV{PRUSS_INSTANCE}=="", ENV{PRUSS_INSTANCE}="$attr{of_node/pruss-instance}"
ENV{PRUSS_INSTANCE}=="", IMPORT{parent}="PRUSS_INSTANCE"
ENV{PRUSS_INSTANCE}=="", ENV{PRUSS_INSTANCE}="pruss"
# create symlinks for the uio devices:
# one for the memory/register spaces (any of the modules work for that)
# one per irq that can be received by linux
SUBSYSTEM!="uio", GOTO="END"
ATTR{name}=="pruss_evt0", SYMLINK+="uio/$env{PRUSS_INSTANCE}/module"
ATTR{name}=="pruss_evt0", SYMLINK+="uio/$env{PRUSS_INSTANCE}/irq2"
ATTR{name}=="pruss_evt1", SYMLINK+="uio/$env{PRUSS_INSTANCE}/irq3"
ATTR{name}=="pruss_evt2", SYMLINK+="uio/$env{PRUSS_INSTANCE}/irq4"
ATTR{name}=="pruss_evt3", SYMLINK+="uio/$env{PRUSS_INSTANCE}/irq5"
ATTR{name}=="pruss_evt4", SYMLINK+="uio/$env{PRUSS_INSTANCE}/irq6"
ATTR{name}=="pruss_evt5", SYMLINK+="uio/$env{PRUSS_INSTANCE}/irq7"
ATTR{name}=="pruss_evt6", SYMLINK+="uio/$env{PRUSS_INSTANCE}/irq8"
ATTR{name}=="pruss_evt7", SYMLINK+="uio/$env{PRUSS_INSTANCE}/irq9"
LABEL="END"