summaryrefslogtreecommitdiffstats
path: root/board/freescale/common/ics307_clk.h
diff options
context:
space:
mode:
authorJerry Huang <Chang-Ming.Huang@freescale.com>2011-11-03 15:18:06 +0800
committerKumar Gala <galak@kernel.crashing.org>2011-11-11 07:48:54 -0600
commit71775d3b54780f1901ff6eac7c5ae05676938107 (patch)
treeea6e79554893a014d014f9fd49d9de62e23c10ff /board/freescale/common/ics307_clk.h
parent8d22ddca3db2577b7f2bf1040972231279288847 (diff)
downloadtalos-obmc-uboot-71775d3b54780f1901ff6eac7c5ae05676938107.tar.gz
talos-obmc-uboot-71775d3b54780f1901ff6eac7c5ae05676938107.zip
powerpc/mpc85xx: Set SYSCLK to the required frequency
For ICS307-02, there is one general expression to generate SYSCLK: CLK1Frequency = InputFrequency * 2 * (VDW + 8) / ((RDW + 2) * OD) If we want the required frequency for SYSCLK, we must find one solution to generate this frequency, this solution includes VDW, RDW and OD. For OD, there are only eight option value: 10, 2, 8, 4, 5, 7, 3, 6. For RDW, the range is 1 to 127. For VDW, the range is 4 to 511. First, we use one OD, RDW and required SYSCLK to calculate the VDW, if VDW is in it's range, we will calculate the CLK1Frequency with the OD, RDW and VDW calculated, and we will check this percent (CLK1Frequency / required SYSCLK), and the precision is 1/1000. if the percent is less than 1/1000, we think the CLK1Frequency is we want. Otherwise, We will continue to calculate it with the next OD and RDW. Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board/freescale/common/ics307_clk.h')
-rw-r--r--board/freescale/common/ics307_clk.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/board/freescale/common/ics307_clk.h b/board/freescale/common/ics307_clk.h
index db3dbc41f7..37579124bc 100644
--- a/board/freescale/common/ics307_clk.h
+++ b/board/freescale/common/ics307_clk.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2010 Freescale Semiconductor, Inc.
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -23,8 +23,10 @@
#define __ICS_CLK_H_ 1
#ifndef __ASSEMBLY__
+
extern unsigned long get_board_sys_clk(void);
extern unsigned long get_board_ddr_clk(void);
+extern unsigned long ics307_sysclk_calculator(unsigned long out_freq);
#endif
#endif /* __ICS_CLK_H_ */
OpenPOWER on IntegriCloud