summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMahesh Radhakrishnan2019-06-28 15:56:39 -0500
committerMahesh Radhakrishnan2019-06-28 15:56:39 -0500
commit988576398ae1488c706eebdd71aeff5959604f77 (patch)
tree13adcb4605dd850c0a236ab212d58636cd6e7e10 /src
parent667b0eb2334ce59492b5b39d1cf124f7871b5f9c (diff)
parent3e430031565b9d81ee6d77ac96014856604f6c6b (diff)
downloadpruss-lld-988576398ae1488c706eebdd71aeff5959604f77.tar.gz
pruss-lld-988576398ae1488c706eebdd71aeff5959604f77.tar.xz
pruss-lld-988576398ae1488c706eebdd71aeff5959604f77.zip
Merge pull request #63 in PROCESSOR-SDK/pruss-lld from PRSDK-4321 to masterDEV.PRUSS_LLD.01.00.00.14A
* commit '3e430031565b9d81ee6d77ac96014856604f6c6b': PRSDK-4321: Correction for J7 SoC object count PRSDK-4321: Updated AM335x object initialization to align with new PRU instance Max count PRSDK-4321: Updated PRU instance support for AM335x PRSDK-4321: Added PRUICSS instace 3 support for AM65xx
Diffstat (limited to 'src')
-rw-r--r--src/pruicss_drv.c64
-rw-r--r--src/pruicss_intc.c10
2 files changed, 18 insertions, 56 deletions
diff --git a/src/pruicss_drv.c b/src/pruicss_drv.c
index ceeba87..7a079b9 100644
--- a/src/pruicss_drv.c
+++ b/src/pruicss_drv.c
@@ -70,7 +70,7 @@ static uintptr_t pruicss_get_ctrl_addr (PRUICSS_HwAttrs const *hwAttrs,
70{ 70{
71 uintptr_t baseaddr = 0; 71 uintptr_t baseaddr = 0;
72 72
73 if ((instance >= PRUICCSS_INSTANCE_ONE) && (instance <= PRUICCSS_INSTANCE_MAX)) 73 if ((instance >= PRUICCSS_INSTANCE_ONE) && (instance < PRUICCSS_INSTANCE_MAX))
74 { 74 {
75 switch (pruNum) { 75 switch (pruNum) {
76 case PRUICCSS_PRU0: baseaddr = hwAttrs->prussPru0CtrlRegBase; 76 case PRUICCSS_PRU0: baseaddr = hwAttrs->prussPru0CtrlRegBase;
@@ -476,11 +476,8 @@ int32_t PRUICSS_pruSendEvent(PRUICSS_Handle handle,uint32_t eventnum)
476 object = (PRUICSS_V1_Object *)handle->object; 476 object = (PRUICSS_V1_Object *)handle->object;
477 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs; 477 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
478 478
479 if(object->instance == PRUICCSS_INSTANCE_ONE) 479 if ((object->instance >= PRUICCSS_INSTANCE_ONE) &&
480 { 480 (object->instance < PRUICCSS_INSTANCE_MAX))
481 baseaddr = hwAttrs->prussIntcRegBase;
482 }
483 else if(object->instance == PRUICCSS_INSTANCE_TWO)
484 { 481 {
485 baseaddr = hwAttrs->prussIntcRegBase; 482 baseaddr = hwAttrs->prussIntcRegBase;
486 } 483 }
@@ -526,11 +523,8 @@ int32_t PRUICSS_pruClearEvent(PRUICSS_Handle handle,uint32_t eventnum)
526 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs; 523 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
527 524
528 baseaddr = hwAttrs->baseAddr; 525 baseaddr = hwAttrs->baseAddr;
529 if(object->instance == PRUICCSS_INSTANCE_ONE) 526 if ((object->instance >= PRUICCSS_INSTANCE_ONE) &&
530 { 527 (object->instance < PRUICCSS_INSTANCE_MAX))
531 baseaddr = hwAttrs->prussIntcRegBase;
532 }
533 else if(object->instance == PRUICCSS_INSTANCE_TWO)
534 { 528 {
535 baseaddr = hwAttrs->prussIntcRegBase; 529 baseaddr = hwAttrs->prussIntcRegBase;
536 } 530 }
@@ -639,7 +633,9 @@ int32_t PRUICSS_mapPruMem(PRUICSS_Handle handle,uint32_t pru_ram_id, void **addr
639 object = (PRUICSS_V1_Object *)handle->object; 633 object = (PRUICSS_V1_Object *)handle->object;
640 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs; 634 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
641 635
642 if(object->instance == PRUICCSS_INSTANCE_ONE) { 636 if ((object->instance >= PRUICCSS_INSTANCE_ONE) &&
637 (object->instance < PRUICCSS_INSTANCE_MAX))
638 {
643 switch (per_id) 639 switch (per_id)
644 { 640 {
645 case PRUICSS_CFG: 641 case PRUICSS_CFG:
@@ -666,34 +662,6 @@ int32_t PRUICSS_mapPruMem(PRUICSS_Handle handle,uint32_t pru_ram_id, void **addr
666 break; 662 break;
667 } 663 }
668 } 664 }
669 else if(object->instance == PRUICCSS_INSTANCE_TWO)
670 {
671 switch (per_id)
672 {
673 case PRUICSS_CFG:
674 *address = (void*)(hwAttrs->prussCfgRegBase);
675 break;
676 case PRUICSS_UART:
677 *address = (void*)(hwAttrs->prussUartRegBase);
678 break;
679 case PRUICSS_IEP:
680 *address = (void*)(hwAttrs->prussIepRegBase);
681 break;
682 case PRUICSS_ECAP:
683 *address = (void*)(hwAttrs->prussEcapRegBase);
684 break;
685 case PRUICSS_MII_RT:
686 *address = (void*)( hwAttrs->prussMiiRtCfgRegBase);
687 break;
688 case PRUICSS_MDIO:
689 *address = (void*)(hwAttrs->prussMiiMdioRegBase);
690 break;
691 default:
692 *address = 0;
693 ret_val = PRUICSS_RETURN_FAILURE;
694 break;
695 }
696 }
697 else 665 else
698 { 666 {
699 ret_val = PRUICSS_RETURN_FAILURE; 667 ret_val = PRUICSS_RETURN_FAILURE;
@@ -710,14 +678,12 @@ void PRUICSS_enableOCPMasterAccess(PRUICSS_Handle handle )
710 object = (PRUICSS_V1_Object *)handle->object; 678 object = (PRUICSS_V1_Object *)handle->object;
711 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs; 679 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
712 680
713 if(object->instance == PRUICCSS_INSTANCE_ONE) 681 if ((object->instance >= PRUICCSS_INSTANCE_ONE) &&
714 { 682 (object->instance < PRUICCSS_INSTANCE_MAX))
715 baseaddr = hwAttrs->prussCfgRegBase;
716 }
717 if(object->instance == PRUICCSS_INSTANCE_TWO)
718 { 683 {
719 baseaddr = hwAttrs->prussCfgRegBase; 684 baseaddr = hwAttrs->prussCfgRegBase;
720 } 685 }
686
721 HW_WR_FIELD32((baseaddr + CSL_ICSSCFG_SYSCFG),CSL_ICSSCFG_SYSCFG_STANDBY_INIT, 0); 687 HW_WR_FIELD32((baseaddr + CSL_ICSSCFG_SYSCFG),CSL_ICSSCFG_SYSCFG_STANDBY_INIT, 0);
722} 688}
723 689
@@ -823,14 +789,12 @@ void PRUICSS_pinMuxConfig(PRUICSS_Handle handle, uint64_t regVal)
823 object = (PRUICSS_V1_Object *)handle->object; 789 object = (PRUICSS_V1_Object *)handle->object;
824 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs; 790 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
825 791
826 if(object->instance == PRUICCSS_INSTANCE_ONE) 792 if ((object->instance >= PRUICCSS_INSTANCE_ONE) &&
827 { 793 (object->instance < PRUICCSS_INSTANCE_MAX))
828 baseaddr = hwAttrs->prussCfgRegBase;
829 }
830 if(object->instance == PRUICCSS_INSTANCE_TWO)
831 { 794 {
832 baseaddr = hwAttrs->prussCfgRegBase; 795 baseaddr = hwAttrs->prussCfgRegBase;
833 } 796 }
797
834 HW_WR_FIELD32((baseaddr + CSL_ICSSCFG_PIN_MX),CSL_ICSSCFG_PIN_MX_PIN_MUX_SEL, regVal); 798 HW_WR_FIELD32((baseaddr + CSL_ICSSCFG_PIN_MX),CSL_ICSSCFG_PIN_MX_PIN_MUX_SEL, regVal);
835} 799}
836 800
diff --git a/src/pruicss_intc.c b/src/pruicss_intc.c
index d681dd4..cc43410 100644
--- a/src/pruicss_intc.c
+++ b/src/pruicss_intc.c
@@ -137,11 +137,8 @@ int32_t PRUICSS_pruIntcInit(PRUICSS_Handle handle, const PRUICSS_IntcInitData *
137 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs; 137 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
138 baseaddr = hwAttrs->baseAddr; 138 baseaddr = hwAttrs->baseAddr;
139 139
140 if(object->instance == PRUICCSS_INSTANCE_ONE) 140 if ((object->instance >= PRUICCSS_INSTANCE_ONE) &&
141 { 141 (object->instance < PRUICCSS_INSTANCE_MAX))
142 baseaddr = hwAttrs->prussIntcRegBase;
143 }
144 else if(object->instance == PRUICCSS_INSTANCE_TWO )
145 { 142 {
146 baseaddr = hwAttrs->prussIntcRegBase; 143 baseaddr = hwAttrs->prussIntcRegBase;
147 } 144 }
@@ -508,7 +505,8 @@ int32_t PRUICSS_pruIntcClear(PRUICSS_Handle handle)
508 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs; 505 hwAttrs = (PRUICSS_HwAttrs const *)handle->hwAttrs;
509 506
510 /* verify the instance */ 507 /* verify the instance */
511 if ((object->instance == PRUICCSS_INSTANCE_ONE) || (object->instance == PRUICCSS_INSTANCE_TWO)) 508 if ((object->instance >= PRUICCSS_INSTANCE_ONE) &&
509 (object->instance < PRUICCSS_INSTANCE_MAX))
512 { 510 {
513 baseaddr = hwAttrs->prussIntcRegBase; 511 baseaddr = hwAttrs->prussIntcRegBase;
514 } 512 }