MDIO clock speed computation

Pavel Bartusek pba at sysgo.de
Wed Jul 24 17:38:38 EST 2002


Jean-Denis Boyer wrote:

>>Will this work for all cases? :
>>
>>((((bd->bi_intfreq + 4999999) / 2500000) / 2 ) & 0x3F ) << 1;
>>
>
>I hope so ;-)
>
Because hoping is not enough, I wrote a little brute force program for testing (see attachment).
The algorithm above is OK :-) It produces MDIO frequencies from 1.875MHz to 2.5 MHz.

BTW: Wolfgang, similar problem is in the PPCboot.

----------------------------------------------------------------------
|                          Pavel Bartusek                            |
|                                                                    |
| Sysgo RTS GmbH,                     phone: +49 (0) 6136 9948-722   |
| Am Pfaffenstein 14                  fax:   +49 (0) 6136 9948-10    |
| D-55270 Klein-Winternheim           email: pba at sysgo.de            |
| Germany                                                            |
|                                                                    |
|       http://www.sysgo.de           http://www.elinos.com          |
|                                                                    |
----------------------------------------------------------------------


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fec_speed.test.c
Url: http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20020724/31bd97e1/attachment.txt 


More information about the Linuxppc-embedded mailing list