Quote:
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.