]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
omapl138: VirtQueue: Fixup mapVAtoPA() and mapPAtoVA()
authorSuman Anna <s-anna@ti.com>
Tue, 26 Mar 2019 23:00:54 +0000 (18:00 -0500)
committerSam Nelson <sam.nelson@ti.com>
Tue, 21 May 2019 19:56:08 +0000 (15:56 -0400)
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 <s-anna@ti.com>
packages/ti/ipc/family/omapl138/VirtQueue.c

index 8b6d12b8e339b4db4b3ba0df7de041a042e5677d..a1f525f71cc6efbbe8df361fe62dcb5aa0a2d1dd 100644 (file)
@@ -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;
 }
 
 /*