Jump to content
  • 0

Accessing specific registers of a custom IP


accel

Question

After doing the hands on linux tutorial for the Zybo I have some grasp on how to access custom IP in linx. However, I'm confused on how to access the three other registers that the IP core has in the demo. I know its using a file transaction to get the user data and write the data to the IP core register in the kernel space.

Would I have to modify the kernel module source to parse the message and then do an IO write to a indicated register or do I have to write enough data to get to the desired register? Also how would I go about reading specific registers using the procfs method? (i.e. I want to write and read register 2 only).

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hello Accel,

The easiest method for this would be to modify the kernel module with additional function calls that use ioread32() and iowrite32() with base_addr+4 to index to the second register.  "+4" because the memory is stored in 32-bit words or 4-byte words.

A better implementation could use ioread32() and iowrite32() to read and write to an offset of the base_addr

prototype EX:

unsigned int my_read(unsigned long base_addr);

int my_write(uint32 value, unsigned long base_addr);

Hope this helps.

Best of Luck!

Marshall

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...