GPIO driver for Soekris net4801 and Linux kernels 2.6.x
Soekris net4801 is a neat small computer for embedded applications such as firewalls, routers etc. This machine also features general purpose inputs/outputs enabling the possibility to connect external devices ranging from simple buttons and LEDs to various displays or data buses.
For the 2.4 kernels there is a driver module coded by Martin Hejl. 2.6 kernels contain a GPIO driver, unfortunately it does not work for the in/outputs connected to the PC87366 chip.
That's why I tried to port the Martin Hejl's driver for the 2.6 kernels. Basically it was necessary to write a new makefile and to replace the floating point arithmetics in the code with a fixed-point version.
Usage: First you need an already configured and compiled 2.6 kernel without the options CONFIG_SCx200 (NatSemi SCx200 support) and CONFIG_SCx200_GPIO (NatSemi SCx200 GPIO Support). Unpack the driver's source code somewhere, change the path to the kernel you are compiling for in the Makefile (probably not the same as the kernel of the machine you are building the module on) and run make. Copy the resulting gpio.ko file into lib/modules/version/kernel/misc on the destination machine, run depmod -a and modprobe gpio. If all goes well, the dmesg command displays something along
gpio: Soekris net4801 GPIO driver Version 1.3.2+trillian0.1 (C) 2003 Martin Hejl
and there will be a few new entries in the /proc/driver directory. Their usage is described in the readme.txt file in the directory with the unpacked source code.
Bratislava, 19. 2. 2005Stanislav Meduna
stano (AT) meduna.org