From f6d74fb237317f082783ee5cd88502c4e89ed3c3 Mon Sep 17 00:00:00 2001 From: Angela Stegmaier Date: Wed, 4 Sep 2013 16:00:45 -0500 Subject: [PATCH] QNX IPC: OMAP5 - Enable DSP-MMU Fault Recovery Add the DSP MMU interrupt to listen for DSP-MMU faults. Also fix a bug where the shm_phys_addr_dsp was not being properly reset to 0, resulting in recovery failing to happen properly. Signed-off-by: Angela Stegmaier Signed-off-by: VW --- .../family/omap5430/ipu/omap5430BenelliEnabler.c | 1 + .../family/omap5430/ipu/omap5430BenelliHalMmu.c | 15 ++++++++++++--- .../family/omap5430/ipu/omap5430BenelliProc.c | 6 ++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliEnabler.c b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliEnabler.c index ce0efa5..2801205 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliEnabler.c +++ b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliEnabler.c @@ -1937,6 +1937,7 @@ Void ipu_destroy(OMAP5430BENELLI_HalObject * halObject) deinit_mmu_page_attribs(); } else if (halObject->procId == PROCTYPE_DSP) { + shm_phys_addr_dsp = 0; deinit_dsp_mmu_page_attribs(); } } diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliHalMmu.c b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliHalMmu.c index 2721886..78307b6 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliHalMmu.c +++ b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliHalMmu.c @@ -102,6 +102,7 @@ extern "C" { * @brief Interrupt Id for DSP MMU faults */ #define MMU_FAULT_INTERRUPT 132 +#define MMU_FAULT_INTERRUPT_DSP 60 /*! * @brief Size constants @@ -394,8 +395,10 @@ _OMAP5430BENELLI_halMmuCheckAndClearFunc (Ptr arg) mmuObj->mmuFaultAddr = REG32(halObject->mmuBase + MMU_MMU_FAULT_AD_OFFSET); /* Print the fault information */ - GT_0trace (curTrace, GT_4CLASS, - "**************** Benelli-MMU Fault ****************"); + GT_1trace (curTrace, GT_4CLASS, + "**************** %s-MMU Fault ****************", + MultiProc_getName(halObject->procId)); + GT_1trace (curTrace, GT_4CLASS, "**** addr: 0x%x", mmuObj->mmuFaultAddr); if (mmuObj->mmuIrqStatus & MMU_IRQ_TLBMISS) @@ -478,7 +481,13 @@ _OMAP5430BENELLI_halMmuEnable (OMAP5430BENELLI_HalObject * halObject, isrParams.sharedInt = FALSE; isrParams.checkAndClearFxn = &_OMAP5430BENELLI_halMmuCheckAndClearFunc; isrParams.fxnArgs = halObject; - isrParams.intId = MMU_FAULT_INTERRUPT; + if (halObject->procId == MultiProc_getId("DSP")) { + isrParams.intId = MMU_FAULT_INTERRUPT_DSP; + } + else { + isrParams.intId = MMU_FAULT_INTERRUPT; + } + mmuObj->isrHandle = OsalIsr_create (&_OMAP5430BENELLI_halMmuInt_isr, halObject, &isrParams); diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliProc.c b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliProc.c index 1193dc8..88b1e69 100644 --- a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliProc.c +++ b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliProc.c @@ -1241,7 +1241,8 @@ OMAP5430BENELLIPROC_attach (Processor_Handle handle, " OMAP5430BENELLIPROC_attach: Slave is now " "in reset!"); - if (procHandle->procId == PROCTYPE_IPU0) { + if (procHandle->procId == PROCTYPE_IPU0 || + procHandle->procId == PROCTYPE_DSP) { /* Enable MMU */ GT_0trace (curTrace, GT_2CLASS, @@ -1333,7 +1334,8 @@ OMAP5430BENELLIPROC_detach (Processor_Handle handle) if ( (procHandle->bootMode == ProcMgr_BootMode_Boot) || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)) { - if (procHandle->procId == PROCTYPE_IPU0) { + if (procHandle->procId == PROCTYPE_IPU0 || + procHandle->procId == PROCTYPE_DSP) { /* Disable MMU */ GT_0trace (curTrace, GT_2CLASS, -- 2.39.2