summaryrefslogtreecommitdiff
path: root/src/cpu/ppc/ppc970/clock.c
diff options
context:
space:
mode:
authorEswar Nallusamy <contacteswar@gmail.com>2005-11-02 17:32:49 +0000
committerEswar Nallusamy <contacteswar@gmail.com>2005-11-02 17:32:49 +0000
commited009371030cb97571c8b8dc342f16a9fa124d59 (patch)
tree3ff2d9e14f73cbb98b5706e837adb897eb5d3c3e /src/cpu/ppc/ppc970/clock.c
parent987ca8e08c3307e46dde3b35c6190c504f0cbf19 (diff)
ppc970 initial porting.
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@2082 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/cpu/ppc/ppc970/clock.c')
-rw-r--r--src/cpu/ppc/ppc970/clock.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/cpu/ppc/ppc970/clock.c b/src/cpu/ppc/ppc970/clock.c
new file mode 100644
index 0000000000..bb600c6d5b
--- /dev/null
+++ b/src/cpu/ppc/ppc970/clock.c
@@ -0,0 +1,27 @@
+#include <ppc.h>
+
+static int PLL_multiplier[] = {
+ 25, /* 0000 - 2.5x */
+ 75, /* 0001 - 7.5x */
+ 70, /* 0010 - 7x */
+ 10, /* 0011 - bypass */
+ 20, /* 0100 - 2x */
+ 65, /* 0101 - 6.5x */
+ 100, /* 0110 - 10x */
+ 45, /* 0111 - 4.5x */
+ 30, /* 1000 - 3x */
+ 55, /* 1001 - 5.5x */
+ 40, /* 1010 - 4x */
+ 50, /* 1011 - 5x */
+ 80, /* 1100 - 8x */
+ 60, /* 1101 - 6x */
+ 35, /* 1110 - 3.5x */
+ 0, /* 1111 - off */
+};
+
+unsigned long
+get_timer_freq(void)
+{
+ unsigned long clock = CONFIG_SYS_CLK_FREQ * 1000000;
+ return clock * PLL_multiplier[ppc_gethid1() >> 28] / 10;
+}