]> git.sur5r.net Git - u-boot/commitdiff
fsl: add register read-back to set_law()
authorTimur Tabi <timur@freescale.com>
Fri, 4 Sep 2009 22:05:24 +0000 (17:05 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Tue, 8 Sep 2009 14:10:06 +0000 (09:10 -0500)
After programming a new LAW, we should read-back the LAWAR register so that
we sync the writes.  Otherwise, code that attempts to use the new LAW-mapped
memory might fail right away.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
drivers/misc/fsl_law.c

index 147fe0a21c8693a757146b54b73c521d494ba213..7bdd355c745fa985e5efb0c797688135dfa79ea5 100644 (file)
@@ -58,7 +58,8 @@ void set_law(u8 idx, phys_addr_t addr, enum law_size sz, enum law_trgt_if id)
        out_be32(lawbar, addr >> 12);
        out_be32(lawar, LAWAR_EN | ((u32)id << 20) | (u32)sz);
 
-       return ;
+       /* Read back so that we sync the writes */
+       in_be32(lawar);
 }
 
 int set_next_law(phys_addr_t addr, enum law_size sz, enum law_trgt_if id)