summaryrefslogtreecommitdiff
path: root/cpu/mpc8260/speed.c
diff options
context:
space:
mode:
authorMatvejchikov Ilya <matvejchikov@gmail.com>2008-07-30 23:21:19 +0400
committerWolfgang Denk <wd@denx.de>2008-07-31 11:35:16 +0200
commit9196b44334c330cc13de2464c59181e4db71f549 (patch)
treecb40a59ad18fe5b12ea2910cef7ffc5bcf173639 /cpu/mpc8260/speed.c
parent6361ad4b596f5a940a01c91ae0297d98f790cbe0 (diff)
downloadu-boot-imx-9196b44334c330cc13de2464c59181e4db71f549.zip
u-boot-imx-9196b44334c330cc13de2464c59181e4db71f549.tar.gz
u-boot-imx-9196b44334c330cc13de2464c59181e4db71f549.tar.bz2
8260: Making the use of gd->pci_clk dependant on the CONFIG_PCI
Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
Diffstat (limited to 'cpu/mpc8260/speed.c')
-rw-r--r--cpu/mpc8260/speed.c47
1 files changed, 27 insertions, 20 deletions
diff --git a/cpu/mpc8260/speed.c b/cpu/mpc8260/speed.c
index 38cd0d9..8d280fb 100644
--- a/cpu/mpc8260/speed.c
+++ b/cpu/mpc8260/speed.c
@@ -162,6 +162,30 @@ int get_clocks (void)
gd->cpu_clk = clkin;
}
+#ifdef CONFIG_PCI
+ gd->pci_clk = clkin;
+
+ if (sccr & SCCR_PCI_MODE) {
+ uint pci_div;
+ uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
+
+ if (sccr & SCCR_PCI_MODCK) {
+ pci_div = 2;
+ if (pcidf == 9) {
+ pci_div *= 5;
+ } else if (pcidf == 0xB) {
+ pci_div *= 6;
+ } else {
+ pci_div *= (pcidf + 1);
+ }
+ } else {
+ pci_div = pcidf + 1;
+ }
+
+ gd->pci_clk = (gd->cpm_clk * 2) / pci_div;
+ }
+#endif
+
return (0);
}
@@ -220,26 +244,9 @@ int prt_8260_clks (void)
printf (" - cpu_clk %10ld, cpm_clk %10ld, bus_clk %10ld\n",
gd->cpu_clk, gd->cpm_clk, gd->bus_clk);
-
- if (sccr & SCCR_PCI_MODE) {
- uint pci_div;
- uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
-
- if (sccr & SCCR_PCI_MODCK) {
- pci_div = 2;
- if (pcidf == 9) {
- pci_div *= 5;
- } else if (pcidf == 0xB) {
- pci_div *= 6;
- } else {
- pci_div *= (pcidf + 1);
- }
- } else {
- pci_div = pcidf + 1;
- }
-
- printf (" - pci_clk %10ld\n", (gd->cpm_clk * 2) / pci_div);
- }
+#ifdef CONFIG_PCI
+ printf (" - pci_clk %10ld\n", gd->pci_clk);
+#endif
putc ('\n');
return (0);