aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Medhurst <tixy@linaro.org>2017-04-20 11:48:19 +0100
committerRyan Harkin <ryan.harkin@linaro.org>2017-07-13 21:00:19 +0100
commit7a7765ba87aa6025416f131b923c5f635d2691cb (patch)
tree9020008ad3bfb06bd9b066632dbd4e2ffc96ddff
parentb394776b7f698680019c65129f0111d60d949266 (diff)
HACK: juno: Limit CPU frequency when running AArch32 kernelslatest-armlt-juno
The silicon doesn't seem to be able to cope with max frequency on the big core. Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r--drivers/firmware/arm_scpi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
index acf277d0a6eb..8d39da71d6b9 100644
--- a/drivers/firmware/arm_scpi.c
+++ b/drivers/firmware/arm_scpi.c
@@ -659,6 +659,8 @@ static int opp_cmp_func(const void *opp1, const void *opp2)
return t1->freq - t2->freq;
}
+static bool juno_cpufreq_limit_hack = 0;
+
static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain)
{
struct scpi_dvfs_info *info;
@@ -697,6 +699,14 @@ static struct scpi_dvfs_info *scpi_dvfs_get_info(u8 domain)
sort(info->opps, info->count, sizeof(*opp), opp_cmp_func, NULL);
+ /*
+ * Juno silicon doesn't seem to be able to run the big cluster
+ * (domain == 0) at max frequency in AArch32 mode (it produces
+ * random and weird crashes) so drop the highest OPP in that case...
+ */
+ if (juno_cpufreq_limit_hack && domain == 0)
+ --info->count;
+
scpi_info->dvfs[domain] = info;
return info;
}
@@ -910,6 +920,10 @@ static int scpi_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct device_node *np = dev->of_node;
+ if (IS_ENABLED(CONFIG_ARM) && of_find_compatible_node(NULL,NULL,"arm,juno")) {
+ juno_cpufreq_limit_hack = true;
+ }
+
scpi_info = devm_kzalloc(dev, sizeof(*scpi_info), GFP_KERNEL);
if (!scpi_info)
return -ENOMEM;