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.
You can use devregs tool to read the register contains.
you can download it from here.
just unzip it & put it at particular location.
suppose you want to use register IPU1_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
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.
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):
However, typing in:
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...
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.
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.
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.