aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAniket Limaye2024-02-08 23:33:51 -0600
committerRyan Eatmon2024-02-09 15:28:37 -0600
commit2d2df9f8058a3aa323daa01a64fcef59176500e3 (patch)
tree10ca24d6ab64213e56b19c20eaf5b0e7384fbe0d
parent6825e895d3b857c641277b3bda1ad98476b1de02 (diff)
downloadmeta-arago-2d2df9f8058a3aa323daa01a64fcef59176500e3.tar.gz
meta-arago-2d2df9f8058a3aa323daa01a64fcef59176500e3.tar.xz
meta-arago-2d2df9f8058a3aa323daa01a64fcef59176500e3.zip
systemd: Add udev rules for persistent naming of the can devices
When multiple CAN's are present, then names that are getting assigned change after every boot even after providing alias in the device tree. So add udev rules to specify the interface name to use for each mcan device, to make it persistent across reboots. Signed-off-by: Bhavya Kapoor <b-kapoor@ti.com> Signed-off-by: Aniket Limaye <a-limaye@ti.com> Signed-off-by: Ryan Eatmon <reatmon@ti.com>
-rw-r--r--meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules4
-rw-r--r--meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules2
-rw-r--r--meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules20
-rw-r--r--meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules2
-rw-r--r--meta-arago-distro/recipes-core/systemd/systemd_%.bbappend17
5 files changed, 45 insertions, 0 deletions
diff --git a/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules
new file mode 100644
index 00000000..59dc8075
--- /dev/null
+++ b/meta-arago-distro/recipes-core/systemd/systemd/37-can-am62.rules
@@ -0,0 +1,4 @@
1SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e08000.can", NAME="mcu_mcan0"
2SUBSYSTEM=="net", ACTION=="add", KERNELS=="4e18000.can", NAME="mcu_mcan1"
3SUBSYSTEM=="net", ACTION=="add", KERNELS=="20701000.can", NAME="main_mcan0"
4SUBSYSTEM=="net", ACTION=="add", KERNELS=="20711000.can", NAME="main_mcan1"
diff --git a/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules
new file mode 100644
index 00000000..3b14150d
--- /dev/null
+++ b/meta-arago-distro/recipes-core/systemd/systemd/37-can-dra7.rules
@@ -0,0 +1,2 @@
1SUBSYSTEM=="net", ACTION=="add", KERNELS=="4ae3c000.can", NAME="main_dcan1"
2SUBSYSTEM=="net", ACTION=="add", KERNELS=="48480000.can", NAME="main_dcan2"
diff --git a/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules
new file mode 100644
index 00000000..f2804ecd
--- /dev/null
+++ b/meta-arago-distro/recipes-core/systemd/systemd/37-can-j7.rules
@@ -0,0 +1,20 @@
1SUBSYSTEM=="net", ACTION=="add", KERNELS=="40528000.can", NAME="mcu_mcan0"
2SUBSYSTEM=="net", ACTION=="add", KERNELS=="40568000.can", NAME="mcu_mcan1"
3SUBSYSTEM=="net", ACTION=="add", KERNELS=="2701000.can", NAME="main_mcan0"
4SUBSYSTEM=="net", ACTION=="add", KERNELS=="2711000.can", NAME="main_mcan1"
5SUBSYSTEM=="net", ACTION=="add", KERNELS=="2721000.can", NAME="main_mcan2"
6SUBSYSTEM=="net", ACTION=="add", KERNELS=="2731000.can", NAME="main_mcan3"
7SUBSYSTEM=="net", ACTION=="add", KERNELS=="2741000.can", NAME="main_mcan4"
8SUBSYSTEM=="net", ACTION=="add", KERNELS=="2751000.can", NAME="main_mcan5"
9SUBSYSTEM=="net", ACTION=="add", KERNELS=="2761000.can", NAME="main_mcan6"
10SUBSYSTEM=="net", ACTION=="add", KERNELS=="2771000.can", NAME="main_mcan7"
11SUBSYSTEM=="net", ACTION=="add", KERNELS=="2781000.can", NAME="main_mcan8"
12SUBSYSTEM=="net", ACTION=="add", KERNELS=="2791000.can", NAME="main_mcan9"
13SUBSYSTEM=="net", ACTION=="add", KERNELS=="27a1000.can", NAME="main_mcan10"
14SUBSYSTEM=="net", ACTION=="add", KERNELS=="27b1000.can", NAME="main_mcan11"
15SUBSYSTEM=="net", ACTION=="add", KERNELS=="27c1000.can", NAME="main_mcan12"
16SUBSYSTEM=="net", ACTION=="add", KERNELS=="27d1000.can", NAME="main_mcan13"
17SUBSYSTEM=="net", ACTION=="add", KERNELS=="2681000.can", NAME="main_mcan14"
18SUBSYSTEM=="net", ACTION=="add", KERNELS=="2691000.can", NAME="main_mcan15"
19SUBSYSTEM=="net", ACTION=="add", KERNELS=="26a1000.can", NAME="main_mcan16"
20SUBSYSTEM=="net", ACTION=="add", KERNELS=="26b1000.can", NAME="main_mcan17"
diff --git a/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules
new file mode 100644
index 00000000..62d650fe
--- /dev/null
+++ b/meta-arago-distro/recipes-core/systemd/systemd/37-can-ti33x.rules
@@ -0,0 +1,2 @@
1SUBSYSTEM=="net", ACTION=="add", KERNELS=="481cc000.can", NAME="main_dcan0"
2SUBSYSTEM=="net", ACTION=="add", KERNELS=="481d0000.can", NAME="main_dcan1"
diff --git a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
index f38606f2..428a16f7 100644
--- a/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
+++ b/meta-arago-distro/recipes-core/systemd/systemd_%.bbappend
@@ -12,6 +12,10 @@ SRC_URI:append = " \
12 file://60-usb.network \ 12 file://60-usb.network \
13 file://sync-clocks.service \ 13 file://sync-clocks.service \
14 file://timesyncd.conf \ 14 file://timesyncd.conf \
15 file://37-can-j7.rules \
16 file://37-can-am62.rules \
17 file://37-can-dra7.rules \
18 file://37-can-ti33x.rules \
15" 19"
16 20
17do_install:append() { 21do_install:append() {
@@ -42,4 +46,17 @@ do_install:append() {
42 46
43 install -d ${D}${sysconfdir}/systemd/ 47 install -d ${D}${sysconfdir}/systemd/
44 install -m 0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd/ 48 install -m 0644 ${WORKDIR}/timesyncd.conf ${D}${sysconfdir}/systemd/
49
50 install -d ${D}${libdir}/udev/rules.d
51 install -m 0644 ${WORKDIR}/37-can-j7.rules ${D}${libdir}/udev/rules.d/
52 install -m 0644 ${WORKDIR}/37-can-am62.rules ${D}${libdir}/udev/rules.d/
53 install -m 0644 ${WORKDIR}/37-can-dra7.rules ${D}${libdir}/udev/rules.d/
54 install -m 0644 ${WORKDIR}/37-can-ti33x.rules ${D}${libdir}/udev/rules.d/
45} 55}
56
57FILES:udev += " \
58 ${libdir}/udev/rules.d/37-can-j7.rules \
59 ${libdir}/udev/rules.d/37-can-am62.rules \
60 ${libdir}/udev/rules.d/37-can-dra7.rules \
61 ${libdir}/udev/rules.d/37-can-ti33x.rules \
62"