linux-device-driverembedded-linuxxilinxpetalinux

Add hwspinlock Linux Driver to Petalinux project


I would like to add a hwspinlock like this to my Petalinux Project for controlling the xilinx mutex on an fpga. I was able to control the mutex using ioremap and creating a module, but I cannot figure out how to add a hwspinlock driver as a module, do I have to clone the kernel source and add files to the /root/drivers/hwspinlock folder? Or is there an easy way like I have been using with petalinux-create -t module...


Solution

  • For now I just copied the hwspinlock_internal.h header file directly from the kernel that I needed, here is my spinlock driver and a test which works