Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/samsung Starting CPUs in cluster 1 of Exynos542...



details:   https://anonhg.NetBSD.org/src/rev/6a7fc335eecd
branches:  trunk
changeset: 447210:6a7fc335eecd
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Fri Jan 04 15:57:03 2019 +0000

description:
Starting CPUs in cluster 1 of Exynos5422 causes strange things to happen
around ap_mpstart. Until we figure out why, only start CPUs in cluster 0.

diffstat:

 sys/arch/arm/samsung/exynos_platform.c |  37 ++++++++++++++++++++++++++++++++-
 1 files changed, 35 insertions(+), 2 deletions(-)

diffs (72 lines):

diff -r 16b375a857b1 -r 6a7fc335eecd sys/arch/arm/samsung/exynos_platform.c
--- a/sys/arch/arm/samsung/exynos_platform.c    Fri Jan 04 15:27:19 2019 +0000
+++ b/sys/arch/arm/samsung/exynos_platform.c    Fri Jan 04 15:57:03 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_platform.c,v 1.21 2019/01/03 23:04:09 jmcneill Exp $ */
+/* $NetBSD: exynos_platform.c,v 1.22 2019/01/04 15:57:03 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -35,7 +35,12 @@
 #include "ukbd.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.21 2019/01/03 23:04:09 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.22 2019/01/04 15:57:03 jmcneill Exp $");
+
+/* XXXJDM
+ * Booting a CA7 core on Exynos5422 is currently broken, disable starting CA7 secondaries.
+ */
+#define        EXYNOS5422_DISABLE_CA7_CLUSTER
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -60,6 +65,8 @@
 
 #include <arm/fdt/arm_fdtvar.h>
 
+#include <libfdt.h>
+
 void exynos_platform_early_putchar(char);
 
 #define        EXYNOS5800_PMU_BASE             0x10040000
@@ -140,6 +147,11 @@
                const u_int aff0 = __SHIFTOUT(mpidr, MPIDR_AFF0);
                const u_int cpu = cluster * 4 + aff0;
 
+#if defined(EXYNOS5422_DISABLE_CA7_CLUSTER)
+               if (cluster == 1)
+                       continue;
+#endif
+
                val = bus_space_read_4(bst, pmu_bsh, EXYNOS5800_PMU_CORE_STATUS(cpu));
                bus_space_write_4(bst, pmu_bsh, EXYNOS5800_PMU_CORE_CONFIG(cpu),
                    EXYNOS5800_PMU_CORE_POWER_EN);
@@ -319,6 +331,27 @@
 
        exynos_bootstrap(5);
 
+#if defined(MULTIPROCESSOR) && defined(EXYNOS5422_DISABLE_CA7_CLUSTER)
+       const struct of_compat_data *cd = of_search_compatible(OF_finddevice("/"), mp_compat_data);
+       if (cd && cd->data == (uintptr_t)exynos5800_mpstart) {
+               void *fdt_data = __UNCONST(fdtbus_get_data());
+               int cpu_off, cpus_off, len;
+
+               cpus_off = fdt_path_offset(fdt_data, "/cpus");
+               if (cpus_off < 0)
+                       return;
+
+               fdt_for_each_subnode(cpu_off, fdt_data, cpus_off) {
+                       const void *prop = fdt_getprop(fdt_data, cpu_off, "reg", &len);
+                       if (len != 4)
+                               continue;
+                       const uint32_t mpidr = be32dec(prop);
+                       if (mpidr != cpu_mpidr_aff_read() && __SHIFTOUT(mpidr, MPIDR_AFF1) == 1)
+                               fdt_setprop_string(fdt_data, cpu_off, "status", "fail");
+               }
+       }
+#endif
+
        arm_fdt_cpu_bootstrap();
 }
 



Home | Main Index | Thread Index | Old Index