[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] GPIO device driver operation



Hi Paul,

Paul Hartke wrote:

> During kernel initialization I see the following on the console:
> ..
> xgpio #0 at 0x40020000 mapped to 0x40020000
> xgpio #1 at 0x40040000 mapped to 0x40040000
> xgpio #2 at 0x40000000 mapped to 0x40000000
> Xilinx GPIO registered
> ..
> 
> In addition, the xilinx device driver appears in /proc/misc:
> # cat /proc/misc
> 185 xgpio
> #

It's a long time since I looked at that driver, it was the quickest of
quick hacks across the the MontaVista one for the PPC.   If memory
serves me rightly, each GPIO should register major 185, minor
0,1,2,3,....  The source will be the best reference for this.

> However, there is no /dev/gpio entry to call open() on such as used in the
> gpio_test program John Williams posted a while ago:
> http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/archive/2004/05/msg00004.html
> 
> In /romfs/dev, I see "@fslfifo7,c,10,199" etc for the fsl fifos.  Should
> there be autogenerated ones for the three gpios there already?  Or do I
> need to create those in /romfs/dev/ myself?  

Typically the dev nodes are created by the vendors Makefile -
vendors/Xilinx/uclinux-auto/Makefile for example.  The mechanism will be
obvious once you see it.

You can (should?) make the creation of the prototype @gpio dev nodes in
/romfs/dev conditionaly on CONFIG_XILINX_GPIO_0 or similar.

> Shouldn't there be three
> entries in
> /proc/misc, one for each gpio instance?

I'm not sure - is that the typical behaviour for misc devices?

John






___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/