imx6ul:help,i can't read or write the weim register

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

imx6ul:help,i can't read or write the weim register

Jump to solution
1,237 Views
半醒的狐狸
Contributor I

the eim register is :

eim register.png

i want to change the register value, but i can't read or write it wen i ioremap the phy_adr.

i built a mode ,when i insmod it :

#define  ADDR_PHY 0x21B8000

void read_phy_addr(int offset)

{

  static struct resource  *my_mem;

  printk("offset = %d\n",offset);

  my_mem = request_mem_region(ADDR_PHY + 0x4000 * offset, 0x4000, "testPF");

     if (my_mem == NULL) { 

        printk("failed to get memory region\n"); 

        return -ENOENT; 

    }

  else

  printk("phy_addr = %8x\n",ADDR_PHY + 0x4000 * offset);

    void __iomem *plx_membase;

    plx_membase = ioremap(ADDR_PHY + 0x4000 * offset, 0x4000);    

    if(NULL == plx_membase){

    printk("ioremap error\n");

    }

  printk("ioremap_addr=%lx\n",(u_long)plx_membase);    

printk("print_out: %d\n",readl(plx_membase));     

  printk("+++++++++++++++++++++\n");

  iounmap(plx_membase);

  release_mem_region(ADDR_PHY + 0x4000 * offset,0x4000);

}

the result is:

卡死.png

the program deadlock.

i have tried other phy_addr.

some can read the value ,and some can't.

0200_0000 

6000_0000

0C00_0000

they can be read the value.

1000_0000

5800_0000

can't.

the board information :

CPU:   Freescale i.MX6UL rev1.0 at 396 MHz

CPU:   Temperature 40 C

Reset cause: POR

Board: MX6UL 14x14 EVK

I2C:   ready

DRAM:  512 MiB

Labels (2)
0 Kudos
1 Solution
700 Views
igorpadykov
NXP Employee
NXP Employee

Hi Yi

please check that CCM register CCM_CCGR6

enables clock (eim_slow clocks) for EIM module.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
701 Views
igorpadykov
NXP Employee
NXP Employee

Hi Yi

please check that CCM register CCM_CCGR6

enables clock (eim_slow clocks) for EIM module.

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
700 Views
半醒的狐狸
Contributor I

Hi igorpadykov

thanks for you help,i read the CCM_CCGR6,found the eim_slow clocks bit is disable.

i can read and write the weim register after enable the clocks.

thanks again for you help!

Best regards

lyi

0 Kudos