How to detect fsystem clock on MPC5200

Grant Likely grant.likely at secretlab.ca
Fri Feb 9 13:42:16 EST 2007


On 2/8/07, Juergen Beisert <juergen.beisert at weihenstephan.org> wrote:
> Hi all,
>
> currently I am writing an SPI driver for a PSC unit.

Cool; that would be useful!  :)  I look forward to seeing it.

> To calculate the baudrate
> this unit should use I need the fsystem frequence (fsystem is the used name
> in the datasheet). Is there a generic way (API) to read back this clock?
>
> For the IPB clock I found mpc52xx_find_ipb_freq() from the open firmware
> framework. Is there something similar for the fsystem clock?

Hmmm, yeah... Sylvain brought this up a while ago.  We currently don't
have that information in the device tree definition; but it is needed.
 I need to add a new device tree property; probably 'system-frequency'
in the soc node.  It is also possible to derive fsystem from the
/soc5200/bus-frequency by interpreting the registers; but i think
that's rather ugly.

I'm working on the device tree bindings at the moment.  I'll add in a
property for the system frequency and post the patch for comments.
Once that's defined, it's trivial to add a function to return the
system frequency.

Cheers,
g.

-- 
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
grant.likely at secretlab.ca
(403) 399-0195



More information about the Linuxppc-embedded mailing list