From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from web23103.mail.ird.yahoo.com (web23103.mail.ird.yahoo.com [217.146.189.43]) by ozlabs.org (Postfix) with SMTP id 78937DDDEE for ; Sat, 6 Dec 2008 07:29:59 +1100 (EST) Date: Fri, 5 Dec 2008 20:29:57 +0000 (GMT) From: Angelo Subject: Re: R: Installation on a MPC5200 based custom board To: Juergen Beisert , Jon Smirl In-Reply-To: <9e4733910812051133v2b14f698k6165834d55037888@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1264117439-1228508997=:68911" Message-ID: <895374.68911.qm@web23103.mail.ird.yahoo.com> Cc: linuxppc-dev@ozlabs.org, Gary Thomas , gianfranco.casanova@alice.it Reply-To: s104259@yahoo.it List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0-1264117439-1228508997=:68911 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ok . =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Case arch =3D powerpc I saw that cdm is modified in two fields. arch/powerpc/platforms/mpc52xx_common.c file, in function: mpc52xx_setup_cp= u(void) ..... =C2=A0=C2=A0=C2=A0 /* Use internal 48 Mhz */ =C2=A0=C2=A0=C2=A0 out_8(&cdm->ext_48mhz_en, 0x00); =C2=A0=C2=A0=C2=A0 out_8(&cdm->fd_enable, 0x01); =C2=A0=C2=A0=C2=A0 if (in_be32(&cdm->rstcfg) & 0x40)=C2=A0=C2=A0=C2=A0 /* A= ssumes 33Mhz clock */ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 out_be16(&cdm->fd_counters, 0x0001); =C2=A0=C2=A0=C2=A0 else =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 out_be16(&cdm->fd_counters, 0x5555); ..... and in file arch/powerpc/platforms/52xx/lite5200.c , function: void __init lite5200_calibrate_decr(void) { =C2=A0=C2=A0=C2=A0 ppc_tb_freq =3D 0x1F78A40;=C2=A0=C2=A0=C2=A0 =C2=A0=C2= =A0=C2=A0 /* hardcoded default */ =C2=A0=C2=A0=C2=A0 /* CPU FREQUENCY FORCED TO 396 MHz VALUE */ =C2=A0=C2=A0=C2=A0 ppc_proc_freq =3D 0x179A7B00;=C2=A0=C2=A0=C2=A0 /* hardc= oded default */ .......... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Case arch =3D ppc The code is equal but obviously the path change (arch/ppc/syslib/mpc52xx_se= tup.c). Funtion: mpc52xx_setup_cpu(void) ..... =C2=A0=C2=A0=C2=A0 /* Use internal 48 Mhz */ =C2=A0=C2=A0=C2=A0 out_8(&cdm->ext_48mhz_en, 0x00); =C2=A0=C2=A0=C2=A0 out_8(&cdm->fd_enable, 0x01); =C2=A0=C2=A0=C2=A0 if (in_be32(&cdm->rstcfg) & 0x40)=C2=A0=C2=A0=C2=A0 /* A= ssumes 33Mhz clock */ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 out_be16(&cdm->fd_counters, 0x0001); =C2=A0=C2=A0=C2=A0 else =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 out_be16(&cdm->fd_counters, 0x5555); ..... And in function: mpc52xx_calibrate_decr(void) ..... =C2=A0=C2=A0=C2=A0 xlbfreq =3D __res.bi_busfreq; =C2=A0=C2=A0=C2=A0 /* if bootloader didn't pass bus frequencies, calculate = them */ =C2=A0=C2=A0=C2=A0 if (xlbfreq =3D=3D 0) { =C2=A0=C2=A0=C2=A0 ........... =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 /* Compute all frequency from that & = CDM settings */ =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 xlbfreq =3D (tbl_end - tbl_start) << = 8; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 cpufreq =3D (xlbfreq * core_mult[in_b= e32(&cdm->rstcfg)&0x1f])/10; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 ipbfreq =3D (in_8(&cdm->ipb_clk_sel) = & 1) ? =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 xlbfreq / 2 : xlbfreq; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 switch (in_8(&cdm->pci_clk_sel) & 3) = { =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 case 0: =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pcifreq =3D ipbfre= q; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 break; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 case 1: =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pcifreq =3D ipbfre= q / 2; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 break; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 default: =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pcifreq =3D xlbfre= q / 4; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 break; =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0 ..... =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D What do you think about this? Thanks in advance, @ngel --- Ven 5/12/08, Jon Smirl ha scritto: Da: Jon Smirl Oggetto: Re: R: Installation on a MPC5200 based custom board A: "Juergen Beisert" Cc: linuxppc-dev@ozlabs.org, s104259@yahoo.it, "Gary Thomas" , gianfranco.casanova@alice.it Data: Venerd=C3=AC 5 dicembre 2008, 20:33 The attachment is from Freescale and shows how the divider works. --=20 Jon Smirl jonsmirl@gmail.com =0A=0A=0A --0-1264117439-1228508997=:68911 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Ok .
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D
Case arch = =3D powerpc

I saw that cdm= is modified in two fields.

arch/powerpc/platforms/mpc52xx_common.c file, in function: mpc52xx_setup_cpu(void)
.....
&nb= sp;   /* Use internal 48 Mhz */
    out_8(&= cdm->ext_48mhz_en, 0x00);
    out_8(&cdm->fd_en= able, 0x01);
    if (in_be32(&cdm->rstcfg) & 0= x40)    /* Assumes 33Mhz clock */
    &nbs= p;   out_be16(&cdm->fd_counters, 0x0001);
  &= nbsp; else
        out_be16(&cdm->f= d_counters, 0x5555);
.....

and in file a= rch/powerpc/platforms/52xx/lite5200.c , function:
void __init lite5200_calibrate_decr(void)
{    ppc_tb_freq =3D 0x1F78A40;     &nb= sp;  /* hardcoded default */
    /* CPU FREQUENCY FO= RCED TO 396 MHz VALUE */
    ppc_proc_freq =3D 0x179A7B00= ;    /* hardcoded default */
..........

=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Case arch =3D ppc

The code is equal but obviou= sly the path change (arch/ppc/syslib/mp= c52xx_setup.c). Funtion: mpc52xx_= setup_cpu(void)
.....
    /* Use internal 48 Mh= z */
    out_8(&cdm->ext_48mhz_en, 0x00);
 = ;   out_8(&cdm->fd_enable, 0x01);
    if (in_be32(&am= p;cdm->rstcfg) & 0x40)    /* Assumes 33Mhz clock */        out_be16(&cdm->fd_counters, = 0x0001);
    else
       = ; out_be16(&cdm->fd_counters, 0x5555);
.....
And in function: = mpc52xx_calibrate_decr(void)
<= br>.....
    xlbfreq =3D __res.bi_busfreq;
  = ;  /* if bootloader didn't pass bus frequencies, calculate them */
=     if (xlbfreq =3D=3D 0) {
    ..........= .
        /* Compute all frequency from th= at & CDM settings */
        xlbfreq = =3D (tbl_end - tbl_start) << 8;
      &nb= sp; cpufreq =3D (xlbfreq * core_mult[in_be32(&cdm->rstcfg)&0x1f])/10;
   = ;     ipbfreq =3D (in_8(&cdm->ipb_clk_sel) & 1) ?=
              &n= bsp;     xlbfreq / 2 : xlbfreq;
     =    switch (in_8(&cdm->pci_clk_sel) & 3) {
 &nb= sp;      case 0:
      &nbs= p;     pcifreq =3D ipbfreq;
     &nbs= p;      break;
       = case 1:
            pcifre= q =3D ipbfreq / 2;
          &nb= sp; break;
        default:
  = ;          pcifreq =3D xlbfreq / 4;
&= nbsp;           break;
        }
    ..= ...
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
What do you think about this?

Thanks in advance,
@ngel
--- <= b>Ven 5/12/08, Jon Smirl <jonsmirl@gmail.com> ha scritto:<= br>
Da: Jon Smirl <jonsmirl@gmail.com>
Ogg= etto: Re: R: Installation on a MPC5200 based custom board
A: "Juergen Be= isert" <jbe@pengutronix.de>
Cc: linuxppc-dev@ozlabs.org, s104259@y= ahoo.it, "Gary Thomas" <gary@mlbassoc.com>, gianfranco.casanova@alice= .it
Data: Venerd=C3=AC 5 dicembre 2008, 20:33

The attachment=
 is from Freescale and shows how the divider works.

--
Jon Smirl=
jonsmirl@gmail.com

=0A=0A= =0A=0A --0-1264117439-1228508997=:68911--