aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuddy Liong2016-02-22 09:08:29 -0600
committerBuddy Liong2016-02-29 13:48:19 -0600
commit80c81818233cf52667731d7837d0c85331a59ff3 (patch)
tree4ef17d783496626da02c160c55e252f656d697f6
parent7b47c8b5ea2c08508f62f716e1905a0fa4ab99ba (diff)
downloadipumm-80c81818233cf52667731d7837d0c85331a59ff3.tar.gz
ipumm-80c81818233cf52667731d7837d0c85331a59ff3.tar.xz
ipumm-80c81818233cf52667731d7837d0c85331a59ff3.zip
Before IPU2 crashed, performs crash_reset to reset IVA-HD
When BIOS detected a crash, adding a callback into System.abortFxn to call crash_reset. In crash_reset, it will perform clean up and release the IVA subsystem resets by asserting reset for RST_LOGIC (IVA Logic and SL2), RST_SEQ2 (IVA Sequencer CPU2) and RST_SEQ1 (IVA Sequencer CPU1). When IPU comes back up, ivahd_init() will perform the iva_boot(). The RM_IVA_RSTCTRL will be the same as when it is power on boot. Change-Id: Ice1b0a318fd00a3a88cbd5ce0cf1c54130823c4c Signed-off-by: Buddy Liong <a0270631@ti.com>
-rw-r--r--platform/ti/configs/omap54xx/IpcCommon.cfg.xs1
-rw-r--r--platform/ti/configs/vayu/IpcCommon.cfg.xs1
-rw-r--r--src/ti/framework/dce/ivahd.c62
3 files changed, 62 insertions, 2 deletions
diff --git a/platform/ti/configs/omap54xx/IpcCommon.cfg.xs b/platform/ti/configs/omap54xx/IpcCommon.cfg.xs
index a322b0c..28c90cd 100644
--- a/platform/ti/configs/omap54xx/IpcCommon.cfg.xs
+++ b/platform/ti/configs/omap54xx/IpcCommon.cfg.xs
@@ -38,6 +38,7 @@ var System = xdc.useModule('xdc.runtime.System');
38var SysMin = xdc.useModule('ti.trace.SysMin'); 38var SysMin = xdc.useModule('ti.trace.SysMin');
39System.SupportProxy = SysMin; 39System.SupportProxy = SysMin;
40SysMin.bufSize = 0x8000; 40SysMin.bufSize = 0x8000;
41System.abortFxn = "&crash_reset";
41 42
42/* Define default memory heap properties */ 43/* Define default memory heap properties */
43var Memory = xdc.useModule('xdc.runtime.Memory'); 44var Memory = xdc.useModule('xdc.runtime.Memory');
diff --git a/platform/ti/configs/vayu/IpcCommon.cfg.xs b/platform/ti/configs/vayu/IpcCommon.cfg.xs
index 5fcccf4..c70bdc5 100644
--- a/platform/ti/configs/vayu/IpcCommon.cfg.xs
+++ b/platform/ti/configs/vayu/IpcCommon.cfg.xs
@@ -38,6 +38,7 @@ var System = xdc.useModule('xdc.runtime.System');
38var SysMin = xdc.useModule('ti.trace.SysMin'); 38var SysMin = xdc.useModule('ti.trace.SysMin');
39System.SupportProxy = SysMin; 39System.SupportProxy = SysMin;
40SysMin.bufSize = 0x8000; 40SysMin.bufSize = 0x8000;
41System.abortFxn = "&crash_reset";
41 42
42/* Define default memory heap properties */ 43/* Define default memory heap properties */
43var Memory = xdc.useModule('xdc.runtime.Memory'); 44var Memory = xdc.useModule('xdc.runtime.Memory');
diff --git a/src/ti/framework/dce/ivahd.c b/src/ti/framework/dce/ivahd.c
index 1262ff5..6d74646 100644
--- a/src/ti/framework/dce/ivahd.c
+++ b/src/ti/framework/dce/ivahd.c
@@ -223,6 +223,8 @@ void ivahd_boot(void)
223 while(((CM_IVAHD_CLKSTCTRL) & 0x100) & ~0x100 ) { 223 while(((CM_IVAHD_CLKSTCTRL) & 0x100) & ~0x100 ) {
224 ; 224 ;
225 } 225 }
226
227 DEBUG("ivahd_boot() CM_IVAHD_CLKCTRL 0x%x CM_IVAHD_CLKSTCTRL 0x%x", CM_IVAHD_CLKCTRL, CM_IVAHD_CLKSTCTRL);
226} 228}
227 229
228int ivahd_reset(void *handle, void *iresHandle) 230int ivahd_reset(void *handle, void *iresHandle)
@@ -231,7 +233,8 @@ int ivahd_reset(void *handle, void *iresHandle)
231 * Reset IVA HD, SL2 and ICONTs 233 * Reset IVA HD, SL2 and ICONTs
232 */ 234 */
233 235
234 DEBUG("Resetting IVAHD..."); 236 DEBUG("Resetting IVAHD START CM_IVAHD_CLKCTRL 0x%x CM_IVAHD_CLKSTCTRL 0x%x", CM_IVAHD_CLKCTRL, CM_IVAHD_CLKSTCTRL);
237
235 238
236 /* First put IVA into HW Auto mode */ 239 /* First put IVA into HW Auto mode */
237 CM_IVAHD_CLKSTCTRL |= 0x00000003; 240 CM_IVAHD_CLKSTCTRL |= 0x00000003;
@@ -245,7 +248,7 @@ int ivahd_reset(void *handle, void *iresHandle)
245 CM_IVAHD_CLKCTRL = 0x00000000; 248 CM_IVAHD_CLKCTRL = 0x00000000;
246 CM_IVAHD_SL2_CLKCTRL = 0x00000000; 249 CM_IVAHD_SL2_CLKCTRL = 0x00000000;
247 250
248 /* Ensure that IVAHD and SL2 are disabled */ 251 /* Ensure that IVAHD and SL2 are enabled */
249 while( !(CM_IVAHD_CLKCTRL & 0x00030000)) { 252 while( !(CM_IVAHD_CLKCTRL & 0x00030000)) {
250 ; 253 ;
251 } 254 }
@@ -254,6 +257,21 @@ int ivahd_reset(void *handle, void *iresHandle)
254 ; 257 ;
255 } 258 }
256 259
260 /* Precondition - TRM DRA7xx Sec. 3.5.6.5 IVA Subsystem Software Warm Reset Sequence
261 * 1. IVA Sequencer CPUS are in IDLE state: CM_IVAHD_CLKCTRL[17:16] IDLEST - has a value 0x2.
262 * 2. IVA subsystem is in STANDBY state: CM_IVAHD_CLKCTRL[18] STBYST - has a value of 0x1.
263 */
264 while( !(CM_IVAHD_CLKCTRL & 0x00060000) ) {
265 ;
266 }
267
268 /* 3. The functional clock to the IVA subsystem has been gated by the PRCM module
269 * CM_IVA_CLKSTCTRL[8] - has a value of 0x0
270 */
271 while( CM_IVAHD_CLKSTCTRL & 0x100) {
272 ;
273 }
274
257 /* Reset IVAHD sequencers and SL2 */ 275 /* Reset IVAHD sequencers and SL2 */
258 RM_IVAHD_RSTCTRL |= 0x00000007; 276 RM_IVAHD_RSTCTRL |= 0x00000007;
259 277
@@ -288,9 +306,49 @@ int ivahd_reset(void *handle, void *iresHandle)
288 ; 306 ;
289 } 307 }
290 308
309 DEBUG("Resetting IVAHD COMPLETED");
291 return (TRUE); 310 return (TRUE);
292} 311}
293 312
313void crash_reset() {
314 ERROR("Received crash_reset");
315
316 IRES_Status ret;
317
318 /* RMAN_unregister IRESMAN_TILEDMEMORY */
319 ret = RMAN_unregister(&IRESMAN_TILEDMEMORY);
320 if( ret != IRES_OK ) {
321 ERROR("RMAN_unregister on IRESMAN_TILEDMEMORY fail with ret %d", ret);
322 }
323
324 /* RMAN_unregister IRESMAN_HDVICP */
325 ret = RMAN_unregister(&IRESMAN_HDVICP);
326 if( ret != IRES_OK ) {
327 ERROR("RMAN_unregister on IRESMAN_HDVICP fail with ret %d", ret);
328 }
329
330 /* RMAN_exit */
331 ret = RMAN_exit();
332 if( ret != IRES_OK ) {
333 ERROR("RMAN_exit fail with ret %d", ret);
334 }
335
336 CERuntime_exit();
337
338 ERROR("crash_reset() CM_IVAHD_CLKCTRL 0x%x CM_IVAHD_CLKSTCTRL 0x%x", CM_IVAHD_CLKCTRL, CM_IVAHD_CLKSTCTRL);
339
340 if( CM_IVAHD_CLKSTCTRL & 0x100 ) {
341 ERROR("crash_report detects IVA_GCLK is running or gate transition on-going");
342 }
343
344 /* RESET RST_LOGIC, RST_SEQ2, and RST_SEQ1 before crashing */
345 RM_IVAHD_RSTCTRL = 0x00000007;
346
347 ERROR("crash_reset() RM_IVAHD_RSTCTRL 0x%x - calling abort NOW", RM_IVAHD_RSTCTRL);
348 abort();
349}
350
351
294static int ivahd_use_cnt = 0; 352static int ivahd_use_cnt = 0;
295 353
296#ifdef ENABLE_DEAD_CODE 354#ifdef ENABLE_DEAD_CODE