summaryrefslogtreecommitdiff
path: root/arch/csky/abiv2
diff options
context:
space:
mode:
Diffstat (limited to 'arch/csky/abiv2')
-rw-r--r--arch/csky/abiv2/inc/abi/ckmmu.h20
-rw-r--r--arch/csky/abiv2/inc/abi/entry.h24
2 files changed, 42 insertions, 2 deletions
diff --git a/arch/csky/abiv2/inc/abi/ckmmu.h b/arch/csky/abiv2/inc/abi/ckmmu.h
index 97230ad9427c..31d75e1a724a 100644
--- a/arch/csky/abiv2/inc/abi/ckmmu.h
+++ b/arch/csky/abiv2/inc/abi/ckmmu.h
@@ -42,6 +42,26 @@ static inline void write_mmu_entryhi(int value)
mtcr("cr<4, 15>", value);
}
+static inline unsigned long read_mmu_msa0(void)
+{
+ return mfcr("cr<30, 15>");
+}
+
+static inline void write_mmu_msa0(unsigned long value)
+{
+ mtcr("cr<30, 15>", value);
+}
+
+static inline unsigned long read_mmu_msa1(void)
+{
+ return mfcr("cr<31, 15>");
+}
+
+static inline void write_mmu_msa1(unsigned long value)
+{
+ mtcr("cr<31, 15>", value);
+}
+
/*
* TLB operations.
*/
diff --git a/arch/csky/abiv2/inc/abi/entry.h b/arch/csky/abiv2/inc/abi/entry.h
index 6a0df655182c..c0a76c43cded 100644
--- a/arch/csky/abiv2/inc/abi/entry.h
+++ b/arch/csky/abiv2/inc/abi/entry.h
@@ -163,9 +163,29 @@
.endm
.macro SETUP_MMU rx
- lrw \rx, PHYS_OFFSET | 0xe
+ /* Check MMU on | off */
+ mfcr \rx, cr18
+ btsti \rx, 0
+ bt 1f
+ grs \rx, 1f
+ br 2f
+1:
+ /*
+ * cr<30, 15> format:
+ * 31 - 29 | 28 - 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
+ * BA Reserved SH WA B SO SEC C D V
+ */
+ mfcr \rx, cr<30, 15>
+2:
+ lsri \rx, 28
+ lsli \rx, 28
+ addi \rx, 0x1ce
mtcr \rx, cr<30, 15>
- lrw \rx, (PHYS_OFFSET + 0x20000000) | 0xe
+
+ lsri \rx, 28
+ addi \rx, 2
+ lsli \rx, 28
+ addi \rx, 0x1ce
mtcr \rx, cr<31, 15>
.endm