Waiting for some bits and bobs to be delivered for the case build, I've been trying to find out how to access and use the gpio ports on Gizmo2.

 

The ubuntu install has a /sys/class/gpio folder and the export/unexport files where gpio pins can be controlled through user space but seems to be missing the controller chip.

 

I tried a few things to get them opened up including making a python script to bash number 0 to 999 at the export file with no success.

 

Clearly, this was a much deeper issue.. The generic Linux kernel provided with Ubuntu isn't designed with the specific drivers needed to access the hardware.

 

The Timesys operating system has a kernel with those drivers built in but theres likely to be issues with just replacing this one.

 

Browsing and using the Timesys website was a labour of love (meaning hate). I can't remember how I got to it, but found a link to their ftp repository that has all of the files and modules included in their kernel builds. LO AND BEHOLD!!! source code files for AMD SOC gpio drivers and a couple of other interesting things..

 

SOLUTION

 

I'll post a more complete solution including all of the files later but here's quickly how I opened the GPIO

 

1. Download the source files

2. Modify the makefile

3. Make - make a kernel module

4. Use insmod on the module to insert it into the kernel

5. Go to /sys/class/gpio to find the driver chip snuggled up all cosy between export and unexport

 

Test:

 

sudo -i

cd /sys/class/gpio

echo 45 > ./export

cd gpio45

echo out > ./direction

echo 1 > ./value

 

SUCCESS!

 

gpio 45 is connected to the mmc card reader LED. The above shell script has just turned it on through the GPIO userspace system.

 

 

Stay tuned for a more thorough guide on how to do this including all source files, build modules and more !

 

 

Lucie