AnsweredAssumed Answered

Issues  About MX6_IO_ADDRESS

Question asked by tony.l.cai on Jun 25, 2015
Latest reply on Jun 25, 2015 by igorpadykov

Dear all,

     I want to read value of the register CCM_CLPCR(Address: 20C_4000h base + 54h offset = 20C_4054h) ,and I my code is following:


void __iomem *mx6_CCM_base =  MX6_IO_ADDRESS(CCM_BASE_ADDR);
u32 ret32;
ret32 = readl(mx6_CCM_base + 0x54);
printk(KERN_ERR "---mx6_CCM_base + CLKCTL_CLPCR:%x-----reg--:%x--------\n",mx6_CCM_base + 0x54,ret32);


So the log is :---mx6_CCM_base + CLKCTL_CLPCR:f40c4054-----reg--:178--------


But I'm so confused that why the addr is 0xf40c4054 not 0x20c4054(this value is on the reference manual).And I also find the following code

/* define virtual address */

#define PERIPBASE_VIRT 0xF0000000

#define MX6_IO_ADDRESS(x) ((x)  - PERIPBASE_VIRT)


Maybe I dont know the basic knowedge about these code,could you give me some guideline in details,especially the virtual address?


and before this ,I want to know the value that I read is right?