diff options
Diffstat (limited to 'arch/csky/abiv1/inc/abi')
-rw-r--r-- | arch/csky/abiv1/inc/abi/ckmmu.h | 20 | ||||
-rw-r--r-- | arch/csky/abiv1/inc/abi/entry.h | 19 |
2 files changed, 37 insertions, 2 deletions
diff --git a/arch/csky/abiv1/inc/abi/ckmmu.h b/arch/csky/abiv1/inc/abi/ckmmu.h index 3a002017bebe..85339bd224c4 100644 --- a/arch/csky/abiv1/inc/abi/ckmmu.h +++ b/arch/csky/abiv1/inc/abi/ckmmu.h @@ -40,6 +40,26 @@ static inline void write_mmu_entryhi(int value) cpwcr("cpcr4", value); } +static inline unsigned long read_mmu_msa0(void) +{ + return cprcr("cpcr30"); +} + +static inline void write_mmu_msa0(unsigned long value) +{ + cpwcr("cpcr30", value); +} + +static inline unsigned long read_mmu_msa1(void) +{ + return cprcr("cpcr31"); +} + +static inline void write_mmu_msa1(unsigned long value) +{ + cpwcr("cpcr31", value); +} + /* * TLB operations. */ diff --git a/arch/csky/abiv1/inc/abi/entry.h b/arch/csky/abiv1/inc/abi/entry.h index 4a485b142be1..18e2023bf165 100644 --- a/arch/csky/abiv1/inc/abi/entry.h +++ b/arch/csky/abiv1/inc/abi/entry.h @@ -144,9 +144,24 @@ .endm .macro SETUP_MMU rx - lrw \rx, PHYS_OFFSET | 0xe + /* Select MMU as co-processor */ + cpseti cp15 + + /* + * cpcr30 format: + * 31 - 29 | 28 - 4 | 3 | 2 | 1 | 0 + * BA Reserved C D V + */ + cprcr \rx, cpcr30 + lsri \rx, 28 + lsli \rx, 28 + addi \rx, 0xe cpwcr \rx, cpcr30 - lrw \rx, (PHYS_OFFSET + 0x20000000) | 0xe + + lsri \rx, 28 + addi \rx, 2 + lsli \rx, 28 + addi \rx, 0xe cpwcr \rx, cpcr31 .endm |