Merge drm/drm-next into drm-misc-next
[linux-2.6-block.git] / drivers / accel / ivpu / ivpu_mmu_context.c
index 122c90fecf6657f6bbcf5a6dc7f991af39dc3cc4..12a8c09d4547d7d9b81cd91d93307e59e648e14f 100644 (file)
@@ -14,6 +14,7 @@
 #include "ivpu_mmu.h"
 #include "ivpu_mmu_context.h"
 
+#define IVPU_MMU_VPU_ADDRESS_MASK        GENMASK(47, 12)
 #define IVPU_MMU_PGD_INDEX_MASK          GENMASK(47, 39)
 #define IVPU_MMU_PUD_INDEX_MASK          GENMASK(38, 30)
 #define IVPU_MMU_PMD_INDEX_MASK          GENMASK(29, 21)
@@ -340,12 +341,8 @@ ivpu_mmu_context_map_sgt(struct ivpu_device *vdev, struct ivpu_mmu_context *ctx,
 
        if (!IS_ALIGNED(vpu_addr, IVPU_MMU_PAGE_SIZE))
                return -EINVAL;
-       /*
-        * VPU is only 32 bit, but DMA engine is 38 bit
-        * Ranges < 2 GB are reserved for VPU internal registers
-        * Limit range to 8 GB
-        */
-       if (vpu_addr < SZ_2G || vpu_addr > SZ_8G)
+
+       if (vpu_addr & ~IVPU_MMU_VPU_ADDRESS_MASK)
                return -EINVAL;
 
        prot = IVPU_MMU_ENTRY_MAPPED;