summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuinn Jensen <quinn.jensen@freescale.com>2007-05-24 18:12:27 -0600
committerQuinn Jensen <quinn.jensen@freescale.com>2007-05-24 18:12:27 -0600
commita2ccb237fb784628585834ef0468838b25edb126 (patch)
treefb34f8ea02ca07fbcaff4dd85af26d3d212078f5
parent65addba21f9ad46593688e169dbe11a8686562b2 (diff)
CR ENGR00028544: Add clock enable & disable in RNG for all platforms
http://www.bitshrine.org/gpp/linux-2.6.19.2-mx-add_rng_clock_enable_disable.patch
-rw-r--r--drivers/mxc/security/Kconfig2
-rw-r--r--drivers/mxc/security/rng/rng_driver.c8
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mxc/security/Kconfig b/drivers/mxc/security/Kconfig
index d00ca372ae02..f897dd22d839 100644
--- a/drivers/mxc/security/Kconfig
+++ b/drivers/mxc/security/Kconfig
@@ -25,7 +25,7 @@ config MXC_SECURITY_RNG
If you are unsure about this, say N here.
config MXC_RNG_TEST_DRIVER
- bool "MXC RNG module debugging"
+ bool "MXC RNG debug register"
depends on MXC_SECURITY_RNG
default n
---help---
diff --git a/drivers/mxc/security/rng/rng_driver.c b/drivers/mxc/security/rng/rng_driver.c
index f539747923f7..b5ea90ce599c 100644
--- a/drivers/mxc/security/rng/rng_driver.c
+++ b/drivers/mxc/security/rng/rng_driver.c
@@ -168,14 +168,18 @@ OS_WAIT_OBJECT(rng_wait_queue);
*/
OS_DEV_INIT(rng_init)
{
+ struct clk *clk;
os_error_code return_code = OS_ERROR_FAIL_S;
rng_availability = RNG_STATUS_CHECKING;
+
#if defined(FSL_HAVE_RNGC)
INIT_COMPLETION(rng_self_testing);
INIT_COMPLETION(rng_seed_done);
#endif
rng_work_queue.head = NULL;
rng_work_queue.tail = NULL;
+ clk = clk_get(NULL, "rng_clk");
+ clk_enable(clk);
printk(KERN_INFO "RNG Driver: Loading\n");
return_code = rng_map_RNG_memory();
@@ -348,8 +352,10 @@ OS_DEV_SHUTDOWN(rng_shutdown)
*/
static void rng_cleanup(void)
{
+ struct clk *clk;
scc_stop_monitoring_security_failure(rng_sec_failure);
-
+ clk = clk_get(NULL, "rng_clk");
+ clk_disable(clk);
if (task_started) {
os_dev_stop_task(rng_entropy_task);
}