ARM: exynos: MCPM: Restore big.LITTLE cpuidle support
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 29 Jun 2020 10:02:18 +0000 (12:02 +0200)
committerKrzysztof Kozlowski <krzk@kernel.org>
Mon, 29 Jun 2020 18:27:33 +0000 (20:27 +0200)
Call exynos_cpu_power_up(cpunr) unconditionally. This is needed by the
big.LITTLE cpuidle driver and has no side-effects on other code paths.

The additional soft-reset call during little core power up has been added
to properly boot all cores on the Exynos5422-based boards with secure
firmware (like Odroid XU3/XU4 family). This however broke big.LITTLE
CPUidle driver, which worked only on boards without secure firmware (like
Peach-Pit/Pi Chromebooks). Apply the workaround only when board is
running under secure firmware.

Fixes: 833b5794e330 ("ARM: EXYNOS: reset Little cores when cpu is up")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
arch/arm/mach-exynos/mcpm-exynos.c

index 9a681b421ae119887dc8abf90de2cf889489b389..cd861c57d5adf9cd0e33abef389a7b0b3171e050 100644 (file)
@@ -26,6 +26,7 @@
 #define EXYNOS5420_USE_L2_COMMON_UP_STATE      BIT(30)
 
 static void __iomem *ns_sram_base_addr __ro_after_init;
+static bool secure_firmware __ro_after_init;
 
 /*
  * The common v7_exit_coherency_flush API could not be used because of the
@@ -58,15 +59,16 @@ static void __iomem *ns_sram_base_addr __ro_after_init;
 static int exynos_cpu_powerup(unsigned int cpu, unsigned int cluster)
 {
        unsigned int cpunr = cpu + (cluster * EXYNOS5420_CPUS_PER_CLUSTER);
+       bool state;
 
        pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster);
        if (cpu >= EXYNOS5420_CPUS_PER_CLUSTER ||
                cluster >= EXYNOS5420_NR_CLUSTERS)
                return -EINVAL;
 
-       if (!exynos_cpu_power_state(cpunr)) {
-               exynos_cpu_power_up(cpunr);
-
+       state = exynos_cpu_power_state(cpunr);
+       exynos_cpu_power_up(cpunr);
+       if (!state && secure_firmware) {
                /*
                 * This assumes the cluster number of the big cores(Cortex A15)
                 * is 0 and the Little cores(Cortex A7) is 1.
@@ -258,6 +260,8 @@ static int __init exynos_mcpm_init(void)
                return -ENOMEM;
        }
 
+       secure_firmware = exynos_secure_firmware_available();
+
        /*
         * To increase the stability of KFC reset we need to program
         * the PMU SPARE3 register