Kernel driver for GPIO

machinekodermachinekoder Posts: 8New Member
edited August 7 in Others

Where can we find the kernel driver for the Up^2?

My applications requires an RT kernel (which available in upstream Debian), so I can't use the kernel that comes with ubilinux.

Are there any instructions on how to compile a kernel for the Up^2?

The documentation (here) is very sparse.



  • machinekodermachinekoder Posts: 8New Member

    I accidentally posted in the wrong section - can you please move it to the software section.

  • nukularnukular Posts: 47New Member ✭✭

    This is the gpio / pinctrl driver for the upboard.
    But there are some other files and drivers that are probably also required, I'd suggest to use the Find File function of github, search for upboard and just copy everything to your kernel that looks like it is Up specific.

    Compiling the kernel for an UP Board is no different from compiling a linux kernel for any other system (there are plenty of guides on how to do that on the internet). If you do it on the board directly, it is pretty slow, even when you use all 4 cores, so maybe also look into how to compile on a different PC and then copying the compiled kernel to the Up board.

  • nukularnukular Posts: 47New Member ✭✭

    Actually, you could also just compile the drivers by themselves, might be easier (and faster to compile) then merging them into your kernel.

  • machinekodermachinekoder Posts: 8New Member

    Thanks a lot, I got it up and running. Next step would be to extend the driver for mmap. Has anyone already achieved this?

  • machinekodermachinekoder Posts: 8New Member

    @nukular Taking a closer look at the driver I understand that the FPGA just acts as a level converter between the RPi pins and the GPIOs of the UP^2, is this correct?

    Data is passed to the FPGA via pin wiggling:

  • nukularnukular Posts: 47New Member ✭✭

    Yes, as far as I know the FPGA is just used as a level converter.
    Regarding mmap: There have been some threads here where people talked about this, but I don't know if anyone has achieved this or if it is possible. I haven't really looked into it.

    If you do and you get it to work and update here would be nice. It would also be interesting to see if that increases the speed at which GPIOs can be accessed. Right now gpio_set_value() takes about 5µs, which is pretty long.

Sign In or Register to comment.