[iMX6qdl]: how to reinitialize iomux/pad registers again after resume

cancel
Showing results for 
Search instead for 
Did you mean: 

[iMX6qdl]: how to reinitialize iomux/pad registers again after resume

362 Views
pintukumar
Contributor II

https://community.nxp.com/community/training/ftf-2015-training-presentations/projects/imx-6-applicat...

imx6: i2c_transfer timeout issue after resume

[i.MX6] Suspend/resume implementation for dw_hdmi-imx.c

Fabio1z

i.MX Processors

display controller subsystem hdmi lvds mipi dsi‌

linux bsp‌

hibernation‌

i.mx6 ipu‌

Hi,

I need some help in reconfiguring iomux/pad register content after system resume from hibernation.

Firstly, here are few details:

Device: custom i.MX6DL board with LCD and HDMI connected

Linux Kernel: custom 4.9+ kernel version with DRM support.

Display: Wayland 3.0 / Weston

Distribution: custom Ubuntu 16

We have a working imx6 board with Linux kernel 4.9 running on it with 2 parallel display (LCD + HDMI).

I am working on it to support custom hibernation feature on it.

The basic feature is working fine (after converting many imx-drm drivers a modules) and LCD is working after resume.

But HDMI display is remaining blank after resume (this issue was already logged in many tickets earlier as mentioned above).

After several debugging session, now I found the root cause.

1) First I got i2c-timeout issue, which I could fix after re-configuring the iomux setting for i2c.

2) Now I am getting vblank timeout issue (for crtc 1, hdmi case). Note: LCD is working fine.

For (2), I found that ipu_irq_handler is not getting called for HDMI. That means interrupted are stopped coming after resume.

This is the handler: in: drivers/gpu/drm/imx-ipuv3-crtc.c

static irqreturn_t ipu_irq_handler(int irq, void *dev_id)
{
struct ipu_crtc *ipu_crtc = dev_id;

pr_info("%s: called\n", __func__);
imx_drm_handle_vblank(ipu_crtc->imx_crtc);

return IRQ_HANDLED;
}

The similar issue was there for i2c case, which I fixed by restoring iomuxc registers during resume path.

So, I suspect in this case also IPU-hdmi related iomuxc registers needs to be restored.

So, for this case, can you help me which register content needs to be restored so that ipu handler will be called?

a) How do I verify which iomux is lost after resume ?
b) How to dump the iomux/pad register content ?
c) Where can I get the iomux register details (I have the imx6
reference manual with me).
d)  how to save and restore the IOMUX data with suspend and resume?

If you have any suggestion, please help!

Regards,

Pintu

0 Kudos
4 Replies

151 Views
pintukumar
Contributor II

Hi,

I also tried to restore almost all the iomux content using the code below in suspend path, but it does not help.

{{{

static void save_all_iomux_regs(void)
{
u32 base = 0x020E0000;
u32 val, offset;
int i;

offset = 0x0000;
for (i = 0; i <= 2380; i++) {
all_mux_regs[i] = read_ioremap_regs(base + offset);
offset += 4;
pr_info("[offset: 0x%x] = 0x%x\n", i, all_mux_regs[i]);
}
}

static void restore_all_iomux_regs(void)
{
u32 base = 0x020E0000;
u32 val, offset;
int i;

offset = 0x0000;
for (i = 0; i <= 2380; i++) {
phys_set_value(base + offset, all_mux_regs[i]);
offset += 4;
//pr_info("[offset: 0x%x] = 0x%x\n", i, val);
}
}

}}}

With this, I am able to resolve i2c timeout issue after resume, but vblank timeout issue still remains.

So, I wanted to know the correct logic to restore the IPU - HDMI connection after resume.

Thanks,

Pintu

0 Kudos

151 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Pintu

nxp linux bsps do not have problems with IPU,HDMI, GPU after resume,

one can look at sources on source.codeaurora.org/external/imx/linux-imx

linux-imx - i.MX Linux kernel 

Linux 4.14.98_2.2.0 Documentation

Best regards
igor

0 Kudos

151 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Pintu

example of restoring parameters after resume can be found in

suspend-imx6.S\mach-imx\arm\arch - linux-imx - i.MX Linux kernel 

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

0 Kudos

151 Views
pintukumar
Contributor II

Dear Igor,

Thank you so much for your reply.

But this part (suspend_imx6dl.S) is already integrated that's why I said basic suspend/resume (with LCD) is working fine.

The problem I am facing is with HDMI display, after snapshot resume.

The IPU irq handler (for crtc 1, hdmi) is not getting called after resume, thus we get vblank timeout issue.

So, I suspect that IOMUX/PAD settings needs to be restored for IPU/HDMI after resume.

So, can you help me with what registers needs to be restored after resume for HDMI to work?

If there is any suspect for IPU handler not to be called after resume, please let me know.

How is the IPU IRQ line connected with the HDMI ?

Please check the details with the technical team and let me know.

This can be of great help and support from NXP.

If this works then it can open-up enormous business opportunities with IMX product line.

Regards,

Pintu

0 Kudos