Can I have code example how to read DCFG_CCSR_FUSESR register. Thanks

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Can I have code example how to read DCFG_CCSR_FUSESR register. Thanks

跳至解决方案
1,569 次查看
sergeyuskach
Contributor I

Can I have code example how to read DCFG_CCSR_FUSESR register. Thanks

hi ,

thanks for the answer but I would like to look if it is possible for the function fusesr = in_be32(&gur->dcfg_fusesr); in yiou sample attached.

Message was edited by: Sergey Uskach

标签 (1)
0 项奖励
回复
1 解答
1,412 次查看
lunminliang
NXP Employee
NXP Employee

Hello Sergey Uskach,

The function in_be32( ) is an inline function for PowerPC defined in u-boot:

extern inline u32 in_be32(const volatile unsigned __iomem *addr)
{
      u32 ret;

     __asm__ __volatile__("sync; lwz%U1%X1 %0,%1;\n"
        "twi 0,%0,0;\n"
        "isync" : "=r" (ret) : "m" (*addr));
      return ret;
}

Have a great day,
Lunmin

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

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,413 次查看
lunminliang
NXP Employee
NXP Employee

Hello Sergey Uskach,

The function in_be32( ) is an inline function for PowerPC defined in u-boot:

extern inline u32 in_be32(const volatile unsigned __iomem *addr)
{
      u32 ret;

     __asm__ __volatile__("sync; lwz%U1%X1 %0,%1;\n"
        "twi 0,%0,0;\n"
        "isync" : "=r" (ret) : "m" (*addr));
      return ret;
}

Have a great day,
Lunmin

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

0 项奖励
回复
1,412 次查看
lunminliang
NXP Employee
NXP Employee

Hello Sergey Uskach,

As it's memory-mapped CCSR register, access it at its address list in reference manual. What's your problem of reading this register?

There is code in U-boot reading this register, see attached code in board\freescale\common\vid.c

Have a great day,
Lunmin

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

                   

                   

                       

                                     

                                         
    0 项奖励
    回复