
20 Apr
2007
20 Apr
'07
9:17 a.m.
Hi Junior,
u-boot-users-bounces@lists.sourceforge.net wrote on Thursday, April 19, 2007 8:52 PM:
return ( ((maindiv2 + 2) * (maindiv1 + 2) *
CONFIG_SYS_CLK_FREQ) / ((prediv + 2) * (1 << ps))); }
I think I see what the problem is but I'm not sure how to fix it in uboot. When I multiply 450 and 14745600, I get a number greater than 32 bits and the MSB is missed.
You could rearrange your formula:
CONFIG_SYS_CLK_FREQ / ((prediv + 2) * (1 << ps)) * (maindiv2 + 2) * (maindiv1 + 2)
The compiler should do the calculation from left to right.
Regards, Martin