Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/oea Minor re-ordering of a few things, and ...



details:   https://anonhg.NetBSD.org/src/rev/14889c2084ba
branches:  trunk
changeset: 1019165:14889c2084ba
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Feb 28 19:01:11 2021 +0000

description:
Minor re-ordering of a few things, and issue an isync barrier at all
critical MMU on/off transitions.

diffstat:

 sys/arch/powerpc/oea/ofw_subr.S |  21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diffs (57 lines):

diff -r 7ad7175880b8 -r 14889c2084ba sys/arch/powerpc/oea/ofw_subr.S
--- a/sys/arch/powerpc/oea/ofw_subr.S   Sun Feb 28 18:51:51 2021 +0000
+++ b/sys/arch/powerpc/oea/ofw_subr.S   Sun Feb 28 19:01:11 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofw_subr.S,v 1.19 2021/02/24 17:35:39 thorpej Exp $    */
+/*     $NetBSD: ofw_subr.S,v 1.20 2021/02/28 19:01:11 thorpej Exp $    */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -148,10 +148,6 @@
         */
        stwu    %r1,-48(%r1)
 
-       lis     %r4,ofentry@ha          /* get firmware entry point */
-       lwz     %r4,ofentry@l(%r4)
-       mtlr    %r4
-
 #ifdef FIRMWORKSBUGS
        lis     %r4,ofwreal_incharge@ha
        lwz     %r4,ofwreal_incharge@l(%r4)
@@ -164,9 +160,12 @@
        mfmsr   %r4                     /* save msr */
        stw     %r4,8(%r1)
 
-       li      %r0,0                   /* clear battable translations */
+       li      %r0,0                   /* disable MMU */
        mtmsr   %r0
+       isync
+
 #if defined (PPC_OEA) || defined (PPC_OEA64_BRIDGE)
+       /* clear BAT translations */
        mtdbatu 2,%r0
        mtdbatu 3,%r0
        mtibatu 2,%r0
@@ -202,13 +201,21 @@
        addi    %r5,%r5,_C_LABEL(ofw_battable)@l
        stw     %r5,CI_BATTABLE(%r4)
 
-       lis     %r4,ofwmsr@ha           /* Open Firmware msr */
+       lis     %r4,ofentry@ha          /* get firmware entry point */
+       lwz     %r4,ofentry@l(%r4)
+       mtlr    %r4
+
+       lis     %r4,ofwmsr@ha           /* load Open Firmware MSR */
        lwz     %r5,ofwmsr@l(%r4)
        mtmsr   %r5
        isync
 
        blrl                            /* call Open Firmware */
 
+       li      %r0,0                   /* ensure disable MMU is disabled */
+       mtmsr   %r0
+       isync
+
        /* curcpu()->ci_battable = &battable */
        GET_CPUINFO(%r4)
        lis     %r5,_C_LABEL(battable)@ha



Home | Main Index | Thread Index | Old Index