Soekris GPIO kernel module
I searched the net for the kernelmodule to access the GPIO. Turns out I had to write (adapt,
that is) it myself. I'll tell you how I came to it. ON7LDS. |
Ok, I got my soekris with ubuntu on it. In fact, I started with debian (my favorite) but I'll tell you later why I switched to ubuntu. After some searching,
I found
http://lists.soekris.com/pipermail/soekris-tech/2006-November/011203.html.
Based on the information and the script found there, I made a new
script with more functionality. You can find it here and an error led test script here.
2. The less easy way: the kernel module I also came across the site of Martin Hejl http://soekris.hejl.de/ where I could find drivers for the net4801 for the 2.2 kernel. There is a link to the site of Stanislav Meduna http://www.meduna.org/sw_gpio_en.html where the port to kernel 2.6 could be found.Trying to compile the code for kernel 2.6, I ran into some serious problems. I was not able to compile for the 2.6.26 kernel my system is running. Writing kernel modules is not that simple, and after some extensive searching, failing to solve the problem, I finally contacted Stanislav Meduna. Unfortunately he no longer has a Soekris in operation nor a kernel build tree for that platform. He gave me some tips, but I was not able to solve the problems and compile the lot. I then called the emergency line : I contacted Geert Uytterhoeven. After some modifications, he could compile the module on a ubuntu 10.04 system with 2.6.32 kernel. With these modifications, strange enough, I was not able to compile it on my system (debian with kernel 2.6.26). I decided to switch the soekris to ubuntu and with the help of Geert I finally was able to compile the kernel module. There came the next disappointment : the module did not recognize the net5501 and made the assumption it was a 4501. But the 5501 has 12 GPIOs and the 4501 only 8. Not good ... With the patch from http://old.nabble.com/GPIO-for-net5501-under-Linux-2.6--td16408801.html it was better, but not yet good enough. The kernel module now takes the 5501 for a 4801 and the GPIO did function. But not the error led. So I studied the code from the cs5535_gpio module (part of the kernel tree), and with that and all info I got till now, I changed the gpio-1.3.2+trillian0.01 source code and created the gpio-1.3.3 sources. These compile into a gpio.ko kernel module. When this kernel module is loaded, it should be able to see if it runs on a 4501, 4801 or 5501 and create the correct /proc/driver/soekris* files. I could only test it on a 5501 (the one I got) - there it works nicely. root@soekris:/usr/src# modprobe gpio
|
|