summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2012-03-19 10:41:10 +0800
committerAnson Huang <b20788@freescale.com>2012-03-26 10:25:36 +0800
commit9b36e35d8f309eb93f31fa4b362540ff23eb0251 (patch)
treed442fe6b14fed1fe4d0d413ee24425bfe0742cb5
parent065c9a6c2b4ba4fcee347b726ee60b80985ec0df (diff)
ENGR00176177-1 Add irq count mechanism to interactive governor
Add irq count to CPUFreq as a freq change condition. Because some devices' working mode is unable to issue CPUFreq change because of low CPU loading, but the cpu freq will impact these devices' performace significantly. Interactive govervor will sample the cpu loading as well as the irq count which is registered. If the loading or the irq count exceed the threshold we set, governor will issue an CPUFreq change request. These devices' irq threshold and enable/disable can be modified via /sys/devices/system/cpu/cpufreq/interactive/irq_scaling echo 0xAABBBC to change the default setting as below AA : irq number BBB: threshold C :enable or disable Currently only enable USDHC3, USDHC4, GPU, SATA and USB by default, we can add device to the init struct which is located in arch/arm/mach-mx6/irq.c. Signed-off-by: Anson Huang <b20788@freescale.com>
-rw-r--r--arch/arm/mach-mx6/irq.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/arch/arm/mach-mx6/irq.c b/arch/arm/mach-mx6/irq.c
index 3d8f81bb6e28..753767bfd7c4 100644
--- a/arch/arm/mach-mx6/irq.c
+++ b/arch/arm/mach-mx6/irq.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,10 +23,16 @@
#include <linux/irq.h>
#include <asm/hardware/gic.h>
#include <mach/hardware.h>
+#ifdef CONFIG_CPU_FREQ_GOV_INTERACTIVE
+#include <linux/cpufreq.h>
+#endif
int mx6q_register_gpios(void);
unsigned int gpc_wake_irq[4];
extern bool enable_wait_mode;
+#ifdef CONFIG_CPU_FREQ_GOV_INTERACTIVE
+extern int cpufreq_gov_irq_tuner_register(struct irq_tuner dbs_irq_tuner);
+#endif
static int mx6_gic_irq_set_wake(struct irq_data *d, unsigned int enable)
{
@@ -44,6 +50,34 @@ static int mx6_gic_irq_set_wake(struct irq_data *d, unsigned int enable)
}
return 0;
}
+#ifdef CONFIG_CPU_FREQ_GOV_INTERACTIVE
+static struct irq_tuner mxc_irq_tuner[] = {
+ {
+ .irq_number = 41, /* GPU 3D */
+ .up_threshold = 0,
+ .enable = 1,},
+ {
+ .irq_number = 56, /* uSDHC3 */
+ .up_threshold = 8,
+ .enable = 1,},
+ {
+ .irq_number = 57, /* uSDHC4 */
+ .up_threshold = 8,
+ .enable = 1,},
+ {
+ .irq_number = 71, /* SATA */
+ .up_threshold = 4,
+ .enable = 1,},
+ {
+ .irq_number = 75, /* OTG */
+ .up_threshold = 10,
+ .enable = 1,},
+ {
+ .irq_number = 0, /* END */
+ .up_threshold = 0,
+ .enable = 0,},
+};
+#endif
void mx6_init_irq(void)
{
void __iomem *gpc_base = IO_ADDRESS(GPC_BASE_ADDR);
@@ -72,4 +106,8 @@ void mx6_init_irq(void)
desc->irq_data.chip->irq_set_wake = mx6_gic_irq_set_wake;
}
mx6q_register_gpios();
+#ifdef CONFIG_CPU_FREQ_GOV_INTERACTIVE
+ for (i = 0; i < ARRAY_SIZE(mxc_irq_tuner); i++)
+ cpufreq_gov_irq_tuner_register(mxc_irq_tuner[i]);
+#endif
}