]> git.sur5r.net Git - u-boot/commitdiff
Adding more control to physical address mapping
authorYork Sun <yorksun@freescale.com>
Tue, 28 Sep 2010 22:20:32 +0000 (15:20 -0700)
committerKumar Gala <galak@kernel.crashing.org>
Wed, 20 Oct 2010 07:28:00 +0000 (02:28 -0500)
A worker function setup_ddr_tlbs_phys() is introduced to implement more
control on physical address mapping.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
arch/powerpc/cpu/mpc85xx/tlb.c

index f2833a5df706fcd038da86dc81d1e661c9ed6b9d..e3a71aec5c4c9298f1e03ad977926d71d699ff16 100644 (file)
@@ -245,7 +245,8 @@ void init_addr_map(void)
 }
 #endif
 
-unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg)
+unsigned int
+setup_ddr_tlbs_phys(phys_addr_t p_addr, unsigned int memsize_in_meg)
 {
        int i;
        unsigned int tlb_size;
@@ -275,21 +276,24 @@ unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg)
 
                tlb_size = (camsize - 10) / 2;
 
-               set_tlb(1, ram_tlb_address, ram_tlb_address,
+               set_tlb(1, ram_tlb_address, p_addr,
                        MAS3_SX|MAS3_SW|MAS3_SR, 0,
                        0, ram_tlb_index, tlb_size, 1);
 
                size -= 1ULL << camsize;
                memsize -= 1ULL << camsize;
                ram_tlb_address += 1UL << camsize;
+               p_addr += 1UL << camsize;
        }
 
        if (memsize)
                print_size(memsize, " left unmapped\n");
-
-       /*
-        * Confirm that the requested amount of memory was mapped.
-        */
        return memsize_in_meg;
 }
+
+unsigned int setup_ddr_tlbs(unsigned int memsize_in_meg)
+{
+       return
+               setup_ddr_tlbs_phys(CONFIG_SYS_DDR_SDRAM_BASE, memsize_in_meg);
+}
 #endif /* !CONFIG_NAND_SPL */