summaryrefslogtreecommitdiff
path: root/cpu/mpc8xx/speed.c
diff options
context:
space:
mode:
authorBryan O'Donoghue <bodonoghue@codehermit.ie>2008-02-17 22:57:47 +0000
committerWolfgang Denk <wd@denx.de>2008-03-25 22:28:34 +0100
commit77ff7b7444ceb8022b46114f3d0b6d18e2fd1138 (patch)
treebfa2e231bae821ff19e0988f8760b6bc0349ab28 /cpu/mpc8xx/speed.c
parent9c666a7db0b2285a270c68810889ce7d5dba304b (diff)
downloadu-boot-imx-77ff7b7444ceb8022b46114f3d0b6d18e2fd1138.zip
u-boot-imx-77ff7b7444ceb8022b46114f3d0b6d18e2fd1138.tar.gz
u-boot-imx-77ff7b7444ceb8022b46114f3d0b6d18e2fd1138.tar.bz2
8xx: Update OF support on 8xx
This patch does some shifting around of OF support on 8xx. Signed-off-by: Bryan O'Donoghue <bodonoghue@codehermit.ie>
Diffstat (limited to 'cpu/mpc8xx/speed.c')
-rw-r--r--cpu/mpc8xx/speed.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/cpu/mpc8xx/speed.c b/cpu/mpc8xx/speed.c
index 11b0893..070babc 100644
--- a/cpu/mpc8xx/speed.c
+++ b/cpu/mpc8xx/speed.c
@@ -174,6 +174,27 @@ unsigned long measure_gclk(void)
#endif
+void get_brgclk(uint sccr)
+{
+ uint divider = 0;
+
+ switch((sccr&SCCR_DFBRG11)>>11){
+ case 0:
+ divider = 1;
+ break;
+ case 1:
+ divider = 4;
+ break;
+ case 2:
+ divider = 16;
+ break;
+ case 3:
+ divider = 64;
+ break;
+ }
+ gd->brg_clk = gd->cpu_clk/divider;
+}
+
#if !defined(CONFIG_8xx_CPUCLK_DEFAULT)
/*
@@ -223,6 +244,8 @@ int get_clocks (void)
gd->bus_clk = gd->cpu_clk / 2;
}
+ get_brgclk(sccr);
+
return (0);
}
@@ -254,6 +277,8 @@ int get_clocks_866 (void)
gd->cpu_clk = measure_gclk ();
#endif
+ get_brgclk(immr->im_clkrst.car_sccr);
+
/* if cpu clock <= 66 MHz then set bus division factor to 1,
* otherwise set it to 2
*/