summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Nelson2016-06-10 14:27:29 -0500
committerSam Nelson2016-06-10 14:27:29 -0500
commit5c1f177b8d5802227dfe7e86fc026620e1e10189 (patch)
tree6e3cb5ddce982de11c30742db8f118d658a7b83b
parent1268e249a612cec8b0540bfaeaad177c1f42cd5c (diff)
downloadmpm-transport-5c1f177b8d5802227dfe7e86fc026620e1e10189.tar.gz
mpm-transport-5c1f177b8d5802227dfe7e86fc026620e1e10189.tar.xz
mpm-transport-5c1f177b8d5802227dfe7e86fc026620e1e10189.zip
transport_mmap: Update mmap to adapt to API change back in uio-module-drvDEV.MPM-TRANSPORT-02.00.01.02
The uio-module-drv is updated to use full address instead of index + offset model. This commit updates the code to use the full address. Also some minor formatting cleanup Signed-off-by: Sam Nelson <sam.nelson@ti.com>
-rw-r--r--src/transport/hyplnk/mpm_transport_hyplnk_interface.c2
-rw-r--r--src/utils/keystone_mmap/mpm_transport_keystone_mmap.h10
-rw-r--r--src/utils/keystone_mmap/mpm_transport_keystone_mmap_osal.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/src/transport/hyplnk/mpm_transport_hyplnk_interface.c b/src/transport/hyplnk/mpm_transport_hyplnk_interface.c
index c0d5a89..d20a5fc 100644
--- a/src/transport/hyplnk/mpm_transport_hyplnk_interface.c
+++ b/src/transport/hyplnk/mpm_transport_hyplnk_interface.c
@@ -675,9 +675,7 @@ int mpm_transport_hyplnk_init_peripheral(mpm_transport_hyplnk_t *hypCfg,
675 675
676 uint32_t dataBase_size = ((hypCfg->hyplnkIF == hyplnk_PORT_0)? 0x10000000 : 0x08000000); 676 uint32_t dataBase_size = ((hypCfg->hyplnkIF == hyplnk_PORT_0)? 0x10000000 : 0x08000000);
677 hyplnkActiveIF[index].physWindowBase = (uint32_t) hyplnkInitCfg.dev.bases[index].dataBase; 677 hyplnkActiveIF[index].physWindowBase = (uint32_t) hyplnkInitCfg.dev.bases[index].dataBase;
678// hyplnkInitCfg.dev.bases[index].cfgBase = internal_hyplnk_mmap((uint32_t)(hyplnkInitCfg.dev.bases[index].cfgBase), 0x100, hypCfg->fd[index]);
679 hyplnkInitCfg.dev.bases[index].cfgBase = internal_hyplnk_mmap(0, (uint32_t)(hyplnkInitCfg.dev.bases[index].cfgBase), 0x100, hypCfg->fd[index]); 678 hyplnkInitCfg.dev.bases[index].cfgBase = internal_hyplnk_mmap(0, (uint32_t)(hyplnkInitCfg.dev.bases[index].cfgBase), 0x100, hypCfg->fd[index]);
680// hyplnkInitCfg.dev.bases[index].dataBase = internal_hyplnk_mmap((uint32_t)(hyplnkInitCfg.dev.bases[index].dataBase), dataBase_size, hypCfg->fd[index]);
681 hyplnkInitCfg.dev.bases[index].dataBase = internal_hyplnk_mmap(1, (uint32_t)(hyplnkInitCfg.dev.bases[index].dataBase), dataBase_size, hypCfg->fd[index]); 679 hyplnkInitCfg.dev.bases[index].dataBase = internal_hyplnk_mmap(1, (uint32_t)(hyplnkInitCfg.dev.bases[index].dataBase), dataBase_size, hypCfg->fd[index]);
682 hyplnkActiveIF[index].windowBase = (uint32_t) hyplnkInitCfg.dev.bases[index].dataBase; 680 hyplnkActiveIF[index].windowBase = (uint32_t) hyplnkInitCfg.dev.bases[index].dataBase;
683 hyplnkActiveIF[index].configBase = (uint32_t) hyplnkInitCfg.dev.bases[index].cfgBase; 681 hyplnkActiveIF[index].configBase = (uint32_t) hyplnkInitCfg.dev.bases[index].cfgBase;
diff --git a/src/utils/keystone_mmap/mpm_transport_keystone_mmap.h b/src/utils/keystone_mmap/mpm_transport_keystone_mmap.h
index 5e57560..3d7010a 100644
--- a/src/utils/keystone_mmap/mpm_transport_keystone_mmap.h
+++ b/src/utils/keystone_mmap/mpm_transport_keystone_mmap.h
@@ -49,7 +49,11 @@
49#include <ti/csl/cslr_msmc.h> 49#include <ti/csl/cslr_msmc.h>
50#include "ti/runtime/mmap/mmap.h" 50#include "ti/runtime/mmap/mmap.h"
51 51
52keystone_mmap_handle_t mpm_transport_keystone_mmap_open(uint32_t base, uint32_t size, unsigned int index, unsigned int count, uint32_t msmc_cfg, int fd, int priv); 52keystone_mmap_handle_t mpm_transport_keystone_mmap_open(uint32_t base,
53 uint32_t size, unsigned int index, unsigned int count,
54 uint32_t msmc_cfg, int fd, int priv);
53int mpm_transport_keystone_free(keystone_mmap_handle_t h); 55int mpm_transport_keystone_free(keystone_mmap_handle_t h);
54uint32_t mpm_transport_keystone_mmap(keystone_mmap_handle_t h, uint64_t addr, uint32_t size); 56uint32_t mpm_transport_keystone_mmap(keystone_mmap_handle_t h,
55int mpm_transport_keystone_unmap(keystone_mmap_handle_t h, uint32_t addr, uint32_t size); 57 uint64_t addr, uint32_t size);
58int mpm_transport_keystone_unmap(keystone_mmap_handle_t h, uint32_t addr,
59 uint32_t size);
diff --git a/src/utils/keystone_mmap/mpm_transport_keystone_mmap_osal.c b/src/utils/keystone_mmap/mpm_transport_keystone_mmap_osal.c
index 6d7054e..bfdd3d3 100644
--- a/src/utils/keystone_mmap/mpm_transport_keystone_mmap_osal.c
+++ b/src/utils/keystone_mmap/mpm_transport_keystone_mmap_osal.c
@@ -37,14 +37,12 @@
37 37
38void Osal_mmapRegisterRead (int fd, uint32_t *val, uint32_t count, uint32_t offset) 38void Osal_mmapRegisterRead (int fd, uint32_t *val, uint32_t count, uint32_t offset)
39{ 39{
40 pread(fd,val,count*sizeof(uint32_t), 40 pread(fd, val, count*sizeof(uint32_t), (off_t)offset);
41 ((off_t)offset) & (~(UIO_MODULE_DRV_MAP_INDEX_MASK << UIO_MODULE_DRV_RW_INDEX_SHIFT)));
42} 41}
43 42
44void Osal_mmapRegisterWrite (int fd, uint32_t *val, uint32_t count, uint32_t offset) 43void Osal_mmapRegisterWrite (int fd, uint32_t *val, uint32_t count, uint32_t offset)
45{ 44{
46 pwrite(fd,val,count*sizeof(uint32_t), 45 pwrite(fd, val, count*sizeof(uint32_t), (off_t)offset);
47 ((off_t)offset) & (~(UIO_MODULE_DRV_MAP_INDEX_MASK << UIO_MODULE_DRV_RW_INDEX_SHIFT)));
48} 46}
49 47
50void* Osal_mmapMalloc (uint32_t num_bytes) 48void* Osal_mmapMalloc (uint32_t num_bytes)