How to get the BRG frequency value?

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

How to get the BRG frequency value?

Jump to solution
1,136 Views
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

Labels (1)
Tags (2)
0 Kudos
1 Solution
997 Views
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.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
998 Views
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 Kudos
997 Views
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 Kudos
997 Views
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 Kudos
997 Views
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 Kudos