branch | RCL_3 |
changeset 43 | c1f20ce4abcf |
parent 26 | c734af59ce98 |
child 44 | 3e88ff8f41d5 |
42:a179b74831c9 | 43:c1f20ce4abcf |
---|---|
713 if(l1type==2 || l1type==3 || l1type==4) |
713 if(l1type==2 || l1type==3 || l1type==4) |
714 { |
714 { |
715 // we have an L1 data cache... |
715 // we have an L1 data cache... |
716 TUint32 csir = InternalCache::SizeIdRegister(0,0); |
716 TUint32 csir = InternalCache::SizeIdRegister(0,0); |
717 TUint sets = ((csir>>13)&0x7fff)+1; |
717 TUint sets = ((csir>>13)&0x7fff)+1; |
718 TUint ways = ((csir>>3)&0x3ff)+1; |
718 TUint ways = ((csir>>3)&0x3ff); |
719 ways+=1; |
|
719 TUint lineSizeShift = (csir&7)+4; |
720 TUint lineSizeShift = (csir&7)+4; |
720 // assume L1 data cache is VIPT and alias checks broken and so we need data cache colouring... |
721 // assume L1 data cache is VIPT and alias checks broken and so we need data cache colouring... |
721 dColourCount = (sets<<lineSizeShift)>>KPageShift; |
722 dColourCount = (sets<<lineSizeShift)>>KPageShift; |
722 if(l1type==4) // unified cache, so set instruction cache colour as well... |
723 if(l1type==4) // unified cache, so set instruction cache colour as well... |
723 iColourCount = (sets<<lineSizeShift)>>KPageShift; |
724 iColourCount = (sets<<lineSizeShift)>>KPageShift; |
727 if(l1type==1 || l1type==3) |
728 if(l1type==1 || l1type==3) |
728 { |
729 { |
729 // we have a separate L1 instruction cache... |
730 // we have a separate L1 instruction cache... |
730 TUint32 csir = InternalCache::SizeIdRegister(1,0); |
731 TUint32 csir = InternalCache::SizeIdRegister(1,0); |
731 TUint sets = ((csir>>13)&0x7fff)+1; |
732 TUint sets = ((csir>>13)&0x7fff)+1; |
732 TUint ways = ((csir>>3)&0x3ff)+1; |
733 TUint ways = ((csir>>3)&0x3ff); |
734 ways+=1; |
|
733 TUint lineSizeShift = (csir&7)+4; |
735 TUint lineSizeShift = (csir&7)+4; |
734 iColourCount = (sets<<lineSizeShift)>>KPageShift; |
736 iColourCount = (sets<<lineSizeShift)>>KPageShift; |
735 __KTRACE_OPT2(KBOOT,KMMU,Kern::Printf("L1ICache = 0x%x,0x%x,%d colourCount=%d",sets,ways,lineSizeShift,(sets<<lineSizeShift)>>KPageShift)); |
737 __KTRACE_OPT2(KBOOT,KMMU,Kern::Printf("L1ICache = 0x%x,0x%x,%d colourCount=%d",sets,ways,lineSizeShift,(sets<<lineSizeShift)>>KPageShift)); |
736 } |
738 } |
737 } |
739 } |