Linux_SDK_V1.1.2

This commit is contained in:
thead_admin
2023-03-05 22:29:50 +08:00
parent 33ee7bad27
commit 74f3b93402

View File

@@ -1180,11 +1180,12 @@ enum MMUStatus MMUCleanup(volatile unsigned char *hwregs[MAX_SUBSYS_NUM][2]) {
if (g_mmu->page_table_array)
iounmap(g_mmu->page_table_array);
} else {
if (g_mmu->stlb_virtual)
dma_free_coherent(&platformdev->dev, g_mmu->stlb_size,
g_mmu->stlb_virtual, (dma_addr_t)g_mmu->stlb_physical);
/* stlb_virtual is same alloc on alloc mtlb_virtual in func MMUEnable()
* so, should not free g_mmu->stlb_virtual.But free handle g_mmu->mtlb_physical
* size should be ( g_mmu->mtlb_size+g_mmu->stlb_size)
* */
if (g_mmu->mtlb_virtual)
dma_free_coherent(&platformdev->dev, g_mmu->mtlb_size,
dma_free_coherent(&platformdev->dev, g_mmu->mtlb_size+g_mmu->stlb_size,
g_mmu->mtlb_virtual, (dma_addr_t)g_mmu->mtlb_physical);
if (g_mmu->page_table_array)
dma_free_coherent(&platformdev->dev, g_mmu->page_table_array_size,
@@ -1893,4 +1894,4 @@ void MMURestore(volatile unsigned char *hwregs[MAX_SUBSYS_NUM][2])
iowrite32(1, (void*)(hwregs[i][1] + MMU_REG_CONTROL));
}
}
}
}