UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
8,313 Views
Registered: ‎07-08-2008

How to use a Linux driver? (beginners)

Hi,

 

I'm working with open source Embedded Linux from Xilinx Wikidot. I'm using xapp1129 project as my reference design. I have already been able to load this project over my board (ML507). Now I want to write a user application to control the pcore (locallink example core) through the given driver.

 

Could anyone tell me how to use a Linux driver? It would be nice if someone could show me a simple code example.

 

P.S. I have been reading about the GPIO driver and the user application from Wikidot but I get confused since the user application doesn't use the GPIO functions that appears in xilinx_GPIO.c located in the Linux tree.

 

Thank you.

0 Kudos
4 Replies
Anonymous
Not applicable
8,297 Views

Re: How to use a Linux driver? (beginners)

Check out some of the other drivers in the kernel soruces for examples, and pick up a good book as well..  "Linux Device Drivers, 3rd Edition" is a good one that is available online as well.
0 Kudos
Xilinx Employee
Xilinx Employee
8,289 Views
Registered: ‎04-23-2008

Re: How to use a Linux driver? (beginners)

Linux drivers are accessed by user applications through the file system. Special files in the /dev directory are opened/accessed by the application. Ordiary file IO operations (open, close, read, write) result in the driver code being called.

 

I'd recommend

Linux Device Drivers, Corebet, Rubini, Kroah-Hartman, O'Reilly Press

Linux Kernel Development,  Robert Love, Novell Press

 

-Brian

0 Kudos
Contributor
Contributor
8,274 Views
Registered: ‎07-08-2008

Re: How to use a Linux driver? (beginners)


toneal wrote:
Check out some of the other drivers in the kernel soruces for examples

Where can I find them? In some path of the Linux kernel?

0 Kudos
Anonymous
Not applicable
8,266 Views

Re: How to use a Linux driver? (beginners)

For example, here is a driver for some xilinx-specific hardware - it's one of the more generic examples of a device-tree character driver out there.

 

drivers/char/xilinx_hwicap/xilinx_hwicap.c

 

 

 

 

 

 

0 Kudos