summaryrefslogtreecommitdiff
path: root/cpu/mips/incaip_clock.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-06-27 21:31:46 +0000
committerwdenk <wdenk>2003-06-27 21:31:46 +0000
commit8bde7f776c77b343aca29b8c7b58464d915ac245 (patch)
tree20f1fd99975215e7c658454a15cdb4ed4694e2d4 /cpu/mips/incaip_clock.c
parent993cad9364c6b87ae429d1ed1130d8153f6f027e (diff)
downloadu-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.zip
u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.gz
u-boot-imx-8bde7f776c77b343aca29b8c7b58464d915ac245.tar.bz2
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc. - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c) * Patches by Kenneth Johansson, 25 Jun 2003: - major rework of command structure (work done mostly by Michal Cendrowski and Joakim Kristiansen)
Diffstat (limited to 'cpu/mips/incaip_clock.c')
-rw-r--r--cpu/mips/incaip_clock.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/cpu/mips/incaip_clock.c b/cpu/mips/incaip_clock.c
index 7fc6eb0..27f0609 100644
--- a/cpu/mips/incaip_clock.c
+++ b/cpu/mips/incaip_clock.c
@@ -25,14 +25,13 @@
#include <asm/inca-ip.h>
-
/*******************************************************************************
*
-* get_cpuclk - returns the frequency of the CPU.
+* get_cpuclk - returns the frequency of the CPU.
*
* Gets the value directly from the INCA-IP hardware.
*
-* RETURNS:
+* RETURNS:
* 150.000.000 for 150 MHz
* 130.000.000. for 130 Mhz
* 100.000.000. for 100 Mhz
@@ -55,24 +54,24 @@ uint incaip_get_cpuclk(void)
else
{
/* MUX I set to 100/133 MHz clock */
- if (*((volatile ulong*)INCA_IP_CGU_CGU_DIVCR) & 0x40)
+ if (*((volatile ulong*)INCA_IP_CGU_CGU_DIVCR) & 0x40)
{
- /* Division value is 1/3, maximum CPU operating */
- /* frequency is 133.3 MHz */
- return 130000000;
+ /* Division value is 1/3, maximum CPU operating */
+ /* frequency is 133.3 MHz */
+ return 130000000;
}
else
{
- /* Division value is 1/4, maximum CPU operating */
- /* frequency is 100 MHz */
- return 100000000;
+ /* Division value is 1/4, maximum CPU operating */
+ /* frequency is 100 MHz */
+ return 100000000;
}
}
}
/*******************************************************************************
*
-* get_fpiclk - returns the frequency of the FPI bus.
+* get_fpiclk - returns the frequency of the FPI bus.
*
* Gets the value directly from the INCA-IP hardware.
*
@@ -82,26 +81,24 @@ uint incaip_get_cpuclk(void)
* This functions should be used by the hardware driver to get the correct
* frequency of the CPU. Don't use the macros, which are set to init the CPU
* frequency in the ROM code.
-* The calculation for the
+* The calculation for the
*/
uint incaip_get_fpiclk(void)
{
uint clkCPU;
-
+
clkCPU = incaip_get_cpuclk();
-
+
switch (*((volatile ulong*)INCA_IP_CGU_CGU_DIVCR) & 0xC)
{
case 0x4:
- return clkCPU >> 1; /* devided by 2 */
- break;
+ return clkCPU >> 1; /* devided by 2 */
+ break;
case 0x8:
- return clkCPU >> 2; /* devided by 4 */
- break;
+ return clkCPU >> 2; /* devided by 4 */
+ break;
default:
- return clkCPU;
- break;
+ return clkCPU;
+ break;
}
}
-
-