summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2023-01-31 15:48:34 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2023-02-27 10:05:12 +0100
commit764570c5ef63985f027302ae14a0c6c42819320d (patch)
tree64f2d1f96c6f86481a0cdda766b5e32bbff29e5c /recipes-core
parentdd633c6ff71b358b9683c504be3b514089825e68 (diff)
verdin-am62: add specific udev rules
Some rules are commented until we have the real hardware. Related-to: ELB-5012 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 46d3c7bec420d35500e5efcc42ac7ed8aa6c3d46)
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/udev/files/verdin-am62/99-toradex.rules15
-rwxr-xr-xrecipes-core/udev/files/verdin-am62/toradex-adc.sh21
2 files changed, 36 insertions, 0 deletions
diff --git a/recipes-core/udev/files/verdin-am62/99-toradex.rules b/recipes-core/udev/files/verdin-am62/99-toradex.rules
new file mode 100644
index 0000000..d74e9bd
--- /dev/null
+++ b/recipes-core/udev/files/verdin-am62/99-toradex.rules
@@ -0,0 +1,15 @@
+#ACTION=="add|change", KERNEL=="i2c-[0-9]*", ATTRS{name}=="30a50000.i2c", SYMLINK+="verdin-i2c1"
+#ACTION=="add|change", KERNEL=="i2c-[0-9]*", ATTRS{name}=="30a30000.i2c", SYMLINK+="verdin-i2c2"
+#ACTION=="add|change", KERNEL=="i2c-[0-9]*", ATTRS{name}=="30a40000.i2c", SYMLINK+="verdin-i2c4"
+#ACTION=="add|change", KERNEL=="i2c-[0-9]*", ATTRS{name}=="30a20000.i2c", SYMLINK+="verdin-i2c-on-module"
+#ACTION=="add|change", ATTRS{iomem_base}=="0x30890000", SYMLINK+="verdin-uart1"
+#ACTION=="add|change", ATTRS{iomem_base}=="0x30880000", SYMLINK+="verdin-uart2"
+#ACTION=="add|change", ATTRS{iomem_base}=="0x30860000", SYMLINK+="verdin-uart3"
+#ACTION=="add|change", KERNELS=="watchdog", SYMLINK+="verdin-watchdog"
+#ACTION=="add|change", SUBSYSTEM=="spidev", KERNELS=="30830000.*spi", SYMLINK+="verdin-spi-cs%n"
+KERNEL=="mmcblk[0-9]", ENV{DEVTYPE}=="disk", KERNELS=="fa10000.mmc", SYMLINK+="emmc"
+KERNEL=="mmcblk[0-9]boot[0-9]", ENV{DEVTYPE}=="disk", KERNELS=="fa10000.mmc", SYMLINK+="emmc-boot%n"
+KERNEL=="mmcblk[0-9]p[0-9]", ENV{DEVTYPE}=="partition", KERNELS=="fa10000.mmc", SYMLINK+="emmc-part%n"
+SUBSYSTEM=="iio", KERNELS=="iio:device0", RUN+="/etc/udev/scripts/toradex-adc.sh"
+ACTION=="add|change", KERNEL=="mmcblk[0-9]", KERNELS=="fa00000.mmc", SYMLINK+="verdin-sd"
+ACTION=="add|change", KERNEL=="mmcblk[0-9]p[0-9]*", KERNELS=="fa00000.mmc", SYMLINK+="verdin-sd-part%n"
diff --git a/recipes-core/udev/files/verdin-am62/toradex-adc.sh b/recipes-core/udev/files/verdin-am62/toradex-adc.sh
new file mode 100755
index 0000000..89c1c92
--- /dev/null
+++ b/recipes-core/udev/files/verdin-am62/toradex-adc.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env sh
+#
+# Called from udev. Compatible to verdin-imx8mm.
+#
+# Create/remove symlinks to/from the files with raw adc data.
+
+# Map the ADC lines:
+# verdin-adc{1..4} -> TLA2024 ADC{3,2,1,0}
+
+if [ "$ACTION" = "add" ]; then
+ ln -s "/sys$DEVPATH/in_voltage0_raw" /dev/verdin-adc4
+ ln -s "/sys$DEVPATH/in_voltage1_raw" /dev/verdin-adc3
+ ln -s "/sys$DEVPATH/in_voltage2_raw" /dev/verdin-adc2
+ ln -s "/sys$DEVPATH/in_voltage3_raw" /dev/verdin-adc1
+elif [ "$ACTION" = "remove" ]; then
+ rm -f /dev/verdin-adc1
+ rm -f /dev/verdin-adc2
+ rm -f /dev/verdin-adc3
+ rm -f /dev/verdin-adc4
+fi
+