AnsweredAssumed Answered

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

Question asked by 益 李 on Apr 21, 2016
Latest reply on Apr 21, 2016 by 益 李

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

Outcomes