UIO Test on imx6dl sabresd board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UIO Test on imx6dl sabresd board

1,945 Views
ramappahugar
Contributor I

Dear all,

I want to perform UIO Testing on imx6dl sabresd target.

I enabled  the CONFIG_UIO=y and CONFIG_UIO_PDRV_GENIRQ=y in kernel. Added the entry in dts file as below.

+/ {

+ uio0_mmc3@219c000

{

+ compatible = "generic-uio";

+ reg = < 0x219c000 0x1000 >;

+ };

+};

I could able to see the sysfs entry. 

My test application is :

fd = open(DEVICE_NAME, O_RDWR);

size = getpagesize();

addr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);

printf("Content is = 0x%x\n", *addr);

if (write(fd, "FF", 2) == 0)

printf("Content after writing is = 0x%x\n", *addr);

Reading is happening properly. It will show the content. 

After write, content is not getting changed. Previous content only shown. 

I need to perform both READ/WRITE tests. 

Let  me know if anything  is wrong in the test procedure.

Also suggest me, if you have any specific IO address for UIO test.

Thanks in advance.!

Thanks,

Ramappa

Labels (1)
Tags (2)
0 Kudos
Reply
1 Reply

1,803 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ramappa

usdhc4 (mmc3@219c000) has already linux mmc driver, so one can try to disable it

as userspace io is another alternative:

The Userspace I/O HOWTO — The Linux Kernel documentation 

Example of io can be found in sect.4.1 ADC attached Linux Manual, also

for register access one can use memtool:

memtool\test - imx-test - i.MX Driver Test Application Software 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply