From 75d8759d614bcf2d8ea9d0476f9d933abd79f695 Mon Sep 17 00:00:00 2001 From: Suman Anna Date: Tue, 26 Mar 2019 18:00:54 -0500 Subject: [PATCH] omapl138: VirtQueue: Fixup mapVAtoPA() and mapPAtoVA() The mapVAtoPA() and mapPAtoVA() functions used in the OMAPL138 VirtQueue code uses a hard-coded address translating logic that caters to only a specific set of images. The DSPs on OMAPL138 do not have MMUs, so the addresses seen in the vring control structures should be identical between the processor view and the actual DDR address. The only case where this might not be true is if the MPAX is being used to perform some address translations, but this is not the case today. So, fixup these functions to provide a one-to-one exact translation. This fixes up issues with latest upstream kernels (v5.1+) where the virtio buffers are no longer allocated from the same remoteproc device DMA pool, and so can be allocated anywhere in DDR memory (from the default Linux DMA/CMA pool). Signed-off-by: Suman Anna --- packages/ti/ipc/family/omapl138/VirtQueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ti/ipc/family/omapl138/VirtQueue.c b/packages/ti/ipc/family/omapl138/VirtQueue.c index 8b6d12b..a1f525f 100644 --- a/packages/ti/ipc/family/omapl138/VirtQueue.c +++ b/packages/ti/ipc/family/omapl138/VirtQueue.c @@ -108,12 +108,12 @@ static VirtQueue_Object *queueRegistry[NUM_QUEUES] = {NULL}; static inline Void * mapPAtoVA(UInt pa) { - return (Void *)((pa & 0x000fffffU) | 0xc3000000U); + return (Void *)(pa); } static inline UInt mapVAtoPA(Void * va) { - return ((UInt)va & 0x000fffffU) | 0xc9000000U; + return (UInt)va; } /* -- 2.39.2