How to get the BRG frequency value?

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

How to get the BRG frequency value?

跳至解决方案
2,235 次查看
yunyuaner
Contributor I

QEIWRM Chapter 5.6 says - " The BRG clock frequency is half the QUICC Engine clock divided by this combined source-clock factor.", so what is 'combined source-clock factor', how can I get the value of it?

Thanks

Jia

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
2,096 次查看
r8070z
NXP Employee
NXP Employee


Have a great day,

The BRG provides a divide-by-16 option (BRGCn[DIV16]) and a 12-bit prescaler (BRGCn[CD]) to divide the source clock frequency. As combined source-clock factor they mean the BRG division factor (D) i.e. ratio of BRG input and output clock frequencies. Its value is given by expression

If BRGCx[DIV16]=1  then D = 16*(BRGCx[CD] + 1)

If BRGCx[DIV16]=0  then D = BRGCx[CD] + 1

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
4 回复数
2,097 次查看
r8070z
NXP Employee
NXP Employee


Have a great day,

The BRG provides a divide-by-16 option (BRGCn[DIV16]) and a 12-bit prescaler (BRGCn[CD]) to divide the source clock frequency. As combined source-clock factor they mean the BRG division factor (D) i.e. ratio of BRG input and output clock frequencies. Its value is given by expression

If BRGCx[DIV16]=1  then D = 16*(BRGCx[CD] + 1)

If BRGCx[DIV16]=0  then D = BRGCx[CD] + 1

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

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复
2,096 次查看
yunyuaner
Contributor I

Hi Serguei,

Thanks for reply! 

The device tree file in linux defined 'brg-frequency', 'bus-frequency', I believe 'bus-frequency' denotes qe clock frequency, and I just want to get the correct value of 'brg-frequency'. Is 'BRG clock frequency' mentioned above equal to baud rate, such as 115200 in case of ucc_uart? What is the 'source clock frequency'? Is it derived from qe clock?

An comment in linux kernel @ucc_uart.c also says:

"Older versions of U-Boot do not initialize the brg-frequency property, so in this case we assume the BRG frequency is half the QE bus frequency."

I'm still confused anyway:-(

Thanks

Jia

0 项奖励
回复
2,096 次查看
yunyuaner
Contributor I

Hi Serguei,

I think what I want to know is BRGCLK, would you please take a look.

Thanks微信截图_20190625164801.png

Jia

0 项奖励
回复
2,096 次查看
r8070z
NXP Employee
NXP Employee

Typically

- bus-frequency : the clock frequency for QUICC Engine

- brg-frequency : the internal clock source frequency for baud-rate generators in Hz.

Clock source is selected by BRGCx[EXTC]. If the BRGCLK is selected then it is half of the QE frequency (bus-frequency).

0 项奖励
回复