|
| View previous topic :: View next topic |
| Author |
Message |
Karel Gardas (kcg)
Joined: 30 Jan 2006 Posts: 40
|
Posted: Sun Dec 17, 2006 4:14 pm Post subject: Efika's IPB clock |
|
|
Hello,
from the SFW bootup output, it seems core clock is 396 and at least XPB clock seems to be 132 MHz (based on MPC5200B user manual) The question is: is IPB clock 132 or 66 MHz?
Thanks,
Karel |
|
| Back to top |
|
 |
Matt Sealey (Neko) Site Admin
Joined: 24 Sep 2004 Posts: 1405 Location: Alamo Heights, TX
|
Posted: Mon Dec 18, 2006 4:38 am Post subject: Re: Efika's IPB clock |
|
|
| kcg wrote: | Hello,
from the SFW bootup output, it seems core clock is 396 and at least XPB clock seems to be 132 MHz (based on MPC5200B user manual) The question is: is IPB clock 132 or 66 MHz?
Thanks,
Karel |
Why do you need to know that? :) _________________ Matt Sealey, Genesi USA Inc.
Product Development Analyst |
|
| Back to top |
|
 |
Karel Gardas (kcg)
Joined: 30 Jan 2006 Posts: 40
|
Posted: Mon Dec 18, 2006 4:45 am Post subject: Re: Efika's IPB clock |
|
|
| Neko wrote: | | kcg wrote: | Hello,
from the SFW bootup output, it seems core clock is 396 and at least XPB clock seems to be 132 MHz (based on MPC5200B user manual) The question is: is IPB clock 132 or 66 MHz?
Thanks,
Karel |
Why do you need to know that? :) |
Because in current generic 5200 BSP, it's needed to configure those three clocks. For example following comments in code, IPB clock is the same as in Bestcomm and Bestcomm clock is what you need to know to configure serial port bauds correctly.
Thanks,
Karel |
|
| Back to top |
|
 |
Karel Gardas (kcg)
Joined: 30 Jan 2006 Posts: 40
|
Posted: Tue Dec 19, 2006 10:05 am Post subject: Re: Efika's IPB clock |
|
|
| kcg wrote: | | Neko wrote: | | kcg wrote: | Hello,
from the SFW bootup output, it seems core clock is 396 and at least XPB clock seems to be 132 MHz (based on MPC5200B user manual) The question is: is IPB clock 132 or 66 MHz?
Thanks,
Karel |
Why do you need to know that? :) |
Because in current generic 5200 BSP, it's needed to configure those three clocks. For example following comments in code, IPB clock is the same as in Bestcomm and Bestcomm clock is what you need to know to configure serial port bauds correctly.
Thanks,
Karel |
So it seems it's 66 MHz if anyone also needs this.
Karel |
|
| Back to top |
|
 |
Matt Sealey (Neko) Site Admin
Joined: 24 Sep 2004 Posts: 1405 Location: Alamo Heights, TX
|
Posted: Fri May 18, 2007 6:22 am Post subject: Re: Efika's IPB clock |
|
|
| kcg wrote: | | So it seems it's 66 MHz if anyone also needs this. |
If you're coding in Linux using the platform support provided by 2.6.20 onwards, you can use the function;
| Code: | if ((ipb_freq = mpc52xx_find_ipb_freq(np)) == 0) {
pr_debug("Could not find IPB bus frequency!\n");
return -EINVAL;
}
|
I got that from the serial port driver. You should pass in the node of the device you're using, which should probably be a child node of /builtin for it to work.
Essentially, the value is the 'bus-frequency' property of the /builtin node. _________________ Matt Sealey, Genesi USA Inc.
Product Development Analyst |
|
| Back to top |
|
 |
Karel Gardas (kcg)
Joined: 30 Jan 2006 Posts: 40
|
Posted: Thu May 24, 2007 12:44 am Post subject: Re: Efika's IPB clock |
|
|
| Neko wrote: | | kcg wrote: | | So it seems it's 66 MHz if anyone also needs this. |
If you're coding in Linux using the platform support provided by 2.6.20 onwards, you can use the function;
| Code: | if ((ipb_freq = mpc52xx_find_ipb_freq(np)) == 0) {
pr_debug("Could not find IPB bus frequency!\n");
return -EINVAL;
}
|
I got that from the serial port driver. You should pass in the node of the device you're using, which should probably be a child node of /builtin for it to work.
Essentially, the value is the 'bus-frequency' property of the /builtin node. |
Hello,
that's interesting observation. Anyway, I'm not sure if it's correct, since returned 'bus-frequency' is 132MHz. The problem is that the driver author a few lines below divide it twice and use it as an 'uart' frequency. See:
| Code: |
port->uartclk = ipb_freq / 2;
|
It's interesting since if I understand mpc5200b user's manual well, then uart clock is exactly the same like bestcomm clock which is again the same like IPB clock. (Paragraph 5.3.5 IPB Clock Domain). So If I'm right Linux folks just get XLB clock frequency and assume that IPB = XLB /2, which don't need to be true (Tables 5-4 and 5-5).
Please correct me if I'm wrong.
Thanks!
Karel |
|
| Back to top |
|
 |
Matt Sealey (Neko) Site Admin
Joined: 24 Sep 2004 Posts: 1405 Location: Alamo Heights, TX
|
Posted: Thu May 24, 2007 2:56 am Post subject: Re: Efika's IPB clock |
|
|
| kcg wrote: |
that's interesting observation. Anyway, I'm not sure if it's correct, since returned 'bus-frequency' is 132MHz. The problem is that the driver author a few lines below divide it twice and use it as an 'uart' frequency. See:
| Code: |
port->uartclk = ipb_freq / 2;
|
It's interesting since if I understand mpc5200b user's manual well, then uart clock is exactly the same like bestcomm clock which is again the same like IPB clock. (Paragraph 5.3.5 IPB Clock Domain). So If I'm right Linux folks just get XLB clock frequency and assume that IPB = XLB /2, which don't need to be true (Tables 5-4 and 5-5).
Please correct me if I'm wrong. |
The way I understand it, the XLB runs at a certain clock, and the IPB runs at a derivative and divided clock (same or half) of the XLB, and the PCI bus runs at yet another derivative clock of the IPB (same or 2 or 4).
If the XLB runs at 132MHz, the IPB can run at 132MHz, 66MHz or 33MHz. The PCI bus runs at the same or half or a quarter of the IPB but has to be 66MHz or 33MHz (to fit spec) and no more than the IPB.
As far as I understand, Efika's XLB is 132MHz, the IPB is 132MHz (no divider), and the PCI bus is 66MHz (2x divider).
I'm not sure why the UART driver divides the IPB by 2 - but it is storing 'uartclk' and not 'ipbclock' in that structure. I have to read a chapter of the manual and check the code to work it out (15.3.1.2) to see what prescalers and dividers it's using in the clock generation.
If the division by 2 was merely to get the correct IPB frequency from a misreporting device tree, then the UART driver would be broken on Lite5200, so I don't think you're correct :)
It may be just simpler to deal with the value by dividing it there. If you are really concerned of the real values, read the CDM configuration register (mbar + 0x20c) and check your values. _________________ Matt Sealey, Genesi USA Inc.
Product Development Analyst |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|