public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
From: Angelo <s104259@yahoo.it>
To: Juergen Beisert <jbe@pengutronix.de>, Jon Smirl <jonsmirl@gmail.com>
Cc: linuxppc-dev@ozlabs.org, Gary Thomas <gary@mlbassoc.com>,
	gianfranco.casanova@alice.it
Subject: Re: R: Installation on a MPC5200 based custom board
Date: Fri, 5 Dec 2008 20:29:57 +0000 (GMT)	[thread overview]
Message-ID: <895374.68911.qm@web23103.mail.ird.yahoo.com> (raw)
In-Reply-To: <9e4733910812051133v2b14f698k6165834d55037888@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2820 bytes --]

Ok .
=============================================
Case arch = powerpc

I saw that cdm is modified in two fields.

arch/powerpc/platforms/mpc52xx_common.c file, in function: mpc52xx_setup_cpu(void)
.....
    /* Use internal 48 Mhz */
    out_8(&cdm->ext_48mhz_en, 0x00);
    out_8(&cdm->fd_enable, 0x01);
    if (in_be32(&cdm->rstcfg) & 0x40)    /* Assumes 33Mhz clock */
        out_be16(&cdm->fd_counters, 0x0001);
    else
        out_be16(&cdm->fd_counters, 0x5555);
.....

and in file arch/powerpc/platforms/52xx/lite5200.c , function:
void __init lite5200_calibrate_decr(void)
{
    ppc_tb_freq = 0x1F78A40;        /* hardcoded default */
    /* CPU FREQUENCY FORCED TO 396 MHz VALUE */
    ppc_proc_freq = 0x179A7B00;    /* hardcoded default */
..........

=============================================
Case arch = ppc

The code is equal but obviously the path change (arch/ppc/syslib/mpc52xx_setup.c). Funtion: mpc52xx_setup_cpu(void)
.....
    /* Use internal 48 Mhz */
    out_8(&cdm->ext_48mhz_en, 0x00);
    out_8(&cdm->fd_enable, 0x01);
    if (in_be32(&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)

.....
    xlbfreq = __res.bi_busfreq;
    /* if bootloader didn't pass bus frequencies, calculate them */
    if (xlbfreq == 0) {
    ...........
        /* Compute all frequency from that & CDM settings */
        xlbfreq = (tbl_end - tbl_start) << 8;
        cpufreq = (xlbfreq * core_mult[in_be32(&cdm->rstcfg)&0x1f])/10;
        ipbfreq = (in_8(&cdm->ipb_clk_sel) & 1) ?
                    xlbfreq / 2 : xlbfreq;
        switch (in_8(&cdm->pci_clk_sel) & 3) {
        case 0:
            pcifreq = ipbfreq;
            break;
        case 1:
            pcifreq = ipbfreq / 2;
            break;
        default:
            pcifreq = xlbfreq / 4;
            break;
        }
    .....
=============================================

What do you think about this?

Thanks in advance,
@ngel
--- Ven 5/12/08, Jon Smirl <jonsmirl@gmail.com> ha scritto:
Da: Jon Smirl <jonsmirl@gmail.com>
Oggetto: Re: R: Installation on a MPC5200 based custom board
A: "Juergen Beisert" <jbe@pengutronix.de>
Cc: linuxppc-dev@ozlabs.org, s104259@yahoo.it, "Gary Thomas" <gary@mlbassoc.com>, gianfranco.casanova@alice.it
Data: Venerdì 5 dicembre 2008, 20:33

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

-- 
Jon Smirl
jonsmirl@gmail.com



      

[-- Attachment #2: Type: text/html, Size: 4655 bytes --]

      reply	other threads:[~2008-12-05 20:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-05 10:47 Installation on a MPC5200 based custom board Angelo
2008-12-05 12:20 ` Gary Thomas
2008-12-05 13:00   ` R: " gianfranco.casanova
2008-12-05 17:36     ` Juergen Beisert
2008-12-05 19:33       ` Jon Smirl
2008-12-05 20:29         ` Angelo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=895374.68911.qm@web23103.mail.ird.yahoo.com \
    --to=s104259@yahoo.it \
    --cc=gary@mlbassoc.com \
    --cc=gianfranco.casanova@alice.it \
    --cc=jbe@pengutronix.de \
    --cc=jonsmirl@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox