1 /* mmu-asm.S -- MMU handling for OpenRISC 1000.
3 * Copyright (c) 2011, 2014 Authors
5 * Contributor Julius Baxter <juliusbaxter@gmail.com>
6 * Contributor Stefan Wallentowitz <stefan.wallentowitz@tum.de>
8 * The authors hereby grant permission to use, copy, modify, distribute,
9 * and license this software and its documentation for any purpose, provided
10 * that existing copyright notices are retained in all copies and that this
11 * notice is included verbatim in any distributions. No written agreement,
12 * license, or royalty fee is required for any of the authorized uses.
13 * Modifications to this software may be copyrighted by their authors
14 * and need not follow the licensing terms described here, provided that
15 * the new terms are clearly indicated on the first page of each file where
19 /* -------------------------------------------------------------------------- */
20 /*!Function to control MMU
22 /* -------------------------------------------------------------------------- */
24 #include "include/or1k-asm.h"
25 #include "include/or1k-sprs.h"
27 /* MMU control functions always switch MMU control with a l.rfe to return
31 .global or1k_dmmu_enable
33 l.mfspr r3,r0,OR1K_SPR_SYS_SR_ADDR
34 l.ori r3,r3,OR1K_SPR_SYS_SR_DME_MASK
35 l.mtspr r0,r3,OR1K_SPR_SYS_ESR_BASE
36 l.mtspr r0,r9,OR1K_SPR_SYS_EPCR_BASE
37 OR1K_DELAYED_NOP(OR1K_INST(l.rfe))
40 .global or1k_dmmu_disable
42 l.ori r3,r0,OR1K_SPR_SYS_SR_DME_MASK
44 l.mfspr r3,r0,OR1K_SPR_SYS_SR_ADDR
46 l.mtspr r0,r3,OR1K_SPR_SYS_ESR_BASE
47 l.mtspr r0,r9,OR1K_SPR_SYS_EPCR_BASE
48 OR1K_DELAYED_NOP(OR1K_INST(l.rfe))
51 .global or1k_immu_enable
53 l.mfspr r3,r0,OR1K_SPR_SYS_SR_ADDR
54 l.ori r3,r3,OR1K_SPR_SYS_SR_IME_MASK
55 l.mtspr r0,r3,OR1K_SPR_SYS_ESR_BASE
56 l.mtspr r0,r9,OR1K_SPR_SYS_EPCR_BASE
57 OR1K_DELAYED_NOP(OR1K_INST(l.rfe))
59 .global or1k_immu_disable
61 l.ori r3,r0,OR1K_SPR_SYS_SR_IME_MASK
63 l.mfspr r3,r0,OR1K_SPR_SYS_SR_ADDR
65 l.mtspr r0,r3,OR1K_SPR_SYS_ESR_BASE
66 l.mtspr r0,r9,OR1K_SPR_SYS_EPCR_BASE
67 OR1K_DELAYED_NOP(OR1K_INST(l.rfe))