[U-Boot-Users] [PATCH] ColdFire: Fix UART baudrate at 115200

Liew Tsi Chung Tsi-chung.Liew at freescale.com
Thu May 29 01:35:22 CEST 2008


> Where are you getting the +31 from?  Is this in the User's Manual?
No in user's manual. The +31 is rounding up purpose.

> Computations are for mathematicians.  Real engineers measure the
actual frequency.  ;-)
Agree.

> If you change the " - 31" to " - 42", your computations will result in
a different divisor.  
> Why are you subtracting what appears to be an arbitrary number (31)?
Can't use 42 when the user's manual spec the divisor is 32. The "- 31"
comes from counter = ((bus_freq / baudrate) + 31) / 32. Using the same
calculation as mentioned here to find out bus_freq. bus_freq = ((counter
* 32) - 31) * baudrate.

> Are you sure your input frequency is 140MHz and not 144MHZ???  Have
you read the itty-bitty 
> numbers on the crystal?  Have you put a scope on it and actually
measured it?  Never trust 
> those hardware people.  ;-)
Actually, the bus freq is 70Mhz, 140Mhz is cpu freq (scope measurement).
The input freq (crystal/oscillator) not always 1 to 1 ratio. Take
M5253EVBE for example, the input clk is 11Mhz. Then, it multiply up and
divide down for CPU and bus frequency.

> Looking at the MFC5407 (arbitrarily, not knowing what processor you
have), the dividers are 
> as expected and *do not* match your "- 31" 
> calculations.  They have a simple example and simple math that matches
(no "- 31").

> Hmmm, the MFC5407 has a max CLKIN (and thus bus clock) of 54MHz.  You
must have a different 
> flavor.  MFC548x maxes at 50MHz.
> What processor are you using?
52x2, 532x, 547x_8x, 5445x. The 5253EVB is having the issue where the
calculation does not apply if baudrate is 115200.

> Ahh, MFC5249 has a 140MHz bus.  Still is a straight forward divide-by
n*32, no "- 31".
I thought the same too, but the 140Mhz is cpu freq.

Regards,
TsiChung




More information about the U-Boot mailing list