diff options
author | Stephen Molfetta | 2019-06-19 13:41:17 -0500 |
---|---|---|
committer | Mahesh Radhakrishnan | 2019-06-24 16:56:14 -0500 |
commit | c3af562c9b20a7bdbec5e0cabdac6170eadf60e7 (patch) | |
tree | 51ccda719ebf767a2f029ceaeb75e7d9feb691a9 | |
parent | c796152013ef7e7973ab98b0c9df6dc3af8002af (diff) | |
download | mcasp-lld-c3af562c9b20a7bdbec5e0cabdac6170eadf60e7.tar.gz mcasp-lld-c3af562c9b20a7bdbec5e0cabdac6170eadf60e7.tar.xz mcasp-lld-c3af562c9b20a7bdbec5e0cabdac6170eadf60e7.zip |
Converting C66x IntrRouter config to use SYSFW
-rw-r--r-- | example/j721e/src/audio_evmInit.c | 56 |
1 files changed, 18 insertions, 38 deletions
diff --git a/example/j721e/src/audio_evmInit.c b/example/j721e/src/audio_evmInit.c index b9345dd..2bb3500 100644 --- a/example/j721e/src/audio_evmInit.c +++ b/example/j721e/src/audio_evmInit.c | |||
@@ -112,53 +112,33 @@ void McASP_Enable(void); | |||
112 | #if defined (_TMS320C6X) | 112 | #if defined (_TMS320C6X) |
113 | void C66x_intrConfig(void) | 113 | void C66x_intrConfig(void) |
114 | { | 114 | { |
115 | CSL_IntrRouterCfg c66xIntrRouterCfg; | 115 | int32_t ret; |
116 | struct tisci_msg_rm_irq_set_req irqSetReq; | ||
117 | struct tisci_msg_rm_irq_set_resp irqSetResp; | ||
116 | 118 | ||
117 | /* | 119 | irqSetReq.valid_params = TISCI_MSG_VALUE_RM_DST_ID_VALID | |
118 | * The C66 INTR_ROUTER on J721E is not directly addressable by the | 120 | TISCI_MSG_VALUE_RM_DST_HOST_IRQ_VALID; |
119 | * C66 core itself, so we need to use the RAT. | 121 | irqSetReq.src_id = TISCI_DEV_TIMER0; |
120 | */ | ||
121 | CSL_ratRegs *C66x_RAT = (CSL_ratRegs *)CSL_C66_COREPAC_C66_RATCFG_BASE; | ||
122 | CSL_RatTranslationCfgInfo ratTranslationCfg; | ||
123 | 122 | ||
123 | /* src_index 0 for TIMER0 is intr_pend signal */ | ||
124 | irqSetReq.src_index = 0; | ||
125 | irqSetReq.dst_id = TISCI_DEV_C66SS0_CORE0; | ||
124 | 126 | ||
125 | /* Choose an arbitrary virtual address for intr_router RAT mapping and | 127 | /* On C66x builds we define OS timer tick in the configuration file to |
126 | * subsequent cfg space access below 0x10000000. | 128 | * trigger event #21 or #20 for C66x_1 or C66x_2, respectively. |
127 | */ | 129 | */ |
128 | uint32_t ratVa = 0xF0000000U; | ||
129 | vaOffset = ratVa; | ||
130 | |||
131 | /* C66x IntrRouter virtual address is now relative to the RAT VA base. */ | ||
132 | #if defined (BUILD_C66X_1) | 130 | #if defined (BUILD_C66X_1) |
133 | uint32_t C66x_IntrRouterVA = ratVa + CSL_C66_0_INTROUTER0_INTR_ROUTER_CFG_BASE; | 131 | irqSetReq.dst_host_irq = 21; |
134 | #elif defined (BUILD_C66X_2) | 132 | #elif defined (BUILD_C66X_2) |
135 | uint32_t C66x_IntrRouterVA = ratVa + CSL_C66_1_INTROUTER0_INTR_ROUTER_CFG_BASE; | 133 | irqSetReq.dst_host_irq = 20; |
136 | #endif | 134 | #endif |
137 | 135 | ||
138 | /* Assign interrupt router virtual address */ | 136 | ret = Sciclient_rmIrqSet(&irqSetReq, &irqSetResp, SCICLIENT_SERVICE_WAIT_FOREVER); |
139 | c66xIntrRouterCfg.pIntrRouterRegs = (CSL_intr_router_cfgRegs *)C66x_IntrRouterVA; | ||
140 | c66xIntrRouterCfg.pIntdRegs = NULL; | ||
141 | c66xIntrRouterCfg.numInputIntrs = 300U; | ||
142 | c66xIntrRouterCfg.numOutputIntrs = 96U; | ||
143 | 137 | ||
144 | /* Program virtual address to REGION_BASE */ | 138 | if (ret != CSL_PASS) |
145 | ratTranslationCfg.sizeInBytes = 0x10000000; | 139 | { |
146 | ratTranslationCfg.baseAddress = ratVa; | 140 | MCASP_log("Irq set failed\n"); |
147 | ratTranslationCfg.translatedAddress = 0x0; | 141 | } |
148 | |||
149 | CSL_ratConfigRegionTranslation(C66x_RAT, 0, &ratTranslationCfg); | ||
150 | |||
151 | /* On C66x builds we define OS timer tick in the configuration file to | ||
152 | * trigger event #21 or #20 for C66x_1 or C66x_2, respectively. C66x | ||
153 | * interrupt router outputs 11 and 10 map to C66x events 21 and 20. Map | ||
154 | * DMTimer 0 interrupt to these events (with implied +1 offsed to bit0 | ||
155 | * configuration defined for this Intr Router instance. | ||
156 | */ | ||
157 | #if defined (BUILD_C66X_1) | ||
158 | CSL_intrRouterCfgMux(&c66xIntrRouterCfg, CSLR_C66_0_INTROUTER0_IN_TIMER0_INTR_PEND_0 + 1, 11); | ||
159 | #elif defined (BUILD_C66X_2) | ||
160 | CSL_intrRouterCfgMux(&c66xIntrRouterCfg, CSLR_C66_1_INTROUTER0_IN_TIMER0_INTR_PEND_0 + 1, 10); | ||
161 | #endif | ||
162 | } | 142 | } |
163 | #endif | 143 | #endif |
164 | #endif | 144 | #endif |