diff options
author | Jon Medhurst <tixy@linaro.org> | 2017-04-20 11:48:19 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2017-04-20 16:29:24 +0100 |
commit | 9b04aabff44bfe8606845e2002dbaf03cf8b0094 (patch) | |
tree | 55b3b7052052517272f893543b6688e83866f3ce | |
parent | a0b34eb32c25f1779ca793c4c976d5be11f2ceea (diff) |
HACK: juno: Limit CPU frequency when running AArch32 kernels
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.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c index d10d109609a9..1151b5b12839 100644 --- a/drivers/firmware/arm_scpi.c +++ b/drivers/firmware/arm_scpi.c @@ -470,6 +470,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; @@ -509,6 +511,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; } @@ -677,6 +687,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; |