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

Stefan Roese stefan.roese at esd-electronics.com
Tue Jul 13 10:33:41 CEST 2004


François-Xavier,

> Actually, I modified the serial.c file so that udiv and bdiv 
> are calculated as I explained in the previous post and it 
> works. In fact, I was wondering if the original operations 
> were correct? For example, I cannot figure out the meaning of 
> udiv = (clk + tmp / 2) / tmp and all these operations are 
> rather confusing 8-/

The equation:

udiv = (clk + tmp / 2) / tmp

is the same as:

udiv = (clk / tmp) + 0.5

This is done because of rounding reasons and is OK! This works on at
least 20 PPC4xx boards under different CPU frequencies and baudrates
without problems.

Could you explain what excatly your problem is (with the current
equations)?

Best regards,
Stefan Roese





More information about the U-Boot mailing list