]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ppc/85xx: Fix how we determine the number of CAM entries
authorKumar Gala <galak@kernel.crashing.org>
Fri, 13 Nov 2009 14:52:21 +0000 (08:52 -0600)
committerKumar Gala <galak@kernel.crashing.org>
Fri, 13 Nov 2009 15:11:01 +0000 (09:11 -0600)
We were incorrectly use the max CAM size as the number of entries in
the array for setting up the addrmap.  We should be using the NENTRY
field which is the low 12-bits of TLB1CFG.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
cpu/mpc85xx/tlb.c

index 6e94c237ad8b16db1b82f22a052f81107699696d..ea5deb2971fcdf158e9bab50d976184d0f10d5ec 100644 (file)
@@ -132,10 +132,10 @@ int find_tlb_idx(void *addr, u8 tlbsel)
 void init_addr_map(void)
 {
        int i;
-       unsigned int max_cam = (mfspr(SPRN_TLB1CFG) >> 16) & 0xff;
+       unsigned int num_cam = mfspr(SPRN_TLB1CFG) & 0xfff;
 
        /* walk all the entries */
-       for (i = 0; i < max_cam; i++) {
+       for (i = 0; i < num_cam; i++) {
                unsigned long epn;
                u32 tsize, _mas1;
                phys_addr_t rpn;