Add APIs to setup HugeTLB mappings for USDPAA

This commit is contained in:
Roy Pledge 2016-01-12 13:40:26 -05:00 committed by Dong Aisheng
parent dc640f653a
commit b558f49bc0
2 changed files with 19 additions and 1 deletions

View File

@ -89,6 +89,12 @@ void print_system_hash_info(void);
#endif /* CONFIG_PPC_MMU_NOHASH */
void settlbcam(int index, unsigned long virt, phys_addr_t phys,
unsigned long size, unsigned long flags, unsigned int pid);
void cleartlbcam(unsigned long virt, unsigned int pid);
#ifdef CONFIG_PPC32
void hash_preload(struct mm_struct *mm, unsigned long ea);

View File

@ -102,7 +102,7 @@ unsigned long p_block_mapped(phys_addr_t pa)
* an unsigned long (for example, 32-bit implementations cannot support a 4GB
* size).
*/
static void settlbcam(int index, unsigned long virt, phys_addr_t phys,
void settlbcam(int index, unsigned long virt, phys_addr_t phys,
unsigned long size, unsigned long flags, unsigned int pid)
{
unsigned int tsize;
@ -140,6 +140,18 @@ static void settlbcam(int index, unsigned long virt, phys_addr_t phys,
tlbcam_addrs[index].phys = phys;
}
void cleartlbcam(unsigned long virt, unsigned int pid)
{
int i = 0;
for (i = 0; i < NUM_TLBCAMS; i++) {
if (tlbcam_addrs[i].start == virt) {
TLBCAM[i].MAS1 = 0;
loadcam_entry(i);
return;
}
}
}
unsigned long calc_cam_sz(unsigned long ram, unsigned long virt,
phys_addr_t phys)
{