iMX6 peripheral memory access

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

iMX6 peripheral memory access

Jump to solution
1,417 Views
aleksandrgusaro
Contributor I

Hello,

While designing an iMX6ULL based device we've encountered an issue with reading/writing after ioremap.

Kernel 

DT and .config are attached.

The problems takes on two forms:

  • If during bootup ioremap was issued before a certain point, readw and writew both work, and then writew stops working;
  • If ioremap was issued after a certain point during bootup (or upon reaching shell), both readw and writew operations hang the system.

The system hangs happen when accessing:

  • KPP registers (base 0x20b8000)
  • EIM registers (base 0x21b8000)
  • EIM adress space (base 0x50000000)

We use this snippet to reproduce the issue:

/* DEBUG START */
{
        void __iomem *test_addr;

       printk(KERN_CRIT "%s:%d\n", __func__, __LINE__);

       test_addr = ioremap(0x020b8000, 0x4000);

       if (IS_ERR(test_addr)) {
               printk(KERN_CRIT "%s:%d ioremap failed\n", __func__, __LINE__);
       } else {
               printk(KERN_CRIT "%s:%d ioremap OK\n", __func__, __LINE__);
       }

       // System hangs here:
       printk(KERN_CRIT "%s:%d\nKPP: 0x%04x\n", __func__, __LINE__, 
               readw(test_addr + 0)
       );

       iounmap(test_addr);     
}
/* DEBUG END   */‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Do you have any advice?

Thanks!

0 Kudos
1 Solution
900 Views
aleksandrgusaro
Contributor I

We found that imx6ull.dtsi in the kpp node doesn't have a proper clocks definition:

kpp: kpp@020b8000 {
     compatible = "fsl,imx6ul-kpp", "fsl,imx21-kpp";
     reg = <0x020b8000 0x4000>;
     interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
     clocks = <&clks IMX6UL_CLK_DUMMY>;
     status = "disabled";
};
‍‍‍‍‍‍‍

instead, the "clocks" property should be:

clocks = <&clks IMX6UL_CLK_KPP>;

The same goes for EIM.

View solution in original post

0 Kudos
2 Replies
901 Views
aleksandrgusaro
Contributor I

We found that imx6ull.dtsi in the kpp node doesn't have a proper clocks definition:

kpp: kpp@020b8000 {
     compatible = "fsl,imx6ul-kpp", "fsl,imx21-kpp";
     reg = <0x020b8000 0x4000>;
     interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>;
     clocks = <&clks IMX6UL_CLK_DUMMY>;
     status = "disabled";
};
‍‍‍‍‍‍‍

instead, the "clocks" property should be:

clocks = <&clks IMX6UL_CLK_KPP>;

The same goes for EIM.

0 Kudos
900 Views
igorpadykov
NXP Employee
NXP Employee

Hi Aleksandr

one can try with official nxp linux releases described on

https://www.nxp.com/support/developer-resources/run-time-software/i.mx-developer-resources/i.mx-6ser...

for issues with linux-fslc (community version bsp) one can post on  meta-fsl-arm mailing list
https://lists.yoctoproject.org/listinfo/meta-freescale
Difference between them is described on

FSL Community BSP Release Notes 2.3 documentation 

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

0 Kudos