POWERPC: Add synchronization to write_bat in lib_ppc/bat_rw.c
authorBecky Bruce <becky.bruce@freescale.com>
Mon, 4 Aug 2008 19:01:53 +0000 (14:01 -0500)
committerWolfgang Denk <wd@denx.de>
Mon, 11 Aug 2008 21:52:49 +0000 (23:52 +0200)
Perform sync/isync as required by the architecture.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
Acked-by: Jon Loeliger <jdl@freescale.com>
lib_ppc/bat_rw.c

index 8546333868de00792ae91296ed235a593b0372bc..a40b377bcaac14947a7a04748c305551bd4a73b2 100644 (file)
 #include <common.h>
 #include <asm/processor.h>
 #include <asm/mmu.h>
+#include <asm/io.h>
 
 int write_bat (ppc_bat_t bat, unsigned long upper, unsigned long lower)
 {
+       sync();
+
        switch (bat) {
        case DBAT0:
                mtspr (DBAT0L, lower);
@@ -99,6 +102,9 @@ int write_bat (ppc_bat_t bat, unsigned long upper, unsigned long lower)
                return (-1);
        }
 
+       sync();
+       isync();
+
        return (0);
 }