summaryrefslogtreecommitdiff
path: root/src/arch/mips/mmu.c
diff options
context:
space:
mode:
authorIonela Voinescu <ionela.voinescu@imgtec.com>2015-07-24 15:00:20 +0100
committerMartin Roth <martinroth@google.com>2015-12-29 18:02:15 +0100
commite7a336ac29b1ef5aaa1b0aa4926ed75829b491b1 (patch)
tree7dbee4b28e86cf01de98498bf06fb4c4f3e92fae /src/arch/mips/mmu.c
parentc2b51085ca4aa3427ad788e9b402e0da46a0b1a6 (diff)
mips: add coherency argument to identity mapping
In order for a U-boot payload to work properly the soc_registers region (device registers) needs to be mapped as uncached. Therefore, add a coherency argument to the identity mapping funcion which will establish the type of mapping. Change-Id: I26fc546378acda4f4f8f4757fbc0adb03ac7db9f Signed-off-by: Ionela Voinescu <ionela.voinescu@imgtec.com> Reviewed-on: https://review.coreboot.org/12769 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/mips/mmu.c')
-rw-r--r--src/arch/mips/mmu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/mips/mmu.c b/src/arch/mips/mmu.c
index 38f496deb3..b144fd3573 100644
--- a/src/arch/mips/mmu.c
+++ b/src/arch/mips/mmu.c
@@ -14,7 +14,6 @@
* GNU General Public License for more details.
*/
-#include <arch/cpu.h>
#include <arch/mmu.h>
#include <console/console.h>
#include <stddef.h>
@@ -70,22 +69,23 @@ static uint32_t pick_pagesize(uint32_t start, uint32_t len)
* Identity map the memory from [start,start+len] in the TLB using the
* largest suitable page size so as to conserve TLB entries.
*/
-int identity_map(uint32_t start, size_t len)
+int identity_map(uint32_t start, size_t len, uint32_t coherency)
{
uint32_t pgsize, pfn, entryhi, entrylo0, entrylo1;
+ coherency &= C0_ENTRYLO_COHERENCY_MASK;
while (len > 0) {
pgsize = pick_pagesize(start, len);
entryhi = start;
pfn = start >> 12;
- entrylo0 = (pfn << C0_ENTRYLO_PFN_SHIFT) | C0_ENTRYLO_WB |
+ entrylo0 = (pfn << C0_ENTRYLO_PFN_SHIFT) | coherency |
C0_ENTRYLO_D | C0_ENTRYLO_V | C0_ENTRYLO_G;
start += pgsize;
len -= MIN(len, pgsize);
if (len >= pgsize) {
pfn = start >> 12;
entrylo1 = (pfn << C0_ENTRYLO_PFN_SHIFT) |
- C0_ENTRYLO_WB | C0_ENTRYLO_D | C0_ENTRYLO_V |
+ coherency | C0_ENTRYLO_D | C0_ENTRYLO_V |
C0_ENTRYLO_G;
start += pgsize;
len -= MIN(len, pgsize);