Support canfd adaptor in raspberrypi
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Sat, 6 Apr 2024 21:54:19 +0000 (23:54 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Sat, 6 Apr 2024 21:59:26 +0000 (23:59 +0200)
Change-Id: I43d6b01de4064f4dd9629ec07ff44ee468705164
Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
meta-agl-bsp/meta-raspberrypi/recipes-bsp/bootfiles/rpi-config_git.bbappend
meta-agl-bsp/meta-raspberrypi/recipes-kernel/linux/linux-raspberrypi_%.bbappend

index 2486236..2331329 100644 (file)
@@ -4,10 +4,17 @@ TOTAL_BOARD_MEM = "3072"
 do_deploy:append:raspberrypi4() {
     # ENABLE CAN
     if [ "${ENABLE_CAN}" = "1" ]; then
-        echo "# Enable CAN" >>${DEPLOYDIR}/bootfiles/config.txt
+        echo "# Enable CAN" >> ${DEPLOYDIR}/bootfiles/config.txt
         echo "dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25" >>${DEPLOYDIR}/bootfiles/config.txt
     fi
 
+    # ENABLE DUAL CANFD
+    if [ "${ENABLE_DUAL_CAN_FD}" = "1" ]; then
+        echo "# Enable CANFD" >> ${DEPLOYDIR}/bootfiles/config.txt
+        echo "dtoverlay=mcp251xfd-can0,oscillator=16000000,interrupt=25" >> ${DEPLOYDIR}/bootfiles/config.txt
+        echo "dtoverlay=mcp251xfd-can1,oscillator=16000000,interrupt=24" >> ${DEPLOYDIR}/bootfiles/config.txt
+    fi
+
     # Handle setup with armstub file
     if [ -n "${ARMSTUB}" ]; then
         echo "\n# ARM stub configuration" >> ${DEPLOYDIR}/bootfiles/config.txt
index ec3fa91..56064db 100644 (file)
@@ -44,3 +44,5 @@ KERNEL_MODULE_AUTOLOAD += "hid-multitouch"
 PACKAGES += "kernel-module-snd-bcm2835"
 
 RDEPENDS:${PN} += "kernel-module-snd-bcm2835"
+
+RPI_KERNEL_DEVICETREE_OVERLAYS:append = " overlays/mcp251xfd.dtbo overlays/seeed-can-fd-hat-v1.dtbo overlays/seeed-can-fd-hat-v2.dtbo overlays/waveshare-can-fd-hat-mode-a.dtbo overlays/waveshare-can-fd-hat-mode-b.dtbo"
\ No newline at end of file