R: Installation on a MPC5200 based custom board

Angelo s104259 at yahoo.it
Sat Dec 6 07:29:57 EST 2008


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 at gmail.com> ha scritto:
Da: Jon Smirl <jonsmirl at gmail.com>
Oggetto: Re: R: Installation on a MPC5200 based custom board
A: "Juergen Beisert" <jbe at pengutronix.de>
Cc: linuxppc-dev at ozlabs.org, s104259 at yahoo.it, "Gary Thomas" <gary at mlbassoc.com>, gianfranco.casanova at alice.it
Data: Venerdì 5 dicembre 2008, 20:33

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

-- 
Jon Smirl
jonsmirl at gmail.com



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20081205/dcd8cfcc/attachment.htm>


More information about the Linuxppc-dev mailing list