summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-03-12 16:14:29 +0100
committerWolfgang Denk <wd@pollux.denx.de>2006-03-12 16:14:29 +0100
commit23466d6a3304433ba8d7ff10f17260010fcc4580 (patch)
tree1b785349fb62d75857c58c4b94f42d787ee3decf
parent74f92e6a3f884b7fe86d2fb2acc114347defb0ae (diff)
downloadu-boot-imx-23466d6a3304433ba8d7ff10f17260010fcc4580.zip
u-boot-imx-23466d6a3304433ba8d7ff10f17260010fcc4580.tar.gz
u-boot-imx-23466d6a3304433ba8d7ff10f17260010fcc4580.tar.bz2
Fix PCIDF calculation in cpu/mpc8260/speed.c for MPC8280EC
Patch by KokHow Teh, 16 Jun 2005
-rw-r--r--CHANGELOG3
-rw-r--r--cpu/mpc8260/speed.c27
2 files changed, 22 insertions, 8 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 43d0133..e532b04 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,9 @@
Changes since U-Boot 1.1.4:
======================================================================
+* Fix PCIDF calculation in cpu/mpc8260/speed.c for MPC8280EC
+ Patch by KokHow Teh, 16 Jun 2005
+
* Add crc of data to jffs2 (in jffs2_1pass_build_lists()).
Patch by Rick Bronson, 15 Jun 2005
diff --git a/cpu/mpc8260/speed.c b/cpu/mpc8260/speed.c
index a761a17..99afe76 100644
--- a/cpu/mpc8260/speed.c
+++ b/cpu/mpc8260/speed.c
@@ -163,7 +163,7 @@ int prt_8260_clks (void)
volatile immap_t *immap = (immap_t *) CFG_IMMR;
ulong sccr, dfbrg;
- ulong scmr, corecnf, busdf, cpmdf, plldf, pllmf;
+ ulong scmr, corecnf, busdf, cpmdf, plldf, pllmf, pcidf;
corecnf_t *cp;
sccr = immap->im_clkrst.car_sccr;
@@ -175,6 +175,7 @@ int prt_8260_clks (void)
cpmdf = (scmr & SCMR_CPMDF_MSK) >> SCMR_CPMDF_SHIFT;
plldf = (scmr & SCMR_PLLDF) ? 1 : 0;
pllmf = (scmr & SCMR_PLLMF_MSK) >> SCMR_PLLMF_SHIFT;
+ pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
cp = &corecnf_tab[corecnf];
@@ -204,8 +205,9 @@ int prt_8260_clks (void)
cp->vco_div, cp->freq_60x, cp->freq_core);
printf (" - dfbrg %ld, corecnf 0x%02lx, busdf %ld, cpmdf %ld, "
- "plldf %ld, pllmf %ld\n", dfbrg, corecnf, busdf, cpmdf, plldf,
- pllmf);
+ "plldf %ld, pllmf %ld, pcidf %ld\n",
+ dfbrg, corecnf, busdf, cpmdf,
+ plldf, pllmf, pcidf);
printf (" - vco_out %10ld, scc_clk %10ld, brg_clk %10ld\n",
gd->vco_out, gd->scc_clk, gd->brg_clk);
@@ -215,9 +217,20 @@ int prt_8260_clks (void)
if (sccr & SCCR_PCI_MODE) {
uint pci_div;
-
- pci_div = ( (sccr & SCCR_PCI_MODCK) ? 2 : 1) *
- ( ( (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT) + 1);
+ 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);
}
@@ -225,5 +238,3 @@ int prt_8260_clks (void)
return (0);
}
-
-/* ------------------------------------------------------------------------- */