[U-Boot-Users] How to decide UART CFG_BASE_BAUD?

Frank Young young726 at hotmail.com
Tue May 18 18:30:21 CEST 2004

I am using PPC 405GP rev E, 200MHz cpu clock. The desired baudrate of UART 
is 9600.

According to the manual, developer needs to decide a devisor udiv to get the 
serial clock, i.e.
serial clock = cpu clock / udiv

An UART baudrate divisior bdiv is defined as bdiv = serial clock / (desired 
baudrate * 16)

I checked the u-boot source code and got a couple of questions:

1. a CFG_BASE_BAUD is defined upfront in u-boot. What is this? Is 
CFG_BASE_BAUD = serial clock / 16? If so the serial clock is fixed, instead 
of programmable, is that right? But the manual says the serial clock is 
programmable through setting the value of udiv. So udiv and the serial 
clock, which should be set first? In another word, should udiv be decided by 
user and then cpu calculate the serial clock according to udiv, or should 
user put a fixed serial clock to let cpu calculate udiv?

2. With two parameters, i.e. cpu clock = 200MHz and UART baudrate = 9600, 
can program decide all divisors such as udiv and bdiv? I found a table in a 
vxworks boot rom source, which tells developers when clock = 200M, UART 
baudrate = 9600, the udiv should be set as 14. How this number comes from? 
Or is it just a suggested number?



Express yourself with the new version of MSN Messenger! Download today - 
it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

More information about the U-Boot mailing list