diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2009-11-13 08:52:21 -0600 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-11-13 09:11:01 -0600 |
commit | cdbdbe65f5f006cba208accee5a126c659d4b867 (patch) | |
tree | 1a42740d6ea7579d530ac3a12016d2c08ea5ae37 | |
parent | 3ad95deb30ac73bd57e966d321215a17d3236f9f (diff) |
ppc/85xx: Fix how we determine the number of CAM entries
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>
-rw-r--r-- | cpu/mpc85xx/tlb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cpu/mpc85xx/tlb.c b/cpu/mpc85xx/tlb.c index 6e94c237ad8..ea5deb2971f 100644 --- a/cpu/mpc85xx/tlb.c +++ b/cpu/mpc85xx/tlb.c @@ -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; |