MPC5121e, Linux, simple IO ports

CF Studelec cfoissac at
Thu Mar 21 19:54:46 EST 2013


This is a simple board base on mpc5121e MCU.

Gpio is detected: kernel is compiled with its support - i got
gpiochip_find_base: found new base @224 in dmesg - on kernel 3.0.4.

But i'm unable to access it through /sys/class/gpio. I can successfully
export a pin (ie, if i type cat 224 > export, gpio224 is created), but i
can't successfully control it:


echo "out" > /sys/class/gpio/gpio224/direction

cat /sys/class/gpio/gpio224/value


echo 1 > /sys/class/gpio/gpio224/value

cat /sys/class/gpio/gpio224/value



My need is a simple chipselect (well, 3 chipselect exactly ), for a
custom design. Running linux is mandatory. I suspect the MPC5121e to be
in the bad function mode, so:

- does anyone knows how to change mode ? What register can i acces and
how ? does it worths a try ?

- does anyone successfully performed simple IO control ?


Last thing, i have tryed to access internal registers through /dev/mem,
but no success. There are very few ressources available for this
microcontroler, but i'm stick to it. Perhaps anybody knows how to access
(read) internal registers with /proc or sys-fs ?


Thank you for your help.

More information about the Linuxppc-dev mailing list