imx258: mmap() access to iim registers and fusebox shadow mem

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

imx258: mmap() access to iim registers and fusebox shadow mem

726 Views
martinskaiser
Contributor I

Dear all,

I'm using Linux on an imx258 chipset with an IIM kernel driver based on Freescale's original version. This driver provides an mmap method that sets pgprot_noncached() and calls remap_pfn_range().

To test this from user space, I do something like

fd = open("/dev/mxc_iim", O_RDWR|O_SYNC);

p = mmap(NULL, 0x1000, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0x0000);

printf("byte 0x%x\n", *(volatile uint32_t *)(p+0x24));

This results in a fault

[ 1929.298287] Unhandled fault: external abort on non-linefetch (0x008) at 0xb6e40024

Bus error

The mmap() call from user space triggers the driver's mmap routine. remap_pfn_range() returns successfully.

I'm sure that the clock for IIM is running. I tried a private or shared mapping, uint8_t access instead of uint32, mapping a diffrent offset instead of 0. None of this made any difference.

I am aware that some registers can be accessed only from supervisor mode, not from user mode. Therefore, I chose offset 0x24 (silicon revision register) where the reference manual says explicitly "User read". Still no success. Is there any configuration to globally disable register access in user mode? (I am running in engineering mode, I'm not using HAB for secure boot.)

Any idea what is causing this problem or what else I can do to track it down?

Thanks,

Martin

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

515 Views
Yuri
NXP Employee
NXP Employee

Hello,

  Please check mxc_iim_test application in /unit_tests if it works

and use its source code as example.

Have a great day,
Yuri

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

0 Kudos