[U-Boot-Users] ppc4xx/serial.c

Seingier François-Xavier Francois-Xavier.Seingier at thomson.net
Mon Jul 12 18:23:16 CEST 2004


hello,
I've been going through the code of the function serial_init because I couldn't get the proper baudrate divisor. I must admit I don't understand the operations made to calculate udiv and bdiv... According to the 405gp user manual, these are the meanings of a few parameters.

CFG_BASE_BAUD = SerClk / 16

bdiv = SerClk / (16 * baudrate)

SerClk = cpu_freq / udiv



As a result, udiv and bdiv should be generated as follows in serail_init:

if external_clock:

SerClk = CFG_EXT_SERIAL_CLK
udiv = 1

else:

SerClk = CFG_BASE_BAUD * 16
udiv = cpu_freq / serClk

endif

bdiv = SerClk / (16 * baudrate)

Am I missing something?

regards,

François-Xavier SEINGIER




More information about the U-Boot mailing list