imx6 IPU2 registers inaccessible

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

imx6 IPU2 registers inaccessible

3,300 Views
ivankozic
Contributor IV

Hi all,

I am having major issues accessing IPU2 registers from user-space, and I don't really know why - hopefully someone could help.

I am using mmap() - something like:

#define IPU1_REG_BASE 0x2600000

#define IPU2_REG_BASE 0x2A00000

#define IPU_MAP_SIZE 0x68020

#define IPU_CONF_OFFSET 0

_fdmem = open( memDevice, O_RDWR | O_SYNC );

map_ipu1 = (int *)(mmap(0, IPU_MAP_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, _fdmem, IPU1_REG_BASE));

map_ipu2 = (int *)(mmap(0, IPU_MAP_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, _fdmem, IPU2_REG_BASE));

int ipu_conf1 = *(map_ipu1+IPU_CONF_OFFSET/4)

int ipu_conf2 = *(map_ipu2+IPU_CONF_OFFSET/4)

If I comment out the last line (ipu_conf2), everything works (IPU1 registers are being read normally always), but if I use *(map_ipu2) anywhere, the application locks-up and I have to reboot. Also funny is output of "cat /proc/iomem ":

...

02400000-027fffff : imx-ipuv3.0
02800000-02bfffff : imx-ipuv3.1

...

I am not sure if this is correct? I have also tried with these addresses and it still locks.

Anyone knows? Or has similar issues? I have silicon rev1.0 and using kernel 3.0.35-4.0.0.

Labels (4)
0 Kudos
9 Replies

1,156 Views
Raybiztech
Contributor V

Hi Ivan,

    You can use devregs tool to read the register contains.

you can download it from here.

http://boundarydevices.com/devregs.zip

just unzip it & put it at particular location.

suppose you want to use register IPU1_DI0_GENERAL.

then

devregs  ipu_di0_general

IPU_DI0_GENERAL:0x2640000  = 0x0300004

you can read more about devregs in http://boundarydevices.com/i-mx5x-device-register-access/

you can get sources from boundarydevices/imx-utils · GitHub

Regards,

raybiztech.

1,156 Views
richardwoodham
Contributor I

devregs tool doesn't work for me.  Downloaded, unzipped & copied to my SD card.  Inserted into imx6q SOM:

-sh: ./devregs: No such file or directory

0 Kudos

1,156 Views
zaheerm
Contributor I

I am having a problem running 'devregs' tool on my custom board based on iMX6D. The /proc/cpuinfo on my board shows the value of "Revision" is '0000'. The devregs is not able to identify the CPU, I would like to know where should the value of Revision be initialized i.e. uboot or DTB or some other place.

0 Kudos

1,156 Views
ivankozic
Contributor IV

Hi raybiztech,

Thanks, this is a nice thing for debug, but it doesn't really solve my problem - as I see from the information page it also uses mmap, while I have issues actually accessing IPU2.

To demonstrate - if I type in (for IPU1, IPU_CONF):

./devregs 0x2600000

output is:

:0x02600000    =0x000006a0

However, typing in:

./devregs 0x2A00000

the systems locks up and you can even stop it anymore (just like in my app). Without an output of course...

Something is really wrong here...

0 Kudos

1,156 Views
YixingKong
Senior Contributor IV

Ivan

This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.

Thanks,

Yixing

0 Kudos

1,156 Views
YixingKong
Senior Contributor IV

Ivan

Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help please feel free to contact Freescale.

Thanks,
Yixing

0 Kudos

1,156 Views
christophe
Contributor V

Hi Ivan,

I've the same issue as you. Can i ask how you have solved it ?

Rgds,

Christophe

0 Kudos

1,156 Views
ivankozic
Contributor IV

Hi Christophe,

It turned out that IPU2 was not even enabled - I didn't know this, but it seems that on my system, only IPU which has active display connected to it will always be on. If it's not used, its clock_en is off when booted. So I think there is an issue with how actually IPU gets turned on when you start CSI capture and it was off before it (due to no displays being connected to it). I guess it makes sense, but I don't like it.

Either way, before trying to read IPUx regs, first find and check its CLOCK_EN - it's somewhere in CCM registers, easy to find.

Hope it helps.

BR,

Ivan

0 Kudos

1,156 Views
christophe
Contributor V

Thanks for these infos Ivan.

Rgds,

Christophe

0 Kudos