<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Ok .<br>=============================================<br><span style="font-weight: bold;">Case arch = powerpc</span><br><br>I saw that <span style="font-weight: bold;">cdm</span> is modified in two fields.<br><br><span style="font-style: italic;">arch/powerpc/platforms/mpc52xx_common.c</span> file, in function: <span style="font-weight: bold;">mpc52xx_setup_cpu(void)</span><br>.....<br>&nbsp;&nbsp;&nbsp; /* Use internal 48 Mhz */<br>&nbsp;&nbsp;&nbsp; out_8(&amp;cdm-&gt;ext_48mhz_en, 0x00);<br>&nbsp;&nbsp;&nbsp; out_8(&amp;cdm-&gt;fd_enable, 0x01);<br>&nbsp;&nbsp;&nbsp; if (in_be32(&amp;cdm-&gt;rstcfg) &amp; 0x40)&nbsp;&nbsp;&nbsp; /* Assumes 33Mhz clock */<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; out_be16(&amp;cdm-&gt;fd_counters, 0x0001);<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; out_be16(&amp;cdm-&gt;fd_counters,
 0x5555);<br>.....<br><br>and in file <span style="font-style: italic;">arch/powerpc/platforms/52xx/lite5200.c</span> , function:<br>void __init <span style="font-weight: bold;">lite5200_calibrate_decr(void)</span><br>{<br>&nbsp;&nbsp;&nbsp; ppc_tb_freq = 0x1F78A40;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* hardcoded default */<br>&nbsp;&nbsp;&nbsp; /* CPU FREQUENCY FORCED TO 396 MHz VALUE */<br>&nbsp;&nbsp;&nbsp; ppc_proc_freq = 0x179A7B00;&nbsp;&nbsp;&nbsp; /* hardcoded default */<br>..........<br><br>=============================================<br><span style="font-weight: bold;">Case arch = ppc</span><br><br>The code is equal but obviously the path change (<span style="font-style: italic;">arch/ppc/syslib/mpc52xx_setup.c</span>). Funtion: <span style="font-weight: bold;">mpc52xx_setup_cpu(void)</span><br>.....<br>&nbsp;&nbsp;&nbsp; /* Use internal 48 Mhz */<br>&nbsp;&nbsp;&nbsp; out_8(&amp;cdm-&gt;ext_48mhz_en, 0x00);<br>&nbsp;&nbsp;&nbsp;
 out_8(&amp;cdm-&gt;fd_enable, 0x01);<br>&nbsp;&nbsp;&nbsp; if (in_be32(&amp;cdm-&gt;rstcfg) &amp; 0x40)&nbsp;&nbsp;&nbsp; /* Assumes 33Mhz clock */<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; out_be16(&amp;cdm-&gt;fd_counters, 0x0001);<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; out_be16(&amp;cdm-&gt;fd_counters, 0x5555);<br>.....<br>And in function: <span style="font-weight: bold;">mpc52xx_calibrate_decr(void)</span><br><br>.....<br>&nbsp;&nbsp;&nbsp; xlbfreq = __res.bi_busfreq;<br>&nbsp;&nbsp;&nbsp; /* if bootloader didn't pass bus frequencies, calculate them */<br>&nbsp;&nbsp;&nbsp; if (xlbfreq == 0) {<br>&nbsp;&nbsp;&nbsp; ...........<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* Compute all frequency from that &amp; CDM settings */<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlbfreq = (tbl_end - tbl_start) &lt;&lt; 8;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cpufreq = (xlbfreq *
 core_mult[in_be32(&amp;cdm-&gt;rstcfg)&amp;0x1f])/10;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ipbfreq = (in_8(&amp;cdm-&gt;ipb_clk_sel) &amp; 1) ?<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlbfreq / 2 : xlbfreq;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; switch (in_8(&amp;cdm-&gt;pci_clk_sel) &amp; 3) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case 0:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pcifreq = ipbfreq;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case 1:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pcifreq = ipbfreq / 2;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; default:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pcifreq = xlbfreq / 4;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 break;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; .....<br>=============================================<br><br>What do you think about this?<br><br>Thanks in advance,<br>@ngel<br>--- <b>Ven 5/12/08, Jon Smirl <i>&lt;jonsmirl@gmail.com&gt;</i></b> ha scritto:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">Da: Jon Smirl &lt;jonsmirl@gmail.com&gt;<br>Oggetto: Re: R: Installation on a MPC5200 based custom board<br>A: "Juergen Beisert" &lt;jbe@pengutronix.de&gt;<br>Cc: linuxppc-dev@ozlabs.org, s104259@yahoo.it, "Gary Thomas" &lt;gary@mlbassoc.com&gt;, gianfranco.casanova@alice.it<br>Data: Venerdì 5 dicembre 2008, 20:33<br><br><pre>The attachment is from Freescale and shows how the divider works.<br><br>-- <br>Jon Smirl<br>jonsmirl@gmail.com<br></pre></blockquote></td></tr></table><br>