diff options
author | Ranjani Vaidyanathan <ra5478@freescale.com> | 2010-09-27 15:52:45 -0500 |
---|---|---|
committer | Alan Tull <r80115@freescale.com> | 2010-09-30 15:44:39 -0500 |
commit | a30aecd7bc64d4813b842ccda2d665cc477f48cc (patch) | |
tree | ae18f31f6fad57edf81ae0d9ab3006a39f923a01 /arch/arm/mach-mx3 | |
parent | 4c6539f3161b66cdc2bb0d0ab917b2cd3c315cb9 (diff) |
ENGR00132142: Add code to print system clocks information for 35 kernel.
Added support such that /proc/cpu/clocks prints the clock usage and frequency
on 35 kernel.
Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx3')
-rw-r--r-- | arch/arm/mach-mx3/clock-imx31.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-mx3/clock-imx35.c | 14 |
2 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/mach-mx3/clock-imx31.c b/arch/arm/mach-mx3/clock-imx31.c index 563b10c560fb..cfe4a746937f 100644 --- a/arch/arm/mach-mx3/clock-imx31.c +++ b/arch/arm/mach-mx3/clock-imx31.c @@ -20,6 +20,8 @@ #include <linux/module.h> #include <linux/spinlock.h> #include <linux/delay.h> +#include <linux/init.h> +#include <linux/list.h> #include <linux/clk.h> #include <linux/err.h> #include <linux/io.h> @@ -667,14 +669,27 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK(NULL, "mbx", mbx_clk) }; +static struct mxc_clk mxc_clks[ARRAY_SIZE(lookups)]; + int __init mx31_clocks_init(unsigned long fref) { u32 reg; + int i; ckih_rate = fref; clkdev_add_table(lookups, ARRAY_SIZE(lookups)); + for (i = 0; i < ARRAY_SIZE(lookups); i++) { + clkdev_add(&lookups[i]); + mxc_clks[i].reg_clk = lookups[i].clk; + if (lookups[i].con_id != NULL) + strcpy(mxc_clks[i].name, lookups[i].con_id); + else + strcpy(mxc_clks[i].name, lookups[i].dev_id); + clk_register(&mxc_clks[i]); + } + /* change the csi_clk parent if necessary */ reg = __raw_readl(MXC_CCM_CCMR); if (!(reg & MXC_CCM_CCMR_CSCS)) diff --git a/arch/arm/mach-mx3/clock-imx35.c b/arch/arm/mach-mx3/clock-imx35.c index 9d0dc0ce9e99..afd9fe7ea524 100644 --- a/arch/arm/mach-mx3/clock-imx35.c +++ b/arch/arm/mach-mx3/clock-imx35.c @@ -21,6 +21,7 @@ #include <linux/list.h> #include <linux/clk.h> #include <linux/io.h> +#include <linux/module.h> #include <asm/clkdev.h> @@ -485,9 +486,12 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) }; +static struct mxc_clk mxc_clks[ARRAY_SIZE(lookups)]; + int __init mx35_clocks_init() { unsigned int ll = 0; + int i; #if defined(CONFIG_DEBUG_LL) && !defined(CONFIG_DEBUG_ICEDCC) ll = (3 << 16); @@ -495,6 +499,16 @@ int __init mx35_clocks_init() clkdev_add_table(lookups, ARRAY_SIZE(lookups)); + for (i = 0; i < ARRAY_SIZE(lookups); i++) { + mxc_clks[i].reg_clk = lookups[i].clk; + if (lookups[i].con_id != NULL) + strcpy(mxc_clks[i].name, lookups[i].con_id); + else + strcpy(mxc_clks[i].name, lookups[i].dev_id); + clk_register(&mxc_clks[i]); + } + + /* Turn off all clocks except the ones we need to survive, namely: * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart */ |