
In message 0721A2B6C14.000002EAejr@inbox.com you wrote:
I'm sorry, but the user's manual for my Z80 processor does not contain
...
I'm not sure what you're missing but my emphasis was on the calculation. This is on an ARM9 LH7A404 chip. Now I might be missing something but even on a 16 bit CPU
You did not understand my little joke about the old Z80 CPU - what I wanted to pointout was that you completely left out all relevant information, like which architecture and CPU and board you were talking about.
the calculation result shouldn't change, no?
You might have overflows here and there...
and CONFIG_SYS_CLK_FREQ is 14745600.
It should probably be 14745600L or "UL".
ulong maindiv1, maindiv2, prediv, ps;
^^^^^
printf("maindiv2: %d, maindiv1 %d, prediv %d, ps %d\n",maindiv2,maindiv1,prediv,ps);
^^ ^^ ^^ ^^
%d is for int, not for ulong.
printf("CONFIG_SYS_CLK_FREQ: %d \n",CONFIG_SYS_CLK_FREQ);
Same here.
return ( ((maindiv2 + 2) * (maindiv1 + 2) * CONFIG_SYS_CLK_FREQ) /
((prediv + 2) * (1 << ps)));
Best regards,
Wolfgang Denk