Re: R: Installation on a MPC5200 based custom board

2008-12-05 Thread Angelo
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, 0x);
.

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, 0x);
.
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 <[EMAIL PROTECTED]> ha scritto:
Da: Jon Smirl <[EMAIL PROTECTED]>
Oggetto: Re: R: Installation on a MPC5200 based custom board
A: "Juergen Beisert" <[EMAIL PROTECTED]>
Cc: linuxppc-dev@ozlabs.org, [EMAIL PROTECTED], "Gary Thomas" <[EMAIL 
PROTECTED]>, [EMAIL PROTECTED]
Data: Venerdì 5 dicembre 2008, 20:33

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

-- 
Jon Smirl
[EMAIL PROTECTED]



  ___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: R: Installation on a MPC5200 based custom board

2008-12-05 Thread Jon Smirl
The attachment is from Freescale and shows how the divider works.

-- 
Jon Smirl
[EMAIL PROTECTED]


fractinal_div.pdf
Description: Adobe PDF document
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: R: Installation on a MPC5200 based custom board

2008-12-05 Thread Juergen Beisert
On Freitag, 5. Dezember 2008, [EMAIL PROTECTED] wrote:
> 
>
> Now plugging-in USB:
>
> 
>
> [EMAIL PROTECTED]: ~ #[   17.228078] hub 1-0:1.0: state 7 ports 2 chg  evt
> 0004 [EMAIL PROTECTED]: ~ #[   17.233798] ppc-of-ohci f0001000.usb: GetStatus
> roothub.portstatus [1] = 0x00010101 CSC PPS CCS [EMAIL PROTECTED]: ~ #[  
> 17.242776] hub 1-0:1.0: port 2, status 0101, change 0001, 12 Mb/s
> [EMAIL PROTECTED]: ~ #[   17.374796] hub 1-0:1.0: debounce: port 2: total 
> 100ms
> stable 100ms status 0x101 [EMAIL PROTECTED]: ~ #[   17.450780] ppc-of-ohci
> f0001000.usb: GetStatus roothub.portstatus [1] = 0x00100103 PRSC PPS PES
> CCS [EMAIL PROTECTED]: ~ #[   17.514787] usb 1-2: new full speed USB device
> using ppc-of-ohci and address 2 [EMAIL PROTECTED]: ~ #[   24.027842] usb 1-2:
> khubd timed out on ep0in len=0/64 [EMAIL PROTECTED]: ~ #[   29.199841] usb 
> 1-2:
> khubd timed out on ep0in len=0/64 [EMAIL PROTECTED]: ~ #[   34.307841] usb 
> 1-2:
> khubd timed out on ep0in len=0/64 [EMAIL PROTECTED]: ~ #[   34.382786]
> ppc-of-ohci f0001000.usb: GetStatus roothub.portstatus [1] = 0x00100103
> PRSC PPS PES CCS [EMAIL PROTECTED]: ~ #[   34.446789] usb 1-2: device
> descriptor read/64, error -110 [EMAIL PROTECTED]: ~ #
> [EMAIL PROTECTED]: ~ #cat /proc/interrupts
>CPU0
> 134:   5689  MPC52xx Peripherals Edge  ohci_hcd:usb1
> 139:207  MPC52xx Peripherals Edge  mpc52xx_psc_uart
> 143:  0  MPC52xx Peripherals Edge  i2c-mpc
> 144:  0  MPC52xx Peripherals Edge  i2c-mpc
> BAD:  0
> [EMAIL PROTECTED]: ~ #
>
> 
>
> we were thinking to some problem like:
>
> http://www.nabble.com/USB-support-on-mpc5200-broken-td19658810.html
>
> or
>
> http://www.nabble.com/MPC5200-PCI-interrupt-routing-p19608472.html

Sounds like a wrong or missed clock configuration. Is your "CDM 48 MHz 
Fractional Divider Configuration Register Field Descriptions (0x0210)" setup 
correctly?

Some kernel revisions guesses and fixes the setting, some other not.

Regards,
Juergen

-- 
 Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
  Vertretung Sued/Muenchen, Germany
  Phone: +49-8766-939 228  | Fax: +49-5121-206917-
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev