summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Nelson <sam.nelson@ti.com>2020-01-20 14:05:09 -0500
committerSam Nelson <sam.nelson@ti.com>2020-01-31 11:20:28 -0500
commit80854bd039207043160f59b2a8fb9bab31e1549f (patch)
tree1c500d4cf8de80b36e323415eaaaf4e32ae16991
parentc4cf044bbd2cc2fb21110453183eaa0ce988aa03 (diff)
downloadipc-80854bd039207043160f59b2a8fb9bab31e1549f.tar.gz
am65xx: Remove dependence on DEVMEM entry
AM65XX does not have an IOMMU, and currently the DEVMEM entry is used as a work around. But in reality the VA and PA are directly mapped and dependence on DEVMEM to do the address translation need to be removed. Signed-off-by: Sam Nelson <sam.nelson@ti.com>
-rw-r--r--packages/ti/ipc/family/am65xx/VirtQueue.c16
-rw-r--r--packages/ti/ipc/remoteproc/rsc_table_am65xx_r5f.h14
2 files changed, 7 insertions, 23 deletions
diff --git a/packages/ti/ipc/family/am65xx/VirtQueue.c b/packages/ti/ipc/family/am65xx/VirtQueue.c
index 5b85be3..09db6a0 100644
--- a/packages/ti/ipc/family/am65xx/VirtQueue.c
+++ b/packages/ti/ipc/family/am65xx/VirtQueue.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Texas Instruments Incorporated - http://www.ti.com
+ * Copyright (c) 2017-2020 Texas Instruments Incorporated - http://www.ti.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -237,9 +237,9 @@ static Void _VirtQueue_init()
}
}
-static inline Void * _VirtQueue_getVA(VirtQueue_Handle vq, UInt32 pa)
+static inline Void * mapPAtoVA(UInt pa)
{
- return (Void *)(pa - vq->basePa + vq->baseVa);
+ return (Void *)(pa);
}
/*!
@@ -321,7 +321,7 @@ Int16 VirtQueue_getAvailBuf(VirtQueue_Handle vq, Void **buf, Int *len)
*/
head = vq->vring.avail->ring[vq->last_avail_idx++ % vq->vring.num];
- *buf = _VirtQueue_getVA(vq, vq->vring.desc[head].addr);
+ *buf = mapPAtoVA(vq->vring.desc[head].addr);
*len = vq->vring.desc[head].len;
}
GateHwi_leave(vq->gateH, key);
@@ -461,13 +461,7 @@ VirtQueue_Handle VirtQueue_create(UInt16 remoteProcId, VirtQueue_Params *params,
vq->basePa = (UInt32)Resource_getVringDA(vq->id);
Assert_isTrue(vq->basePa != 0, NULL);
- result = Resource_physToVirt(vq->basePa, &(vq->baseVa));
- Assert_isTrue(result == Resource_S_SUCCESS, (Assert_Id)NULL);
- /* Additional check to handle case when Assert is disabled */
- if (result != Resource_S_SUCCESS) {
- return (NULL);
- }
-
+ vq->baseVa = mapPAtoVA(vq->basePa);
vringAddr = (Void *)vq->baseVa;
break;
default:
diff --git a/packages/ti/ipc/remoteproc/rsc_table_am65xx_r5f.h b/packages/ti/ipc/remoteproc/rsc_table_am65xx_r5f.h
index 8dba081..3ae0dc0 100644
--- a/packages/ti/ipc/remoteproc/rsc_table_am65xx_r5f.h
+++ b/packages/ti/ipc/remoteproc/rsc_table_am65xx_r5f.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018, Texas Instruments Incorporated
+ * Copyright (c) 2017-2020, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -57,7 +57,7 @@
#define R5F_MEM_IPC_VRING_SIZE SZ_1M
-#define R5F_NUM_ENTRIES 3
+#define R5F_NUM_ENTRIES 2
/*
* Assign direct mapped RAM address to facilitate address translations in
@@ -89,9 +89,6 @@ struct my_resource_table {
/* trace entry */
struct fw_rsc_trace trace;
-
- /* devmem entry */
- struct fw_rsc_devmem devmem0;
};
extern char ti_trace_SysMin_Module_State_0_outbuf__A[];
@@ -109,7 +106,6 @@ const struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
{
offsetof(struct my_resource_table, rpmsg_vdev),
offsetof(struct my_resource_table, trace),
- offsetof(struct my_resource_table, devmem0),
},
/* rpmsg vdev entry */
@@ -130,12 +126,6 @@ const struct my_resource_table ti_ipc_remoteproc_ResourceTable = {
#endif
},
- {
- TYPE_DEVMEM,
- R5F_MEM_IPC_VRING, PHYS_MEM_IPC_VRING,
- R5F_MEM_IPC_VRING_SIZE, 0, 0, "R5F_MEM_IPC_VRING",
- },
-
};
#endif /* _RSC_TABLE_AM65XX_R5F_H_ */