Accessing timer registers in P4080DS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Accessing timer registers in P4080DS

979件の閲覧回数
rahul011189
Contributor I

Hi there,

I am trying to use a timer for profiling my bare-metal code on P4080DS but I couldn't find much info on it.

The e500mc Core reference manual says that there are timers like TB which can be configured and used. However, it does not have much info on using them. There is a small code snippet but it is in assembly language:

12825319_1300544763295660_617552403_n.jpg

It will be helpful if I can get either of the two:

1) A code snippet (in C) which shows how to configure and read/write the timer registers.

2) A code snippet on how to embed the above assembly code in my C code.

TIA,

- Rahul

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

748件の閲覧回数
bpe
NXP Employee
NXP Employee

Your processor core timer facilities are fully described in EREF_RM, Chapter 6. As of reference code, see how it is

implemented in Linux kernel, function get_tb​():

Linux/arch/powerpc/include/asm/time.h - Linux Cross Reference - Free Electrons

Have a great day,
Platon

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

0 件の賞賛
返信

748件の閲覧回数
rahul011189
Contributor I

Hi Platon,

In get_tb(), the value seems to be read from the location  0x3dd:

     asm volatile("mfspr %0, 0x3dd" : "=r" (tbl));

Where is it specified that TBL register is mapped to 0x3dd? The programmers manual does say that TBL is SPR268 but I am unable to locate the mapping to 0x3dd.

It will be really helpful if you can point me to the a document which clarifies this.

Regards,

Rahul

0 件の賞賛
返信