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

hello,
What's exactly your problem?
Give us your cpu_freq value and desired baudrate so that we can help.
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-/
regards,
François-Xavier SEINGIER

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
participants (2)
-
Seingier François-Xavier
-
Stefan Roese