summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongmei Gou2016-11-22 13:28:10 -0600
committerHongmei Gou2016-11-22 13:28:10 -0600
commit6a13992fc420246ed302e8d9a780915bb1d7d047 (patch)
tree9b3136309c667bfb7a7d2abcf236e147522c4a00 /src/pruicss_drv.c
parenta605585eb2e15fe07a8248fa8e02a51c37a9af68 (diff)
downloadpruss-lld-6a13992fc420246ed302e8d9a780915bb1d7d047.tar.gz
pruss-lld-6a13992fc420246ed302e8d9a780915bb1d7d047.tar.xz
pruss-lld-6a13992fc420246ed302e8d9a780915bb1d7d047.zip
PRUSS-LLD port to Linux user space: driver changes
* Update firmware download to define separate mem regions, rather than offsetting from a base address Signed-off-by: Hongmei Gou <h-gou@ti.com>
Diffstat (limited to 'src/pruicss_drv.c')
-rw-r--r--src/pruicss_drv.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/pruicss_drv.c b/src/pruicss_drv.c
index 7421a28..4c0710e 100644
--- a/src/pruicss_drv.c
+++ b/src/pruicss_drv.c
@@ -346,19 +346,32 @@ uint32_t PRUICSS_pruWriteMemory(
346 ) 346 )
347{ 347{
348 348
349 uint32_t baseaddr; 349 uint32_t addr;
350 PRUICSS_HwAttrs const *hwAttrs; 350 PRUICSS_HwAttrs const *hwAttrs;
351 uint32_t temp_addr = 0U; 351 uint32_t temp_addr = 0U;
352 352
353 hwAttrs = handle->hwAttrs; 353 hwAttrs = handle->hwAttrs;
354 baseaddr = hwAttrs->baseAddr;
355 uint32_t i, wordlength; 354 uint32_t i, wordlength;
356 355
357 wordlength = (bytelength + 3U) >> 2U; 356 wordlength = (bytelength + 3U) >> 2U;
358 357
358 if (pruMem == PRU_ICSS_DATARAM(0U)) {
359 addr = hwAttrs->prussPru0DramBase;
360 } else if (pruMem == PRU_ICSS_IRAM(0U)) {
361 addr = hwAttrs->prussPru0IramBase;
362 } else if (pruMem == PRU_ICSS_DATARAM(1U)) {
363 addr = hwAttrs->prussPru1DramBase;
364 } else if (pruMem == PRU_ICSS_IRAM(1U)) {
365 addr = hwAttrs->prussPru1IramBase;
366 } else if (pruMem == PRU_ICSS_SHARED_RAM) {
367 addr = hwAttrs->prussSharedDramBase;
368 } else {
369 return -1;
370 }
371
359 for (i = 0; i < wordlength; i++) 372 for (i = 0; i < wordlength; i++)
360 { 373 {
361 temp_addr = (baseaddr + pruMem + (i << 2) + wordoffset); 374 temp_addr = (addr + (i << 2) + wordoffset);
362 HWREG(temp_addr) = source_mem[i]; 375 HWREG(temp_addr) = source_mem[i];
363 } 376 }
364 return wordlength; 377 return wordlength;