// SPDX-License-Identifier: GPL-2.0+ /* Copyright (C) 2017-2018 Broadcom */ /** * DOC: Broadcom V3D MMU * * The V3D 3.x hardware (compared to VC4) now includes an MMU. It has * a single level of page tables for the V3D's 4GB address space to * map to AXI bus addresses, thus it could need up to 4MB of * physically contiguous memory to store the PTEs. * * Because the 4MB of contiguous memory for page tables is precious, * and switching between them is expensive, we load all BOs into the * same 4GB address space. * * To protect clients from each other, we should use the GMP to * quickly mask out (at 128kb granularity) what pages are available to * each client. This is not yet implemented. */ #include "v3d_drv.h" #include "v3d_regs.h" /* Note: All PTEs for the 1MB superpage must be filled with the * superpage bit set. */ #define V3D_PTE_SUPERPAGE … #define V3D_PTE_WRITEABLE … #define V3D_PTE_VALID … static int v3d_mmu_flush_all(struct v3d_dev *v3d) { … } int v3d_mmu_set_page_table(struct v3d_dev *v3d) { … } void v3d_mmu_insert_ptes(struct v3d_bo *bo) { … } void v3d_mmu_remove_ptes(struct v3d_bo *bo) { … }