Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/rockchip Write back and invalidate cache before...



details:   https://anonhg.NetBSD.org/src/rev/ddab511ef0f7
branches:  trunk
changeset: 1025582:ddab511ef0f7
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Nov 13 15:17:22 2021 +0000

description:
Write back and invalidate cache before starting secondary CPUs.

diffstat:

 sys/arch/arm/rockchip/rk3066_smp.c |  19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diffs (47 lines):

diff -r 422bbe10b3a0 -r ddab511ef0f7 sys/arch/arm/rockchip/rk3066_smp.c
--- a/sys/arch/arm/rockchip/rk3066_smp.c        Sat Nov 13 14:52:08 2021 +0000
+++ b/sys/arch/arm/rockchip/rk3066_smp.c        Sat Nov 13 15:17:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3066_smp.c,v 1.1 2021/11/12 22:02:08 jmcneill Exp $ */
+/* $NetBSD: rk3066_smp.c,v 1.2 2021/11/13 15:17:22 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2021 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk3066_smp.c,v 1.1 2021/11/12 22:02:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk3066_smp.c,v 1.2 2021/11/13 15:17:22 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -141,26 +141,15 @@
 static int
 cpu_enable_rk3066(int phandle)
 {
-       static uint32_t enabled;
        uint64_t mpidr;
-       int error = 0;
 
        fdtbus_get_reg64(phandle, 0, &mpidr, NULL);
 
        const u_int cpuno = __SHIFTOUT(mpidr, MPIDR_AFF0);
-       const bool is_enabled = enabled & __BIT(cpuno);
 
-       if (!is_enabled) {
-               error = rk3066_smp_enable(OF_parent(phandle), cpuno);
-               if (error == 0) {
-                       enabled |= __BIT(cpuno);
-               }
-       } else {
-               printf("WARNING: CPU enable called more than once for CPU %u\n",
-                   cpuno);
-       }
+       cpu_dcache_wbinv_all();
 
-       return error;
+       return rk3066_smp_enable(OF_parent(phandle), cpuno);
 }
 
 ARM_CPU_METHOD(rk3066, "rockchip,rk3066-smp", cpu_enable_rk3066);



Home | Main Index | Thread Index | Old Index