2006-02-28 09:44:04     pflag driver

Document created by Aaronwu Employee on Aug 6, 2013
Version 1Show Document
  • View in full screen mode

2006-02-28 09:44:04     pflag driver

Michele d'Amico (ITALY)

Message: 5656    Hi,

where can i find some examples how to use pflag driver from the kernel space?

 

I'm looking for these examples but I haven't found any driver that use pflag module ...

 

Regards

 

--Michele

QuoteReplyEditDelete

 

 

2006-02-28 10:29:25     RE: pflag driver

Jerry Zeng (CHINA)

Message: 5658    Hi,

We have a test program for pflag test.

 

In order to successfully build and run the PFLAGS Test Application, following

kernel and user space adjustments needs to be done.

 

1) In your uClinux-dist folder enter:

 

#make menuconfig

 

 

[ ] Default all settings (lose changes)

[*] Customize Kernel Settings (NEW)

[*] Customize Vendor/User Settings (NEW)

[ ] Update Default Vendor Settings

 

 

Check Customize Kernel Settings and Customize Vendor/User Settings, then save and exit

During kernel configuration under 'Character devices', Blackfin BF533/2/1 Programmable Flags Driver'.

 

[ ] Blackfin BF533/2/1 SPI port support

[ ] Blackfin BF533/2/1 ADSP SPI ADC support

[*] Blackfin BF533/2/1 Programmable Flags Driver

[ ] Virtual terminal

[ ] Non-standard serial port support

Serial drivers --->

[*] Unix98 PTY support

[*] Legacy (BSD) PTY support

(256) Maximum number of legacy PTY in use

[ ] QIC-02 tape support

IPMI --->

Watchdog Cards --->

[ ] Enhanced Real Time Clock Support

[ ] Generic /dev/rtc emulation

[*] Blackfin Real Time Clock Support

[*] Blackfin Power Management support

[ ] Double Talk PC internal speech card support

[ ] Siemens R3964 line discipline

Ftape, the floppy tape device driver --->

[ ] /dev/agpgart (AGP Support)

[ ] Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)

[ ] RAW driver (/dev/raw/rawN) (OBSOLETE)

 

Save and exit. We are now leaving kernel configuration and enter user space configuration.

Here we need to enable 'PFLAGS test program' under 'Blackfin test programs'.

 

 

Core Applications --->

Library Configuration --->

Flash Tools --->

Filesystem Applications --->

Network Applications --->

Miscellaneous Applications --->

BusyBox --->

Tinylogin --->

MicroWindows --->

Games --->

Miscellaneous Configuration --->

Debug Builds --->

Blackfin test programs --->

Blackfin app programs --->

 

 

[ ] RTC test program

[ ] DPMC test program

[ ] AUDIO test program

[ ] VIDEO test program

[*] PFLAGS test program

[ ] Still to write

 

Save and exit

 

2) Recompile kernel and user space^M

^M

3) Starting the Application:^M

^M

From the shell:^M

^M

1.) Starting the Application : pflags_test

 

root:~> pflags_test

########################## PFLAGS TEST ###############################

open success /dev/pf2

open success /dev/pf5

 

 

Press BTN1 to EXIT

root:~>

 

This will toggle STAMP board LED1 until Button1 is pressed.^M

^M

4) Test PROC filesystem interface

 

From the shell type: cat /proc/driver/pflags

 

root:~> cat /proc/driver/pflags

FIO_DIR : = 0x1F

FIO_MASKA : = 0x0

FIO_MASKB : = 0x80

FIO_POLAR : = 0x160

FIO_EDGE : = 0x0

FIO_INEN : = 0x1E0

FIO_BOTH : = 0x0

FIO_FLAG_D : = 0x1D

PIN :DATA DIR INEN EDGE BOTH POLAR MASKA MASKB

:H/L O/I D/E E/L B/S L/H S/C S/C

PF0 : 1....1....0....0....0....0.....0.....0

PF1 : 0....1....0....0....0....0.....0.....0

PF2 : 1....1....0....0....0....0.....0.....0

PF3 : 1....1....0....0....0....0.....0.....0

PF4 : 1....1....0....0....0....0.....0.....0

PF5 : 0....0....1....0....0....1.....0.....0

PF6 : 0....0....1....0....0....1.....0.....0

PF7 : 0....0....1....0....0....0.....0.....1

PF8 : 0....0....1....0....0....1.....0.....0

PF9 : 0....0....0....0....0....0.....0.....0

PF10 : 0....0....0....0....0....0.....0.....0

PF11 : 0....0....0....0....0....0.....0.....0

PF12 : 0....0....0....0....0....0.....0.....0

PF13 : 0....0....0....0....0....0.....0.....0

PF14 : 0....0....0....0....0....0.....0.....0

PF15 : 0....0....0....0....0....0.....0.....0

root:~>

QuoteReplyEditDelete

 

 

2006-02-28 10:34:09     RE: pflag driver

Jerry Zeng (CHINA)

Message: 5659    Hi,

The test file path:

uClinux-dist/user/blkfin-test/pflags-test/

 

The drive file path:

uClinux-dist/linux-2.6.x/drivers/char/pflags.c

uClinux-dist/linux-2.6.x/drivers/char/pflags.h

 

You can find both driver and test examples.

 

Thanks

-Jerry

QuoteReplyEditDelete

 

 

2006-02-28 10:40:23     RE: pflag driver

Michele d'Amico (ITALY)

Message: 5660    Thanks, but maybe there are some misunderstanding ...

 

I know the test program and the proc interface well ... but I'm not

interested how to use this driver from the user space but how to use it

from KERNEL space.

 

I would like use it from my driver "drivers/input/misc/bf53xPFbuttons"

for removing the direct references to pflags registers.

 

Regards

 

--Michele

 

QuoteReplyEditDelete

 

 

2006-03-04 05:04:15     RE: pflag driver

Jerry Zeng (CHINA)

Message: 5735    Hi,

I think we need some time to dig into your question. We will reply you ASAP.

 

Thanks

-Jerry

QuoteReplyEditDelete

 

 

2008-05-22 20:09:30     RE: pflag driver

Ben Burleson (UNITED STATES)

Message: 56159   

 

It seems like the drive file path is outdated - no longer exists in 2008R1-RC8.

 

I'm using the pflags driver in userspace, but the ioctl calls are all returning an error, so I wanted to look at the source to see why it is throwing this error: errno = 25

 

and

 

#define    ENOTTY        25    /* Not a typewriter */

 

 

 

However, without being able to find the driver source, I can't trace it.

 

Any hint on where I can find that, OR what my problem might be would be helpful.

 

 

 

Thanks!

 

Ben

QuoteReplyEditDelete

 

 

2008-05-22 20:19:55     RE: pflag driver

Mike Frysinger (UNITED STATES)

Message: 56161   

 

this thread is over 2 years old ... when things break the 1 year limit, that's usually a good indicator you should start a new thread.  2 years is almost a dead sure bet.

 

the pflags driver still exists in 2008R1, but is most likely broken.  why werent you able to find the driver source ?  it hasnt moved ... it's always been drivers/char/bfin_pflags.c.

 

i wrote a simple gpio driver to replace the pflags driver in a simple/generic manner:

http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:simple-gpio

 

it should largely be back-portable to 2008R1 ... copy the driver and paste in the relevant resources

Attachments

    Outcomes