Issues About MX6_IO_ADDRESS

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

Issues About MX6_IO_ADDRESS

490 Views
tony_l_cai
Contributor III

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?

3Q~

Labels (3)
0 Kudos
1 Reply

339 Views
igorpadykov
NXP Employee
NXP Employee

HI tony

you are right: 0xf40c4054 is virtual address, that is 0x20c4054 + PERIPBASE_VIRT,

check attached mx6.h (..linux-3.0.35_4.1.0/arch/arm/plat-mxc/include/mach)

#define PERIPBASE_VIRT

0xF2000000

Best regards

igor

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

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

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

0 Kudos