summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb45164)
raw | patch | inline | side by side (parent: fb45164)
author | vwan@ti.com <vwan@ti.com> | |
Sat, 23 Nov 2013 01:03:28 +0000 (17:03 -0800) | ||
committer | Chris Ring <cring@ti.com> | |
Thu, 5 Dec 2013 23:05:24 +0000 (15:05 -0800) |
This is to address SDOCM00101830.
Signed-off-by: VW <vwan@ti.com>
Signed-off-by: VW <vwan@ti.com>
69 files changed:
diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/lib/common.mk b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/lib/common.mk
index 2e8daa843ccb5dedc6036185ab4ee0e7c3f7a3cb..a19b51b32271518c6ebf945223f6c2356341473c 100644 (file)
#To override the TRACE flag
SYSLINK_TRACE_ENABLE := 0
-ifeq ("$(SYSLINK_PLATFORM)", "")
-#default value
-SYSLINK_PLATFORM=omap4430
-endif # ifeq ("$(SYSLINK_PLATFORM)", "")
-
-ifeq ("$(SYSLINK_PLATFORM)", "omap4430")
-CCOPTS += -DSYSLINK_PLATFORM_OMAP4430
-endif # ifeq ("$(SYSLINK_PLATFORM)", "omap4430")
ifeq ("$(SYSLINK_PLATFORM)", "omap5430")
CCOPTS += -DSYSLINK_PLATFORM_OMAP5430
endif # ifeq ("$(SYSLINK_PLATFORM)", "omap5430")
diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/common.mk b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/common.mk
index 3adc25bcbc7ec0e4feb76de7a65a99f3d20339d2..0de8f9e8bf109ae6b0cff40d2b320e098621999f 100644 (file)
CCOPTS += -g -O0
endif # ifeq ("$(SYSLINK_DEBUG)", "1")
-ifeq ("$(SYSLINK_PLATFORM)", "")
-#default value
-SYSLINK_PLATFORM=omap4430
-endif # ifeq ("$(SYSLINK_PLATFORM)", "")
-
-ifeq ("$(SYSLINK_PLATFORM)", "omap4430")
-CCOPTS += -DSYSLINK_PLATFORM_OMAP4430 -DARM_TARGET -DC60_TARGET -DSYSLINK_USE_IPU_PM
-endif # ifeq ("$(SYSLINK_PLATFORM)", "omap4430")
-
ifeq ("$(SYSLINK_PLATFORM)", "omap5430")
ifeq ("$(VIRTIO)", "true")
CCOPTS += -DOMAP5430_VIRTIO
CCOPTS += -DSYSLINK_PLATFORM_OMAP5430 -DARM_TARGET -DC60_TARGET -DSYSLINK_USE_IPU_PM
endif # ifeq ("$(SYSLINK_PLATFORM)", "omap5430")
-ifeq ("$(SYSLINK_PLATFORM)", "ti81xx")
-CCOPTS += -DSYSLINK_PLATFORM_TI81XX -DARM_TARGET -DC60_TARGET
-
-ifeq ("$(SYSLINK_VARIANT)", "TI814X")
-CCOPTS += -DSYSLINK_VARIANT_TI814X
-endif
-
-ifeq ("$(SYSLINK_VARIANT)", "TI811X")
-CCOPTS += -DSYSLINK_VARIANT_TI811X
-endif
-
-endif # ifeq ("$(SYSLINK_PLATFORM)", "ti81xx")
-
ifeq ("$(SYSLINK_PLATFORM)", "vayu")
ifeq ("$(VIRTIO)", "true")
CCOPTS += -DVAYU_VIRTIO
$(SYSLINK_ROOT)/ti/syslink/rpmsg-resmgr/hlos/knl/$(SYSLINK_BUILDOS)/family/$(SYSLINK_PLATFORM) \
$(SYSLINK_ROOT)/ti/syslink/rpmsg-resmgr/hlos/knl/$(SYSLINK_BUILDOS)
-ifeq ("$(SYSLINK_PLATFORM)", "omap4430")
-EXTRA_SRCVPATH+=$(SYSLINK_ROOT)/ti/syslink/family/$(SYSLINK_PLATFORM) \
- $(SYSLINK_ROOT)/ti/syslink/family/$(SYSLINK_PLATFORM)/ipu
-endif
-
ifeq ("$(SYSLINK_PLATFORM)", "omap5430")
EXTRA_SRCVPATH+=$(SYSLINK_ROOT)/ti/syslink/family/$(SYSLINK_PLATFORM) \
$(SYSLINK_ROOT)/ti/syslink/family/$(SYSLINK_PLATFORM)/ipu
EXCLUDE_OBJS = GateMP_daemon.o gatemp_devctl.o
endif
-ifeq ("$(SYSLINK_PLATFORM)", "ti81xx")
-EXTRA_SRCVPATH+=$(SYSLINK_ROOT)/ti/syslink/family/common \
- $(SYSLINK_ROOT)/ti/syslink/family/common/$(SYSLINK_PLATFORM)/$(SYSLINK_PLATFORM)dsp \
- $(SYSLINK_ROOT)/ti/syslink/family/common/$(SYSLINK_PLATFORM)/$(SYSLINK_PLATFORM)ducati \
- $(SYSLINK_ROOT)/ti/syslink/family/common/$(SYSLINK_PLATFORM)/$(SYSLINK_PLATFORM)ducati/$(SYSLINK_PLATFORM)videom3 \
- $(SYSLINK_ROOT)/ti/syslink/family/common/$(SYSLINK_PLATFORM)/$(SYSLINK_PLATFORM)ducati/$(SYSLINK_PLATFORM)vpssm3 \
- $(SYSLINK_ROOT)/ti/syslink/family/hlos/knl/$(SYSLINK_PLATFORM) \
- $(SYSLINK_ROOT)/ti/syslink/family/hlos/knl/$(SYSLINK_PLATFORM)/Qnx \
- $(SYSLINK_ROOT)/ti/syslink/family/hlos/knl/$(SYSLINK_PLATFORM)/$(SYSLINK_PLATFORM)dsp \
- $(SYSLINK_ROOT)/ti/syslink/family/hlos/knl/$(SYSLINK_PLATFORM)/$(SYSLINK_PLATFORM)ducati/$(SYSLINK_PLATFORM)videom3 \
- $(SYSLINK_ROOT)/ti/syslink/family/hlos/knl/$(SYSLINK_PLATFORM)/$(SYSLINK_PLATFORM)ducati/$(SYSLINK_PLATFORM)vpssm3
-endif
-
ifeq ("$(SYSLINK_PLATFORM)", "vayu")
EXTRA_SRCVPATH+=$(SYSLINK_ROOT)/ti/syslink/family/common \
$(SYSLINK_ROOT)/ti/syslink/family/common/$(SYSLINK_PLATFORM)/$(SYSLINK_PLATFORM)dsp \
EXTRA_LIBVPATH += $(IPC_REPO)/qnx/src/utils/arm/a.le.v7
LIBS += utils
endif # ifeq ("$(SYSLINK_DEBUG)", "1")
-
-ifeq ("$(SYSLINK_PLATFORM)", "omap4430")
-LIBS += powman camdrv login slog2
-endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c
index 182d1873ec37000fe49ac07875a47329852b52bd..aeda4ebedd31f0415cb51aa923e647b79550338d 100644 (file)
#include <sys/siginfo.h>
#include <signal.h>
#include <stdbool.h>
-#if defined(SYSLINK_PLATFORM_OMAP4430)
-#include <login.h>
-#endif
#include <IpcKnl.h>
#include <_GateMP_daemon.h>
#include <OsalSemaphore.h>
#include <ti/syslink/utils/OsalPrint.h>
-#if defined(SYSLINK_PLATFORM_OMAP4430) || defined(SYSLINK_PLATFORM_OMAP5430)
+#if defined(SYSLINK_PLATFORM_OMAP5430)
#include <_ipu_pm.h>
#endif
#include <ti/syslink/utils/Trace.h>
// Syslink hibernation global variables
Bool syslink_hib_enable = TRUE;
-#if !defined(SYSLINK_PLATFORM_OMAP4430) && !defined(SYSLINK_PLATFORM_OMAP5430)
+#if !defined(SYSLINK_PLATFORM_OMAP5430)
#define PM_HIB_DEFAULT_TIME 5000
#endif
uint32_t syslink_hib_timeout = PM_HIB_DEFAULT_TIME;
return ret;
}
-#if defined(SYSLINK_PLATFORM_OMAP4430)
-#define SYSLINK_CARVEOUT
-#ifdef SYSLINK_CARVEOUT
-#define IPU_MEM_SIZE 49 * 1024 * 1024
-#define IPU_MEM_PHYS 0x97F00000
-#else
-#define IPU_MEM_SIZE 104 * 1024 * 1024
-#define IPU_MEM_ALIGN 0x1000000
-#endif
-#endif
-
-
/*
* Initialize the syslink ipc
*
int init_ipc(syslink_dev_t * dev, syslink_firmware_info * firmware, bool recover)
{
int status = 0;
-#if defined(SYSLINK_PLATFORM_OMAP4430)
- int32_t ret = 0;
- uint32_t len = 0;
-#ifndef SYSLINK_CARVEOUT
- int64_t pa = 0;
- void * da;
-#endif
- int64_t paddr = 0;
-#endif
Ipc_Config iCfg;
OsalThread_Params threadParams;
ProcMgr_AttachParams attachParams;
UInt16 procId;
int i;
-#if defined(SYSLINK_PLATFORM_OMAP4430)
- /* Map a contiguous memory section for ipu - currently hard-coded */
- if (!recover) {
-#ifdef SYSLINK_CARVEOUT
- dev->da_virt = mmap64(NULL, IPU_MEM_SIZE,
- PROT_NOCACHE | PROT_READ | PROT_WRITE,
- MAP_PHYS,
- NOFD,
- IPU_MEM_PHYS);
-#else
- dev->da_virt = mmap64(NULL, IPU_MEM_SIZE + IPU_MEM_ALIGN,
- PROT_NOCACHE | PROT_READ | PROT_WRITE,
- MAP_ANON | MAP_PHYS | MAP_SHARED,
- NOFD,
- 0);
-
-#endif
-
- if (dev->da_virt == MAP_FAILED) {
- status = ENOMEM;
- goto exit;
- }
- }
-
- if (status >= 0) {
-#ifdef SYSLINK_CARVEOUT
- /* Make sure the memory is contiguous */
- ret = mem_offset64(dev->da_virt, NOFD, IPU_MEM_SIZE, &paddr, &len);
- if (ret)
- status = ret;
- else if (len != IPU_MEM_SIZE)
- status = ENOMEM;
-#else
- /* Make sure the memory is contiguous */
- ret = mem_offset64(dev->da_virt, NOFD, IPU_MEM_SIZE + IPU_MEM_ALIGN,
- &paddr, &len);
- if (ret)
- status = ret;
- else if (len != IPU_MEM_SIZE + IPU_MEM_ALIGN)
- status = ENOMEM;
- else {
- pa = (paddr + IPU_MEM_ALIGN - 1) / IPU_MEM_ALIGN * IPU_MEM_ALIGN;
- if ((pa - paddr) < 0x900000)
- pa += 0x900000;
- else
- pa -= 0x700000;
- da = dev->da_virt + (pa - paddr);
- }
-#endif
- if (status != 0)
- goto memoryos_fail;
- }
-#endif
-
if (status >= 0) {
if (!recover) {
/* Set up the MemoryOS module */
@@ -634,15 +556,6 @@ int init_ipc(syslink_dev_t * dev, syslink_firmware_info * firmware, bool recover
}
/* Setup IPC and platform-specific items */
-#if defined(SYSLINK_PLATFORM_OMAP4430)
-#ifdef SYSLINK_CARVEOUT
- iCfg.vAddr = (uint32_t)dev->da_virt;
- iCfg.pAddr = (uint32_t)paddr;
-#else
- iCfg.vAddr = (uint32_t)da;
- iCfg.pAddr = (uint32_t)pa;
-#endif
-#endif
status = Ipc_setup (&iCfg);
if (status < 0)
goto ipcsetup_fail;
ipcsetup_fail:
MemoryOS_destroy();
memoryos_fail:
-#if defined(SYSLINK_PLATFORM_OMAP4430)
- if (dev->da_virt != MAP_FAILED)
-#ifdef SYSLINK_CARVEOUT
- munmap(dev->da_virt, IPU_MEM_SIZE);
-#else
- munmap(dev->da_virt, IPU_MEM_SIZE + IPU_MEM_ALIGN);
-#endif
-#endif
exit:
return status;
}
if (status < 0) {
printf("MemoryOS_destroy() failed 0x%x", status);
}
-#if defined(SYSLINK_PLATFORM_OMAP4430)
- if (dev->da_virt != MAP_FAILED) {
-#ifdef SYSLINK_CARVEOUT
- status = munmap(dev->da_virt, IPU_MEM_SIZE);
-#else
- status = munmap(dev->da_virt, IPU_MEM_SIZE + IPU_MEM_ALIGN);
-#endif
- if (status < 0) {
- printf("munmap failed %d", errno);
- }
- }
-#endif
}
return status;
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ClockOps.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ClockOps.c
index dab0536bf2b7ecd0830deb0a00c43768abf6b3ed..cb449f57b4bbca6def26e4b2249c1e04cf2bd02c 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
+ * Copyright (c) 2008-2013, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#include <sys/mman.h>
#include <hw/inout.h>
-#include <ti/syslink/inc/Dm8168Clock.h>
//#include <ti/syslink/inc/ClockOps.h>
#include <ti/syslink/utils/Trace.h>
#include <ti/syslink/utils/String.h>
UInt32 refDSP = 0;
UInt32 refDucati = 0;
-/* =============================================================================
- * APIs called by DM8168VIDEOM3PROC module
- * =============================================================================
- */
/*!
* @brief Function returns the clock handle .
*
* @clkHandle clk handle returned to corresponding clk name
* @clkname name of clk for which handle is to be obtained
*
- * @sa DM8168CLOCK_put
*/
Ptr
ClockOps_get (ClockOps_Handle handle, String clkName)
* @clkHandle clk handle returned to corresponding clk name
* @clkname name of clk for which handle is to be obtained
*
- * @sa DM8168CLOCK_put
*/
Void
ClockOps_put(ClockOps_Handle handle, Ptr clkHandle)
Int32
ClockOps_enable(ClockOps_Handle handle, Ptr clkHandle)
{
-#if defined(SYSLINK_PLATFORM_TI81XX)
- switch ((UInt32)clkHandle){
-
- case SPINBOX:
- if (refSpinCount == 0) {
- /*Enable Clock to SPIN box*/
- prcm_enable(0, PRCM_BASE_ADDR+CM_ALWON_SPINBOX_CLKCTRL, 0 , 2, 0x0, 0x100, TRUE, FALSE);
- refSpinCount++;
- }
- else if(refSpinCount > 0) {
- refSpinCount++;
- }
- else {
- /* refSpinCount should not be less than zero */
- }
- break;
- case MAILBOX:
- if (refMboxCount == 0) {
- /*Enable Clock to mail box*/
- prcm_enable(0, PRCM_BASE_ADDR+CM_ALWON_MAILBOX_CLKCTRL, 0 , 2, 0x0, 0x100, TRUE, FALSE);
- refMboxCount++;
- }
- else if(refMboxCount > 0) {
- refMboxCount++;
- }
- else {
- /* refMboxCount should not be less than zero */
- }
- break;
- case IGPTIMER4:
- if (refGptimer4ick == 0) {
- prcm_enable(PRCM_BASE_ADDR+CM_ALWON_L3_SLOW_CLKSTCTRL , PRCM_BASE_ADDR+CM_ALWON_TIMER_4_CLKCTRL, 2, 2, 0x0, 0x100, TRUE, TRUE);
- refGptimer4ick++;
- }
- else if(refGptimer4ick > 0) {
- refGptimer4ick++;
- }
- else {
- /* refGptimer4ick should not be less than zero */
- }
- break;
- case FGPTIMER4:
- if (refGptimer4fck == 0) {
-#ifdef CLOCK_FIX
- uintptr_t sysclk18ClksrcPtr = REMAP(SYSCLK18_CLKSRC);
- uintptr_t clkselPtr = REMAP(CM_DPLL_SYSCLK18_CLKSEL);
- uintptr_t dmtimerClksrcPtr = REMAP(DMTIMER_CLKSRC);
-
- /* CLKIN32/RTCDIVIDER multiplexor */
- REGRDMWR(sysclk18ClksrcPtr, 0xFFFFFFFE, 0);
-
- /* sysclk18 */
- REGRDMWR(clkselPtr, 0xFFFFFFFE, 0);
-
- /* timer4 */
- REGRDMWR(dmtimerClksrcPtr, 0xFFF8FFFF, 0);
-
- UNMAP(sysclk18ClksrcPtr);
- UNMAP(clkselPtr);
- UNMAP(dmtimerClksrcPtr);
-#endif
- refGptimer4fck++;
- }
- else if(refGptimer4fck > 0) {
- refGptimer4fck++;
- }
- else {
- /* refGptimer4fck should not be less than zero */
- }
- break;
- case MMU:
- /* required config is done as a part of the case DSP */
- break;
- case MMUCFG:
- /* required config is done as a part of the case DSP */
- break;
- case DSP:
- if (refDSP == 0) {
- GEMSSClkEnable();
- refDSP++;
- }
- break;
- case DUCATI:
- if (refDucati == 0) {
- DucatiClkEnable();
- refDucati++;
- }
- break;
- default:
- break;
-
- }
-#endif
return 1;
}
/*!
Void
ClockOps_disable(ClockOps_Handle handle, Ptr clkHandle)
{
-#if defined(SYSLINK_PLATFORM_TI81XX)
- switch ((UInt32)clkHandle){
-
- case SPINBOX:
- /*disable Clock to SPIN box*/
- if (refSpinCount == LAST_CORE) {
- prcm_disable_spinbox();
- refSpinCount = 0;
- }
- else if(refSpinCount > LAST_CORE) {
- refSpinCount--;
- }
- else {
- /* refSpinCount is less that or equal to zero */
- }
- break;
- case MAILBOX:
- /*disable Clock to MAIL box*/
- if (refMboxCount == LAST_CORE) {
- prcm_disable_mailbox();
- refMboxCount = 0;
- }
- else if(refMboxCount > LAST_CORE) {
- refMboxCount--;
- }
- else {
- /* refMboxCount is less that or equal to zero */
- }
- break;
- case IGPTIMER4:
- if ( refGptimer4ick == LAST_CORE) {
- prcm_disable_gptimer4();
- refGptimer4ick = 0;
- refGptimer4fck = 0;
- }
- else if(refGptimer4ick > LAST_CORE) {
- refGptimer4ick--;
- }
- else {
- /* refGptimer4ick is less that or equal to zero */
- }
- break;
- case FGPTIMER4:
- break;
- case MMU:
- break;
- case MMUCFG:
- break;
- case DSP:
- if (refDSP > 0 ) {
- GEMSSClkDisable();
- refDSP = 0;
- }
- break;
- case DUCATI:
- if (refDucati > 0) {
- DucatiClkDisable();
- refDucati = 0;
- }
- break;
- default:
- break;
-
- }
-#endif
}
/*!
void PLL_Clocks_Config(UInt32 Base_Address,UInt32 OSC_FREQ,UInt32 N,UInt32 M,UInt32 M2,UInt32 CLKCTRL_VAL)
{
-#if defined(SYSLINK_PLATFORM_TI81XX)
- UInt32 m2nval,mn2val,read_clkctrl;
- Int32 i = 0;
-
- uintptr_t m2ndivPtr = REMAP(Base_Address+M2NDIV);
- uintptr_t mn2divPtr = REMAP(Base_Address+MN2DIV);
- uintptr_t tenabledivPtr = REMAP(Base_Address+TENABLEDIV);
- uintptr_t tenablePtr = REMAP(Base_Address+TENABLE);
- uintptr_t clkctrlPtr = REMAP(Base_Address+CLKCTRL);
- uintptr_t statusPtr = REMAP(Base_Address+STATUS);
-
- m2nval = (M2<<16) | N;
- mn2val = M;
-
- REGWR(m2ndivPtr, m2nval);
- REGWR(mn2divPtr, mn2val);
- REGWR(tenabledivPtr, 0x1);
- REGWR(tenabledivPtr, 0x0);
- REGWR(tenablePtr, 0x1);
- REGWR(tenablePtr, 0x0);
-
- read_clkctrl = REGRD(clkctrlPtr);
-
- //configure the TINITZ(bit0) and CLKDCO BITS IF REQUIRED
- REGWR(clkctrlPtr, ((read_clkctrl & 0xff7fe3ff) | CLKCTRL_VAL));
-
- read_clkctrl = REGRD(clkctrlPtr);
-
- // poll for the freq,phase lock to occur
- while ((REGRD(statusPtr) & 0x00000600) != 0x00000600);
-
- //wait fot the clocks to get stabized
- for (i = 0; i <1000; i++)
- {
- ;
- }
-
- UNMAP(m2ndivPtr);
- UNMAP(mn2divPtr);
- UNMAP(tenabledivPtr);
- UNMAP(tenablePtr);
- UNMAP(clkctrlPtr);
- UNMAP(statusPtr);
-#endif
-}
-
-#if defined(SYSLINK_PLATFORM_TI81XX)
-void prcm_enable(UInt32 clkstctrl, UInt32 clkctrl, UInt32 regVal1, UInt32 regVal2, UInt32 cmpVal1, UInt32 cmpVal2, UInt32 wait1, UInt32 wait2){
- uintptr_t clkstctrlPtr = REMAP(PRCM_BASE_ADDR+CM_GEM_CLKSTCTRL);
-
- if (clkstctrl != 0) {
- uintptr_t clkstctrlArgPtr = REMAP(clkstctrl);
-
- /*reg write using out */
- REGWR(clkstctrlArgPtr, regVal1);
-
- UNMAP(clkstctrlArgPtr);
- }
-
- if (clkstctrl == REGRD(clkstctrlPtr)) {
- uintptr_t pwrststPtr = REMAP(PRCM_BASE_ADDR+PM_ACTIVE_PWRSTST);
- while (REGRD(pwrststPtr)!= 0x37); /*Check Power is ON*/
- UNMAP(pwrststPtr);
- }
- UNMAP(clkstctrlPtr);
-
- if (clkctrl != 0) {
- /*reg write using out */
- uintptr_t clkctrlArgPtr = REMAP(clkctrl);
- REGWR(clkctrlArgPtr, regVal2);
- UNMAP(clkctrlArgPtr);
- }
-
- if (wait1) {
- uintptr_t clkctrlArgPtr = REMAP(clkctrl);
- while ((REGRD(clkctrlArgPtr)&cmpVal1)!=cmpVal1);
- UNMAP(clkctrlArgPtr);
- }
-
- if (wait2) {
- uintptr_t clkstctrlArgPtr = REMAP(clkstctrl);
- while ((REGRD(clkstctrlArgPtr)&cmpVal2)!=cmpVal2);
- UNMAP(clkstctrlArgPtr);
- }
-}
-
-void prcm_disable_spinbox(void){
- uintptr_t clkctrlPtr = REMAP(PRCM_BASE_ADDR+CM_ALWON_SPINBOX_CLKCTRL);
- REGRDMWR(clkctrlPtr, 0xFFFFFFFD, 0);
- UNMAP(clkctrlPtr);
-}
-
-void prcm_disable_mailbox(void){
- uintptr_t clkctrlPtr = REMAP(PRCM_BASE_ADDR+CM_ALWON_MAILBOX_CLKCTRL);
- REGRDMWR(clkctrlPtr, 0xFFFFFFFD, 0);
- UNMAP(clkctrlPtr);
-}
-
-void prcm_disable_gptimer4(void){
- uintptr_t clkctrlPtr = REMAP(PRCM_BASE_ADDR+CM_ALWON_TIMER_4_CLKCTRL);
- uintptr_t clkstctrlPtr = REMAP(PRCM_BASE_ADDR+CM_ALWON_L3_SLOW_CLKSTCTRL);
-
- REGRDMWR(clkctrlPtr, 0xFFFFFFFD, 0);
-
- REGRDMWR(clkstctrlPtr, 0xFFFFFFFD, 0);
- UNMAP(clkctrlPtr);
- UNMAP(clkstctrlPtr);
-}
-
-void prcm_disable_gem(void){
- uintptr_t clkctrlPtr = REMAP(PRCM_BASE_ADDR+CM_ACTIVE_GEM_CLKCTRL);
- uintptr_t clkstctrlPtr = REMAP(PRCM_BASE_ADDR+CM_GEM_CLKSTCTRL);
-
- REGRDMWR(clkctrlPtr, 0xFFFFFFFD, 0);
-
- REGRDMWR(clkstctrlPtr, 0xFFFFFFFD, 0);
- UNMAP(clkctrlPtr);
- UNMAP(clkstctrlPtr);
-}
-
-void prcm_disable_mmu(void){
- uintptr_t clkctrlPtr = REMAP(PRCM_BASE_ADDR+CM_ALWON_MMUDATA_CLKCTRL);
- uintptr_t clkstctrlPtr = REMAP(PRCM_BASE_ADDR+CM_MMU_CLKSTCTRL);
-
- REGRDMWR(clkctrlPtr, 0xFFFFFFFD, 0);
-
- REGRDMWR(clkstctrlPtr, 0xFFFFFFFD, 0);
- UNMAP(clkctrlPtr);
- UNMAP(clkstctrlPtr);
-}
-
-void prcm_disable_mmuconfig(void){
- uintptr_t clkctrlPtr = REMAP(PRCM_BASE_ADDR+CM_ALWON_MMUCFG_CLKCTRL);
- uintptr_t clkstctrlPtr = REMAP(PRCM_BASE_ADDR+CM_MMUCFG_CLKSTCTRL);
-
- REGRDMWR(clkctrlPtr, 0xFFFFFFFD, 0);
-
- REGRDMWR(clkstctrlPtr, 0xFFFFFFFD, 0);
- UNMAP(clkctrlPtr);
- UNMAP(clkstctrlPtr);
-}
-
-
-void DucatiClkEnable(void)
-{
- UInt32 val;
- uintptr_t rstctrlPtr = REMAP(PRCM_BASE_ADDR+RM_DEFAULT_RSTCTRL);
- uintptr_t clkstctrlPtr = REMAP(PRCM_BASE_ADDR+CM_DEFAULT_DUCATI_CLKSTCTRL);
- uintptr_t clkctrlPtr = REMAP(PRCM_BASE_ADDR+CM_DEFAULT_DUCATI_CLKCTRL);
-
-#ifdef CLOCK_FIX
- /* set the ISS PLL before the clock enable */
- PLL_Clocks_Config(ISS_PLL_BASE, OSC_0, 19, 800, 2, ADPLLJ_CLKCRTL_HS2);
-#endif
-
- /* enable the ducati logic */
- val = REGRD(rstctrlPtr);
- val &= (~(0x1 << 4));
- REGWR(rstctrlPtr, val);
-
- /* enable power domain transition */
- REGWR(clkstctrlPtr, 2);
-
- /* enable ducati clocks */
- REGWR(clkctrlPtr, 2);
-
- /* wait for clocks CLKIN200TR and CLKINTR to become active */
- do {
- val = REGRD(clkstctrlPtr);
- } while ((val & 0x300) != 0x300);
-
- /* wait for module to be fully functional */
- do {
- val = REGRD(clkctrlPtr);
- } while ((val & 0x30000) != 0);
-
- UNMAP(rstctrlPtr);
- UNMAP(clkstctrlPtr);
- UNMAP(clkctrlPtr);
-
-}
-
-void DucatiClkDisable(void)
-{
- uintptr_t rstctrlPtr = REMAP(PRCM_BASE_ADDR+RM_DEFAULT_RSTCTRL);
- uintptr_t clkctrlPtr = REMAP(PRCM_BASE_ADDR+CM_DEFAULT_DUCATI_CLKCTRL);
- uintptr_t clkstctrlPtr = REMAP(PRCM_BASE_ADDR+CM_DEFAULT_DUCATI_CLKSTCTRL);
- UInt32 val;
-
- /* assert reset for cores m3_0 and m3_1 */
- val = REGRD(rstctrlPtr);
- val |= (0x3 << 2);
- REGWR(rstctrlPtr, val);
-
- /* disable ducati clocks */
- REGWR(clkctrlPtr, 0);
-
- /* disable power domain transition */
- REGWR(clkstctrlPtr, 0);
-
- /* disable the ducati logic */
- val = REGRD(rstctrlPtr);
- val |= (0x1 << 4);
- REGWR(rstctrlPtr, val);
-
- /* ensure posted write has completed */
- do {
- val = REGRD(rstctrlPtr);
- } while ((val & (0x1 << 4)) == 0);
-
- UNMAP(rstctrlPtr);
- UNMAP(clkctrlPtr);
- UNMAP(clkstctrlPtr);
}
-void GEMSSClkEnable(void)
-{
-
- /* set the DSP PLL before clock enable */
- PLL_Clocks_Config(DSP_PLL_BASE,OSC_0,19,500,1,ADPLLJ_CLKCRTL_HS2);
-
- /*Enable Clock to MMU CFG*/
- prcm_enable(PRCM_BASE_ADDR+CM_MMUCFG_CLKSTCTRL, PRCM_BASE_ADDR+CM_ALWON_MMUCFG_CLKCTRL, 2 , 2, 0x0, 0x100, TRUE, TRUE);
-
- /*Enable Clock to Data*/
- prcm_enable(PRCM_BASE_ADDR+CM_MMU_CLKSTCTRL, PRCM_BASE_ADDR+CM_ALWON_MMUDATA_CLKCTRL, 2 , 2, 0x0, 0x100, TRUE, TRUE);
-
- /*Enable Clock to GEMSS*/
- prcm_enable(PRCM_BASE_ADDR+CM_GEM_CLKSTCTRL, PRCM_BASE_ADDR+CM_ACTIVE_GEM_CLKCTRL, 2 , 2, 0x0, 0x700, FALSE, TRUE);
-
-}
-
-void GEMSSClkDisable(void)
-{
- prcm_disable_gem();
- prcm_disable_mmu();
- prcm_disable_mmuconfig();
-}
-#endif
-
#if defined (__cplusplus)
}
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspHal.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspHal.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * @file Dm8168DspHal.c
- *
- * @brief Top-level Hardware Abstraction Module implementation
- *
- * This module implements the top-level Hardware Abstraction Layer
- * for DM8168DSP.
- * The implementation is specific to DM8168DSP.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#include <ti/syslink/utils/Trace.h>
-/* Hardware Abstraction Layer headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-#include <Dm8168DspHal.h>
-#include <Dm8168DspHalBoot.h>
-#include <Dm8168DspPhyShmem.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs called by DM8168DSPPROC module
- * =============================================================================
- */
-/*!
- * @brief Function to initialize the HAL object
- *
- * @param halObj Return parameter: Pointer to the HAL object
- * @param initParams Optional initialization parameters
- *
- * @sa DM8168DSP_halExit
- * DM8168DSP_phyShmemInit
- */
-Int
-DM8168DSP_halInit (Ptr * halObj, Ptr params)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSP_HalObject * halObject = NULL;
-
- GT_2trace(curTrace, GT_ENTER,
- "--> DM8168DSP_halInit: halObj=0x%x, params=0x%x", halObj, params);
-
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168DSP_HalObject *) halObj ;
-
- (Void) params ; /* Not used. */
-
- *halObj = Memory_calloc (NULL, sizeof (DM8168DSP_HalObject), 0, NULL);
- if (halObject == NULL) {
- /*! @retval PROCESSOR_E_MEMORY Memory allocation failed */
- status = PROCESSOR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halInit",
- status,
- "Memory allocation failed for HAL object!");
- }
- else {
- status = DM8168DSP_phyShmemInit (*halObj);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halInit",
- status,
- "DM8168DSP_phyShmemInit failed!");
- Memory_free (NULL, *halObj, sizeof (DM8168DSP_HalObject));
- *halObj = NULL;
- }
-#endif
- }
-
-
- GT_1trace(curTrace, GT_LEAVE, "<-- DM8168DSP_halInit: 0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to finalize the HAL object
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168DSP_halInit
- * DM8168DSP_phyShmemExit
- */
-Int
-DM8168DSP_halExit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSP_halExit", halObj);
-
- GT_assert (curTrace, (halObj != NULL));
-
- status = DM8168DSP_phyShmemExit (halObj);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halExit",
- status,
- "DM8168DSP_phyShmemExit failed!");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (halObj != NULL) {
- /* Free the memory for the HAL object. */
- Memory_free (NULL, halObj, sizeof (DM8168DSP_HalObject));
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSP_halExit", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspHalBoot.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspHalBoot.c
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * @file Dm8168DspHalBoot.c
- *
- * @brief Boot control module.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM8168DSP.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Trace.h>
-
-/* Module headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168DspHal.h>
-#include <Dm8168DspHalBoot.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Offsets of the DSP BOOT ADDR register
- */
-#define CONTROL_IVA2_BOOTADDR_OFFSET 0x190
-#define CONTROL_IVA2_BOOTMOD_OFFSET 0x194
-
-
-/* =============================================================================
- * APIs called by DM8168DSPPROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control boot operations
- *
- * @param halObj Pointer to the HAL object
- * @param cmd Boot command
- * @param arg Arguments specific to the boot command
- *
- * @sa
- */
-Int
-DM8168DSP_halBootCtrl (Ptr halObj, Processor_BootCtrlCmd cmd, Ptr args)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSP_HalObject * halObject = NULL;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168DSP_halBootCtrl", halObj, cmd, args);
-
- GT_assert (curTrace, (halObj != NULL));
- GT_assert (curTrace, (cmd < Processor_BootCtrlCmd_EndValue));
-
- halObject = (DM8168DSP_HalObject *) halObj;
-
- switch (cmd) {
- case Processor_BootCtrlCmd_SetEntryPoint:
- {
- /* copy _c_int00 addresses to dsp boot address*/
- REG (halObject->generalCtrlBase) = ((UInt32) args & 0xFFFFFC00);
- }
- break ;
-
- case Processor_BootCtrlCmd_SetBootComplete:
- {
- /* set boot complete bit in boot stat reg */
- REG (halObject->bootStatBase) |= 0x1;
- }
- break ;
-
- case Processor_BootCtrlCmd_ResetBootComplete:
- {
- /* Do nothing here for DM8168DSP gem */
- }
- break ;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halBootCtrl",
- status,
- "Unsupported boot ctrl cmd specified");
- }
- break ;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSP_halBootCtrl",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspHalReset.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspHalReset.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * @file Dm8168DspHalReset.c
- *
- * @brief Reset control module.
- *
- * This module is responsible for handling reset-related hardware-
- * specific operations.
- * The implementation is specific to DM8168DSP.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#include <ti/syslink/utils/Trace.h>
-
-
-#include <Bitops.h>
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168DspHal.h>
-#include <Dm8168DspHalReset.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief PRM address for GEM
- */
-#define CM_GEM_CLKSTCTRL 0x400
-/*!
- * @brief Clock mgmt for GEM
- */
-#define CM_ACTIVE_GEM_CLKCTRL 0x420
-/*!
- * @brief Reset control for GEM
- */
-#define RM_ACTIVE_RSTCTRL 0xA10
-/*!
- * @brief Reset status for GEM
- */
-#define RM_ACTIVE_RSTST 0xA14
-
-/* =============================================================================
- * APIs called by DM8168DSPPROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control reset operations
- *
- * @param halObj Pointer to the HAL object
- * @param cmd Reset control command
- * @param arg Arguments specific to the reset control command
- *
- * @sa
- */
-Int
-Dm8168DspHal_reset(Ptr halObj, Dm8168DspHal_ResetCmd cmd)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSP_HalObject * halObject;
- UInt32 prcmBase;
- UInt32 addr;
- UInt32 val;
-
- GT_2trace(curTrace, GT_ENTER, "--> Dm8168DspHal_reset", halObj, cmd);
-
- GT_assert(curTrace, (halObj != NULL));
- GT_assert(curTrace, (cmd < Dm8168DspHal_Reset_EndValue));
-
- halObject = (DM8168DSP_HalObject *)halObj;
- prcmBase = halObject->prcmBase;
-
- switch (cmd) {
- case Dm8168DspHal_Reset_Attach:
- {
- /* assert GEM global and cpu resets */
- addr = prcmBase + RM_ACTIVE_RSTCTRL;
- REG(addr) = 0x3;
-
- /* clear status bit, write-1 to clear bit */
- addr = prcmBase + RM_ACTIVE_RSTST;
- REG(addr) = 0x2;
-
- /* release GEM global reset */
- addr = prcmBase + RM_ACTIVE_RSTCTRL;
- val = REG(addr);
- val &= ~(0x2);
- REG(addr) = val;
-
- /* wait for reset done flag */
- addr = prcmBase + RM_ACTIVE_RSTST;
- do {
- val = REG(addr);
- val &= 0x2;
- } while(val != 0x2);
- }
- break;
-
- case Dm8168DspHal_Reset_Start:
- {
- /* clear status bit, write-1 to clear bit */
- addr = prcmBase + RM_ACTIVE_RSTST;
- REG(addr) = 1;
-
- /* release cpu reset (and global to ensure proper boot) */
- addr = prcmBase + RM_ACTIVE_RSTCTRL;
- REG(addr) = 0;
-
- /* wait for reset done flag */
- addr = prcmBase + RM_ACTIVE_RSTST;
- do {
- val = REG(addr);
- val &= 0x1;
- } while(val != 0x1);
- }
- break;
-
- case Dm8168DspHal_Reset_Stop:
- {
- /* assert only cpu reset */
- addr = prcmBase + RM_ACTIVE_RSTCTRL;
- REG(addr) = 0x1;
- }
- break;
-
- case Dm8168DspHal_Reset_Detach:
- {
- /* assert both GEM global and cpu resets */
- addr = prcmBase + RM_ACTIVE_RSTCTRL;
- REG(addr) = 0x3;
- }
- break;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSP_halResetCtrl", status,
- "Unsupported reset ctrl cmd specified");
- }
- break;
- }
-
- GT_1trace(curTrace, GT_LEAVE, "<-- Dm8168DspHal_reset", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspPhyShmem.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspPhyShmem.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * @file Dm8168DspPhyShmem.c
- *
- * @brief Linux shared memory physical interface file for DM8168DSP.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM8168DSP.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-
-
-#if defined(SYSLINK_BUILD_HLOS)
-/* Standard headers */
-#include <ti/syslink/Std.h>
-
-/* OSAL and utils */
-#include <ti/syslink/utils/Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/Error.h>
-#include <ti/syslink/utils/_Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#include <ti/syslink/utils/Trace.h>
-
-/* Module headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168DspHal.h>
-#include <Dm8168DspHalBoot.h>
-#include <Dm8168DspHalReset.h>
-#include <Dm8168DspPhyShmem.h>
-#include <Dm8168DspHalMmu.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-
-/* =============================================================================
- * APIs called by DM8168DSPPROC module
- * =============================================================================
- */
-/*!
- * @brief Function to initialize Shared Driver/device.
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168DSP_phyShmemExit
- * Memory_map
- */
-Int
-DM8168DSP_phyShmemInit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSP_HalObject * halObject = NULL;
- Memory_MapInfo mapInfo;
-
- GT_1trace(curTrace, GT_ENTER,
- "--> DM8168DSP_phyShmemInit: halObj=0x%x", halObj);
-
- GT_assert (curTrace,(halObj != NULL));
-
- halObject = (DM8168DSP_HalObject *) halObj;
-
- mapInfo.src = DSP_BOOT_ADDR;
- mapInfo.size = DSP_BOOT_ADDR_SIZE;
- mapInfo.isCached = FALSE;
-
- status = Memory_map (&mapInfo);
-
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->generalCtrlBase = 0;
- }
- else {
- halObject->generalCtrlBase = mapInfo.dst;
- }
-
- mapInfo.src = DSP_BOOT_STAT;
- mapInfo.size = DSP_BOOT_STAT_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->bootStatBase = 0;
- }
- else {
- halObject->bootStatBase = mapInfo.dst;
- }
-
- mapInfo.src = L2_RAM_CLK_ENABLE;
- mapInfo.size = L2_RAM_CLK_ENABLE_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->l2ClkBase = 0;
- }
- else {
- halObject->l2ClkBase = mapInfo.dst;
- }
-
- mapInfo.src = PRCM_BASE_ADDR;
- mapInfo.size = PRCM_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->prcmBase = 0;
- }
- else {
- halObject->prcmBase = mapInfo.dst;
- }
-/* TO BE IMPLEMENTED
- mapInfo.src = MMU_BASE;
- mapInfo.size = MMU_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->mmuBase = 0;
- }
- else {
- halObject->mmuBase = mapInfo.dst;
- }
-*/
- GT_1trace(curTrace, GT_LEAVE, "<-- DM8168DSP_phyShmemInit: 0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to finalize Shared Driver/device.
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168DSP_phyShmemInit
- * Memory_Unmap
- */
-Int
-DM8168DSP_phyShmemExit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSP_HalObject * halObject = NULL;
- Memory_UnmapInfo unmapInfo;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSP_phyShmemExit", halObj);
-
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168DSP_HalObject *) halObj;
-
- unmapInfo.addr = halObject->prcmBase;
- unmapInfo.size = PRCM_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemExit",
- status,
- "Failure in Memory_Unmap for MMU base registers");
- }
- halObject->mmuBase = 0 ;
- }
-
- unmapInfo.addr = halObject->l2ClkBase;
- unmapInfo.size = L2_RAM_CLK_ENABLE_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemExit",
- status,
- "Failure in Memory_Unmap for MMU base registers");
- }
- halObject->l2ClkBase = 0 ;
- }
-
- unmapInfo.addr = halObject->bootStatBase;
- unmapInfo.size = DSP_BOOT_STAT_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemExit",
- status,
- "Failure in Memory_Unmap for MMU base registers");
- }
- halObject->bootStatBase = 0 ;
- }
-
- unmapInfo.addr = halObject->generalCtrlBase;
- unmapInfo.size = DSP_BOOT_ADDR_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_phyShmemExit",
- status,
- "Failure in Memory_Unmap for MMU base registers");
- }
- halObject->generalCtrlBase = 0 ;
- }
-
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSP_phyShmemExit",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspProc.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspProc.c
+++ /dev/null
@@ -1,2035 +0,0 @@
-/*
- * @file Dm8168DspProc.c
- *
- * @brief Processor implementation for DM8168DSP.
- *
- * This module is responsible for taking care of device-specific
- * operations for the processor. This module can be used
- * stand-alone or as part of ProcMgr.
- * The implementation is specific to DM8168DSP.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/System.h>
-#include <xdc/runtime/IGateProvider.h>
-#include <ti/sysbios/gates/GateMutex.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Cfg.h>
-#include <ti/syslink/utils/String.h>
-#include <ti/syslink/utils/IGateProvider.h>
-#include <ti/syslink/utils/GateMutex.h>
-#include <ti/syslink/utils/Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-#include <linux/string.h>
-#else
-#include <string.h>
-#endif
-
-#include <ti/syslink/utils/Trace.h>
-/* Module level headers */
-#include <ProcDefs.h>
-#include <Processor.h>
-#include <Dm8168DspProc.h>
-#include <_Dm8168DspProc.h>
-#include <Dm8168DspHal.h>
-#include <Dm8168DspHalReset.h>
-#include <Dm8168DspHalBoot.h>
-#include <ti/ipc/MultiProc.h>
-#include <_MultiProc.h>
-#include <RscTable.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-/*!
- * @brief Number of static entries in address translation table.
- */
-#define AddrTable_STATIC_COUNT 5
-
-/*!
- * @brief max entries in translation table.
- */
-#define AddrTable_SIZE 32
-
-/* number of carveouts */
-#define NumCarveouts 1
-
-/* config param for dsp mmu */
-#define PARAMS_mmuEnable "ProcMgr.proc[DSP].mmuEnable="
-#define PARAMS_carveoutAddr "ProcMgr.proc[DSP].carveoutAddr="
-#define PARAMS_carveoutSize "ProcMgr.proc[DSP].carveoutSize="
-
-
-/*!
- * @brief DM8168DSPPROC Module state object
- */
-typedef struct DM8168DSPPROC_ModuleObject_tag {
- UInt32 configSize;
- /*!< Size of configuration structure */
- DM8168DSPPROC_Config cfg;
- /*!< DM8168DSPPROC configuration structure */
- DM8168DSPPROC_Config defCfg;
- /*!< Default module configuration */
- DM8168DSPPROC_Params defInstParams;
- /*!< Default parameters for the DM8168DSPPROC instances */
- Bool isSetup;
- /*!< Indicates whether the DM8168DSPPROC module is setup. */
- DM8168DSPPROC_Handle procHandles [MultiProc_MAXPROCESSORS];
- /*!< Processor handle array. */
- IGateProvider_Handle gateHandle;
- /*!< Handle of gate to be used for local thread safety */
-} DM8168DSPPROC_ModuleObject;
-
-/*!
- * @brief DM8168DSPPROC instance object.
- */
-typedef struct DM8168DSPPROC_Object_tag {
- DM8168DSPPROC_Params params;
- /*!< Instance parameters (configuration values) */
- Ptr halObject;
- /*!< Pointer to the Hardware Abstraction Layer object. */
- ProcMgr_Handle pmHandle;
- /*!< Handle to proc manager */
-} DM8168DSPPROC_Object;
-
-/* Default memory regions */
-static UInt32 AddrTable_count = AddrTable_STATIC_COUNT;
-
-/* static memory regions
- * CAUTION: AddrTable_STATIC_COUNT must match number of entries below.
- */
-static ProcMgr_AddrInfo AddrTable[AddrTable_SIZE] =
- {
- { /* L2 RAM */
- .addr = { -1u, -1u, 0x40800000, 0x10800000, 0x10800000 },
- .size = 0x40000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = ProcMgr_MASTERKNLVIRT
- },
- { /* L1P RAM */
- .addr = { -1u, -1u, 0x40E00000, 0x10E00000, 0x10E00000 },
- .size = 0x8000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = ProcMgr_MASTERKNLVIRT
- },
- { /* L1D RAM */
- .addr = { -1u, -1u, 0x40F00000, 0x10F00000, 0x10F00000 },
- .size = 0x8000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = ProcMgr_MASTERKNLVIRT
- },
- { /* OCMC0, 256 KB */
- .addr = { -1u, -1u, 0x40300000, 0x40300000, 0x40300000 },
- .size = 0x40000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = (ProcMgr_MASTERKNLVIRT | ProcMgr_SLAVEVIRT)
- },
- { /* OCMC1, 256 KB */
- .addr = { -1u, -1u, 0x40400000, 0x40400000, 0x40400000 },
- .size = 0x40000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = (ProcMgr_MASTERKNLVIRT | ProcMgr_SLAVEVIRT)
- }
- };
-
-/* =============================================================================
- * Globals
- * =============================================================================
- */
-
-/*!
- * @var DM8168DSPPROC_state
- *
- * @brief DM8168DSPPROC state object variable
- */
-#if !defined(SYSLINK_BUILD_DEBUG)
-static
-#endif /* if !defined(SYSLINK_BUILD_DEBUG) */
-DM8168DSPPROC_ModuleObject DM8168DSPPROC_state =
-{
- .isSetup = FALSE,
- .configSize = sizeof(DM8168DSPPROC_Config),
- .gateHandle = NULL,
- .defInstParams.mmuEnable = FALSE,
- .defInstParams.numMemEntries = AddrTable_STATIC_COUNT
-};
-
-/* config override specified in SysLinkCfg.c, defined in ProcMgr.c */
-extern String ProcMgr_sysLinkCfgParams;
-
-/* =============================================================================
- * APIs directly called by applications
- * =============================================================================
- */
-/*!
- * @brief Function to get the default configuration for the DM8168DSPPROC
- * module.
- *
- * This function can be called by the application to get their
- * configuration parameter to DM8168DSPPROC_setup filled in by the
- * DM8168DSPPROC module with the default parameters. If the user
- * does not wish to make any change in the default parameters, this
- * API is not required to be called.
- *
- * @param cfg Pointer to the DM8168DSPPROC module configuration
- * structure in which the default config is to be
- * returned.
- *
- * @sa DM8168DSPPROC_setup
- */
-Void
-DM8168DSPPROC_getConfig (DM8168DSPPROC_Config * cfg)
-{
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPROC_getConfig", cfg);
-
- GT_assert (curTrace, (cfg != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (cfg == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_getConfig",
- PROCESSOR_E_INVALIDARG,
- "Argument of type (DM8168DSPPROC_Config *) passed "
- "is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- memcpy (cfg,
- &(DM8168DSPPROC_state.defCfg),
- sizeof (DM8168DSPPROC_Config));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_0trace (curTrace, GT_LEAVE, "DM8168DSPPROC_getConfig");
-}
-
-
-/*!
- * @brief Function to setup the DM8168DSPPROC module.
- *
- * This function sets up the DM8168DSPPROC module. This function
- * must be called before any other instance-level APIs can be
- * invoked.
- * Module-level configuration needs to be provided to this
- * function. If the user wishes to change some specific config
- * parameters, then DM8168DSPPROC_getConfig can be called to get the
- * configuration filled with the default values. After this, only
- * the required configuration values can be changed. If the user
- * does not wish to make any change in the default parameters, the
- * application can simply call DM8168DSPPROC_setup with NULL
- * parameters. The default parameters would get automatically used.
- *
- * @param cfg Optional DM8168DSPPROC module configuration. If provided as
- * NULL, default configuration is used.
- *
- * @sa DM8168DSPPROC_destroy
- * GateMutex_create
- */
-Int
-DM8168DSPPROC_setup (DM8168DSPPROC_Config * cfg)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSPPROC_Config tmpCfg;
- Error_Block eb;
-
- Error_init(&eb);
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPROC_setup", cfg);
-
- if (cfg == NULL) {
- DM8168DSPPROC_getConfig (&tmpCfg);
- cfg = &tmpCfg;
- }
-
- /* Create a default gate handle for local module protection. */
- DM8168DSPPROC_state.gateHandle = (IGateProvider_Handle)
- GateMutex_create ((GateMutex_Params *)NULL, &eb);
- if (DM8168DSPPROC_state.gateHandle == NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed to create GateMutex! */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_setup",
- status,
- "Failed to create GateMutex!");
- }
- else {
- /* Copy the user provided values into the state object. */
- memcpy (&DM8168DSPPROC_state.cfg,
- cfg,
- sizeof (DM8168DSPPROC_Config));
-
- /* Initialize the name to handles mapping array. */
- memset (&DM8168DSPPROC_state.procHandles,
- 0,
- (sizeof (DM8168DSPPROC_Handle) * MultiProc_MAXPROCESSORS));
- DM8168DSPPROC_state.isSetup = TRUE;
- }
-
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_setup", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to destroy the DM8168DSPPROC module.
- *
- * Once this function is called, other DM8168DSPPROC module APIs,
- * except for the DM8168DSPPROC_getConfig API cannot be called
- * anymore.
- *
- * @sa DM8168DSPPROC_setup
- * GateMutex_delete
- */
-Int
-DM8168DSPPROC_destroy (Void)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt16 i;
-
- GT_0trace (curTrace, GT_ENTER, "DM8168DSPPROC_destroy");
-
- /* Check if any DM8168DSPPROC instances have not been deleted so far. If not,
- * delete them.
- */
- for (i = 0 ; i < MultiProc_MAXPROCESSORS ; i++) {
- GT_assert (curTrace, (DM8168DSPPROC_state.procHandles [i] == NULL));
- if (DM8168DSPPROC_state.procHandles [i] != NULL) {
- DM8168DSPPROC_delete (&(DM8168DSPPROC_state.procHandles [i]));
- }
- }
-
- if (DM8168DSPPROC_state.gateHandle != NULL) {
- GateMutex_delete ((GateMutex_Handle *)
- &(DM8168DSPPROC_state.gateHandle));
- }
-
- DM8168DSPPROC_state.isSetup = FALSE;
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_destroy", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to initialize the parameters for this Processor
- * instance.
- *
- * @param params Configuration parameters to be returned
- *
- * @sa DM8168DSPPROC_create
- */
-Void
-DM8168DSPPROC_Params_init(
- DM8168DSPPROC_Handle handle,
- DM8168DSPPROC_Params * params)
-{
- DM8168DSPPROC_Object * procObject = (DM8168DSPPROC_Object *) handle;
- Int i = 0;
- ProcMgr_AddrInfo * ai = NULL;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DSPPROC_Params_init", handle, params);
-
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (params == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_Params_init",
- PROCESSOR_E_INVALIDARG,
- "Argument of type (DM8168DSPPROC_Params *) "
- "passed is null!");
- }
- else {
-#endif
- if (handle == NULL) {
-
- /* check for instance params override */
- Cfg_propBool(PARAMS_mmuEnable, ProcMgr_sysLinkCfgParams,
- &(DM8168DSPPROC_state.defInstParams.mmuEnable));
-
- memcpy(params, &(DM8168DSPPROC_state.defInstParams),
- sizeof(DM8168DSPPROC_Params));
-
- /* initialize the translation table */
- for (i = AddrTable_count; i < AddrTable_SIZE; i++) {
- ai = &AddrTable[i];
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
- }
-
- /* initialize refCount for all entries - both static and dynamic */
- for(i = 0; i < AddrTable_SIZE; i++) {
- AddrTable[i].refCount = 0u;
- }
- memcpy((Ptr)params->memEntries, AddrTable, sizeof(AddrTable));
- }
- else {
- /* return updated DM8168DSPPROC instance specific parameters */
- memcpy(params, &(procObject->params), sizeof(DM8168DSPPROC_Params));
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
-
- GT_0trace (curTrace, GT_LEAVE, "DM8168DSPPROC_Params_init");
-}
-
-/*!
- * @brief Function to create an instance of this Processor.
- *
- * @param name Name of the Processor instance.
- * @param params Configuration parameters.
- *
- * @sa DM8168DSPPROC_delete
- */
-DM8168DSPPROC_Handle
-DM8168DSPPROC_create ( UInt16 procId,
- const DM8168DSPPROC_Params * params)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * handle = NULL;
- DM8168DSPPROC_Object * object = NULL;
- IArg key;
- List_Params listParams;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DSPPROC_create", procId, params);
-
- GT_assert (curTrace, IS_VALID_PROCID (procId));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (!IS_VALID_PROCID (procId)) {
- /* Not setting status here since this function does not return status.*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_create",
- PROCESSOR_E_INVALIDARG,
- "Invalid procId specified");
- }
- else if (params == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_create",
- PROCESSOR_E_INVALIDARG,
- "params passed is NULL!");
- }
- else {
-#endif
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168DSPPROC_state.gateHandle);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- /* Check if the Processor already exists for specified procId. */
- if (DM8168DSPPROC_state.procHandles [procId] != NULL) {
- status = PROCESSOR_E_ALREADYEXIST;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_create",
- status,
- "Processor already exists for specified procId!");
- }
- else {
-#endif
- /* Allocate memory for the handle */
- handle = (Processor_Object *) Memory_calloc (NULL,
- sizeof (Processor_Object),
- 0,
- NULL);
- if (handle == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_create",
- PROCESSOR_E_MEMORY,
- "Memory allocation failed for handle!");
- }
- else {
- /* Populate the handle fields */
- handle->procFxnTable.attach = &DM8168DSPPROC_attach;
- handle->procFxnTable.detach = &DM8168DSPPROC_detach;
- handle->procFxnTable.start = &DM8168DSPPROC_start;
- handle->procFxnTable.stop = &DM8168DSPPROC_stop;
- handle->procFxnTable.read = &DM8168DSPPROC_read;
- handle->procFxnTable.write = &DM8168DSPPROC_write;
- handle->procFxnTable.control = &DM8168DSPPROC_control;
- handle->procFxnTable.map = &DM8168DSPPROC_map;
- handle->procFxnTable.unmap = &DM8168DSPPROC_unmap;
- handle->procFxnTable.translateAddr = &DM8168DSPPROC_translate;
- handle->state = ProcMgr_State_Unknown;
-
- /* Allocate memory for the DM8168DSPPROC handle */
- handle->object = Memory_calloc (NULL,
- sizeof (DM8168DSPPROC_Object),
- 0,
- NULL);
- if (handle->object == NULL) {
- status = PROCESSOR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_create",
- status,
- "Memory allocation failed for handle->object!");
- }
- else {
- handle->procId = procId;
- object = (DM8168DSPPROC_Object *) handle->object;
- object->halObject = NULL;
- /* Copy params into instance object. */
- memcpy (&(object->params),
- (Ptr) params,
- sizeof (DM8168DSPPROC_Params));
- /* Set the handle in the state object. */
- DM8168DSPPROC_state.procHandles [procId] =
- (DM8168DSPPROC_Handle) handle;
- /* Initialize the list of listeners */
- List_Params_init(&listParams);
- handle->registeredNotifiers = List_create(&listParams);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (handle->registeredNotifiers == NULL) {
- /*! @retval PROCESSOR_E_FAIL OsalIsr_create failed */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_create",
- status,
- "List_create failed");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- handle->notifiersLock =
- OsalMutex_create(OsalMutex_Type_Interruptible);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (handle->notifiersLock == NULL) {
- /*! @retval PROCESSOR_E_FAIL OsalIsr_create failed*/
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_create",
- status,
- "OsalMutex_create failed");
- }
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168DSPPROC_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (status < 0) {
- if (handle != NULL) {
- if (handle->registeredNotifiers != NULL) {
- List_delete (&handle->registeredNotifiers);
- }
- if (handle->object != NULL) {
- Memory_free (NULL,
- handle->object,
- sizeof (DM8168DSPPROC_Object));
- }
- Memory_free (NULL, handle, sizeof (Processor_Object));
- }
- /*! @retval NULL Function failed */
- handle = NULL;
- }
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_create", handle);
-
- /*! @retval Valid-Handle Operation successful */
- return (DM8168DSPPROC_Handle) handle;
-}
-
-
-/*!
- * @brief Function to delete an instance of this Processor.
- *
- * The user provided pointer to the handle is reset after
- * successful completion of this function.
- *
- * @param handlePtr Pointer to Handle to the Processor instance
- *
- * @sa DM8168DSPPROC_create
- */
-Int
-DM8168DSPPROC_delete (DM8168DSPPROC_Handle * handlePtr)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSPPROC_Object * object = NULL;
- Processor_Object * handle;
- IArg key;
- List_Elem * elem = NULL;
- Processor_RegisterElem * regElem = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPROC_delete", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid NULL handlePtr pointer
- specified*/
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_delete",
- status,
- "Invalid NULL handlePtr pointer specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_delete",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- handle = (Processor_Object *) (*handlePtr);
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168DSPPROC_state.gateHandle);
-
- /* Reset handle in PwrMgr handle array. */
- GT_assert (curTrace, IS_VALID_PROCID (handle->procId));
- DM8168DSPPROC_state.procHandles [handle->procId] = NULL;
-
- /* Free memory used for the DM8168DSPPROC object. */
- if (handle->object != NULL) {
- object = (DM8168DSPPROC_Object *) handle->object;
- Memory_free (NULL,
- object,
- sizeof (DM8168DSPPROC_Object));
- handle->object = NULL;
- }
-
- /*
- * Check the list of listeners to see if any are remaining
- * and reply to them
- */
- OsalMutex_delete(&handle->notifiersLock);
-
- while ((elem = List_dequeue(handle->registeredNotifiers)) != NULL) {
- regElem = (Processor_RegisterElem *)elem;
-
- /* Check if there is an associated timer and cancel it */
- if (regElem->timer != -1) {
- struct itimerspec value ;
- value.it_value.tv_sec = 0;
- value.it_value.tv_nsec = 0;
- value.it_interval.tv_sec = 0;
- value.it_interval.tv_nsec = 0;
- timer_settime(regElem->timer, 0, &value, NULL);
-
- timer_delete(regElem->timer);
- regElem->timer = -1;
- }
-
- /* Call the callback function so it can clean up. */
- regElem->info->cbFxn(handle->procId,
- NULL,
- handle->state,
- handle->state,
- ProcMgr_EventStatus_Canceled,
- regElem->info->arg);
- /* Free the memory */
- Memory_free(NULL, regElem, sizeof(Processor_RegisterElem));
- }
-
- /* Delete the list of listeners */
- List_delete(&handle->registeredNotifiers);
-
- /* Free memory used for the Processor object. */
- Memory_free (NULL, handle, sizeof (Processor_Object));
- *handlePtr = NULL;
-
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168DSPPROC_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_delete", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to open a handle to an instance of this Processor. This
- * function is called when access to the Processor is required from
- * a different process.
- *
- * @param handlePtr Handle to the Processor instance
- * @param procId Processor ID addressed by this Processor instance.
- *
- * @sa DM8168DSPPROC_close
- */
-Int
-DM8168DSPPROC_open (DM8168DSPPROC_Handle * handlePtr, UInt16 procId)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DSPPROC_open", handlePtr, procId);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, IS_VALID_PROCID (procId));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_open",
- status,
- "Invalid NULL handlePtr specified");
- }
- else if (!IS_VALID_PROCID (procId)) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid procId specified */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_open",
- status,
- "Invalid procId specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Initialize return parameter handle. */
- *handlePtr = NULL;
-
- /* Check if the PwrMgr exists and return the handle if found. */
- if (DM8168DSPPROC_state.procHandles [procId] == NULL) {
- /*! @retval PROCESSOR_E_NOTFOUND Specified instance not found */
- status = PROCESSOR_E_NOTFOUND;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_open",
- status,
- "Specified DM8168DSPPROC instance does not exist!");
- }
- else {
- *handlePtr = DM8168DSPPROC_state.procHandles [procId];
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_open", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to close a handle to an instance of this Processor.
- *
- * @param handlePtr Pointer to Handle to the Processor instance
- *
- * @sa DM8168DSPPROC_open
- */
-Int
-DM8168DSPPROC_close (DM8168DSPPROC_Handle * handlePtr)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPROC_close", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid NULL handlePtr pointer
- specified*/
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_close",
- status,
- "Invalid NULL handlePtr pointer specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_close",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Nothing to be done for close. */
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_close", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/* =============================================================================
- * APIs called by Processor module (part of function table interface)
- * =============================================================================
- */
-/*!
- * @brief Function to initialize the slave processor
- *
- * @param handle Handle to the Processor instance
- * @param params Attach parameters
- *
- * @sa DM8168DSPPROC_detach
- */
-Int
-DM8168DSPPROC_attach(
- Processor_Handle handle,
- Processor_AttachParams * params)
-{
-
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168DSPPROC_Object * object = NULL;
- UInt32 i = 0;
- UInt32 index = 0;
- ProcMgr_AddrInfo * me;
- SysLink_MemEntry * entry;
- SysLink_MemEntry_Block memBlock;
- Char configProp[SYSLINK_MAX_NAMELENGTH];
-// DM8168DSP_HalMmuCtrlArgs_Enable mmuEnableArgs;
-
- GT_2trace(curTrace, GT_ENTER,
- "--> DM8168DSPPROC_attach: handle=0x%x, parms=0x%x", handle, params);
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_attach",
- status,
- "Invalid handle specified");
- }
- else if (params == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_attach",
- status,
- "Invalid params specified");
- }
- else {
-#endif
- object = (DM8168DSPPROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- params->procArch = Processor_ProcArch_C64x;
-
- /* check for instance params override */
- Cfg_propBool(PARAMS_mmuEnable, ProcMgr_sysLinkCfgParams,
- &(object->params.mmuEnable));
-
- /* check for carveout params override */
- Cfg_prop(PARAMS_carveoutAddr, ProcMgr_sysLinkCfgParams, configProp);
- object->params.carveoutAddr = strtoul(configProp, 0, 16);
- Cfg_prop(PARAMS_carveoutSize, ProcMgr_sysLinkCfgParams, configProp);
- object->params.carveoutSize = strtoul(configProp, 0, 16);
-
- object->pmHandle = params->pmHandle;
- GT_0trace(curTrace, GT_1CLASS,
- "DM8168DSPPROC_attach: Mapping memory regions");
-
- /* search for dsp memory map */
- status = RscTable_process(procHandle->procId, object->params.mmuEnable,
- NumCarveouts,
- (Ptr)&object->params.carveoutAddr,
- &object->params.carveoutSize, FALSE,
- &memBlock.numEntries);
- if (status < 0 || memBlock.numEntries > SYSLINK_MAX_MEMENTRIES) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_attach",
- status,
- "Failed to process resource table");
- }
- else {
- status = RscTable_getMemEntries(procHandle->procId,
- memBlock.memEntries,
- &memBlock.numEntries);
- if (status < 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_attach",
- status,
- "Failed to get resource table memEntries");
- }
- }
-
- /* update translation tables with memory map */
- for (i = 0; (i < memBlock.numEntries)
- && (memBlock.memEntries[i].isValid) && (status >= 0); i++) {
-
- entry = &memBlock.memEntries[i];
-
- if (entry->map == FALSE) {
- /* update table with entries which don't require mapping */
- if (AddrTable_count != AddrTable_SIZE) {
- me = &AddrTable[AddrTable_count];
-
- me->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterPhys] =
- entry->masterPhysAddr;
- me->addr[ProcMgr_AddrType_SlaveVirt] = entry->slaveVirtAddr;
- me->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- me->size = entry->size;
- me->isCached = entry->isCached;
- me->mapMask = entry->mapMask;
-
- AddrTable_count++;
- }
- else {
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_attach", status,
- "AddrTable_SIZE reached!");
- }
- }
- else if (entry->map == TRUE) {
- /* send these entries back to ProcMgr for mapping */
- index = object->params.numMemEntries;
-
- if (index != ProcMgr_MAX_MEMORY_REGIONS) {
- me = &object->params.memEntries[index];
-
- me->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterPhys] =
- entry->masterPhysAddr;
- me->addr[ProcMgr_AddrType_SlaveVirt] = entry->slaveVirtAddr;
- me->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- me->size = entry->size;
- me->isCached = entry->isCached;
- me->mapMask = entry->mapMask;
-
- object->params.numMemEntries++;
- }
- else {
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_attach", status,
- "ProcMgr_MAX_MEMORY_REGIONS reached!");
- }
- }
- else {
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_attach", status,
- "Memory map has entry with invalid 'map' value");
- }
- } /* for (...) */
-
- if (status >= 0) {
- /* populate the return params */
- params->numMemEntries = object->params.numMemEntries;
- memcpy((Ptr)params->memEntries, (Ptr)object->params.memEntries,
- sizeof(ProcMgr_AddrInfo) * params->numMemEntries);
-
- status = DM8168DSP_halInit(&(object->halObject), NULL);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_attach", status,
- "DM8168DSP_halInit failed");
- }
- else {
-#endif
- if ((procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)) {
-
- /* assert reset, then release global reset to enable L2 */
- status = Dm8168DspHal_reset(object->halObject,
- Dm8168DspHal_Reset_Attach);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_attach", status,
- "Failed to reset the slave processor");
- }
- else {
-#endif
- GT_0trace(curTrace, GT_1CLASS,
- "DM8168DSPPROC_attach: slave is now in reset");
-
- if (object->params.mmuEnable) {
-#if 0 /* disabled because of silicon bug */
- mmuEnableArgs.numMemEntries = 0;
- status = DM8168DSP_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_Enable, &mmuEnableArgs);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_attach", status,
- "Failed to enable the slave MMU");
- }
-#endif
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168DSPPROC_attach: Slave MMU "
- "is configured!");
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
-
- GT_1trace(curTrace, GT_LEAVE,
- "<-- DM8168DSPPROC_attach: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to detach from the Processor.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168DSPPROC_attach
- */
-Int
-DM8168DSPPROC_detach (Processor_Handle handle)
-{
- Int status = PROCESSOR_SUCCESS;
- Int tmpStatus = PROCESSOR_SUCCESS;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168DSPPROC_Object * object = NULL;
- Int i = 0;
- ProcMgr_AddrInfo * ai;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPROC_detach", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_detach",
- PROCESSOR_E_HANDLE,
- "Invalid handle specified");
- }
- else {
-#endif
- object = (DM8168DSPPROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)) {
-
- if (object->params.mmuEnable) {
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168DSPPROC_detach: Disabling Slave MMU ...");
-
-#if 0 /* disabled because of silicon bug */
- status = DM8168DSP_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_Disable, NULL);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_detach", status,
- "Failed to disable the slave MMU");
- }
-#endif
-#endif
- }
-
- /* delete all dynamically added entries */
- for (i = AddrTable_STATIC_COUNT; i < AddrTable_count; i++) {
- ai = &AddrTable[i];
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
- ai->refCount = 0u;
- }
- object->params.numMemEntries = AddrTable_STATIC_COUNT;
- AddrTable_count = AddrTable_STATIC_COUNT;
-
- /* assert reset on the slave processor */
- tmpStatus = Dm8168DspHal_reset(object->halObject,
- Dm8168DspHal_Reset_Detach);
-
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168DSPPROC_detach: Slave processor is now in reset");
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if ((tmpStatus < 0) && (status >= 0)) {
- status = tmpStatus;
- GT_setFailureReason(curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_detach",
- status,
- "Failed to reset the slave processor");
- }
-#endif
- }
-
- GT_0trace (curTrace,
- GT_2CLASS,
- " DM8168DSPPROC_detach: Unmapping memory regions\n");
-
- tmpStatus = DM8168DSP_halExit (object->halObject);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if ((tmpStatus < 0) && (status >= 0)) {
- status = tmpStatus;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_detach",
- status,
- "Failed to finalize HAL object");
- }
- }
-#endif
-
- GT_1trace(curTrace, GT_LEAVE, "DM8168DSPPROC_detach: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to start the slave processor
- *
- * Start the slave processor running from its entry point.
- * Depending on the boot mode, this involves configuring the boot
- * address and releasing the slave from reset.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168DSPPROC_stop, DM8168DSP_halBootCtrl, Dm8168DspHal_reset
- */
-Int
-DM8168DSPPROC_start (Processor_Handle handle,
- UInt32 entryPt,
- Processor_StartParams * params)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168DSPPROC_Object * object = NULL;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168DSPPROC_start",
- handle, entryPt, params);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_start",
- status,
- "Invalid handle specified");
- }
- else if (params == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_start",
- status,
- "Invalid params specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168DSPPROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_NoPwr)) {
- /* Slave is to be started only for Boot mode and NoLoad mode. */
- /* Specify the DSP boot address in the boot config register */
- status = DM8168DSP_halBootCtrl (object->halObject,
- Processor_BootCtrlCmd_SetEntryPoint,
- (Ptr) entryPt);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_start",
- status,
- "Failed to set slave boot entry point");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* release the slave cpu from reset */
- status = Dm8168DspHal_reset(object->halObject,
- Dm8168DspHal_Reset_Start);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_start",
- status,
- "Failed to release slave from reset");
- }
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
-
- /* For NoBoot mode, send an interrupt to the slave.
- * TBD: How should Dm8168DspProc interface with Notify for this?
- */
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (status >= 0) {
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168DSPPROC_start: Slave successfully started!\n");
- }
- else {
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168DSPPROC_start: Slave could not be started!\n");
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_start", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to stop the slave processor
- *
- * Stop the execution of the slave processor. Depending on the boot
- * mode, this may result in placing the slave processor in reset.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168DSPPROC_start, Dm8168DspHal_reset
- */
-Int
-DM8168DSPPROC_stop (Processor_Handle handle)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168DSPPROC_Object * object = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPROC_stop", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_stop",
- status,
- "Invalid handle specified");
- }
- else {
-#endif
- object = (DM8168DSPPROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* Slave is to be stopped only for Boot mode and NoLoad mode. */
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_NoPwr)) {
- status = Dm8168DspHal_reset(object->halObject,
- Dm8168DspHal_Reset_Stop);
-
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168DSPPROC_stop: Slave is now in reset!\n");
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_stop",
- status,
- "Failed to place slave in reset");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_stop", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to read from the slave processor's memory.
- *
- * Read from the slave processor's memory and copy into the
- * provided buffer.
- *
- * @param handle Handle to the Processor instance
- * @param procAddr Address in host processor's address space of the
- * memory region to read from.
- * @param numBytes IN/OUT parameter. As an IN-parameter, it takes in the
- * number of bytes to be read. When the function
- * returns, this parameter contains the number of bytes
- * actually read.
- * @param buffer User-provided buffer in which the slave processor's
- * memory contents are to be copied.
- *
- * @sa DM8168DSPPROC_write
- */
-Int
-DM8168DSPPROC_read (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer)
-{
- Int status = PROCESSOR_SUCCESS ;
- UInt8 * procPtr8 = NULL;
-
- GT_4trace (curTrace, GT_ENTER, "DM8168DSPPROC_read",
- handle, procAddr, numBytes, buffer);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (numBytes != NULL));
- GT_assert (curTrace, (buffer != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_read",
- status,
- "Invalid handle specified");
- }
- else if (numBytes == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_read",
- status,
- "Invalid numBytes specified");
- }
- else if (buffer == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_read",
- status,
- "Invalid buffer specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- procPtr8 = (UInt8 *) procAddr ;
- buffer = memcpy (buffer, procPtr8, *numBytes);
- GT_assert (curTrace, (buffer != (UInt32) NULL));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (buffer == (UInt32) NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed in memcpy */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_read",
- status,
- "Failed in memcpy");
- *numBytes = 0;
- }
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_read",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to write into the slave processor's memory.
- *
- * Read from the provided buffer and copy into the slave
- * processor's memory.
- *
- * @param handle Handle to the Processor object
- * @param procAddr Address in host processor's address space of the
- * memory region to write into.
- * @param numBytes IN/OUT parameter. As an IN-parameter, it takes in the
- * number of bytes to be written. When the function
- * returns, this parameter contains the number of bytes
- * actually written.
- * @param buffer User-provided buffer from which the data is to be
- * written into the slave processor's memory.
- *
- * @sa DM8168DSPPROC_read, DM8168DSPPROC_translateAddr
- */
-Int
-DM8168DSPPROC_write (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer)
-{
- Int status = PROCESSOR_SUCCESS ;
- UInt8 * procPtr8 = NULL;
- UInt8 temp8_1;
- UInt8 temp8_2;
- UInt8 temp8_3;
- UInt8 temp8_4;
- UInt32 temp;
-
- GT_4trace (curTrace, GT_ENTER, "DM8168DSPPROC_write",
- handle, procAddr, numBytes, buffer);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (numBytes != NULL));
- GT_assert (curTrace, (buffer != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_write",
- status,
- "Invalid handle specified");
- }
- else if (numBytes == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_write",
- status,
- "Invalid numBytes specified");
- }
- else if (buffer == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_write",
- status,
- "Invalid buffer specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- if (*numBytes != sizeof (UInt32)) {
- procPtr8 = (UInt8 *) procAddr ;
- procAddr = (UInt32) memcpy (procPtr8,
- buffer,
- *numBytes);
- GT_assert (curTrace, (procAddr != (UInt32) NULL));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (procAddr == (UInt32) NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed in memcpy */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_write",
- status,
- "Failed in memcpy");
- *numBytes = 0;
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
- else {
- /* For 4 bytes, directly write as a UInt32 */
- temp8_1 = ((UInt8 *) buffer) [0];
- temp8_2 = ((UInt8 *) buffer) [1];
- temp8_3 = ((UInt8 *) buffer) [2];
- temp8_4 = ((UInt8 *) buffer) [3];
- temp = (UInt32) ( ((UInt32) temp8_4 << 24)
- | ((UInt32) temp8_3 << 16)
- | ((UInt32) temp8_2 << 8)
- | ((UInt32) temp8_1));
- *((UInt32*) procAddr) = temp;
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_write",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to perform device-dependent operations.
- *
- * Performs device-dependent control operations as exposed by this
- * implementation of the Processor module.
- *
- * @param handle Handle to the Processor object
- * @param cmd Device specific processor command
- * @param arg Arguments specific to the type of command.
- *
- * @sa
- */
-Int
-DM8168DSPPROC_control (Processor_Handle handle, Int32 cmd, Ptr arg)
-{
- Int status = PROCESSOR_SUCCESS ;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168DSPPROC_control", handle, cmd, arg);
-
- GT_assert (curTrace, (handle != NULL));
- /* cmd and arg can be 0/NULL, so cannot check for validity. */
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_control",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* No control operations currently implemented. */
- /*! @retval PROCESSOR_E_NOTSUPPORTED No control operations are supported
- for this device. */
- status = PROCESSOR_E_NOTSUPPORTED;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPROC_control",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Translate slave virtual address to master physical address.
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Returned: master physical address.
- * @param srcAddr Slave virtual address.
- *
- * @sa
- */
-Int
-DM8168DSPPROC_translate(
- Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 srcAddr)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * procHandle= (Processor_Object *)handle;
- DM8168DSPPROC_Object * object = NULL;
- UInt32 startAddr;
- UInt32 endAddr;
- UInt32 offset;
- UInt32 i;
- ProcMgr_AddrInfo * ai;
-
- GT_3trace(curTrace, GT_ENTER,
- "DM8168DSPPROC_translate: handle=0x%x, dstAddr=0x%x, srcAddr=0x%x",
- handle, dstAddr, srcAddr);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (dstAddr != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_translate",
- status,
- "Invalid handle specified");
- }
- else if (dstAddr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG sglist provided as NULL */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_translate",
- status,
- "dstAddr provided as NULL");
- }
- else {
-#endif
- object = (DM8168DSPPROC_Object *)procHandle->object;
- GT_assert(curTrace, (object != NULL));
- *dstAddr = -1u;
-
- for (i = 0; i < AddrTable_count; i++) {
- ai = &AddrTable[i];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= srcAddr) && (srcAddr < endAddr)) {
- offset = srcAddr - startAddr;
- *dstAddr = ai->addr[ProcMgr_AddrType_MasterPhys] + offset;
- break;
- }
- }
-
- if (*dstAddr == -1u) {
- if (!object->params.mmuEnable) {
- /* default to direct mapping (i.e. v=p) */
- *dstAddr = srcAddr;
- }
- else {
- /* srcAddr not found in slave address space */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_translate", status,
- "srcAddr not found in slave address space");
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE,
- "DM8168DSPPROC_translate: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Map the given address translation into the slave mmu
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Base virtual address
- * @param nSegs Number of given segments
- * @param sglist Segment list
- */
-Int
-DM8168DSPPROC_map(
- Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 nSegs,
- Memory_SGList * sglist)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168DSPPROC_Object * object = NULL;
- Bool found = FALSE;
- UInt32 startAddr;
- UInt32 endAddr;
- UInt32 i;
- UInt32 j;
- ProcMgr_AddrInfo * ai;
-// DM8168DSP_HalMmuCtrlArgs_AddEntry addEntryArgs;
-
- GT_4trace(curTrace, GT_ENTER, "DM8168DSPPROC_map: "
- "handle=0x%x, dstAddr=0x%x, nSegs=%d, sglist=0x%x",
- handle, dstAddr, nSegs, sglist);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (sglist != NULL));
- GT_assert (curTrace, (nSegs > 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_map",
- status,
- "Invalid handle specified");
- }
- else if (sglist == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG sglist provided as NULL */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_map",
- status,
- "sglist provided as NULL");
- }
- else if (nSegs == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Number of segments provided is 0 */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_map",
- status,
- "Number of segments provided is 0");
- }
- else {
-#endif
- object = (DM8168DSPPROC_Object *)procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- for (i = 0; (i < nSegs) && (status >= 0); i++) {
- /* Update the translation table with entries for which mapping
- * is required. Add the entry only if the range does not exist
- * in the translation table.
- */
-
- /* check in static entries first */
- for (j = 0; j < AddrTable_STATIC_COUNT; j++) {
- ai = &AddrTable [j];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)) {
- found = TRUE;
- ai->refCount++;
- break;
- }
- }
-
- /* if not found in static entries, check in dynamic entries */
- if (!found) {
- for (j = AddrTable_STATIC_COUNT; j < AddrTable_count; j++) {
- ai = &AddrTable [j];
-
- if (ai->isMapped == TRUE) {
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
- && ((*dstAddr + sglist[i].size) <= endAddr)) {
- found = TRUE;
- ai->refCount++;
- break;
- }
- }
- }
- }
-
- /* if not found and mmu is enabled, add new entry to table */
- if (!found) {
- if (object->params.mmuEnable) {
- if (AddrTable_count != AddrTable_SIZE) {
- ai = &AddrTable[AddrTable_count];
-
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = sglist[i].paddr;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = *dstAddr;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = sglist[i].size;
- ai->isCached = sglist[i].isCached;
- ai->refCount++;
-
- AddrTable_count++;
- }
- else {
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_map", status,
- "AddrTable_SIZE reached!");
- }
- }
- else {
- /* if mmu disabled, AddrTable not updated */
- ai = NULL;
- }
- }
-
- /* if new entry, map into dsp mmu */
- if ((ai != NULL) && (ai->refCount == 1) && (status >= 0)) {
- ai->isMapped = TRUE;
-
- if (object->params.mmuEnable) {
- /* Add entry to Dsp mmu */
-#if 0
- addEntryArgs.masterPhyAddr = sglist [i].paddr;
- addEntryArgs.size = sglist [i].size;
- addEntryArgs.slaveVirtAddr = (UInt32)*dstAddr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- addEntryArgs.elementSize = ELEM_SIZE_16BIT;
- addEntryArgs.endianism = LITTLE_ENDIAN;
- addEntryArgs.mixedSize = MMU_TLBES;
- status = DM8168DSP_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_AddEntry, &addEntryArgs);
-#endif
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_map", status,
- "Processor_MmuCtrlCmd_AddEntry failed");
- }
-#endif
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_map", status,
- "DSP MMU configuration failed");
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE, "DM8168DSPPROC_map: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to unmap slave address from host address space
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Return parameter: Pointer to receive the mapped
- * address.
- * @param size Size of the region to be mapped.
- *
- * @sa
- */
-Int
-DM8168DSPPROC_unmap(
- Processor_Handle handle,
- UInt32 addr,
- UInt32 size)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168DSPPROC_Object * object = NULL;
- ProcMgr_AddrInfo * ai;
- Int i;
- UInt32 startAddr;
- UInt32 endAddr;
-// DM8168DSP_HalMmuCtrlArgs_DeleteEntry deleteEntryArgs;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168DSPPROC_unmap",
- handle, addr, size);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (size != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_unmap",
- status,
- "Invalid handle specified");
- }
- else if (size == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Size provided is zero */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPROC_unmap",
- status,
- "Size provided is zero");
- }
- else {
-#endif
- object = (DM8168DSPPROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* Delete dynamically added non-default entries from translation
- * table only in last unmap called on that entry
- */
- for (i = AddrTable_STATIC_COUNT; i < AddrTable_count; i++) {
- ai = &AddrTable[i];
-
- if (!ai->isMapped) {
- continue;
- }
-
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= addr) && (addr < endAddr)) {
- ai->refCount--;
-
- if (ai->refCount == 0) {
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
-
- if (object->params.mmuEnable) {
-#if 0
- /* Remove the entry from the DSP MMU also */
- deleteEntryArgs.size = size;
- deleteEntryArgs.slaveVirtAddr = addr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- deleteEntryArgs.elementSize = ELEM_SIZE_16BIT;
- deleteEntryArgs.endianism = LITTLE_ENDIAN;
- deleteEntryArgs.mixedSize = MMU_TLBES;
-
- status = DM8168DSP_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_DeleteEntry, &deleteEntryArgs);
-#endif
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168DSPPROC_unmap", status,
- "DSP MMU configuration failed");
- }
-#endif
- }
- }
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE, "DM8168DSPPROC_unmap: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspPwr.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxdsp/Dm8168DspPwr.c
+++ /dev/null
@@ -1,1229 +0,0 @@
-/*
- * @file Dm8168DspPwr.c
- *
- * @brief PwrMgr implementation for DM8168DSP.
- *
- * This module is responsible for handling power requests for
- * the ProcMgr. The implementation is specific to DM8168DSP.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-/* Standard headers */
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <string.h>
-#include <xdc/runtime/Error.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/System.h>
-#include <xdc/runtime/IGateProvider.h>
-#include <ti/sysbios/gates/GateMutex.h>
-#include <ti/syslink/utils/_Memory.h>
-#include <ti/syslink/inc/Dm8168Clock.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/String.h>
-#include <ti/syslink/utils/IGateProvider.h>
-#include <ti/syslink/utils/GateMutex.h>
-#include <ti/syslink/utils/Memory.h>
-#include <_MultiProc.h>
-#if defined(__KERNEL__)
-#include <linux/string.h>
-#else
-#include <string.h>
-#endif
-#if defined (SYSLINK_BUILDOS_LINUX)
-#include <ti/syslink/inc/knl/Linux/LinuxClock.h>
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-#include <ti/syslink/utils/Trace.h>
-#include <Bitops.h>
-
-/* Module level headers */
-#include <ti/ipc/MultiProc.h>
-#include <ti/syslink/inc/_MultiProc.h>
-#include <ti/syslink/inc/knl/PwrDefs.h>
-#include <ti/syslink/inc/knl/PwrMgr.h>
-#include <ti/syslink/inc/knl/Dm8168DspPwr.h>
-#include <ti/syslink/inc/knl/_Dm8168DspPwr.h>
-#include <ti/syslink/inc/ClockOps.h>
-
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief DM8168DSP module and mmr addresses (physical)
- */
-#define PRCM_BASE_ADDR 0x48180000
-#define PRCM_SIZE 0x00003000
-#define PM_ACTIVE_PWRSTST 0x00000A04
-#define CM_ACTIVE_GEM_CLKCTRL 0x00000420
-
-
-#define CM_MMU_CLKSTCTRL 0x0000140C
-#define CM_ALWON_MMUDATA_CLKCTRL 0x0000159C
-#define CM_MMUCFG_CLKSTCTRL 0x00001410
-#define CM_ALWON_MMUCFG_CLKCTRL 0x000015A8
-
-
-#define RM_ACTIVE_RSTCTRL 0x00000A10
-#define RM_ACTIVE_RSTST 0x00000A14
-
-#define GEM_L2RAM_BASE_ADDR 0x40800000
-#define GEM_L2RAM_SIZE 0x00040000
-
-#define CTRL_MODULE_BASE_ADDR 0x48140000
-#define CTRL_MODULE_SIZE 0x00020000
-#define DSPMEM_SLEEP 0x00000650
-
-#define DSP_IDLE_CFG 0x0000061c
-
-#define REG(x) *((volatile UInt32 *) (x))
-#define MEM(x) *((volatile UInt32 *) (x))
-
-/*!
- * @brief DM8168DSPPWR Module state object
- */
-typedef struct DM8168DSPPWR_ModuleObject_tag {
- UInt32 configSize;
- /*!< Size of configuration structure */
- DM8168DSPPWR_Config cfg;
- /*!< DM8168DSPPWR configuration structure */
- DM8168DSPPWR_Config defCfg;
- /*!< Default module configuration */
- Bool isSetup;
- /*!< Indicates whether the DM8168DSPPWR module is setup. */
- DM8168DSPPWR_Handle pwrHandles [MultiProc_MAXPROCESSORS];
- /*!< PwrMgr handle array. */
- IGateProvider_Handle gateHandle;
- /*!< Handle of gate to be used for local thread safety */
-} DM8168DSPPWR_ModuleObject;
-
-/*!
- * @brief DM8168DSPPWR instance object.
- */
-struct DM8168DSPPWR_Object_tag {
- DM8168DSPPWR_Params params;
- /*!< Instance parameters (configuration values) */
- UInt32 prcmVA;
- /*!< Virtual address for prcm module */
- UInt32 controlVA;
- /*!< Virtual address for control module */
- UInt32 l2baseVA;
- /*!< Virtual address for control module */
- Ptr dspClkHandle;
- /*!< dsp clk handle */
- Ptr dspMmuClkHandle;
- /*!< dsp clk handle */
- Ptr dspMmuCfgClkHandle;
- /*!< dsp clk handle */
- Ptr dspSpinlockHandle;
- /*!< dsp Spinlock handle */
- Ptr dspMailboxHandle;
- /*!< dsp Mailbox handle */
-#if defined(SYSLINK_VARIANT_TI814X) || defined(SYSLINK_VARIANT_TI811X)
- Ptr dspTimerIclkHandle;
- /*!< dsp Timer4 handle */
- Ptr dspTimerFclkHandle;
- /*!< dsp Timer4 handle */
-#else
- Ptr dspTimerIclkHandle1;
- /*!< dsp Timer4 handle */
- Ptr dspTimerFclkHandle1;
- /*!< dsp Timer4 handle */
- Ptr dspTimerIclkHandle2;
- /*!< dsp Timer4 handle */
- Ptr dspTimerFclkHandle2;
- /*!< dsp Timer4 handle */
-#endif
- ClockOps_Handle clockHandle;
- /*!< Pointer to the Clock object. */
-
-};
-
-/* Defines the DM8168DSPPWR object type. */
-typedef struct DM8168DSPPWR_Object_tag DM8168DSPPWR_Object;
-
-
-/* =============================================================================
- * Globals
- * =============================================================================
- */
-/*!
- * @var DM8168DSPPWR_state
- *
- * @brief DM8168DSPPWR state object variable
- */
-#if !defined(SYSLINK_BUILD_DEBUG)
-static
-#endif /* if !defined(SYSLINK_BUILD_DEBUG) */
-DM8168DSPPWR_ModuleObject DM8168DSPPWR_state =
-{
- .isSetup = FALSE,
- .configSize = sizeof (DM8168DSPPWR_Config),
- .defCfg.reserved = 0,
- .gateHandle = NULL,
-};
-
-
-/* =============================================================================
- * APIs directly called by applications
- * =============================================================================
- */
-/*!
- * @brief Function to get the default configuration for the DM8168DSPPWR
- * module.
- *
- * This function can be called by the application to get their
- * configuration parameter to DM8168DSPPWR_setup filled in by the
- * DM8168DSPPWR module with the default parameters. If the user does
- * not wish to make any change in the default parameters, this API
- * is not required to be called.
- *
- * @param cfg Pointer to the DM8168DSPPWR module configuration
- * structure in which the default config is to be
- * returned.
- *
- * @sa DM8168DSPPWR_setup
- */
-Void
-DM8168DSPPWR_getConfig (DM8168DSPPWR_Config * cfg)
-{
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPWR_getConfig", cfg);
-
- GT_assert (curTrace, (cfg != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (cfg == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_getConfig",
- PWRMGR_E_INVALIDARG,
- "Argument of type (DM8168DSPPWR_Config *) passed "
- "is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- memcpy (cfg,
- &DM8168DSPPWR_state.defCfg,
- sizeof (DM8168DSPPWR_Config));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_0trace (curTrace, GT_LEAVE, "DM8168DSPPWR_getConfig");
-}
-
-
-/*!
- * @brief Function to setup the DM8168DSPPWR module.
- *
- * This function sets up the DM8168DSPPWR module. This function must
- * be called before any other instance-level APIs can be invoked.
- * Module-level configuration needs to be provided to this
- * function. If the user wishes to change some specific config
- * parameters, then DM8168DSPPWR_getConfig can be called to get the
- * configuration filled with the default values. After this, only
- * the required configuration values can be changed. If the user
- * does not wish to make any change in the default parameters, the
- * application can simply call DM8168DSPPWR_setup with NULL
- * parameters. The default parameters would get automatically used.
- *
- * @param cfg Optional DM8168DSPPWR module configuration. If provided as
- * NULL, default configuration is used.
- *
- * @sa DM8168DSPPWR_destroy
- * GateMutex_create
- */
-Int
-DM8168DSPPWR_setup (DM8168DSPPWR_Config * cfg)
-{
- Int status = PWRMGR_SUCCESS;
- DM8168DSPPWR_Config tmpCfg;
- Error_Block eb;
-
- Error_init(&eb);
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPWR_setup", cfg);
-
- if (cfg == NULL) {
- DM8168DSPPWR_getConfig (&tmpCfg);
- cfg = &tmpCfg;
- }
-
- /* Create a default gate handle for local module protection. */
- DM8168DSPPWR_state.gateHandle = (IGateProvider_Handle)
- GateMutex_create ((GateMutex_Params*)NULL, &eb);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DSPPWR_state.gateHandle == NULL) {
- /*! @retval PWRMGR_E_FAIL Failed to create GateMutex! */
- status = PWRMGR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_setup",
- status,
- "Failed to create GateMutex!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Copy the user provided values into the state object. */
- memcpy (&DM8168DSPPWR_state.cfg,
- cfg,
- sizeof (DM8168DSPPWR_Config));
-
- /* Initialize the name to handles mapping array. */
- memset (&DM8168DSPPWR_state.pwrHandles,
- 0,
- (sizeof (DM8168DSPPWR_Handle) * MultiProc_MAXPROCESSORS));
- DM8168DSPPWR_state.isSetup = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_setup", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to destroy the DM8168DSPPWR module.
- *
- * Once this function is called, other DM8168DSPPWR module APIs, except
- * for the DM8168DSPPWR_getConfig API cannot be called anymore.
- *
- * @sa DM8168DSPPWR_setup
- * GateMutex_delete
- */
-Int
-DM8168DSPPWR_destroy (Void)
-{
- Int status = PWRMGR_SUCCESS;
- UInt16 i;
-
- GT_0trace (curTrace, GT_ENTER, "DM8168DSPPWR_destroy");
-
- /* Check if any DM8168DSPPWR instances have not been deleted so far. If not,
- * delete them.
- */
- for (i = 0 ; i < MultiProc_MAXPROCESSORS ; i++) {
- GT_assert (curTrace, (DM8168DSPPWR_state.pwrHandles [i] == NULL));
- if (DM8168DSPPWR_state.pwrHandles [i] != NULL) {
- DM8168DSPPWR_delete (&(DM8168DSPPWR_state.pwrHandles [i]));
- }
- }
-
- if (DM8168DSPPWR_state.gateHandle != NULL) {
- GateMutex_delete ((GateMutex_Handle *)
- &(DM8168DSPPWR_state.gateHandle));
- }
-
- DM8168DSPPWR_state.isSetup = FALSE;
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_destroy", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to initialize the parameters for this PwrMgr instance.
- *
- * @param params Configuration parameters.
- *
- * @sa DM8168DSPPWR_create
- */
-Void
-DM8168DSPPWR_Params_init (DM8168DSPPWR_Params * params)
-{
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPWR_Params_init",params);
-
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (params == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_Params_init",
- PWRMGR_E_INVALIDARG,
- "Argument of type (DM8168DSPPWR_Params *) "
- "passed is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Return updated DM8168DSPPWR instance specific parameters. */
- params->reserved = 0;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_0trace (curTrace, GT_LEAVE, "DM8168DSPPWR_Params_init");
-}
-
-/*!
- * @brief Function to create an instance of this PwrMgr.
- *
- * @param procId Processor ID addressed by this PwrMgr instance.
- * @param params Configuration parameters.
- *
- * @sa DM8168DSPPWR_delete
- */
-DM8168DSPPWR_Handle
-DM8168DSPPWR_create ( UInt16 procId,
- const DM8168DSPPWR_Params * params)
-{
- Int status = PWRMGR_SUCCESS;
- PwrMgr_Object * handle = NULL;
- IArg key;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DSPPWR_create", procId, params);
-
- GT_assert (curTrace, IS_VALID_PROCID (procId));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (!IS_VALID_PROCID (procId)) {
- status = PWRMGR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_create",
- status,
- "Invalid procId specified");
- }
- else if (params == NULL) {
- status = PWRMGR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_create",
- status,
- "params passed is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168DSPPWR_state.gateHandle);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- /* Check if the PwrMgr already exists for specified procId. */
- if (DM8168DSPPWR_state.pwrHandles [procId] != NULL) {
- status = PWRMGR_E_ALREADYEXIST;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_create",
- status,
- "PwrMgr already exists for specified procId!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Allocate memory for the handle */
- handle = (PwrMgr_Object *) Memory_calloc (NULL,
- sizeof (PwrMgr_Object),
- 0,
- NULL);
- if (handle == NULL) {
- status = PWRMGR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_create",
- status,
- "Memory allocation failed for handle!");
- }
- else {
- /* Populate the handle fields */
- handle->pwrFxnTable.attach = &DM8168DSPPWR_attach;
- handle->pwrFxnTable.detach = &DM8168DSPPWR_detach;
- handle->pwrFxnTable.on = &DM8168DSPPWR_on;
- handle->pwrFxnTable.off = &DM8168DSPPWR_off;
- /* TBD: Other functions */
-
- /* Allocate memory for the DM8168DSPPWR handle */
- handle->object = Memory_calloc (NULL,
- sizeof (DM8168DSPPWR_Object),
- 0,
- NULL);
- if (handle->object == NULL) {
- status = PWRMGR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_create",
- status,
- "Memory allocation failed for handle!");
- }
- else {
-#if defined (SYSLINK_BUILDOS_LINUX)
- ((DM8168DSPPWR_Object *)(handle->object))->clockHandle
- = (ClockOps_Handle) LinuxClock_create();
-#endif/* #if defined (SYSLINK_BUILDOS_LINUX) */
-#if defined (SYSLINK_BUILD_RTOS)
- ((DM8168DSPPWR_Object *)(handle->object))->clockHandle
- = (ClockOps_Handle) DM8168CLOCK_create();
-#endif/* #if defined (SYSLINK_BUILD_RTOS) */
- handle->procId = procId;
- DM8168DSPPWR_state.pwrHandles [procId] =
- (DM8168DSPPWR_Handle) handle;
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168DSPPWR_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (status < 0) {
- if (handle != NULL) {
- if (handle->object != NULL) {
- Memory_free (NULL, handle->object, sizeof (DM8168DSPPWR_Object));
- }
- Memory_free (NULL, handle, sizeof (PwrMgr_Object));
- }
- /*! @retval NULL Function failed */
- handle = NULL;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_create", handle);
-
- /*! @retval Valid-Handle Operation successful */
- return (DM8168DSPPWR_Handle) handle;
-}
-
-
-/*!
- * @brief Function to delete an instance of this PwrMgr.
- *
- * The user provided pointer to the handle is reset after
- * successful completion of this function.
- *
- * @param handlePtr Pointer to Handle to the PwrMgr instance
- *
- * @sa DM8168DSPPWR_create
- */
-Int
-DM8168DSPPWR_delete (DM8168DSPPWR_Handle * handlePtr)
-{
- Int status = PWRMGR_SUCCESS;
- DM8168DSPPWR_Object * object = NULL;
- PwrMgr_Object * handle;
- IArg key;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPWR_delete", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PWRMGR_E_INVALIDARG Invalid NULL handlePtr specified*/
- status = PWRMGR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_delete",
- status,
- "Invalid NULL handlePtr specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_delete",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- handle = (PwrMgr_Object *) (*handlePtr);
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168DSPPWR_state.gateHandle);
-
- /* Reset handle in PwrMgr handle array. */
- GT_assert (curTrace, IS_VALID_PROCID (handle->procId));
- DM8168DSPPWR_state.pwrHandles [handle->procId] = NULL;
-
- object = (DM8168DSPPWR_Object *) handle->object;
- /* Free memory used for the DM8168DSPPWR object. */
- if (handle->object != NULL) {
- /* Free memory used for the clock handle */
-#if defined (SYSLINK_BUILDOS_LINUX)
- LinuxClock_delete(((DM8168DSPPWR_Object *)(handle->object))->clockHandle);
-#endif /* #if defined (SYSLINK_BUILDOS_LINUX) */
-#if defined (SYSLINK_BUILD_RTOS)
- DM8168CLOCK_delete(((DM8168DSPPWR_Object *)(handle->object))->clockHandle);
-#endif /* #if defined (SYSLINK_BUILD_RTOS) */
- Memory_free (NULL,
- object,
- sizeof (DM8168DSPPWR_Object));
- handle->object = NULL;
- }
-
- /* Free memory used for the PwrMgr object. */
- Memory_free (NULL, handle, sizeof (PwrMgr_Object));
- *handlePtr = NULL;
-
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168DSPPWR_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_delete", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to open a handle to an instance of this PwrMgr. This
- * function is called when access to the PwrMgr is required from
- * a different process.
- *
- * @param handlePtr Handle to the PwrMgr instance
- * @param procId Processor ID addressed by this PwrMgr instance.
- *
- * @sa DM8168DSPPWR_close
- */
-Int
-DM8168DSPPWR_open (DM8168DSPPWR_Handle * handlePtr, UInt16 procId)
-{
- Int status = PWRMGR_SUCCESS;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DSPPWR_open", handlePtr, procId);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, IS_VALID_PROCID (procId));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid NULL handlePtr specified */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_open",
- status,
- "Invalid NULL handlePtr specified");
- }
- else if (!IS_VALID_PROCID (procId)) {
- /*! @retval PWRMGR_E_INVALIDARG Invalid procId specified */
- status = PWRMGR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_open",
- status,
- "Invalid procId specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Initialize return parameter handle. */
- *handlePtr = NULL;
-
- /* Check if the PwrMgr exists and return the handle if found. */
- if (DM8168DSPPWR_state.pwrHandles [procId] == NULL) {
- /*! @retval PWRMGR_E_NOTFOUND Specified instance not found */
- status = PWRMGR_E_NOTFOUND;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_open",
- status,
- "Specified DM8168DSPPWR instance does not exist!");
- }
- else {
- *handlePtr = DM8168DSPPWR_state.pwrHandles [procId];
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_open", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to close a handle to an instance of this PwrMgr.
- *
- * @param handlePtr Pointer to Handle to the PwrMgr instance
- *
- * @sa DM8168DSPPWR_open
- */
-Int
-DM8168DSPPWR_close (DM8168DSPPWR_Handle * handlePtr)
-{
- Int status = PWRMGR_SUCCESS;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPWR_close", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PWRMGR_E_INVALIDARG Invalid NULL handlePtr pointer
- specified*/
- status = PWRMGR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_close",
- status,
- "Invalid NULL handlePtr pointer specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_close",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Nothing to be done for close. */
- *handlePtr = NULL;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_close", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return status;
-}
-
-
-/* =============================================================================
- * APIs called by PwrMgr module (part of function table interface)
- * =============================================================================
- */
-/*!
- * @brief Function to attach to the PwrMgr.
- *
- * @param handle Handle to the PwrMgr instance
- * @param params Attach parameters
- *
- * @sa DM8168DSPPWR_detach
- */
-Int
-DM8168DSPPWR_attach (PwrMgr_Handle handle, PwrMgr_AttachParams * params)
-{
- Int status = PWRMGR_SUCCESS;
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DSPPWR_Object * object = NULL;
- Memory_MapInfo mapInfo;
- /* Mapping for prcm base is done in DM8168VIDEOM3_phyShmemInit */
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DSPPWR_attach", handle, params);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_attach",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168DSPPWR_Object *) pwrMgrHandle->object;
- GT_assert (curTrace, (object != NULL));
- /* Map and get the virtual address for system control module */
- mapInfo.src = PRCM_BASE_ADDR;
- mapInfo.size = PRCM_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DSPPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_attach",
- status,
- "Failure in mapping prcm module");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object->prcmVA = mapInfo.dst;
-
- /* Map and get the virtual address for system control module */
- mapInfo.src = CTRL_MODULE_BASE_ADDR;
- mapInfo.size = CTRL_MODULE_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DSPPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_attach",
- status,
- "Failure in mapping prcm module");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object->controlVA = mapInfo.dst;
-
- /* Map and get the virtual address for system l2 ram */
- mapInfo.src = GEM_L2RAM_BASE_ADDR;
- mapInfo.size = GEM_L2RAM_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DSPPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_attach",
- status,
- "Failure in mapping prcm module");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object->l2baseVA = mapInfo.dst;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
- }
- }
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /*! @retval PWRMGR_SUCCESS Operation successful */
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_attach", status);
- return (status);
-
-}
-
-
-/*!
- * @brief Function to detach from the PwrMgr.
- *
- * @param handle Handle to the PwrMgr instance
- *
- * @sa DM8168DSPPWR_attach
- */
-Int
-DM8168DSPPWR_detach (PwrMgr_Handle handle)
-{
-
- Int status = PWRMGR_SUCCESS;
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DSPPWR_Object * object = NULL;
- Memory_UnmapInfo unmapInfo;
-
-
- /* Mapping for prcm base is done in DM8168VIDEOM3_phyShmemInit */
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPWR_detach", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_detach",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168DSPPWR_Object *) pwrMgrHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- if (object->controlVA != 0x0) {
- /* Unmap the virtual address for control module */
- unmapInfo.addr = object->controlVA;
- unmapInfo.size = CTRL_MODULE_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DSPPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_detach",
- status,
- "Failure in mapping prcm module");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
- }
- if (object->prcmVA != 0x0) {
- /* Unmap the virtual address for prcm module */
- unmapInfo.addr = object->prcmVA;
- unmapInfo.size = PRCM_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DSPPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_detach",
- status,
- "Failure in mapping prcm module");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
- }
- if (object->l2baseVA != 0x0) {
- /* Unmap the virtual address for prcm module */
- unmapInfo.addr = object->l2baseVA;
- unmapInfo.size = GEM_L2RAM_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DSPPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_detach",
- status,
- "Failure in mapping prcm module");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_detach", status);
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-
-}
-
-
-/*!
- * @brief Function to power on the slave processor.
- *
- * Power on the IVA subsystem, hold the DSP and SEQ in reset, and
- * release IVA2_RST. This is a hostile reset of the IVA. If the IVA
- * is already powered on, then it must be powered off in order to
- * terminate all current activity and initiate a power-on-reset
- * transition to bring the IVA to a know good state.
- *
- * @param handle Handle to the PwrMgr instance
- *
- * @sa DM8168DSPPWR_off
- */
-Int
-DM8168DSPPWR_on (PwrMgr_Handle handle)
-{
-
- Int status = PWRMGR_SUCCESS ;
-
-#if !defined (NETRA_SIMULATOR) /* Commented for simulator */
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DSPPWR_Object * object = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPWR_on", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_on",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168DSPPWR_Object *) pwrMgrHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* Enable spinlocks, mailbox and timers before powering on dsp */
- object->dspSpinlockHandle = ClockOps_get(object->clockHandle, "spinbox_ick");
-
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspSpinlockHandle != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspSpinlockHandle);
- if (status < 0) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_on",
- status,
- "ClockOps_enable failed");
- }
- object->dspMailboxHandle = ClockOps_get(object->clockHandle, "mailbox_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspMailboxHandle != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspMailboxHandle);
- GT_assert (curTrace, (status >= 0));
-
-#if defined(SYSLINK_VARIANT_TI814X) || defined(SYSLINK_VARIANT_TI811X)
- /* GP timer4 is actually timer 3 for bios it will be enabled from bios
- * Here we are enabling the gptimer 4 clk module
- */
-
- object->dspTimerIclkHandle = ClockOps_get(object->clockHandle, "gpt4_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspTimerIclkHandle != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspTimerIclkHandle);
- GT_assert (curTrace, (status >= 0));
-
- object->dspTimerFclkHandle = ClockOps_get(object->clockHandle, "gpt4_fck");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspTimerFclkHandle != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspTimerFclkHandle);
- GT_assert (curTrace, (status >= 0));
-#else
- /* GP timer3 is actually timer 2 for bios it will be enabled from bios
- * Here we are enabling the gptimer 3 clk module
- */
- /*
- * TISB update: I don't know what the above comment is trying to say.
- * We enable both gpt3 and gpt4 here for Netra because "older" BIOS
- * needs gpt3 and "newer" BIOS needs gpt4.
- */
-
- object->dspTimerIclkHandle1 = ClockOps_get(object->clockHandle, "gpt3_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspTimerIclkHandle1 != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspTimerIclkHandle1);
- GT_assert (curTrace, (status >= 0));
-
- object->dspTimerFclkHandle1 = ClockOps_get(object->clockHandle, "gpt3_fck");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspTimerFclkHandle1 != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspTimerFclkHandle1);
- GT_assert (curTrace, (status >= 0));
-
- object->dspTimerIclkHandle2 = ClockOps_get(object->clockHandle, "gpt4_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspTimerIclkHandle2 != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspTimerIclkHandle2);
- GT_assert (curTrace, (status >= 0));
-
- object->dspTimerFclkHandle2 = ClockOps_get(object->clockHandle, "gpt4_fck");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspTimerFclkHandle2 != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspTimerFclkHandle2);
- GT_assert (curTrace, (status >= 0));
-
- /* Bring GEM L2RAM out of Power down Mode */
- REG(object->controlVA + DSPMEM_SLEEP) = 0x0;
-#endif
-
- /* Enable Dsp MMU clocks */
-
- object->dspMmuCfgClkHandle = ClockOps_get(object->clockHandle, "mmu_cfg_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspMmuCfgClkHandle != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspMmuCfgClkHandle);
- GT_assert (curTrace, (status >= 0));
-
- object->dspMmuClkHandle = ClockOps_get(object->clockHandle, "mmu_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (object->dspMmuClkHandle != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspMmuClkHandle);
- GT_assert (curTrace, (status >= 0));
- object->dspClkHandle = ClockOps_get(object->clockHandle, "gem_ick");
-
- GT_assert (curTrace, (object->dspClkHandle != NULL));
- status = ClockOps_enable(object->clockHandle, object->dspClkHandle);
- GT_assert (curTrace, (status >= 0));
-
- /* Warm Reset to access Internal RAM of DSP - to access internal RAM */
-// REG((object->prcmVA) + RM_ACTIVE_RSTCTRL) = 0x01;
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_on", status);
- /*! @retval PWRMGR_SUCCESS Operation successful */
-#endif /*#if !defined (NETRA_SIMULATOR)*/
- return (status);
-}
-
-
-/*!
- * @brief Function to power off the slave processor.
- *
- * Turn the IVA power domain off. To ensure a clean power-off
- * transition, the IVA subsystem must first be turned on so that
- * the DSP can initiate an autonomous power-off transition.
- *
- * @param handle Handle to the PwrMgr instance
- * @param force Indicates whether power-off is to be forced
- *
- * @sa DM8168DSPPWR_on
- */
-Int
-DM8168DSPPWR_off (PwrMgr_Handle handle, Bool force)
-{
- Int status = PWRMGR_SUCCESS ;
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DSPPWR_Object * object = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DSPPWR_off", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSPPWR_off",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168DSPPWR_Object *) pwrMgrHandle->object;
- GT_assert (curTrace, (object != NULL));
-
-
- /* Disable Dsp mmu clocks */
- if(object->dspMmuClkHandle) {
- ClockOps_disable(object->clockHandle, object->dspMmuClkHandle);
- ClockOps_put(object->clockHandle, object->dspMmuClkHandle);
- }
- /* Disable Dsp mmu cfg clocks */
- if(object->dspMmuCfgClkHandle) {
- ClockOps_disable(object->clockHandle, object->dspMmuCfgClkHandle);
- ClockOps_put(object->clockHandle, object->dspMmuCfgClkHandle);
- }
-
- /* assert DSP standby, removed to fix DSP internal memory load, -rams */
-// REG(object->controlVA + DSP_IDLE_CFG) |= 0x8000;
-
- /* Disable GEM clocks */
- if(object->dspClkHandle) {
- ClockOps_disable(object->clockHandle, object->dspClkHandle);
- ClockOps_put(object->clockHandle, object->dspClkHandle);
- }
-
-#if defined(SYSLINK_VARIANT_TI814X) || defined(SYSLINK_VARIANT_TI811X)
- /* Disable Timer4 functional clocks */
- if(object->dspTimerFclkHandle) {
- ClockOps_disable(object->clockHandle, object->dspTimerFclkHandle);
- ClockOps_put(object->clockHandle, object->dspTimerFclkHandle);
- }
- /* Disable Timer4 interface clocks */
- if(object->dspTimerIclkHandle) {
- ClockOps_disable(object->clockHandle, object->dspTimerIclkHandle);
- ClockOps_put(object->clockHandle, object->dspTimerIclkHandle);
- }
-#else
- /* Bring GEM L2RAM in to Power down Mode */
- REG(object->controlVA + DSPMEM_SLEEP) = 0x04;
-
- /* Disable Timer4 functional clocks */
- if(object->dspTimerFclkHandle2) {
- ClockOps_disable(object->clockHandle, object->dspTimerFclkHandle2);
- ClockOps_put(object->clockHandle, object->dspTimerFclkHandle2);
- }
- /* Disable Timer4 interface clocks */
- if(object->dspTimerIclkHandle2) {
- ClockOps_disable(object->clockHandle, object->dspTimerIclkHandle2);
- ClockOps_put(object->clockHandle, object->dspTimerIclkHandle2);
- }
- /* Disable Timer3 functional clocks */
- if(object->dspTimerFclkHandle1) {
- ClockOps_disable(object->clockHandle, object->dspTimerFclkHandle1);
- ClockOps_put(object->clockHandle, object->dspTimerFclkHandle1);
- }
- /* Disable Timer3 interface clocks */
- if(object->dspTimerIclkHandle1) {
- ClockOps_disable(object->clockHandle, object->dspTimerIclkHandle1);
- ClockOps_put(object->clockHandle, object->dspTimerIclkHandle1);
- }
-#endif
- /* Disable Mailbox clocks */
- if(object->dspMailboxHandle) {
- ClockOps_disable(object->clockHandle, object->dspMailboxHandle);
- ClockOps_put(object->clockHandle, object->dspMailboxHandle);
- }
- /* Disable Spinlock clocks */
- if(object->dspSpinlockHandle) {
- ClockOps_disable(object->clockHandle, object->dspSpinlockHandle);
- ClockOps_put(object->clockHandle, object->dspSpinlockHandle);
- }
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSPPWR_off", status);
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/Dm8168DucatiMmu.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/Dm8168DucatiMmu.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * @file Dm8168DucatiMmu.c
- *
- * @brief ducati mmu code
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-/* OSAL & Utils headers */
-#include <OsalDelay.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-
-#include <ti/syslink/utils/Trace.h>
-#include <OsalThread.h>
-
-#include <PwrDefs.h>
-#include <PwrMgr.h>
-#include <Dm8168DucatiPwr.h>
-#include <ti/syslink/inc/knl/Linux/Dm8168DucatiMmu.h>
-#include <ti/syslink/inc/Bitops.h>
-
-#define REG(x) *((volatile UInt32 *) (x))
-
-
-#define RM_DEFAULT_RSTCTRL 0x00000B10
-#define RM_DEFAULT_RSTST 0x00000B14
-#define CM_DEFAULT_DUCATI_CLKSTCTRL 0x00000518
-#define CM_DEFAULT_DUCATI_CLKCTRL 0x00000574
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-
-Void DM8168DUCATIMMU_enable(PwrMgr_Handle handle)
-{
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DUCATIPWR_Object * object = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIMMU_enable", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIMMU_enable",
- PWRMGR_E_FAIL,
- "Invalid handle specified");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- object = (DM8168DUCATIPWR_Object *) pwrMgrHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /*Enable the Ducati Logic*/
- CLEAR_BIT(REG(object->prcmVA + RM_DEFAULT_RSTCTRL), 0x4);
- while((((REG(object->prcmVA + RM_DEFAULT_RSTST)&0x10))!=0x10));
-#if defined(SYSLINK_VARIANT_TI814X) || \
- defined(SYSLINK_VARIANT_TI813X) || \
- defined(SYSLINK_VARIANT_TI811X)
- /* This delay is required only in case of centaurus*/
-// OsalDelay_udelay(2);
- OsalThread_delay(2); //2ms sec delay
-#endif
- /* Write a while(1) so that even if m3 comes out of reset
- * m3 wont crash */
- REG(object->ducatibaseVA) = 0x10000;
- REG(object->ducatibaseVA + 0x04) = 0x9;
- REG(object->ducatibaseVA + 0x08) = 0xE7FEE7FE;
-
- /* M3_0 and M3_1 should be taken out of reset after this
- and that is done is reset code*/
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
-
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- GT_0trace (curTrace, GT_LEAVE, "DM8168DUCATIMMU_enable");
-}
-
-
-Void DM8168DUCATIMMU_disable(PwrMgr_Handle handle)
-{
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DUCATIPWR_Object * object = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIMMU_disable", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIMMU_enable",
- PWRMGR_E_FAIL,
- "Invalid handle specified");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- object = (DM8168DUCATIPWR_Object *) pwrMgrHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* This code is specific for apps to run */
- REG(object->ducatibaseVA) = 0x10000;
- REG(object->ducatibaseVA + 0x04) = 0x9;
- REG(object->ducatibaseVA + 0x08) = 0xE7FEE7FE;
- /* Flush the unicache so as to succeed in subsequent runs */
- REG(object->ducatiMmuVA + 0x0CA8) = 0x400;
-
- /* DO NOT Disable the Ducati Logic*/
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
-
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- GT_0trace (curTrace, GT_LEAVE, "DM8168DUCATIMMU_disable");
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/Dm8168DucatiPwr.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/Dm8168DucatiPwr.c
+++ /dev/null
@@ -1,1209 +0,0 @@
-/*
- * @file Dm8168DucatiPwr.c
- *
- * @brief PwrMgr implementation for DM8168DUCATI.
- *
- * This module is responsible for handling power requests for
- * the ProcMgr. The implementation is common to DM8168VIDEOM3 and
- * DM8168VPSSM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/String.h>
-#include <ti/syslink/utils/IGateProvider.h>
-#include <ti/syslink/utils/GateMutex.h>
-#include <ti/syslink/utils/Memory.h>
-#include <ti/syslink/utils/Gate.h>
-#if defined (SYSLINK_BUILDOS_LINUX)
-#include <ti/syslink/inc/knl/Linux/LinuxClock.h>
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/System.h>
-#include <xdc/runtime/Gate.h>
-#include <xdc/runtime/IGateProvider.h>
-#include <ti/sysbios/gates/GateMutex.h>
-#include <ti/syslink/utils/_Memory.h>
-#include <ti/syslink/inc/Dm8168Clock.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-#include <linux/string.h>
-#else
-#include <string.h>
-#endif
-
-#include <ti/syslink/utils/Trace.h>
-
-/* Module level headers */
-#include <ti/ipc/MultiProc.h>
-#include <ti/syslink/inc/_MultiProc.h>
-#include <ti/syslink/inc/knl/PwrDefs.h>
-#include <ti/syslink/inc/knl/PwrMgr.h>
-#include <ti/syslink/inc/knl/Dm8168DucatiPwr.h>
-#include <ti/syslink/inc/knl/_Dm8168DucatiPwr.h>
-#include <ti/syslink/inc/knl/Linux/Dm8168DucatiMmu.h>
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief DM8168VIDEOM3 module and mmr addresses (physical)
- */
-
-#define DM8168M3_PRCM_BASE_ADDR 0x48180000
-#define DM8168M3_PRCM_SIZE 0x00002FFF
-
-/* Ducati MMU base */
-#define DUCATI_MMU_CFG 0x55080000
-#define DUCATI_MMU_CFG_SIZE 0x00000FFF
-
-
-#define DUCATI_BASE_ADDR 0x55020000
-#define DUCATI_BASE_ADDR_SIZE 0x00000008
-
-#define MAX_WAIT_COUNT 0x50000
-
-#define REG(x) *((volatile UInt32 *) (x))
-#define MEM(x) *((volatile UInt32 *) (x))
-
-/* Macro to make a correct module magic number with refCount */
-#define DM8168DUCATIPWR_MAKE_MAGICSTAMP(x) \
- ((DM8168DUCATIPWR_MODULEID << 12u) | (x))
-
-/*!
- * @brief DM8168DUCATIPWR Module state object
- */
-typedef struct DM8168DUCATIPWR_ModuleObject_tag {
- UInt32 refCount;
- /* Module Reference count */
- UInt32 pwrstateRefCount;
- /* Reference count */
- UInt32 configSize;
- /*!< Size of configuration structure */
- DM8168DUCATIPWR_Config cfg;
- /*!< DM8168DUCATIPWR configuration structure */
- DM8168DUCATIPWR_Config defCfg;
- /*!< Default module configuration */
- Bool isSetup;
- /*!< Indicates whether the DM8168DUCATIPWR module is setup. */
- DM8168DUCATIPWR_Handle pwrHandles [MultiProc_MAXPROCESSORS];
- /*!< PwrMgr handle array. */
- IGateProvider_Handle gateHandle;
- /*!< Handle of gate to be used for local thread safety */
- Ptr ducatiClkHandle;
- /*!< clock handle used to call kernel APIs */
- Ptr ducatiSpinlockHandle;
- /*!< dsp Spinlock handle */
- Ptr ducatiMailboxHandle;
- /*!< dsp Mailbox handle */
-} DM8168DUCATIPWR_ModuleObject;
-
-/* =============================================================================
- * Globals
- * =============================================================================
- */
-/*!
- * @var DM8168DUCATIPWR_state
- *
- * @brief DM8168DUCATIPWR state object variable
- */
-#if !defined(SYSLINK_BUILD_DEBUG)
-static
-#endif /* if !defined(SYSLINK_BUILD_DEBUG) */
-DM8168DUCATIPWR_ModuleObject DM8168DUCATIPWR_state =
-{
- .isSetup = FALSE,
- .configSize = sizeof (DM8168DUCATIPWR_Config),
- .refCount = 0,
- .pwrstateRefCount = 0,
- .defCfg.reserved = 0,
- .gateHandle = NULL,
-};
-
-/* =============================================================================
- * APIs directly called by applications
- * =============================================================================
- */
-/*!
- * @brief Function to get the default configuration for the DM8168DUCATIPWR
- * module.
- *
- * This function can be called by the application to get their
- * configuration parameter to DM8168DUCATIPWR_setup filled in by the
- * DM8168DUCATIPWR module with the default parameters. If the user does
- * not wish to make any change in the default parameters, this API
- * is not required to be called.
- *
- * @param cfg Pointer to the DM8168DUCATIPWR module configuration
- * structure in which the default config is to be
- * returned.
- *
- * @sa DM8168DUCATIPWR_setup
- */
-Void
-DM8168DUCATIPWR_getConfig (DM8168DUCATIPWR_Config * cfg)
-{
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_getConfig", cfg);
-
- GT_assert (curTrace, (cfg != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (cfg == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_getConfig",
- PWRMGR_E_INVALIDARG,
- "Argument of type (DM8168DUCATIPWR_Config *) passed "
- "is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (DM8168DUCATIPWR_state.refCount == 0) {
- memcpy (cfg,
- &DM8168DUCATIPWR_state.defCfg,
- sizeof (DM8168DUCATIPWR_Config));
- }
- else {
- memcpy (cfg,
- &DM8168DUCATIPWR_state.cfg,
- sizeof (DM8168DUCATIPWR_Config));
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_0trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_getConfig");
-}
-
-/*!
- * @brief Function to setup the DM8168DUCATIPWR module.
- *
- * This function sets up the DM8168DUCATIPWR module. This function must
- * be called before any other instance-level APIs can be invoked.
- * Module-level configuration needs to be provided to this
- * function. If the user wishes to change some specific config
- * parameters, then DM8168DUCATIPWR_getConfig can be called to get the
- * configuration filled with the default values. After this, only
- * the required configuration values can be changed. If the user
- * does not wish to make any change in the default parameters, the
- * application can simply call DM8168DUCATIPWR_setup with NULL
- * parameters. The default parameters would get automatically used.
- *
- * @param cfg Optional DM8168DUCATIPWR module configuration. If provided as
- * NULL, default configuration is used.
- *
- * @sa DM8168DUCATIPWR_destroy
- * GateMutex_create
- */
-Int
-DM8168DUCATIPWR_setup (DM8168DUCATIPWR_Config * cfg)
-{
- Int status = PWRMGR_SUCCESS;
- DM8168DUCATIPWR_Config tmpCfg;
- IArg key;
- Error_Block eb;
-
-#if defined(SYSLINK_BUILD_RTOS)
- Error_init(&eb);
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-#if defined(SYSLINK_BUILD_HLOS)
- eb = 0;
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_setup", cfg);
- if (cfg == NULL) {
- DM8168DUCATIPWR_getConfig (&tmpCfg);
- cfg = &tmpCfg;
- }
-
- /* This sets the refCount variable is not initialized, upper 16 bits is
- * written with module Id to ensure correctness of refCount variable.
- */
- key = Gate_enterSystem();
- DM8168DUCATIPWR_state.refCount++;
- if (DM8168DUCATIPWR_state.refCount > 1) {
- status = DM8168DUCATIPWR_S_ALREADYSETUP;
- Gate_leaveSystem(key);
- }
- else {
- Gate_leaveSystem(key);
-
- /* Create a default gate handle for local module protection. */
- DM8168DUCATIPWR_state.gateHandle = (IGateProvider_Handle)
- GateMutex_create ((GateMutex_Params*)NULL, &eb);
- if (DM8168DUCATIPWR_state.gateHandle == NULL) {
- key = Gate_enterSystem();
- DM8168DUCATIPWR_state.refCount = 0;
- Gate_leaveSystem(key);
- /*! @retval PWRMGR_E_FAIL Failed to create GateMutex! */
- status = PWRMGR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_setup",
- status,
- "Failed to create GateMutex!");
- }
- else {
- /* Copy the user provided values into the state object. */
- memcpy (&DM8168DUCATIPWR_state.cfg,
- cfg,
- sizeof (DM8168DUCATIPWR_Config));
-
- /* Initialize the name to handles mapping array. */
- memset (&DM8168DUCATIPWR_state.pwrHandles,
- 0,
- (sizeof (DM8168DUCATIPWR_Handle) * MultiProc_MAXPROCESSORS));
- DM8168DUCATIPWR_state.isSetup = TRUE;
- }
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_setup", status);
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-/*!
- * @brief Function to destroy the DM8168DUCATIPWR module.
- *
- * Once this function is called, other DM8168DUCATIPWR module APIs, except
- * for the DM8168DUCATIPWR_getConfig API cannot be called anymore.
- *
- * @sa DM8168DUCATIPWR_setup
- * GateMutex_delete
- */
-Int
-DM8168DUCATIPWR_destroy (Void)
-{
- Int status = PWRMGR_SUCCESS;
- UInt16 i;
- IArg key;
-
- GT_0trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_destroy");
-
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- status = DM8168DUCATIPWR_E_INVALIDSTATE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_destroy",
- status,
- "Module was not initialized!");
- }
- else {
-#endif /* !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- key = Gate_enterSystem();
- DM8168DUCATIPWR_state.refCount--;
- Gate_leaveSystem(key);
-
- if (DM8168DUCATIPWR_state.refCount == 0) {
- /* Temporarily increment refCount here. */
- key = Gate_enterSystem();
- DM8168DUCATIPWR_state.refCount = 1;
- Gate_leaveSystem(key);
-
- /* Check if any DM8168DUCATIPWR instances have not been deleted so far. If not,
- * delete them.
- */
- for (i = 0 ; i < MultiProc_MAXPROCESSORS ; i++) {
- GT_assert (curTrace, (DM8168DUCATIPWR_state.pwrHandles [i] == NULL));
- if (DM8168DUCATIPWR_state.pwrHandles [i] != NULL) {
- DM8168DUCATIPWR_delete (&(DM8168DUCATIPWR_state.pwrHandles [i]));
- }
- }
- /* restore refCount here. */
- key = Gate_enterSystem();
- DM8168DUCATIPWR_state.refCount = 0;
- Gate_leaveSystem(key);
-
- if (DM8168DUCATIPWR_state.gateHandle != NULL) {
- GateMutex_delete ((GateMutex_Handle *)
- &(DM8168DUCATIPWR_state.gateHandle));
- }
- DM8168DUCATIPWR_state.isSetup = FALSE;
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_destroy", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-/*!
- * @brief Function to initialize the parameters for this PwrMgr instance.
- *
- * @param params Configuration parameters.
- *
- * @sa DM8168DUCATIPWR_create
- */
-Void
-DM8168DUCATIPWR_Params_init (DM8168DUCATIPWR_Params * params)
-{
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_Params_init", params);
-
- GT_assert (curTrace, (params != NULL));
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_Params_initv",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else if (params == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_Params_init",
- PWRMGR_E_INVALIDARG,
- "Argument of type (DM8168DUCATIPWR_Params *) "
- "passed is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- params->reserved = 0;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_0trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_Params_init");
-}
-
-/*!
- * @brief Function to create an instance of this PwrMgr.
- *
- * @param procId Processor ID addressed by this PwrMgr instance.
- * @param params Configuration parameters.
- *
- * @sa DM8168DUCATIPWR_delete
- */
-DM8168DUCATIPWR_Handle
-DM8168DUCATIPWR_create ( UInt16 procId,
- const DM8168DUCATIPWR_Params * params)
-{
- Int status = PWRMGR_SUCCESS;
- PwrMgr_Object * handle = NULL;
- IArg key;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_create", procId, params);
-
- GT_assert (curTrace, IS_VALID_PROCID (procId));
- GT_assert (curTrace, (params != NULL));
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_create",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else if (!IS_VALID_PROCID (procId)) {
- /* Not setting status here since this function does not return status.*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_create",
- PWRMGR_E_INVALIDARG,
- "Invalid procId specified");
- }
- else if (params == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_create",
- PWRMGR_E_INVALIDARG,
- "params passed is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168DUCATIPWR_state.gateHandle);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- /* Check if the PwrMgr already exists for specified procId. */
- if (DM8168DUCATIPWR_state.pwrHandles [procId] != NULL) {
- status = PWRMGR_E_ALREADYEXIST;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_create",
- status,
- "PwrMgr already exists for specified procId!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Allocate memory for the handle */
- handle = (PwrMgr_Object *) Memory_calloc (NULL,
- sizeof (PwrMgr_Object),
- 0,
- NULL);
- if (handle == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_create",
- PWRMGR_E_MEMORY,
- "Memory allocation failed for handle!");
- }
- else {
- /* Populate the handle fields */
- handle->pwrFxnTable.attach = &DM8168DUCATIPWR_attach;
- handle->pwrFxnTable.detach = &DM8168DUCATIPWR_detach;
- handle->pwrFxnTable.on = &DM8168DUCATIPWR_on;
- handle->pwrFxnTable.off = &DM8168DUCATIPWR_off;
- /* TBD: Other functions */
-
- /* Allocate memory for the DM8168DUCATIPWR handle */
- handle->object = Memory_calloc (NULL,
- sizeof (DM8168DUCATIPWR_Object),
- 0,
- NULL);
- if (handle == NULL) {
- status = PWRMGR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_create",
- status,
- "Memory allocation failed for handle!");
- }
- else {
-#if defined (SYSLINK_BUILDOS_LINUX)
- ((DM8168DUCATIPWR_Object *)handle->object)->clockHandle
- = (ClockOps_Handle) LinuxClock_create();
-#endif/* #if defined (SYSLINK_BUILDOS_LINUX) */
-#if defined (SYSLINK_BUILD_RTOS)
- ((DM8168DUCATIPWR_Object *)handle->object)->clockHandle
- = (ClockOps_Handle) DM8168CLOCK_create();
-#endif/* #if defined (SYSLINK_BUILD_RTOS) */
- handle->procId = procId;
- DM8168DUCATIPWR_state.pwrHandles [procId] =
- (DM8168DUCATIPWR_Handle) handle;
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168DUCATIPWR_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (status < 0) {
- if (handle != NULL) {
- if (handle->object != NULL) {
- Memory_free (NULL, handle->object, sizeof (DM8168DUCATIPWR_Object));
- }
- Memory_free (NULL, handle, sizeof (PwrMgr_Object));
- }
- /*! @retval NULL Function failed */
- handle = NULL;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_create", handle);
-
- /*! @retval Valid-Handle Operation successful */
- return (DM8168DUCATIPWR_Handle) handle;
-}
-
-/*!
- * @brief Function to delete an instance of this PwrMgr.
- *
- * The user provided pointer to the handle is reset after
- * successful completion of this function.
- *
- * @param handlePtr Pointer to Handle to the PwrMgr instance
- *
- * @sa DM8168DUCATIPWR_create
- */
-Int
-DM8168DUCATIPWR_delete (DM8168DUCATIPWR_Handle * handlePtr)
-{
- Int status = PWRMGR_SUCCESS;
- DM8168DUCATIPWR_Object * object = NULL;
- PwrMgr_Object * handle;
- IArg key;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_delete", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_delete",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else if (handlePtr == NULL) {
- /*! @retval PWRMGR_E_INVALIDARG Invalid NULL handlePtr specified*/
- status = PWRMGR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_delete",
- status,
- "Invalid NULL handlePtr specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_delete",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- handle = (PwrMgr_Object *) (*handlePtr);
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168DUCATIPWR_state.gateHandle);
-
- /* Reset handle in PwrMgr handle array. */
- GT_assert (curTrace, IS_VALID_PROCID (handle->procId));
- DM8168DUCATIPWR_state.pwrHandles [handle->procId] = NULL;
-
- object = (DM8168DUCATIPWR_Object *) handle->object;
- /* Free memory used for the DM8168DUCATIPWR object. */
- if (handle->object != NULL) {
- /* Free memory used for the clock handle */
-#if defined (SYSLINK_BUILDOS_LINUX)
- LinuxClock_delete(((DM8168DUCATIPWR_Object *)handle->object)->clockHandle);
-#endif /* #if defined (SYSLINK_BUILDOS_LINUX) */
-#if defined (SYSLINK_BUILD_RTOS)
- DM8168CLOCK_delete(((DM8168DUCATIPWR_Object *)handle->object)->clockHandle);
-#endif /* #if defined (SYSLINK_BUILD_RTOS) */
- Memory_free (NULL,
- object,
- sizeof (DM8168DUCATIPWR_Object));
- handle->object = NULL;
- }
-
- /* Free memory used for the PwrMgr object. */
- Memory_free (NULL, handle, sizeof (PwrMgr_Object));
- *handlePtr = NULL;
-
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168DUCATIPWR_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_delete", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-/*!
- * @brief Function to open a handle to an instance of this PwrMgr. This
- * function is called when access to the PwrMgr is required from
- * a different process.
- *
- * @param handlePtr Handle to the PwrMgr instance
- * @param procId Processor ID addressed by this PwrMgr instance.
- *
- * @sa DM8168DUCATIPWR_close
- */
-Int
-DM8168DUCATIPWR_open (DM8168DUCATIPWR_Handle * handlePtr, UInt16 procId)
-{
- Int status = PWRMGR_SUCCESS;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_open", handlePtr, procId);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, IS_VALID_PROCID (procId));
-
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_open",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else if (handlePtr == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid NULL handlePtr specified */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_open",
- status,
- "Invalid NULL handlePtr specified");
- }
- else if (!IS_VALID_PROCID (procId)) {
- /*! @retval PWRMGR_E_INVALIDARG Invalid procId specified */
- status = PWRMGR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_open",
- status,
- "Invalid procId specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Initialize return parameter handle. */
- *handlePtr = NULL;
-
- /* Check if the PwrMgr exists and return the handle if found. */
- if (DM8168DUCATIPWR_state.pwrHandles [procId] == NULL) {
- /*! @retval PWRMGR_E_NOTFOUND Specified instance not found */
- status = PWRMGR_E_NOTFOUND;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_open",
- status,
- "Specified DM8168DUCATIPWR instance does not exist!");
- }
- else {
- *handlePtr = DM8168DUCATIPWR_state.pwrHandles [procId];
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_open", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return status;
-}
-
-/*!
- * @brief Function to close a handle to an instance of this PwrMgr.
- *
- * @param handlePtr Pointer to Handle to the PwrMgr instance
- *
- * @sa DM8168DUCATIPWR_open
- */
-Int
-DM8168DUCATIPWR_close (DM8168DUCATIPWR_Handle * handlePtr)
-{
- Int status = PWRMGR_SUCCESS;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_close", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_close",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else if (handlePtr == NULL) {
- /*! @retval PWRMGR_E_INVALIDARG Invalid NULL handlePtr pointer
- specified*/
- status = PWRMGR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_close",
- status,
- "Invalid NULL handlePtr pointer specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_close",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- /* Nothing to be done for close. */
- *handlePtr = NULL;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_close", status);
-
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return status;
-}
-
-/* =============================================================================
- * APIs called by PwrMgr module (part of function table interface)
- * =============================================================================
- */
-/*!
- * @brief Function to attach to the PwrMgr.
- *
- * @param handle Handle to the PwrMgr instance
- * @param params Attach parameters
- *
- * @sa DM8168DUCATIPWR_detach
- */
-Int
-DM8168DUCATIPWR_attach (PwrMgr_Handle handle, PwrMgr_AttachParams * params)
-{
-
- Int status = PWRMGR_SUCCESS;
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DUCATIPWR_Object * object = NULL;
- Memory_MapInfo mapInfo;
- /* Mapping for prcm base is done in DM8168VIDEOM3_phyShmemInit */
-
- GT_2trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_attach", handle, params);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (params != NULL));
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_attach",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_attach",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- object = (DM8168DUCATIPWR_Object *) pwrMgrHandle->object;
- GT_assert (curTrace, (object != NULL));
- /* Map and get the virtual address for system control module */
- mapInfo.src = DM8168M3_PRCM_BASE_ADDR;
- mapInfo.size = DM8168M3_PRCM_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DUCATIPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_attach",
- status,
- "Failure in mapping prcm module");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- object->prcmVA = mapInfo.dst;
- /* Map and get the virtual address for system control module */
- mapInfo.src = DUCATI_MMU_CFG;
- mapInfo.size = DUCATI_MMU_CFG_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DUCATIPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_attach",
- status,
- "Failure in mapping ducatimmu module");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- object->ducatiMmuVA = mapInfo.dst;
- /* Map and get the virtual address for system control module */
- mapInfo.src = DUCATI_BASE_ADDR;
- mapInfo.size = DUCATI_BASE_ADDR_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DUCATIPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_attach",
- status,
- "Failure in mapping ducatibase module");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- object->ducatibaseVA = mapInfo.dst;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
- }
- }
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_attach", status);
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-/*!
- * @brief Function to detach from the PwrMgr.
- *
- * @param handle Handle to the PwrMgr instance
- *
- * @sa DM8168DUCATIPWR_attach
- */
-Int
-DM8168DUCATIPWR_detach (PwrMgr_Handle handle)
-{
- Int status = PWRMGR_SUCCESS;
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DUCATIPWR_Object * object = NULL;
- Memory_UnmapInfo unmapInfo;
-
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_detach", handle);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_detach",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_detach",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- object = (DM8168DUCATIPWR_Object *) pwrMgrHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* Unmap the virtual address for prcm module */
- unmapInfo.addr = object->prcmVA;
- unmapInfo.size = DM8168M3_PRCM_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DUCATIPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_detach",
- status,
- "Failure in mapping prcm module");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- }
- /* Unmap the virtual address for mmu base*/
- unmapInfo.addr = object->ducatiMmuVA;
- unmapInfo.size = DUCATI_MMU_CFG_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DUCATIPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_detach",
- status,
- "Failure in mapping ducatiMmu module");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- }
-
- /* Unmap the virtual address for ducati control base */
- unmapInfo.addr = object->ducatibaseVA;
- unmapInfo.size = DUCATI_BASE_ADDR_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- status = DM8168DUCATIPWR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_detach",
- status,
- "Failure in mapping ducatiMmu module");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_detach", status);
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-/*!
- * @brief Function to power on the slave processor.
- *
- * Power on the IVA subsystem, hold the DSP and SEQ in reset, and
- * release IVA2_RST. This is a hostile reset of the IVA. If the IVA
- * is already powered on, then it must be powered off in order to
- * terminate all current activity and initiate a power-on-reset
- * transition to bring the IVA to a know good state.
- *
- * @param handle Handle to the PwrMgr instance
- *
- * @sa DM8168DUCATIPWR_off
- */
-Int
-DM8168DUCATIPWR_on (PwrMgr_Handle handle)
-{
- Int status = PWRMGR_SUCCESS ;
- Int32 tmpstatus = 0;
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DUCATIPWR_Object * object = NULL;
- IArg key;
- (Void)tmpstatus;
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_on", handle);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_on",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* This sets the refCount variable is not initialized, upper 16 bits is
- * written with module Id to ensure correctness of refCount variable.
- */
- key = Gate_enterSystem();
- DM8168DUCATIPWR_state.pwrstateRefCount++;
- if (DM8168DUCATIPWR_state.pwrstateRefCount > 1) {
- status = DM8168DUCATIPWR_S_ALREADYSETUP;
- Gate_leaveSystem(key);
- }
- else {
- Gate_leaveSystem(key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)&& defined(SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_on",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- object = (DM8168DUCATIPWR_Object *) pwrMgrHandle->object;
-
- GT_assert (curTrace, (object != NULL));
- /* Enable spinlocks, mailbox and timers before powering on ducati */
-
- DM8168DUCATIPWR_state.ducatiSpinlockHandle
- = ClockOps_get(object->clockHandle, "spinbox_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace,
- (DM8168DUCATIPWR_state.ducatiSpinlockHandle != NULL));
- status = ClockOps_enable(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiSpinlockHandle);
- GT_assert (curTrace, (status >= 0));
-
- DM8168DUCATIPWR_state.ducatiMailboxHandle
- = ClockOps_get(object->clockHandle, "mailbox_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- GT_assert (curTrace, (DM8168DUCATIPWR_state.ducatiMailboxHandle != NULL));
- status = ClockOps_enable(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiMailboxHandle);
- GT_assert (curTrace, (status >= 0));
-
- /* poer on ducati */
- DM8168DUCATIPWR_state.ducatiClkHandle
- = ClockOps_get(object->clockHandle, "ducati_ick");
- /* Do not put this check under SYSLINK_BUILD_OPTIMIZE */
- if (DM8168DUCATIPWR_state.ducatiClkHandle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_on",
- status,
- "object->clkHandle retuned NULL clk_get failed for ducati");
- }
- else {
- tmpstatus = ClockOps_enable(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiClkHandle);
- GT_assert (curTrace, (tmpstatus >= 0));
- /* Complete the remaining power sequence here*/
- DM8168DUCATIMMU_enable(pwrMgrHandle);
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS)*/
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)*/
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_on", status);
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-/*!
- * @brief Function to power off the slave processor.
- *
- * Turn the IVA power domain off. To ensure a clean power-off
- * transition, the IVA subsystem must first be turned on so that
- * the DSP can initiate an autonomous power-off transition.
- *
- * @param handle Handle to the PwrMgr instance
- * @param force Indicates whether power-off is to be forced
- *
- * @sa DM8168DUCATIPWR_on
- */
-Int
-DM8168DUCATIPWR_off (PwrMgr_Handle handle, Bool force)
-{
- Int status = PWRMGR_SUCCESS ;
- PwrMgr_Object * pwrMgrHandle = (PwrMgr_Object *) handle;
- DM8168DUCATIPWR_Object * object = NULL;
- IArg key;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168DUCATIPWR_off", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
- GT_assert (curTrace, (DM8168DUCATIPWR_state.refCount != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168DUCATIPWR_state.refCount == 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_off",
- DM8168DUCATIPWR_E_INVALIDSTATE,
- "Module was not initialized!");
- }
- else if (handle == NULL) {
- /*! @retval PWRMGR_E_HANDLE Invalid argument */
- status = PWRMGR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DUCATIPWR_off",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168DUCATIPWR_Object *) pwrMgrHandle->object;
- key = Gate_enterSystem();
- DM8168DUCATIPWR_state.pwrstateRefCount--;
- Gate_leaveSystem(key);
-
- if (DM8168DUCATIPWR_state.pwrstateRefCount == 0) {
- DM8168DUCATIMMU_disable(pwrMgrHandle);
- /* Disable Mailbox clocks */
- if(DM8168DUCATIPWR_state.ducatiMailboxHandle) {
- ClockOps_disable(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiMailboxHandle);
- ClockOps_put(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiMailboxHandle);
- }
- /* Disable Spinlock clocks */
- if(DM8168DUCATIPWR_state.ducatiSpinlockHandle) {
- ClockOps_disable(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiSpinlockHandle);
- ClockOps_put(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiSpinlockHandle);
- }
- if(DM8168DUCATIPWR_state.ducatiClkHandle) {
- ClockOps_disable(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiClkHandle);
- ClockOps_put(object->clockHandle,
- DM8168DUCATIPWR_state.ducatiClkHandle);
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168DUCATIPWR_off", status);
- /*! @retval PWRMGR_SUCCESS Operation successful */
- return (status);
-}
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHal.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHal.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHal.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * @file Dm8168M3VideoHal.c
- *
- * @brief Top-level Hardware Abstraction Module implementation
- *
- * This module implements the top-level Hardware Abstraction Layer
- * for DM8168VIDEOM3.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-/* OSAL & utils headers */
-#include <ti/syslink/utils/Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Trace.h>
-
-/* Hardware Abstraction Layer headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-#include <Dm8168M3VideoHal.h>
-#include <Dm8168M3VideoHalBoot.h>
-#include <Dm8168M3VideoPhyShmem.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs called by DM8168VIDEOM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to initialize the HAL object
- *
- * @param halObj Return parameter: Pointer to the HAL object
- * @param initParams Optional initialization parameters
- *
- * @sa DM8168VIDEOM3_halExit
- * DM8168VIDEOM3_phyShmemInit
- */
-Int
-DM8168VIDEOM3_halInit (Ptr * halObj, Ptr params)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3_HalObject * halObject = NULL;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168VIDEOM3_halInit", halObj, params);
-
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168VIDEOM3_HalObject *) halObj ;
-
- (Void) params ; /* Not used. */
-
- *halObj = Memory_calloc (NULL, sizeof (DM8168VIDEOM3_HalObject), 0, NULL);
- if (halObject == NULL) {
- /*! @retval PROCESSOR_E_MEMORY Memory allocation failed */
- status = PROCESSOR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halInit",
- status,
- "Memory allocation failed for HAL object!");
- }
- else {
- status = DM8168VIDEOM3_phyShmemInit (*halObj);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halInit",
- status,
- "DM8168VIDEOM3_phyShmemInit failed!");
- Memory_free (NULL, *halObj, sizeof (DM8168VIDEOM3_HalObject));
- *halObj = NULL;
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
-
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3_halInit", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to finalize the HAL object
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168VIDEOM3_halInit
- * DM8168VIDEOM3_phyShmemExit
- */
-Int
-DM8168VIDEOM3_halExit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3_halExit", halObj);
-
- GT_assert (curTrace, (halObj != NULL));
-
- status = DM8168VIDEOM3_phyShmemExit (halObj);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halExit",
- status,
- "DM8168VIDEOM3_phyShmemExit failed!");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (halObj != NULL) {
- /* Free the memory for the HAL object. */
- Memory_free (NULL, halObj, sizeof (DM8168VIDEOM3_HalObject));
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3_halExit", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalBoot.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalBoot.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalBoot.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * @file Dm8168M3VideoHalBoot.c
- *
- * @brief Boot control module.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Trace.h>
-
-/* Module headers */
-//#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168M3VideoHal.h>
-#include <Dm8168M3VideoHalBoot.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Offsets of the DSP BOOT ADDR register
- */
-#define CONTROL_IVA2_BOOTADDR_OFFSET 0x190
-#define CONTROL_IVA2_BOOTMOD_OFFSET 0x194
-
-
-/* =============================================================================
- * APIs called by DM8168VIDEOM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control boot operations
- *
- * @param halObj Pointer to the HAL object
- * @param cmd Boot command
- * @param arg Arguments specific to the boot command
- *
- * @sa
- */
-Int
-DM8168VIDEOM3_halBootCtrl (Ptr halObj, Processor_BootCtrlCmd cmd, Ptr args)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3_HalObject * halObject = NULL;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VIDEOM3_halBootCtrl", halObj, cmd, args);
-
- GT_assert (curTrace, (halObj != NULL));
- GT_assert (curTrace, (cmd < Processor_BootCtrlCmd_EndValue));
-
- halObject = (DM8168VIDEOM3_HalObject *) halObj;
-
- switch (cmd) {
- case Processor_BootCtrlCmd_SetEntryPoint:
- {
- /* copy _c_int00 addresses to 0x4th location of Ducati
- Last bit at this mem location has to be explicitly set to 1 to
- ensure that M3 is in THUMB mode*/
- REG (halObject->generalCtrlBase) = 0x0;
- REG (halObject->generalCtrlBase) = ((UInt32)args | 0x1);
- }
- break ;
-
- case Processor_BootCtrlCmd_SetBootComplete:
- {
- /* Do nothing here for DM8168VIDEOM3 gem */
- }
- break ;
-
- case Processor_BootCtrlCmd_ResetBootComplete:
- {
- /* Do nothing here for DM8168VIDEOM3 gem */
- }
- break ;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halBootCtrl",
- status,
- "Unsupported boot ctrl cmd specified");
- }
- break ;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3_halBootCtrl",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalReset.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalReset.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalReset.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * @file Dm8168M3VideoHalReset.c
- *
- * @brief Reset control module.
- *
- * This module is responsible for handling reset-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Trace.h>
-#include <Bitops.h>
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168M3VideoHal.h>
-#include <Dm8168M3VideoHalReset.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-#define CM_DEFAULT_DUCATI_CLKSTCTRL 0x00000518
-#define CM_DEFAULT_DUCATI_CLKCTRL 0x00000574
-#define RM_DEFAULT_RSTCTRL 0x00000B10
-#define RM_DEFAULT_RSTST 0x00000B14
-
-
-/* =============================================================================
- * APIs called by DM8168VIDEOM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control reset operations
- *
- * @param halObj Pointer to the HAL object
- * @param cmd Reset control command
- * @param arg Arguments specific to the reset control command
- *
- * @sa
- */
-Int
-DM8168VIDEOM3_halResetCtrl (Ptr halObj, Processor_ResetCtrlCmd cmd, Ptr args)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3_HalObject * halObject = NULL;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VIDEOM3_halResetCtrl", halObj, cmd, args);
-
- GT_assert (curTrace, (halObj != NULL));
- GT_assert (curTrace, (cmd < Processor_ResetCtrlCmd_EndValue));
-
- halObject = (DM8168VIDEOM3_HalObject *) halObj ;
-
- switch (cmd) {
- case Processor_ResetCtrlCmd_Reset:
- {
- /*Put ONLY Ducati M3_0 to Reset*/
- SET_BIT (REG((halObject->prcmBase) + RM_DEFAULT_RSTCTRL), 0x2);
- /* clear the status bit only if it is set*/
- if(TEST_BIT(REG((halObject->prcmBase) + RM_DEFAULT_RSTST) , 0x2)) {
- REG((halObject->prcmBase) + RM_DEFAULT_RSTST) = 0x4;
- }
- }
- break ;
-
- case Processor_ResetCtrlCmd_Release:
- {
- /*Bring ONLY Ducati M3_0 out of Reset*/
- CLEAR_BIT (REG((halObject->prcmBase) + RM_DEFAULT_RSTCTRL), 0x2);
- /*Check for Ducati M3_0 out of Reset*/
- while((((REG(halObject->prcmBase + RM_DEFAULT_RSTST)&0x04))!=0x04)&&
- (((REG(halObject->prcmBase + RM_DEFAULT_RSTST)&0x14))!=0x14)&&
- (((REG(halObject->prcmBase + RM_DEFAULT_RSTST)&0x1C))!=0x1C)) ;
- /*Check Module is in Functional Mode */
- while(((REG(halObject->prcmBase + CM_DEFAULT_DUCATI_CLKCTRL)&0x30000)>>16)!=0) ;
- }
- break;
-
- case Processor_ResetCtrlCmd_PeripheralUp:
- {
- /* Nothing to be done to bringup the peripherals for this device. */
- }
- break;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halResetCtrl",
- status,
- "Unsupported reset ctrl cmd specified");
- }
- break ;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3_halResetCtrl",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoPhyShmem.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoPhyShmem.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoPhyShmem.c
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * @file Dm8168M3VideoPhyShmem.c
- *
- * @brief Linux shared memory physical interface file for DM8168VIDEOM3.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM740VIDEOM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_HLOS)
-/* Standard headers */
-#include <ti/syslink/Std.h>
-
-
-/* OSAL and utils */
-#include <ti/syslink/utils/Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/Error.h>
-#include <ti/syslink/utils/_Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-/* Module headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-#include <ti/syslink/utils/Trace.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168M3VideoHal.h>
-#include <Dm8168M3VideoHalBoot.h>
-#include <Dm8168M3VideoHalReset.h>
-#include <Dm8168M3VideoPhyShmem.h>
-#include <Dm8168M3VideoHalMmu.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-
-/* =============================================================================
- * APIs called by DM8168VIDEOM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to initialize Shared Driver/device.
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168VIDEOM3_phyShmemExit
- * Memory_map
- */
-Int
-DM8168VIDEOM3_phyShmemInit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3_HalObject * halObject = NULL;
- Memory_MapInfo mapInfo;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3_phyShmemInit", halObj);
-
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168VIDEOM3_HalObject *) halObj;
-
- mapInfo.src = VIDEOM3_BOOT_ADDR;
- mapInfo.size = VIDEOM3_BOOT_ADDR_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->generalCtrlBase = 0;
- }
- else {
- halObject->generalCtrlBase = mapInfo.dst;
- }
-
- mapInfo.src = PRCM_BASE_ADDR;
- mapInfo.size = PRCM_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->prcmBase = 0;
- }
- else {
- halObject->prcmBase = mapInfo.dst;
- }
-/* TO BE IMPLEMENTED
- mapInfo.src = MMU_BASE;
- mapInfo.size = MMU_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->mmuBase = 0;
- }
- else {
- halObject->mmuBase = mapInfo.dst;
- }
-*/
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3_phyShmemInit", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to finalize Shared Driver/device.
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168VIDEOM3_phyShmemInit
- * Memory_Unmap
- */
-Int
-DM8168VIDEOM3_phyShmemExit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3_HalObject * halObject = NULL;
- Memory_UnmapInfo unmapInfo;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3_phyShmemExit", halObj);
-
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168VIDEOM3_HalObject *) halObj;
-
- unmapInfo.addr = halObject->prcmBase;
- unmapInfo.size = PRCM_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_phyShmemExit",
- status,
- "Failure in Memory_Unmap for MMU base registers");
- }
- halObject->mmuBase = 0 ;
- }
-
- unmapInfo.addr = halObject->generalCtrlBase;
- unmapInfo.size = VIDEOM3_BOOT_ADDR_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_phyShmemExit",
- status,
- "Failure in Memory_Unmap for MMU base registers");
- }
- halObject->generalCtrlBase = 0 ;
- }
-
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3_phyShmemExit",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoProc.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoProc.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoProc.c
+++ /dev/null
@@ -1,2035 +0,0 @@
-/*
- * @file Dm8168M3VideoProc.c
- *
- * @brief Processor implementation for DM8168VIDEOM3.
- *
- * This module is responsible for taking care of device-specific
- * operations for the processor. This module can be used
- * stand-alone or as part of ProcMgr.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/System.h>
-#include <xdc/runtime/IGateProvider.h>
-#include <ti/sysbios/gates/GateMutex.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Cfg.h>
-#include <ti/syslink/utils/String.h>
-#include <ti/syslink/utils/IGateProvider.h>
-#include <ti/syslink/utils/GateMutex.h>
-#include <ti/syslink/utils/Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-#include <linux/string.h>
-#else
-#include <string.h>
-#endif
-
-#include <ti/syslink/utils/Trace.h>
-/* Module level headers */
-#include <ProcDefs.h>
-#include <Processor.h>
-#include <Dm8168M3VideoProc.h>
-#include <_Dm8168M3VideoProc.h>
-#include <Dm8168M3VideoHal.h>
-#include <Dm8168M3VideoHalReset.h>
-#include <Dm8168M3VideoHalBoot.h>
-#include <ti/ipc/MultiProc.h>
-#include <_MultiProc.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-/*!
- * @brief Number of static entries in address translation table.
- */
-#define AddrTable_STATIC_COUNT 4
-
-/*!
- * @brief Max entries in address translation table.
- */
-#define AddrTable_SIZE 32
-
-/* Config param for L2MMU. This is not a typo, we are using the
- * same name (VPSS-M3) because both Ducati M3 processors use the
- * same L2MMU. The docs expose VPSS-M3 but not the VIDEO-M3 processor.
- */
-#define PARAMS_mmuEnable "ProcMgr.proc[VPSS-M3].mmuEnable="
-
-
-/*!
- * @brief DM8168VIDEOM3PROC Module state object
- */
-typedef struct DM8168VIDEOM3PROC_ModuleObject_tag {
- UInt32 configSize;
- /*!< Size of configuration structure */
- DM8168VIDEOM3PROC_Config cfg;
- /*!< DM8168VIDEOM3PROC configuration structure */
- DM8168VIDEOM3PROC_Config defCfg;
- /*!< Default module configuration */
- DM8168VIDEOM3PROC_Params defInstParams;
- /*!< Default parameters for the DM8168VIDEOM3PROC instances */
- Bool isSetup;
- /*!< Indicates whether the DM8168VIDEOM3PROC module is setup. */
- DM8168VIDEOM3PROC_Handle procHandles [MultiProc_MAXPROCESSORS];
- /*!< Processor handle array. */
- IGateProvider_Handle gateHandle;
- /*!< Handle of gate to be used for local thread safety */
-} DM8168VIDEOM3PROC_ModuleObject;
-
-/*!
- * @brief DM8168VIDEOM3PROC instance object.
- */
-struct DM8168VIDEOM3PROC_Object_tag {
- DM8168VIDEOM3PROC_Params params;
- /*!< Instance parameters (configuration values) */
- Ptr halObject;
- /*!< Pointer to the Hardware Abstraction Layer object. */
- ProcMgr_Handle pmHandle;
- /*!< Handle to proc manager */
-};
-
-/* Defines the DM8168VIDEOM3PROC object type. */
-typedef struct DM8168VIDEOM3PROC_Object_tag DM8168VIDEOM3PROC_Object;
-
-/* Default memory regions */
-static UInt32 AddrTable_count = AddrTable_STATIC_COUNT;
-
-/* static memory regions
- * CAUTION: AddrTable_STATIC_COUNT must match number of entries below.
- */
-static ProcMgr_AddrInfo AddrTable[AddrTable_SIZE] =
- {
- { /* L2 BOOT, 16 KB */
- .addr = { -1u, -1u, 0x55020000, 0x00000000, 0x55020000 },
- .size = 0x4000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = ProcMgr_MASTERKNLVIRT
- },
- { /* L2 RAM, 240 KB */
- .addr = { -1u, -1u, 0x55024000, 0x20004000, 0x55024000 },
- .size = 0x3C000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = ProcMgr_MASTERKNLVIRT
- },
- { /* OCMC0, 256 KB */
- .addr = { -1u, -1u, 0x40300000, 0x00300000, 0x40300000 },
- .size = 0x40000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = (ProcMgr_MASTERKNLVIRT | ProcMgr_SLAVEVIRT)
- },
- { /* OCMC1, 256 KB */
- .addr = { -1u, -1u, 0x40400000, 0x00400000, 0x40400000 },
- .size = 0x40000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = (ProcMgr_MASTERKNLVIRT | ProcMgr_SLAVEVIRT)
- }
- };
-
-
-/* =============================================================================
- * Globals
- * =============================================================================
- */
-
-/*!
- * @var DM8168VIDEOM3PROC_state
- *
- * @brief DM8168VIDEOM3PROC state object variable
- */
-#if !defined(SYSLINK_BUILD_DEBUG)
-static
-#endif /* if !defined(SYSLINK_BUILD_DEBUG) */
-DM8168VIDEOM3PROC_ModuleObject DM8168VIDEOM3PROC_state =
-{
- .isSetup = FALSE,
- .configSize = sizeof (DM8168VIDEOM3PROC_Config),
- .gateHandle = NULL,
- .defInstParams.mmuEnable = FALSE,
- .defInstParams.numMemEntries = AddrTable_STATIC_COUNT
-};
-
-/* config override specified in SysLinkCfg.c, defined in ProcMgr.c */
-extern String ProcMgr_sysLinkCfgParams;
-
-
-/* =============================================================================
- * APIs directly called by applications
- * =============================================================================
- */
-/*!
- * @brief Function to get the default configuration for the DM8168VIDEOM3PROC
- * module.
- *
- * This function can be called by the application to get their
- * configuration parameter to DM8168VIDEOM3PROC_setup filled in by the
- * DM8168VIDEOM3PROC module with the default parameters. If the user
- * does not wish to make any change in the default parameters, this
- * API is not required to be called.
- *
- * @param cfg Pointer to the DM8168VIDEOM3PROC module configuration
- * structure in which the default config is to be
- * returned.
- *
- * @sa DM8168VIDEOM3PROC_setup
- */
-Void
-DM8168VIDEOM3PROC_getConfig (DM8168VIDEOM3PROC_Config * cfg)
-{
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_getConfig", cfg);
-
- GT_assert (curTrace, (cfg != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (cfg == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_getConfig",
- PROCESSOR_E_INVALIDARG,
- "Argument of type (DM8168VIDEOM3PROC_Config *) passed "
- "is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- memcpy(cfg,
- &(DM8168VIDEOM3PROC_state.defCfg),
- sizeof (DM8168VIDEOM3PROC_Config));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_0trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_getConfig");
-}
-
-
-/*!
- * @brief Function to setup the DM8168VIDEOM3PROC module.
- *
- * This function sets up the DM8168VIDEOM3PROC module. This function
- * must be called before any other instance-level APIs can be
- * invoked.
- * Module-level configuration needs to be provided to this
- * function. If the user wishes to change some specific config
- * parameters, then DM8168VIDEOM3PROC_getConfig can be called to get the
- * configuration filled with the default values. After this, only
- * the required configuration values can be changed. If the user
- * does not wish to make any change in the default parameters, the
- * application can simply call DM8168VIDEOM3PROC_setup with NULL
- * parameters. The default parameters would get automatically used.
- *
- * @param cfg Optional DM8168VIDEOM3PROC module configuration. If provided as
- * NULL, default configuration is used.
- *
- * @sa DM8168VIDEOM3PROC_destroy
- * GateMutex_create
- */
-Int
-DM8168VIDEOM3PROC_setup (DM8168VIDEOM3PROC_Config * cfg)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3PROC_Config tmpCfg;
- Error_Block eb;
- Error_init(&eb);
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_setup", cfg);
-
- if (cfg == NULL) {
- DM8168VIDEOM3PROC_getConfig (&tmpCfg);
- cfg = &tmpCfg;
- }
-
- /* Create a default gate handle for local module protection. */
- DM8168VIDEOM3PROC_state.gateHandle = (IGateProvider_Handle)
- GateMutex_create ((GateMutex_Params*)NULL, &eb);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168VIDEOM3PROC_state.gateHandle == NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed to create GateMutex! */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_setup",
- status,
- "Failed to create GateMutex!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Copy the user provided values into the state object. */
- memcpy (&DM8168VIDEOM3PROC_state.cfg,
- cfg,
- sizeof (DM8168VIDEOM3PROC_Config));
-
- /* Initialize the name to handles mapping array. */
- memset (&DM8168VIDEOM3PROC_state.procHandles,
- 0,
- (sizeof (DM8168VIDEOM3PROC_Handle) * MultiProc_getNumProcessors()));
- DM8168VIDEOM3PROC_state.isSetup = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_setup", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to destroy the DM8168VIDEOM3PROC module.
- *
- * Once this function is called, other DM8168VIDEOM3PROC module APIs,
- * except for the DM8168VIDEOM3PROC_getConfig API cannot be called
- * anymore.
- *
- * @sa DM8168VIDEOM3PROC_setup
- * GateMutex_delete
- */
-Int
-DM8168VIDEOM3PROC_destroy (Void)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt16 i;
-
- GT_0trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_destroy");
-
- /* Check if any DM8168VIDEOM3PROC instances have not been deleted so far. If not,
- * delete them.
- */
- for (i = 0 ; i < MultiProc_getNumProcessors() ; i++) {
- GT_assert (curTrace, (DM8168VIDEOM3PROC_state.procHandles [i] == NULL));
- if (DM8168VIDEOM3PROC_state.procHandles [i] != NULL) {
- DM8168VIDEOM3PROC_delete (&(DM8168VIDEOM3PROC_state.procHandles [i]));
- }
- }
-
- if (DM8168VIDEOM3PROC_state.gateHandle != NULL) {
- GateMutex_delete ((GateMutex_Handle *)
- &(DM8168VIDEOM3PROC_state.gateHandle));
- }
-
- DM8168VIDEOM3PROC_state.isSetup = FALSE;
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_destroy", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to initialize the parameters for this Processor
- * instance.
- *
- * @param params Configuration parameters to be returned
- *
- * @sa DM8168VIDEOM3PROC_create
- */
-Void
-DM8168VIDEOM3PROC_Params_init(
- DM8168VIDEOM3PROC_Handle handle,
- DM8168VIDEOM3PROC_Params * params)
-{
- DM8168VIDEOM3PROC_Object * procObject = (DM8168VIDEOM3PROC_Object *) handle;
- Int i = 0;
- ProcMgr_AddrInfo * ai = NULL;
-
- GT_2trace(curTrace, GT_ENTER,
- "DM8168VIDEOM3PROC_Params_init: handle=0x%x, params=0x%x\n",
- handle, params);
-
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (params == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_Params_init",
- PROCESSOR_E_INVALIDARG,
- "Argument of type (DM8168VIDEOM3PROC_Params *) "
- "passed is null!");
- }
- else {
-#endif
- if (handle == NULL) {
-
- /* check for instance params override */
- Cfg_propBool(PARAMS_mmuEnable, ProcMgr_sysLinkCfgParams,
- &(DM8168VIDEOM3PROC_state.defInstParams.mmuEnable));
-
- memcpy(params, &(DM8168VIDEOM3PROC_state.defInstParams),
- sizeof(DM8168VIDEOM3PROC_Params));
-
- /* initialize the translation table */
- for (i = AddrTable_count; i < AddrTable_SIZE; i++) {
- ai = &AddrTable[i];
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
- }
-
- /* initialize refCount for all entries - both static and dynamic */
- for (i = 0; i < AddrTable_SIZE; i++) {
- AddrTable[i].refCount = 0u;
- }
-
- memcpy((Ptr)params->memEntries, AddrTable, sizeof (AddrTable));
- }
- else {
- /* return updated DM8168VIDEOM3PROC instance specific parameters */
- memcpy(params, &(procObject->params),
- sizeof (DM8168VIDEOM3PROC_Params));
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
-
- GT_0trace(curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_Params_init");
-}
-
-/*!
- * @brief Function to create an instance of this Processor.
- *
- * @param name Name of the Processor instance.
- * @param params Configuration parameters.
- *
- * @sa DM8168VIDEOM3PROC_delete
- */
-DM8168VIDEOM3PROC_Handle
-DM8168VIDEOM3PROC_create ( UInt16 procId,
- const DM8168VIDEOM3PROC_Params * params)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * handle = NULL;
- DM8168VIDEOM3PROC_Object * object = NULL;
- IArg key;
- List_Params listParams;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_create", procId, params);
-
- GT_assert (curTrace, IS_VALID_PROCID (procId));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (!IS_VALID_PROCID (procId)) {
- /* Not setting status here since this function does not return status.*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_create",
- PROCESSOR_E_INVALIDARG,
- "Invalid procId specified");
- }
- else if (params == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_create",
- PROCESSOR_E_INVALIDARG,
- "params passed is NULL!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168VIDEOM3PROC_state.gateHandle);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- /* Check if the Processor already exists for specified procId. */
- if (DM8168VIDEOM3PROC_state.procHandles [procId] != NULL) {
- status = PROCESSOR_E_ALREADYEXIST;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_create",
- status,
- "Processor already exists for specified procId!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Allocate memory for the handle */
- handle = (Processor_Object *) Memory_calloc (NULL,
- sizeof (Processor_Object),
- 0,
- NULL);
- if (handle == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_create",
- PROCESSOR_E_MEMORY,
- "Memory allocation failed for handle!");
- }
- else {
- /* Populate the handle fields */
- handle->procFxnTable.attach = &DM8168VIDEOM3PROC_attach;
- handle->procFxnTable.detach = &DM8168VIDEOM3PROC_detach;
- handle->procFxnTable.start = &DM8168VIDEOM3PROC_start;
- handle->procFxnTable.stop = &DM8168VIDEOM3PROC_stop;
- handle->procFxnTable.read = &DM8168VIDEOM3PROC_read;
- handle->procFxnTable.write = &DM8168VIDEOM3PROC_write;
- handle->procFxnTable.control = &DM8168VIDEOM3PROC_control;
- handle->procFxnTable.map = &DM8168VIDEOM3PROC_map;
- handle->procFxnTable.unmap = &DM8168VIDEOM3PROC_unmap;
- handle->procFxnTable.translateAddr = &DM8168VIDEOM3PROC_translate;
- handle->state = ProcMgr_State_Unknown;
-
- /* Allocate memory for the DM8168VIDEOM3PROC handle */
- handle->object = Memory_calloc (NULL,
- sizeof (DM8168VIDEOM3PROC_Object),
- 0,
- NULL);
- if (handle->object == NULL) {
- status = PROCESSOR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_create",
- status,
- "Memory allocation failed for handle->object!");
- }
- else {
- handle->procId = procId;
- object = (DM8168VIDEOM3PROC_Object *) handle->object;
- object->halObject = NULL;
- /* Copy params into instance object. */
- memcpy (&(object->params),
- (Ptr) params,
- sizeof (DM8168VIDEOM3PROC_Params));
-
- /* Set the handle in the state object. */
- DM8168VIDEOM3PROC_state.procHandles [procId] =
- (DM8168VIDEOM3PROC_Handle) handle;
- /* Initialize the list of listeners */
- List_Params_init(&listParams);
- handle->registeredNotifiers = List_create(&listParams);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (handle->registeredNotifiers == NULL) {
- /*! @retval PROCESSOR_E_FAIL OsalIsr_create failed */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_create",
- status,
- "List_create failed");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- handle->notifiersLock =
- OsalMutex_create(OsalMutex_Type_Interruptible);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (handle->notifiersLock == NULL) {
- /*! @retval PROCESSOR_E_FAIL OsalIsr_create failed*/
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_create",
- status,
- "OsalMutex_create failed");
- }
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168VIDEOM3PROC_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (status < 0) {
- if (handle != NULL) {
- if (handle->registeredNotifiers != NULL) {
- List_delete (&handle->registeredNotifiers);
- }
- if (handle->object != NULL) {
- Memory_free (NULL,
- handle->object,
- sizeof (DM8168VIDEOM3PROC_Object));
- }
- Memory_free (NULL, handle, sizeof (Processor_Object));
- }
- /*! @retval NULL Function failed */
- handle = NULL;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_create", handle);
-
- /*! @retval Valid-Handle Operation successful */
- return (DM8168VIDEOM3PROC_Handle) handle;
-}
-
-
-/*!
- * @brief Function to delete an instance of this Processor.
- *
- * The user provided pointer to the handle is reset after
- * successful completion of this function.
- *
- * @param handlePtr Pointer to Handle to the Processor instance
- *
- * @sa DM8168VIDEOM3PROC_create
- */
-Int
-DM8168VIDEOM3PROC_delete (DM8168VIDEOM3PROC_Handle * handlePtr)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3PROC_Object * object = NULL;
- Processor_Object * handle;
- IArg key;
- List_Elem * elem = NULL;
- Processor_RegisterElem * regElem = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_delete", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid NULL handlePtr pointer
- specified*/
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_delete",
- status,
- "Invalid NULL handlePtr pointer specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_delete",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- handle = (Processor_Object *) (*handlePtr);
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168VIDEOM3PROC_state.gateHandle);
-
- /* Reset handle in PwrMgr handle array. */
- GT_assert (curTrace, IS_VALID_PROCID (handle->procId));
- DM8168VIDEOM3PROC_state.procHandles [handle->procId] = NULL;
-
- /* Free memory used for the DM8168VIDEOM3PROC object. */
- if (handle->object != NULL) {
- object = (DM8168VIDEOM3PROC_Object *) handle->object;
- Memory_free (NULL,
- object,
- sizeof (DM8168VIDEOM3PROC_Object));
- handle->object = NULL;
- }
-
- /*
- * Check the list of listeners to see if any are remaining
- * and reply to them
- */
- OsalMutex_delete(&handle->notifiersLock);
-
- while ((elem = List_dequeue(handle->registeredNotifiers)) != NULL) {
- regElem = (Processor_RegisterElem *)elem;
-
- /* Check if there is an associated timer and cancel it */
- if (regElem->timer != -1) {
- struct itimerspec value ;
- value.it_value.tv_sec = 0;
- value.it_value.tv_nsec = 0;
- value.it_interval.tv_sec = 0;
- value.it_interval.tv_nsec = 0;
- timer_settime(regElem->timer, 0, &value, NULL);
-
- timer_delete(regElem->timer);
- regElem->timer = -1;
- }
-
- /* Call the callback function so it can clean up. */
- regElem->info->cbFxn(handle->procId,
- NULL,
- handle->state,
- handle->state,
- ProcMgr_EventStatus_Canceled,
- regElem->info->arg);
- /* Free the memory */
- Memory_free(NULL, regElem, sizeof(Processor_RegisterElem));
- }
-
- /* Delete the list of listeners */
- List_delete(&handle->registeredNotifiers);
-
- /* Free memory used for the Processor object. */
- Memory_free (NULL, handle, sizeof (Processor_Object));
- *handlePtr = NULL;
-
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168VIDEOM3PROC_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_delete", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to open a handle to an instance of this Processor. This
- * function is called when access to the Processor is required from
- * a different process.
- *
- * @param handlePtr Handle to the Processor instance
- * @param procId Processor ID addressed by this Processor instance.
- *
- * @sa DM8168VIDEOM3PROC_close
- */
-Int
-DM8168VIDEOM3PROC_open (DM8168VIDEOM3PROC_Handle * handlePtr, UInt16 procId)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_open", handlePtr, procId);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, IS_VALID_PROCID (procId));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_open",
- status,
- "Invalid NULL handlePtr specified");
- }
- else if (!IS_VALID_PROCID (procId)) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid procId specified */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_open",
- status,
- "Invalid procId specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Initialize return parameter handle. */
- *handlePtr = NULL;
-
- /* Check if the PwrMgr exists and return the handle if found. */
- if (DM8168VIDEOM3PROC_state.procHandles [procId] == NULL) {
- /*! @retval PROCESSOR_E_NOTFOUND Specified instance not found */
- status = PROCESSOR_E_NOTFOUND;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_open",
- status,
- "Specified DM8168VIDEOM3PROC instance does not exist!");
- }
- else {
- *handlePtr = DM8168VIDEOM3PROC_state.procHandles [procId];
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_open", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to close a handle to an instance of this Processor.
- *
- * @param handlePtr Pointer to Handle to the Processor instance
- *
- * @sa DM8168VIDEOM3PROC_open
- */
-Int
-DM8168VIDEOM3PROC_close (DM8168VIDEOM3PROC_Handle * handlePtr)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_close", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid NULL handlePtr pointer
- specified*/
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_close",
- status,
- "Invalid NULL handlePtr pointer specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_close",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Nothing to be done for close. */
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_close", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/* =============================================================================
- * APIs called by Processor module (part of function table interface)
- * =============================================================================
- */
-/*!
- * @brief Function to initialize the slave processor
- *
- * @param handle Handle to the Processor instance
- * @param params Attach parameters
- *
- * @sa DM8168VIDEOM3PROC_detach
- */
-Int
-DM8168VIDEOM3PROC_attach(
- Processor_Handle handle,
- Processor_AttachParams * params)
-{
-
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168VIDEOM3PROC_Object * object = NULL;
- Int i = 0;
- Int j = 0;
- Int index = 0;
- ProcMgr_AddrInfo * me;
- SysLink_MemEntry * entry;
- SysLink_MemEntry_Block * memBlock = NULL;
- DM8168VIDEOM3_HalMmuCtrlArgs_Enable mmuEnableArgs;
-
- GT_2trace(curTrace, GT_ENTER,
- "--> DM8168VIDEOM3PROC_attach: handle=0x%x, parms=0x%x",
- handle, params);
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_attach",
- status,
- "Invalid handle specified");
- }
- else if (params == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_attach",
- status,
- "Invalid params specified");
- }
- else {
-#endif
- object = (DM8168VIDEOM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* Added for Netra Ducati core0 is cortex M3 */
- params->procArch = Processor_ProcArch_M3;
-
- /* check for instance params override */
- Cfg_propBool(PARAMS_mmuEnable, ProcMgr_sysLinkCfgParams,
- &(object->params.mmuEnable));
-
- object->pmHandle = params->pmHandle;
- GT_0trace(curTrace, GT_1CLASS,
- "DM8168VIDEOM3PROC_attach: Mapping memory regions");
-
- /* update translation tables with memory map */
- for (i = 0; (memBlock != NULL) && (i < memBlock->numEntries)
- && (memBlock->memEntries[i].isValid) && (status >= 0); i++) {
-
- entry = &memBlock->memEntries[i];
-
- if (entry->map == FALSE) {
- /* update table with entries which don't require mapping */
- if (AddrTable_count != AddrTable_SIZE) {
- me = &AddrTable[AddrTable_count];
-
- me->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterPhys] =
- entry->masterPhysAddr;
- me->addr[ProcMgr_AddrType_SlaveVirt] = entry->slaveVirtAddr;
- me->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- me->size = entry->size;
- me->isCached = entry->isCached;
- me->mapMask = entry->mapMask;
-
- AddrTable_count++;
- }
- else {
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_attach", status,
- "AddrTable_SIZE reached!");
- }
- }
- else if (entry->map == TRUE) {
- /* send these entries back to ProcMgr for mapping */
- index = object->params.numMemEntries;
-
- if (index != ProcMgr_MAX_MEMORY_REGIONS) {
- me = &object->params.memEntries[index];
-
- me->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterPhys] =
- entry->masterPhysAddr;
- me->addr[ProcMgr_AddrType_SlaveVirt] = entry->slaveVirtAddr;
- me->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- me->size = entry->size;
- me->isCached = entry->isCached;
- me->mapMask = entry->mapMask;
-
- object->params.numMemEntries++;
- }
- else {
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_attach", status,
- "ProcMgr_MAX_MEMORY_REGIONS reached!");
- }
- }
- else {
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_attach", status,
- "Memory map has entry with invalid 'map' value");
- }
- } /* for (...) */
-
- if (status >= 0) {
- /* populate the return params */
- me = object->params.memEntries;
- params->numMemEntries = object->params.numMemEntries;
- memcpy((Ptr)params->memEntries, (Ptr)object->params.memEntries,
- sizeof(ProcMgr_AddrInfo) * params->numMemEntries);
-
- status = DM8168VIDEOM3_halInit (&(object->halObject), NULL);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_attach", status,
- "DM8168VIDEOM3_halInit failed");
- }
- else {
-#endif
- if ((procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)) {
-
- /* place the slave processor in reset */
- status = DM8168VIDEOM3_halResetCtrl(object->halObject,
- Processor_ResetCtrlCmd_Reset, NULL);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_attach", status,
- "Failed to reset the slave processor");
- }
- else {
-#endif
- GT_0trace(curTrace, GT_1CLASS,
- "DM8168VIDEOM3PROC_attach: slave is now in reset");
-
- if (object->params.mmuEnable) {
- mmuEnableArgs.numMemEntries = 0;
- status = DM8168VIDEOM3_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_Enable, &mmuEnableArgs);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_attach", status,
- "Failed to enable the slave MMU");
- }
-#endif
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168VIDEOM3PROC_attach: Slave MMU "
- "is configured!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
-
- GT_1trace(curTrace, GT_LEAVE,
- "<-- DM8168VIDEOM3PROC_attach: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to detach from the Processor.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168VIDEOM3PROC_attach
- */
-Int
-DM8168VIDEOM3PROC_detach (Processor_Handle handle)
-{
- Int status = PROCESSOR_SUCCESS;
- Int tmpStatus = PROCESSOR_SUCCESS;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168VIDEOM3PROC_Object * object = NULL;
- Int i = 0;
- ProcMgr_AddrInfo * ai;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_detach", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_detach",
- PROCESSOR_E_HANDLE,
- "Invalid handle specified");
- }
- else {
-#endif
- object = (DM8168VIDEOM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)) {
-
- if (object->params.mmuEnable) {
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168VIDEOM3PROC_detach: Disabling Slave MMU ...");
-
- status = DM8168VIDEOM3_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_Disable, NULL);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_detach", status,
- "Failed to disable the slave MMU");
- }
-#endif
- }
-
- /* delete all dynamically added entries */
- for(i = AddrTable_STATIC_COUNT; i < AddrTable_count; i++) {
- ai = &AddrTable[i];
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
- ai->refCount = 0u;
- }
-
- object->params.numMemEntries = AddrTable_STATIC_COUNT;
- AddrTable_count = AddrTable_STATIC_COUNT;
-
- /* place the slave processor into reset */
- tmpStatus = DM8168VIDEOM3_halResetCtrl(object->halObject,
- Processor_ResetCtrlCmd_Reset, NULL);
-
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168VIDEOM3PROC_detach: Slave processor is now in reset");
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if ((tmpStatus < 0) && (status >= 0)) {
- status = tmpStatus;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_detach",
- status,
- "Failed to reset the slave processor");
- }
-#endif
- }
-
- GT_0trace (curTrace,
- GT_2CLASS,
- " DM8168VIDEOM3PROC_detach: Unmapping memory regions\n");
-
- tmpStatus = DM8168VIDEOM3_halExit (object->halObject);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if ((tmpStatus < 0) && (status >= 0)) {
- status = tmpStatus;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_detach",
- status,
- "Failed to finalize HAL object");
- }
- }
-#endif
-
- GT_1trace(curTrace, GT_LEAVE,
- "DM8168VIDEOM3PROC_detach: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to start the slave processor
- *
- * Start the slave processor running from its entry point.
- * Depending on the boot mode, this involves configuring the boot
- * address and releasing the slave from reset.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168VIDEOM3PROC_stop, DM8168VIDEOM3_halBootCtrl, DM8168VIDEOM3_halResetCtrl
- */
-Int
-DM8168VIDEOM3PROC_start (Processor_Handle handle,
- UInt32 entryPt,
- Processor_StartParams * params)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168VIDEOM3PROC_Object * object = NULL;
-
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_start",
- handle, entryPt, params);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_start",
- status,
- "Invalid handle specified");
- }
- else if (params == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_start",
- status,
- "Invalid params specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168VIDEOM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_NoPwr)) {
- GT_1trace (curTrace,
- GT_2CLASS,
- " DM8168VIDEOM3PROC_start: Configuring boot register\n"
- " Reset vector [0x%x]!\n",
- entryPt);
- /* Specify the VIDEOM3 boot address in the boot config register */
- status = DM8168VIDEOM3_halBootCtrl (
- object->halObject,
- Processor_BootCtrlCmd_SetEntryPoint,
- (Ptr) entryPt);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_start",
- status,
- "Failed to set slave boot entry point");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Write the branch instruction to at the boot address to
- * branch to _c_int00
- */
-
-
- /* Release the slave from reset */
- status = DM8168VIDEOM3_halResetCtrl (object->halObject,
- Processor_ResetCtrlCmd_Release,
- NULL);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_start",
- status,
- "Failed to release slave from reset");
- }
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
-
- /* For NoBoot mode, send an interrupt to the slave.
- * TBD: How should Dm8168M3VideoProc interface with Notify for this?
- */
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (status >= 0) {
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168VIDEOM3PROC_start: Slave successfully started!\n");
- }
- else {
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168VIDEOM3PROC_start: Slave could not be started!\n");
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_start", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to stop the slave processor
- *
- * Stop the execution of the slave processor. Depending on the boot
- * mode, this may result in placing the slave processor in reset.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168VIDEOM3PROC_start, DM8168VIDEOM3_halResetCtrl
- */
-Int
-DM8168VIDEOM3PROC_stop (Processor_Handle handle)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168VIDEOM3PROC_Object * object = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_stop", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_stop",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168VIDEOM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_NoPwr)) {
- /* Slave is to be stopped only for Boot mode and NoLoad mode. */
- /* Place the slave processor in reset. */
- status = DM8168VIDEOM3_halResetCtrl (object->halObject,
- Processor_ResetCtrlCmd_Reset,
- NULL);
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168VIDEOM3PROC_stop: Slave is now in reset!\n");
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_stop",
- status,
- "Failed to place slave in reset");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_stop", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to read from the slave processor's memory.
- *
- * Read from the slave processor's memory and copy into the
- * provided buffer.
- *
- * @param handle Handle to the Processor instance
- * @param procAddr Address in host processor's address space of the
- * memory region to read from.
- * @param numBytes IN/OUT parameter. As an IN-parameter, it takes in the
- * number of bytes to be read. When the function
- * returns, this parameter contains the number of bytes
- * actually read.
- * @param buffer User-provided buffer in which the slave processor's
- * memory contents are to be copied.
- *
- * @sa DM8168VIDEOM3PROC_write
- */
-Int
-DM8168VIDEOM3PROC_read (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer)
-{
- Int status = PROCESSOR_SUCCESS ;
- UInt8 * procPtr8 = NULL;
-
- GT_4trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_read",
- handle, procAddr, numBytes, buffer);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (numBytes != NULL));
- GT_assert (curTrace, (buffer != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_read",
- status,
- "Invalid handle specified");
- }
- else if (numBytes == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_read",
- status,
- "Invalid numBytes specified");
- }
- else if (buffer == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_read",
- status,
- "Invalid buffer specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- procPtr8 = (UInt8 *) procAddr ;
- buffer = memcpy (buffer, procPtr8, *numBytes);
- GT_assert (curTrace, (buffer != (UInt32) NULL));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (buffer == (UInt32) NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed in memcpy */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_read",
- status,
- "Failed in memcpy");
- *numBytes = 0;
- }
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_read",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to write into the slave processor's memory.
- *
- * Read from the provided buffer and copy into the slave
- * processor's memory.
- *
- * @param handle Handle to the Processor object
- * @param procAddr Address in host processor's address space of the
- * memory region to write into.
- * @param numBytes IN/OUT parameter. As an IN-parameter, it takes in the
- * number of bytes to be written. When the function
- * returns, this parameter contains the number of bytes
- * actually written.
- * @param buffer User-provided buffer from which the data is to be
- * written into the slave processor's memory.
- *
- * @sa DM8168VIDEOM3PROC_read, DM8168VIDEOM3PROC_translateAddr
- */
-Int
-DM8168VIDEOM3PROC_write (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer)
-{
- Int status = PROCESSOR_SUCCESS ;
- UInt8 * procPtr8 = NULL;
- UInt8 temp8_1;
- UInt8 temp8_2;
- UInt8 temp8_3;
- UInt8 temp8_4;
- UInt32 temp;
-
- GT_4trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_write",
- handle, procAddr, numBytes, buffer);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (numBytes != NULL));
- GT_assert (curTrace, (buffer != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_write",
- status,
- "Invalid handle specified");
- }
- else if (numBytes == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_write",
- status,
- "Invalid numBytes specified");
- }
- else if (buffer == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_write",
- status,
- "Invalid buffer specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- if (*numBytes != sizeof (UInt32)) {
- procPtr8 = (UInt8 *) procAddr ;
- procAddr = (UInt32) memcpy (procPtr8,
- buffer,
- *numBytes);
- GT_assert (curTrace, (procAddr != (UInt32) NULL));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (procAddr == (UInt32) NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed in memcpy */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_write",
- status,
- "Failed in memcpy");
- *numBytes = 0;
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
- else {
- /* For 4 bytes, directly write as a UInt32 */
- temp8_1 = ((UInt8 *) buffer) [0];
- temp8_2 = ((UInt8 *) buffer) [1];
- temp8_3 = ((UInt8 *) buffer) [2];
- temp8_4 = ((UInt8 *) buffer) [3];
- temp = (UInt32) ( ((UInt32) temp8_4 << 24)
- | ((UInt32) temp8_3 << 16)
- | ((UInt32) temp8_2 << 8)
- | ((UInt32) temp8_1));
- *((UInt32*) procAddr) = temp;
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_write", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to perform device-dependent operations.
- *
- * Performs device-dependent control operations as exposed by this
- * implementation of the Processor module.
- *
- * @param handle Handle to the Processor object
- * @param cmd Device specific processor command
- * @param arg Arguments specific to the type of command.
- *
- * @sa
- */
-Int
-DM8168VIDEOM3PROC_control (Processor_Handle handle, Int32 cmd, Ptr arg)
-{
- Int status = PROCESSOR_SUCCESS ;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_control", handle, cmd, arg);
-
- GT_assert (curTrace, (handle != NULL));
- /* cmd and arg can be 0/NULL, so cannot check for validity. */
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_control",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* No control operations currently implemented. */
- /*! @retval PROCESSOR_E_NOTSUPPORTED No control operations are supported
- for this device. */
- status = PROCESSOR_E_NOTSUPPORTED;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_control",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Translate slave virtual address to master physical address.
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Returned: master physical address.
- * @param srcAddr Slave virtual address.
- *
- * @sa
- */
-Int
-DM8168VIDEOM3PROC_translate(
- Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 srcAddr)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * procHandle= (Processor_Object *)handle;
- DM8168VIDEOM3PROC_Object * object = NULL;
- UInt32 i;
- UInt32 startAddr;
- UInt32 endAddr;
- UInt32 offset;
- ProcMgr_AddrInfo * ai;
-
- GT_3trace(curTrace, GT_ENTER,
- "DM8168VIDEOM3PROC_translate: handle=0x%x, dstAddr=0x%x, srcAddr=0x%x",
- handle, dstAddr, srcAddr);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (dstAddr != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_translate",
- status,
- "Invalid handle specified");
- }
- else if (dstAddr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG sglist provided as NULL */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_translate",
- status,
- "dstAddr provided as NULL");
- }
- else {
-#endif
- object = (DM8168VIDEOM3PROC_Object *)procHandle->object;
- GT_assert(curTrace, (object != NULL));
- *dstAddr = -1u;
-
- for (i = 0; i < AddrTable_count; i++) {
- ai = &AddrTable [i];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= srcAddr) && (srcAddr < endAddr)) {
- offset = srcAddr - startAddr;
- *dstAddr = ai->addr[ProcMgr_AddrType_MasterPhys] + offset;
- break;
- }
- }
-
- if (*dstAddr == -1u) {
- if (!object->params.mmuEnable) {
- /* default to direct mapping (i.e. v=p) */
- *dstAddr = srcAddr;
- }
- else {
- /* srcAddr not found in slave address space */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_translate", status,
- "srcAddr not found in slave address space");
- }
- }
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE,
- "DM8168VIDEOM3PROC_translate: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Map the given address translation into the slave mmu
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Base virtual address
- * @param nSegs Number of given segments
- * @param sglist Segment list
- */
-Int
-DM8168VIDEOM3PROC_map(
- Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 nSegs,
- Memory_SGList * sglist)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168VIDEOM3PROC_Object * object = NULL;
- Bool found = FALSE;
- UInt32 startAddr;
- UInt32 endAddr;
- UInt32 i;
- UInt32 j;
- ProcMgr_AddrInfo * ai;
- DM8168VIDEOM3_HalMmuCtrlArgs_AddEntry addEntryArgs;
-
- GT_4trace(curTrace, GT_ENTER, "DM8168VIDEOM3PROC_map:",
- handle, *dstAddr, nSegs, sglist);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (sglist != NULL));
- GT_assert (curTrace, (nSegs > 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_map",
- status,
- "Invalid handle specified");
- }
- else if (sglist == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG sglist provided as NULL */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_map",
- status,
- "sglist provided as NULL");
- }
- else if (nSegs == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Number of segments provided is 0 */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_map",
- status,
- "Number of segments provided is 0");
- }
- else {
-#endif
- object = (DM8168VIDEOM3PROC_Object *)procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- for (i = 0; (i < nSegs) && (status >= 0); i++) {
- /* Update the translation table with entries for which mapping
- * is required. Add the entry only if the range does not exist
- * in the translation table.
- */
-
- /* check in static entries first */
- for (j = 0; j < AddrTable_STATIC_COUNT; j++) {
- ai = &AddrTable[j];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)) {
- found = TRUE;
- ai->refCount++;
- GT_4trace(curTrace, GT_1CLASS, "DM8168VIDEOM3PROC_map: "
- "found static entry: [%d] sva=0x%x, mpa=0x%x size=0x%x",
- j, ai->addr[ProcMgr_AddrType_SlaveVirt],
- ai->addr[ProcMgr_AddrType_MasterPhys], ai->size);
- break;
- }
- }
-
- /* if not found in static entries, check in dynamic entries */
- if (!found) {
- for (j = AddrTable_STATIC_COUNT; j < AddrTable_count; j++) {
- ai = &AddrTable[j];
-
- if (ai->isMapped == TRUE) {
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
- && ((*dstAddr + sglist[i].size) <= endAddr)) {
- found = TRUE;
- ai->refCount++;
- GT_4trace(curTrace, GT_1CLASS,
- "DM8168VIDEOM3PROC_map: found dynamic entry: "
- "[%d] sva=0x%x, mpa=0x%x, size=0x%x",
- j, ai->addr[ProcMgr_AddrType_SlaveVirt],
- ai->addr[ProcMgr_AddrType_MasterPhys],ai->size);
- break;
- }
- }
- }
- }
-
- /* If not found, add new entry to table. If mmu is disabled,
- * the assumption is that the ammu will be used.
- */
- if (!found) {
- if (AddrTable_count != AddrTable_SIZE) {
- ai = &AddrTable[AddrTable_count];
-
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = sglist[i].paddr;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = *dstAddr;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = sglist[i].size;
- ai->isCached = sglist[i].isCached;
- ai->refCount++;
-
- AddrTable_count++;
-
- GT_4trace(curTrace, GT_1CLASS,
- "DM8168VIDEOM3PROC_map: adding dynamic entry: "
- "[%d] sva=0x%x, mpa=0x%x, size=0x%x",
- (AddrTable_count - 1), *dstAddr, sglist[i].paddr,
- sglist[i].size);
- }
- else {
- status = PROCESSOR_E_FAIL;
- ai = NULL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_map", status,
- "AddrTable_SIZE reached!");
- }
- }
-
- /* if new entry, map into dsp mmu */
- if ((ai != NULL) && (ai->refCount == 1) && (status >= 0)) {
- ai->isMapped = TRUE;
-
- if (object->params.mmuEnable) {
- GT_3trace(curTrace, GT_1CLASS,
- "DM8168VIDEOM3PROC_map: adding entry to L2MMU: "
- "sva=0x%x, spa=0x%x, size=0x%x",
- *dstAddr, sglist[i].paddr, sglist[i].size);
-
- /* add entry to L2 MMU */
- addEntryArgs.masterPhyAddr = sglist [i].paddr;
- addEntryArgs.size = sglist [i].size;
- addEntryArgs.slaveVirtAddr = (UInt32)*dstAddr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- addEntryArgs.elementSize = ELEM_SIZE_16BIT;
- addEntryArgs.endianism = LITTLE_ENDIAN;
- addEntryArgs.mixedSize = MMU_TLBES;
-
- status = DM8168VIDEOM3_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_AddEntry, &addEntryArgs);
-
- GT_3trace(curTrace, GT_1CLASS,
- "DM8168VIDEOM3PROC_map: mmu add entry, "
- "masterPhyAddr=0x%x, slaveVirAddr=0x%x, size=0x%x",
- addEntryArgs.masterPhyAddr, addEntryArgs.slaveVirtAddr,
- addEntryArgs.size);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_map", status,
- "Processor_MmuCtrlCmd_AddEntry failed");
- }
-#endif
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_map", status,
- "VIDEOM3 MMU configuration failed");
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE, "DM8168VIDEOM3PROC_map:", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to unmap slave address from host address space
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Return parameter: Pointer to receive the mapped
- * address.
- * @param size Size of the region to be mapped.
-s *
- * @sa
- */
-Int
-DM8168VIDEOM3PROC_unmap(
- Processor_Handle handle,
- UInt32 addr,
- UInt32 size)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168VIDEOM3PROC_Object * object = NULL;
- ProcMgr_AddrInfo * ai;
- Int i;
- UInt32 startAddr;
- UInt32 endAddr;
- DM8168VIDEOM3_HalMmuCtrlArgs_DeleteEntry deleteEntryArgs;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VIDEOM3PROC_unmap",
- handle, addr, size);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (size != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_unmap",
- status,
- "Invalid handle specified");
- }
- else if (size == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Size provided is zero */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3PROC_unmap",
- status,
- "Size provided is zero");
- }
- else {
-#endif
- object = (DM8168VIDEOM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* Delete dynamically added non-default entries from translation
- * table only in last unmap called on that entry
- */
- for (i = AddrTable_STATIC_COUNT; i < AddrTable_count; i++) {
- ai = &AddrTable[i];
-
- if (!ai->isMapped) {
- continue;
- }
-
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= addr) && (addr < endAddr)) {
- ai->refCount--;
-
- if (ai->refCount == 0) {
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
-
- if (object->params.mmuEnable) {
- /* Remove the entry from the VIDEOM3 MMU also */
- deleteEntryArgs.size = size;
- deleteEntryArgs.slaveVirtAddr = addr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- deleteEntryArgs.elementSize = ELEM_SIZE_16BIT;
- deleteEntryArgs.endianism = LITTLE_ENDIAN;
- deleteEntryArgs.mixedSize = MMU_TLBES;
-
- status = DM8168VIDEOM3_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_DeleteEntry, &deleteEntryArgs);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VIDEOM3PROC_unmap", status,
- "VIDEOM3 MMU configuration failed");
- }
-#endif
- }
- }
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE,
- "DM8168VIDEOM3PROC_unmap: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHal.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHal.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * @file Dm8168M3DssHal.c
- *
- * @brief Top-level Hardware Abstraction Module implementation
- *
- * This module implements the top-level Hardware Abstraction Layer
- * for DM8168VPSSM3.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-/* OSAL & utils headers */
-#include <ti/syslink/utils/Memory.h>
-
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#include <ti/syslink/utils/Trace.h>
-
-/* Hardware Abstraction Layer headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-#include <Dm8168M3DssHal.h>
-#include <Dm8168M3DssHalBoot.h>
-#include <Dm8168M3DssPhyShmem.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs called by DM8168VPSSM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to initialize the HAL object
- *
- * @param halObj Return parameter: Pointer to the HAL object
- * @param initParams Optional initialization parameters
- *
- * @sa DM8168VPSSM3_halExit
- * DM8168VPSSM3_phyShmemInit
- */
-Int
-DM8168VPSSM3_halInit (Ptr * halObj, Ptr params)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3_HalObject * halObject = NULL;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168VPSSM3_halInit", halObj, params);
-
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168VPSSM3_HalObject *) halObj ;
-
- (Void) params ; /* Not used. */
-
- *halObj = Memory_calloc (NULL, sizeof (DM8168VPSSM3_HalObject), 0, NULL);
- if (halObject == NULL) {
- /*! @retval PROCESSOR_E_MEMORY Memory allocation failed */
- status = PROCESSOR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halInit",
- status,
- "Memory allocation failed for HAL object!");
- }
- else {
- status = DM8168VPSSM3_phyShmemInit (*halObj);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halInit",
- status,
- "DM8168VPSSM3_phyShmemInit failed!");
- Memory_free (NULL, *halObj, sizeof (DM8168VPSSM3_HalObject));
- *halObj = NULL;
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3_halInit", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to finalize the HAL object
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168VPSSM3_halInit
- * DM8168VPSSM3_phyShmemExit
- */
-Int
-DM8168VPSSM3_halExit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3_halExit", halObj);
-
- GT_assert (curTrace, (halObj != NULL));
-
- status = DM8168VPSSM3_phyShmemExit (halObj);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halExit",
- status,
- "DM8168VPSSM3_phyShmemExit failed!");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (halObj != NULL) {
- /* Free the memory for the HAL object. */
- Memory_free (NULL, halObj, sizeof (DM8168VPSSM3_HalObject));
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3_halExit", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalBoot.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalBoot.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalBoot.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * @file Dm8168M3DssHalBoot.c
- *
- * @brief Boot control module.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Trace.h>
-
-/* Module headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168M3DssHal.h>
-#include <Dm8168M3DssHalBoot.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Offsets of the DSP BOOT ADDR register
- */
-#define CONTROL_IVA2_BOOTADDR_OFFSET 0x190
-#define CONTROL_IVA2_BOOTMOD_OFFSET 0x194
-
-
-/* =============================================================================
- * APIs called by DM8168VPSSM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control boot operations
- *
- * @param halObj Pointer to the HAL object
- * @param cmd Boot command
- * @param arg Arguments specific to the boot command
- *
- * @sa
- */
-Int
-DM8168VPSSM3_halBootCtrl (Ptr halObj, Processor_BootCtrlCmd cmd, Ptr args)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3_HalObject * halObject = NULL;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VPSSM3_halBootCtrl", halObj, cmd, args);
-
- GT_assert (curTrace, (halObj != NULL));
- GT_assert (curTrace, (cmd < Processor_BootCtrlCmd_EndValue));
-
- halObject = (DM8168VPSSM3_HalObject *) halObj;
-
- switch (cmd) {
- case Processor_BootCtrlCmd_SetEntryPoint:
- {
- /* copy _c_int00 addresses to 0x4th location of Ducati
- Last bit at this mem location has to be explicitly set to 1 to
- ensure that M3 is in THUMB mode*/
- REG (halObject->generalCtrlBase) = ((UInt32)args | 0x1);
- }
- break ;
-
- case Processor_BootCtrlCmd_SetBootComplete:
- {
- /* Do nothing here for DM8168VPSSM3 gem */
- }
- break ;
-
- case Processor_BootCtrlCmd_ResetBootComplete:
- {
- /* Do nothing here for DM8168VPSSM3 gem */
- }
- break ;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halBootCtrl",
- status,
- "Unsupported boot ctrl cmd specified");
- }
- break ;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3_halBootCtrl",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalReset.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalReset.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalReset.c
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * @file Dm8168M3DssHalReset.c
- *
- * @brief Reset control module.
- *
- * This module is responsible for handling reset-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Trace.h>
-#include <Bitops.h>
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168M3DssHal.h>
-#include <Dm8168M3DssHalReset.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-#define CM_DEFAULT_DUCATI_CLKSTCTRL 0x00000518
-#define CM_DEFAULT_DUCATI_CLKCTRL 0x00000574
-#define RM_DEFAULT_RSTCTRL 0x00000B10
-#define RM_DEFAULT_RSTST 0x00000B14
-
-
-/* =============================================================================
- * APIs called by DM8168VPSSM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control reset operations
- *
- * @param halObj Pointer to the HAL object
- * @param cmd Reset control command
- * @param arg Arguments specific to the reset control command
- *
- * @sa
- */
-Int
-DM8168VPSSM3_halResetCtrl (Ptr halObj, Processor_ResetCtrlCmd cmd, Ptr args)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3_HalObject * halObject = NULL;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VPSSM3_halResetCtrl", halObj, cmd, args);
-
- GT_assert (curTrace, (halObj != NULL));
- GT_assert (curTrace, (cmd < Processor_ResetCtrlCmd_EndValue));
-
- halObject = (DM8168VPSSM3_HalObject *) halObj ;
-
- switch (cmd) {
- case Processor_ResetCtrlCmd_Reset:
- {
- /*Put ONLY Ducati M3_1 to Reset*/
- SET_BIT (REG((halObject->prcmBase) + RM_DEFAULT_RSTCTRL), 0x3);
- /* clear the status bit only if it is set*/
- if(TEST_BIT(REG((halObject->prcmBase) + RM_DEFAULT_RSTST) , 0x3)) {
- REG((halObject->prcmBase) + RM_DEFAULT_RSTST) = 0x8;
- }
- }
- break ;
-
- case Processor_ResetCtrlCmd_Release:
- {
- /*Bring ONLY Ducati M3_1 out of Reset*/
- CLEAR_BIT (REG((halObject->prcmBase) + RM_DEFAULT_RSTCTRL), 0x3);
- /*Check for Ducati M3_1 out of Reset*/
- while((((REG(halObject->prcmBase + RM_DEFAULT_RSTST)&0x08))!=0x08) &&
- (((REG(halObject->prcmBase + RM_DEFAULT_RSTST)&0x18))!=0x18) &&
- (((REG(halObject->prcmBase + RM_DEFAULT_RSTST)&0x1C))!=0x1C) ) ;
- /*Check Module is in Functional Mode */
- while(((REG(halObject->prcmBase + CM_DEFAULT_DUCATI_CLKCTRL)&0x30000)>>16)!=0) ;
- }
- break;
-
- case Processor_ResetCtrlCmd_PeripheralUp:
- {
- /* Nothing to be done to bringup the peripherals for this device. */
- }
- break;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halResetCtrl",
- status,
- "Unsupported reset ctrl cmd specified");
- }
- break ;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3_halResetCtrl",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssPhyShmem.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssPhyShmem.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssPhyShmem.c
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * @file Dm8168M3DssPhyShmem.c
- *
- * @brief Linux shared memory physical interface file for DM8168VPSSM3.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_HLOS)
-/* Standard headers */
-#include <ti/syslink/Std.h>
-
-
-/* OSAL and utils */
-#include <ti/syslink/utils/Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/Error.h>
-#include <ti/syslink/utils/_Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-/* Module headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-
-#include <ti/syslink/utils/Trace.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168M3DssHal.h>
-#include <Dm8168M3DssHalBoot.h>
-#include <Dm8168M3DssHalReset.h>
-#include <Dm8168M3DssPhyShmem.h>
-#include <Dm8168M3DssHalMmu.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-
-/* =============================================================================
- * APIs called by DM8168VPSSM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to initialize Shared Driver/device.
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168VPSSM3_phyShmemExit
- * Memory_map
- */
-Int
-DM8168VPSSM3_phyShmemInit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3_HalObject * halObject = NULL;
- Memory_MapInfo mapInfo;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3_phyShmemInit", halObj);
-
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168VPSSM3_HalObject *) halObj;
-
- halObject = (DM8168VPSSM3_HalObject *) halObj;
-
- mapInfo.src = VPSSM3_BOOT_ADDR;
- mapInfo.size = VPSSM3_BOOT_ADDR_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->generalCtrlBase = 0;
- }
- else {
- halObject->generalCtrlBase = mapInfo.dst;
- }
-
- mapInfo.src = PRCM_BASE_ADDR;
- mapInfo.size = PRCM_SIZE;
- mapInfo.isCached = FALSE;
- status = Memory_map (&mapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_phyShmemInit",
- status,
- "Failure in Memory_map for MMU base registers");
- halObject->prcmBase = 0;
- }
- else {
- halObject->prcmBase = mapInfo.dst;
- }
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3_phyShmemInit", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to finalize Shared Driver/device.
- *
- * @param halObj Pointer to the HAL object
- *
- * @sa DM8168VPSSM3_phyShmemInit
- * Memory_Unmap
- */
-Int
-DM8168VPSSM3_phyShmemExit (Ptr halObj)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3_HalObject * halObject = NULL;
- Memory_UnmapInfo unmapInfo;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3_phyShmemExit", halObj);
-
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168VPSSM3_HalObject *) halObj;
-
- unmapInfo.addr = halObject->prcmBase;
- unmapInfo.size = PRCM_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_phyShmemExit",
- status,
- "Failure in Memory_Unmap for MMU base registers");
- }
- halObject->mmuBase = 0 ;
- }
-
- unmapInfo.addr = halObject->generalCtrlBase;
- unmapInfo.size = VPSSM3_BOOT_ADDR_SIZE;
- unmapInfo.isCached = FALSE;
- if (unmapInfo.addr != 0) {
- status = Memory_unmap (&unmapInfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_phyShmemExit",
- status,
- "Failure in Memory_Unmap for MMU base registers");
- }
- halObject->generalCtrlBase = 0 ;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3_phyShmemExit",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssProc.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssProc.c
+++ /dev/null
@@ -1,2034 +0,0 @@
-/*
- * @file Dm8168M3DssProc.c
- *
- * @brief Processor implementation for DM8168VPSSM3.
- *
- * This module is responsible for taking care of device-specific
- * operations for the processor. This module can be used
- * stand-alone or as part of ProcMgr.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#if defined(SYSLINK_BUILD_RTOS)
-#include <xdc/std.h>
-#include <xdc/runtime/Error.h>
-#include <xdc/runtime/Memory.h>
-#include <xdc/runtime/System.h>
-#include <xdc/runtime/IGateProvider.h>
-#include <ti/sysbios/gates/GateMutex.h>
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-#if defined(SYSLINK_BUILD_HLOS)
-#include <ti/syslink/Std.h>
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Cfg.h>
-#include <ti/syslink/utils/String.h>
-#include <ti/syslink/utils/IGateProvider.h>
-#include <ti/syslink/utils/GateMutex.h>
-#include <ti/syslink/utils/Memory.h>
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-#include <linux/string.h>
-#else
-#include <string.h>
-#endif
-
-#include <ti/syslink/utils/Trace.h>
-
-/* Module level headers */
-#include <ti/ipc/MultiProc.h>
-#include <_MultiProc.h>
-#include <ProcDefs.h>
-#include <Processor.h>
-#include <Dm8168M3DssProc.h>
-#include <_Dm8168M3DssProc.h>
-#include <Dm8168M3DssHal.h>
-#include <Dm8168M3DssHalReset.h>
-#include <Dm8168M3DssHalBoot.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-/*!
- * @brief Number of static entries in address translation table.
- */
-#define AddrTable_STATIC_COUNT 4
-
-/*!
- * @brief Max entries in address translation table.
- */
-#define AddrTable_SIZE 32
-
-/* Config param for L2MMU. This is not a typo, we are using the
- * same name (VPSS-M3) because both Ducati M3 processors use the
- * same L2MMU. The docs expose VPSS-M3 but not the VIDEO-M3 processor.
- */
-#define PARAMS_mmuEnable "ProcMgr.proc[VPSS-M3].mmuEnable="
-
-
-/*!
- * @brief DM8168VPSSM3PROC Module state object
- */
-typedef struct DM8168VPSSM3PROC_ModuleObject_tag {
- UInt32 configSize;
- /*!< Size of configuration structure */
- DM8168VPSSM3PROC_Config cfg;
- /*!< DM8168VPSSM3PROC configuration structure */
- DM8168VPSSM3PROC_Config defCfg;
- /*!< Default module configuration */
- DM8168VPSSM3PROC_Params defInstParams;
- /*!< Default parameters for the DM8168VPSSM3PROC instances */
- Bool isSetup;
- /*!< Indicates whether the DM8168VPSSM3PROC module is setup. */
- DM8168VPSSM3PROC_Handle procHandles [MultiProc_MAXPROCESSORS];
- /*!< Processor handle array. */
- IGateProvider_Handle gateHandle;
- /*!< Handle of gate to be used for local thread safety */
-} DM8168VPSSM3PROC_ModuleObject;
-
-/*!
- * @brief DM8168VPSSM3PROC instance object.
- */
-struct DM8168VPSSM3PROC_Object_tag {
- DM8168VPSSM3PROC_Params params;
- /*!< Instance parameters (configuration values) */
- Ptr halObject;
- /*!< Pointer to the Hardware Abstraction Layer object. */
- ProcMgr_Handle pmHandle;
- /*!< Handle to proc manager */
-};
-
-/* Defines the DM8168VPSSM3PROC object type. */
-typedef struct DM8168VPSSM3PROC_Object_tag DM8168VPSSM3PROC_Object;
-
-
-/* Default memory regions */
-static UInt32 AddrTable_count = AddrTable_STATIC_COUNT;
-
-/* static memory regions
- * CAUTION: AddrTable_STATIC_COUNT must match number of entries below.
- */
-static ProcMgr_AddrInfo AddrTable[AddrTable_SIZE] =
- {
- { /* L2 BOOT, 16 KB */
- .addr = { -1u, -1u, 0x55020000, 0x00000000, 0x55020000 },
- .size = 0x4000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = ProcMgr_MASTERKNLVIRT
- },
- { /* L2 RAM, 240 KB */
- .addr = { -1u, -1u, 0x55024000, 0x20004000, 0x55024000 },
- .size = 0x3C000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = ProcMgr_MASTERKNLVIRT
- },
- { /* OCMC0, 256 KB */
- .addr = { -1u, -1u, 0x40300000, 0x00300000, 0x40300000 },
- .size = 0x40000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = (ProcMgr_MASTERKNLVIRT | ProcMgr_SLAVEVIRT)
- },
- { /* OCMC1, 256 KB */
- .addr = { -1u, -1u, 0x40400000, 0x00400000, 0x40400000 },
- .size = 0x40000,
- .isCached = FALSE,
- .isMapped = FALSE,
- .mapMask = (ProcMgr_MASTERKNLVIRT | ProcMgr_SLAVEVIRT)
- }
- };
-
-/* =============================================================================
- * Globals
- * =============================================================================
- */
-
-/*!
- * @var DM8168VPSSM3PROC_state
- *
- * @brief DM8168VPSSM3PROC state object variable
- */
-#if !defined(SYSLINK_BUILD_DEBUG)
-static
-#endif /* if !defined(SYSLINK_BUILD_DEBUG) */
-DM8168VPSSM3PROC_ModuleObject DM8168VPSSM3PROC_state =
-{
- .isSetup = FALSE,
- .configSize = sizeof(DM8168VPSSM3PROC_Config),
- .gateHandle = NULL,
- .defInstParams.mmuEnable = FALSE,
- .defInstParams.numMemEntries = AddrTable_STATIC_COUNT
-};
-
-/* config override specified in SysLinkCfg.c, defined in ProcMgr.c */
-extern String ProcMgr_sysLinkCfgParams;
-
-/* =============================================================================
- * APIs directly called by applications
- * =============================================================================
- */
-/*!
- * @brief Function to get the default configuration for the DM8168VPSSM3PROC
- * module.
- *
- * This function can be called by the application to get their
- * configuration parameter to DM8168VPSSM3PROC_setup filled in by the
- * DM8168VPSSM3PROC module with the default parameters. If the user
- * does not wish to make any change in the default parameters, this
- * API is not required to be called.
- *
- * @param cfg Pointer to the DM8168VPSSM3PROC module configuration
- * structure in which the default config is to be
- * returned.
- *
- * @sa DM8168VPSSM3PROC_setup
- */
-Void
-DM8168VPSSM3PROC_getConfig (DM8168VPSSM3PROC_Config * cfg)
-{
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_getConfig", cfg);
-
- GT_assert (curTrace, (cfg != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (cfg == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_getConfig",
- PROCESSOR_E_INVALIDARG,
- "Argument of type (DM8168VPSSM3PROC_Config *) passed "
- "is null!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- memcpy (cfg,
- &(DM8168VPSSM3PROC_state.defCfg),
- sizeof (DM8168VPSSM3PROC_Config));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_0trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_getConfig");
-}
-
-
-/*!
- * @brief Function to setup the DM8168VPSSM3PROC module.
- *
- * This function sets up the DM8168VPSSM3PROC module. This function
- * must be called before any other instance-level APIs can be
- * invoked.
- * Module-level configuration needs to be provided to this
- * function. If the user wishes to change some specific config
- * parameters, then DM8168VPSSM3PROC_getConfig can be called to get the
- * configuration filled with the default values. After this, only
- * the required configuration values can be changed. If the user
- * does not wish to make any change in the default parameters, the
- * application can simply call DM8168VPSSM3PROC_setup with NULL
- * parameters. The default parameters would get automatically used.
- *
- * @param cfg Optional DM8168VPSSM3PROC module configuration. If provided as
- * NULL, default configuration is used.
- *
- * @sa DM8168VPSSM3PROC_destroy
- * GateMutex_create
- */
-Int
-DM8168VPSSM3PROC_setup (DM8168VPSSM3PROC_Config * cfg)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3PROC_Config tmpCfg;
- Error_Block eb;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_setup", cfg);
- Error_init(&eb);
- if (cfg == NULL) {
- DM8168VPSSM3PROC_getConfig (&tmpCfg);
- cfg = &tmpCfg;
- }
-
- /* Create a default gate handle for local module protection. */
- DM8168VPSSM3PROC_state.gateHandle = (IGateProvider_Handle)
- GateMutex_create ((GateMutex_Params*)NULL, &eb);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (DM8168VPSSM3PROC_state.gateHandle == NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed to create GateMutex! */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_setup",
- status,
- "Failed to create GateMutex!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Copy the user provided values into the state object. */
- memcpy (&DM8168VPSSM3PROC_state.cfg,
- cfg,
- sizeof (DM8168VPSSM3PROC_Config));
-
- /* Initialize the name to handles mapping array. */
- memset (&DM8168VPSSM3PROC_state.procHandles,
- 0,
- (sizeof (DM8168VPSSM3PROC_Handle) * MultiProc_MAXPROCESSORS));
- DM8168VPSSM3PROC_state.isSetup = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_setup", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to destroy the DM8168VPSSM3PROC module.
- *
- * Once this function is called, other DM8168VPSSM3PROC module APIs,
- * except for the DM8168VPSSM3PROC_getConfig API cannot be called
- * anymore.
- *
- * @sa DM8168VPSSM3PROC_setup
- * GateMutex_delete
- */
-Int
-DM8168VPSSM3PROC_destroy (Void)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt16 i;
-
- GT_0trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_destroy");
-
- /* Check if any DM8168VPSSM3PROC instances have not been deleted so far. If not,
- * delete them.
- */
- for (i = 0 ; i < MultiProc_MAXPROCESSORS ; i++) {
- GT_assert (curTrace, (DM8168VPSSM3PROC_state.procHandles [i] == NULL));
- if (DM8168VPSSM3PROC_state.procHandles [i] != NULL) {
- DM8168VPSSM3PROC_delete (&(DM8168VPSSM3PROC_state.procHandles [i]));
- }
- }
-
- if (DM8168VPSSM3PROC_state.gateHandle != NULL) {
- GateMutex_delete ((GateMutex_Handle *)
- &(DM8168VPSSM3PROC_state.gateHandle));
- }
-
- DM8168VPSSM3PROC_state.isSetup = FALSE;
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_destroy", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to initialize the parameters for this Processor
- * instance.
- *
- * @param params Configuration parameters to be returned
- *
- * @sa DM8168VPSSM3PROC_create
- */
-Void
-DM8168VPSSM3PROC_Params_init(
- DM8168VPSSM3PROC_Handle handle,
- DM8168VPSSM3PROC_Params * params)
-{
- DM8168VPSSM3PROC_Object *procObject = (DM8168VPSSM3PROC_Object *)handle;
- Int i = 0;
- ProcMgr_AddrInfo *ai = NULL;
-
- GT_2trace(curTrace, GT_ENTER,
- "DM8168VPSSM3PROC_Params_init: handle=0x%x, params=0x%x\n",
- handle, params);
-
- GT_assert(curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (params == NULL) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_Params_init", PROCESSOR_E_INVALIDARG,
- "Argument of type (DM8168VPSSM3PROC_Params *) passed is null!");
- }
- else {
-#endif
- if (handle == NULL) {
-
- /* check for instance params override */
- Cfg_propBool(PARAMS_mmuEnable, ProcMgr_sysLinkCfgParams,
- &(DM8168VPSSM3PROC_state.defInstParams.mmuEnable));
-
- memcpy(params, &(DM8168VPSSM3PROC_state.defInstParams),
- sizeof (DM8168VPSSM3PROC_Params));
-
- /* initialize the translation table */
- for (i = AddrTable_count; i < AddrTable_SIZE; i++) {
- ai = &AddrTable[i];
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
- }
-
- /* initialize refCount for all entries - both static and dynamic */
- for (i = 0; i < AddrTable_SIZE; i++) {
- AddrTable[i].refCount = 0u;
- }
-
- memcpy((Ptr)params->memEntries, AddrTable, sizeof(AddrTable));
- }
- else {
- /* return updated DM8168VPSSM3PROC instance specific parameters */
- memcpy(params, &(procObject->params),
- sizeof(DM8168VPSSM3PROC_Params));
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
-
- GT_0trace(curTrace, GT_LEAVE, "DM8168VPSSM3PROC_Params_init");
-}
-
-/*!
- * @brief Function to create an instance of this Processor.
- *
- * @param name Name of the Processor instance.
- * @param params Configuration parameters.
- *
- * @sa DM8168VPSSM3PROC_delete
- */
-DM8168VPSSM3PROC_Handle
-DM8168VPSSM3PROC_create ( UInt16 procId,
- const DM8168VPSSM3PROC_Params * params)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * handle = NULL;
- DM8168VPSSM3PROC_Object * object = NULL;
- IArg key;
- List_Params listParams;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_create", procId, params);
-
- GT_assert (curTrace, IS_VALID_PROCID (procId));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (!IS_VALID_PROCID (procId)) {
- /* Not setting status here since this function does not return status.*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_create",
- PROCESSOR_E_INVALIDARG,
- "Invalid procId specified");
- }
- else if (params == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_create",
- PROCESSOR_E_INVALIDARG,
- "params passed is NULL!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168VPSSM3PROC_state.gateHandle);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- /* Check if the Processor already exists for specified procId. */
- if (DM8168VPSSM3PROC_state.procHandles [procId] != NULL) {
- status = PROCESSOR_E_ALREADYEXIST;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_create",
- status,
- "Processor already exists for specified procId!");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Allocate memory for the handle */
- handle = (Processor_Object *) Memory_calloc (NULL,
- sizeof (Processor_Object),
- 0,
- NULL);
- if (handle == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_create",
- PROCESSOR_E_MEMORY,
- "Memory allocation failed for handle!");
- }
- else {
- /* Populate the handle fields */
- handle->procFxnTable.attach = &DM8168VPSSM3PROC_attach;
- handle->procFxnTable.detach = &DM8168VPSSM3PROC_detach;
- handle->procFxnTable.start = &DM8168VPSSM3PROC_start;
- handle->procFxnTable.stop = &DM8168VPSSM3PROC_stop;
- handle->procFxnTable.read = &DM8168VPSSM3PROC_read;
- handle->procFxnTable.write = &DM8168VPSSM3PROC_write;
- handle->procFxnTable.control = &DM8168VPSSM3PROC_control;
- handle->procFxnTable.map = &DM8168VPSSM3PROC_map;
- handle->procFxnTable.unmap = &DM8168VPSSM3PROC_unmap;
- handle->procFxnTable.translateAddr = &DM8168VPSSM3PROC_translate;
- handle->state = ProcMgr_State_Unknown;
-
- /* Allocate memory for the DM8168VPSSM3PROC handle */
- handle->object = (DM8168VPSSM3PROC_Object *) Memory_calloc (NULL,
- sizeof (DM8168VPSSM3PROC_Object),
- 0,
- NULL);
- if (handle->object == NULL) {
- status = PROCESSOR_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_create",
- status,
- "Memory allocation failed for handle->object!");
- }
- else {
- handle->procId = procId;
- object = (DM8168VPSSM3PROC_Object *) handle->object;
- object->halObject = NULL;
- /* Copy params into instance object. */
- memcpy (&(object->params),
- (Ptr) params,
- sizeof (DM8168VPSSM3PROC_Params));
-
- /* Set the handle in the state object. */
- DM8168VPSSM3PROC_state.procHandles [procId] =
- (DM8168VPSSM3PROC_Handle) handle;
- /* Initialize the list of listeners */
- List_Params_init(&listParams);
- handle->registeredNotifiers = List_create(&listParams);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (handle->registeredNotifiers == NULL) {
- /*! @retval PROCESSOR_E_FAIL OsalIsr_create failed */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_create",
- status,
- "List_create failed");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- handle->notifiersLock =
- OsalMutex_create(OsalMutex_Type_Interruptible);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (handle->notifiersLock == NULL) {
- /*! @retval PROCESSOR_E_FAIL OsalIsr_create failed*/
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_create",
- status,
- "OsalMutex_create failed");
- }
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168VPSSM3PROC_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (status < 0) {
- if (handle != NULL) {
- if (handle->registeredNotifiers != NULL) {
- List_delete (&handle->registeredNotifiers);
- }
- if (handle->object != NULL) {
- Memory_free (NULL,
- handle->object,
- sizeof (DM8168VPSSM3PROC_Object));
- }
- Memory_free (NULL, handle, sizeof (Processor_Object));
- }
- /*! @retval NULL Function failed */
- handle = NULL;
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_create", handle);
-
- /*! @retval Valid-Handle Operation successful */
- return (DM8168VPSSM3PROC_Handle) handle;
-}
-
-
-/*!
- * @brief Function to delete an instance of this Processor.
- *
- * The user provided pointer to the handle is reset after
- * successful completion of this function.
- *
- * @param handlePtr Pointer to Handle to the Processor instance
- *
- * @sa DM8168VPSSM3PROC_create
- */
-Int
-DM8168VPSSM3PROC_delete (DM8168VPSSM3PROC_Handle * handlePtr)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3PROC_Object * object = NULL;
- Processor_Object * handle;
- IArg key;
- List_Elem * elem = NULL;
- Processor_RegisterElem * regElem = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_delete", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid NULL handlePtr pointer
- specified*/
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_delete",
- status,
- "Invalid NULL handlePtr pointer specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_delete",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- handle = (Processor_Object *) (*handlePtr);
- /* Enter critical section protection. */
- key = IGateProvider_enter (DM8168VPSSM3PROC_state.gateHandle);
-
- /* Reset handle in PwrMgr handle array. */
- GT_assert (curTrace, IS_VALID_PROCID (handle->procId));
- DM8168VPSSM3PROC_state.procHandles [handle->procId] = NULL;
-
- /* Free memory used for the DM8168VPSSM3PROC object. */
- if (handle->object != NULL) {
- object = (DM8168VPSSM3PROC_Object *) handle->object;
-
- Memory_free (NULL,
- object,
- sizeof (DM8168VPSSM3PROC_Object));
- handle->object = NULL;
- }
-
- /*
- * Check the list of listeners to see if any are remaining
- * and reply to them
- */
- OsalMutex_delete(&handle->notifiersLock);
-
- while ((elem = List_dequeue(handle->registeredNotifiers)) != NULL) {
- regElem = (Processor_RegisterElem *)elem;
-
- /* Check if there is an associated timer and cancel it */
- if (regElem->timer != -1) {
- struct itimerspec value ;
- value.it_value.tv_sec = 0;
- value.it_value.tv_nsec = 0;
- value.it_interval.tv_sec = 0;
- value.it_interval.tv_nsec = 0;
- timer_settime(regElem->timer, 0, &value, NULL);
-
- timer_delete(regElem->timer);
- regElem->timer = -1;
- }
-
- /* Call the callback function so it can clean up. */
- regElem->info->cbFxn(handle->procId,
- NULL,
- handle->state,
- handle->state,
- ProcMgr_EventStatus_Canceled,
- regElem->info->arg);
- /* Free the memory */
- Memory_free(NULL, regElem, sizeof(Processor_RegisterElem));
- }
-
- /* Delete the list of listeners */
- List_delete(&handle->registeredNotifiers);
-
- /* Free memory used for the Processor object. */
- Memory_free (NULL, handle, sizeof (Processor_Object));
- *handlePtr = NULL;
-
- /* Leave critical section protection. */
- IGateProvider_leave (DM8168VPSSM3PROC_state.gateHandle, key);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_delete", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return (status);
-}
-
-
-/*!
- * @brief Function to open a handle to an instance of this Processor. This
- * function is called when access to the Processor is required from
- * a different process.
- *
- * @param handlePtr Handle to the Processor instance
- * @param procId Processor ID addressed by this Processor instance.
- *
- * @sa DM8168VPSSM3PROC_close
- */
-Int
-DM8168VPSSM3PROC_open (DM8168VPSSM3PROC_Handle * handlePtr, UInt16 procId)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_2trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_open", handlePtr, procId);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, IS_VALID_PROCID (procId));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_open",
- status,
- "Invalid NULL handlePtr specified");
- }
- else if (!IS_VALID_PROCID (procId)) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid procId specified */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_open",
- status,
- "Invalid procId specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Initialize return parameter handle. */
- *handlePtr = NULL;
-
- /* Check if the PwrMgr exists and return the handle if found. */
- if (DM8168VPSSM3PROC_state.procHandles [procId] == NULL) {
- /*! @retval PROCESSOR_E_NOTFOUND Specified instance not found */
- status = PROCESSOR_E_NOTFOUND;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_open",
- status,
- "Specified DM8168VPSSM3PROC instance does not exist!");
- }
- else {
- *handlePtr = DM8168VPSSM3PROC_state.procHandles [procId];
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_open", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to close a handle to an instance of this Processor.
- *
- * @param handlePtr Pointer to Handle to the Processor instance
- *
- * @sa DM8168VPSSM3PROC_open
- */
-Int
-DM8168VPSSM3PROC_close (DM8168VPSSM3PROC_Handle * handlePtr)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_close", handlePtr);
-
- GT_assert (curTrace, (handlePtr != NULL));
- GT_assert (curTrace, ((handlePtr != NULL) && (*handlePtr != NULL)));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handlePtr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid NULL handlePtr pointer
- specified*/
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_close",
- status,
- "Invalid NULL handlePtr pointer specified");
- }
- else if (*handlePtr == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid NULL *handlePtr specified */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_close",
- status,
- "Invalid NULL *handlePtr specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Nothing to be done for close. */
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_close", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/* =============================================================================
- * APIs called by Processor module (part of function table interface)
- * =============================================================================
- */
-/*!
- * @brief Function to initialize the slave processor
- *
- * @param handle Handle to the Processor instance
- * @param params Attach parameters
- *
- * @sa DM8168VPSSM3PROC_detach
- */
-Int
-DM8168VPSSM3PROC_attach(
- Processor_Handle handle,
- Processor_AttachParams * params)
-{
-
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168VPSSM3PROC_Object * object = NULL;
- Int i = 0;
- Int j = 0;
- Int index = 0;
- ProcMgr_AddrInfo * me;
- SysLink_MemEntry * entry;
- SysLink_MemEntry_Block * memBlock = NULL;
- DM8168VPSSM3_HalMmuCtrlArgs_Enable mmuEnableArgs;
-
- GT_2trace(curTrace, GT_ENTER,
- "DM8168VPSSM3PROC_attach: handle=0x%x, parms=0x%x", handle, params);
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_attach",
- status,
- "Invalid handle specified");
- }
- else if (params == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_attach",
- status,
- "Invalid params specified");
- }
- else {
-#endif
- object = (DM8168VPSSM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* Added for Netra Ducati core1 is cortex M3 */
- params->procArch = Processor_ProcArch_M3;
-
- /* check for instance params override */
- Cfg_propBool(PARAMS_mmuEnable, ProcMgr_sysLinkCfgParams,
- &(object->params.mmuEnable));
-
- object->pmHandle = params->pmHandle;
- GT_0trace(curTrace, GT_1CLASS,
- "DM8168VPSSM3PROC_attach: Mapping memory regions");
-
- /* update translation tables with memory map */
- for (i = 0; (memBlock != NULL) && (i < memBlock->numEntries)
- && (memBlock->memEntries[i].isValid) && (status >= 0); i++) {
-
- entry = &memBlock->memEntries[i];
-
- if (entry->map == FALSE) {
- /* update table with entries which don't require mapping */
- if (AddrTable_count != AddrTable_SIZE) {
- me = &AddrTable[AddrTable_count];
-
- me->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterPhys] =
- entry->masterPhysAddr;
- me->addr[ProcMgr_AddrType_SlaveVirt] = entry->slaveVirtAddr;
- me->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- me->size = entry->size;
- me->isCached = entry->isCached;
- me->mapMask = entry->mapMask;
-
- AddrTable_count++;
- }
- else {
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_attach", status,
- "AddrTable_SIZE reached!");
- }
- }
- else if (entry->map == TRUE) {
- /* send these entries back to ProcMgr for mapping */
- index = object->params.numMemEntries;
-
- if (index != ProcMgr_MAX_MEMORY_REGIONS) {
- me = &object->params.memEntries[index];
-
- me->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- me->addr[ProcMgr_AddrType_MasterPhys] =
- entry->masterPhysAddr;
- me->addr[ProcMgr_AddrType_SlaveVirt] = entry->slaveVirtAddr;
- me->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- me->size = entry->size;
- me->isCached = entry->isCached;
- me->mapMask = entry->mapMask;
-
- object->params.numMemEntries++;
- }
- else {
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_attach", status,
- "ProcMgr_MAX_MEMORY_REGIONS reached!");
- }
- }
- else {
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_attach", status,
- "Memory map has entry with invalid 'map' value");
- }
- } /* for (...) */
-
- if (status >= 0) {
- /* populate the return params */
- params->numMemEntries = object->params.numMemEntries;
- memcpy((Ptr)params->memEntries, (Ptr)object->params.memEntries,
- sizeof(ProcMgr_AddrInfo) * params->numMemEntries);
-
- status = DM8168VPSSM3_halInit(&(object->halObject), NULL);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined(SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_attach", status,
- "DM8168VPSSM3_halInit failed");
- }
- else {
-#endif
- if ((procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)) {
-
- /* place the slave processor in reset */
- status = DM8168VPSSM3_halResetCtrl(object->halObject,
- Processor_ResetCtrlCmd_Reset, NULL);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_attach", status,
- "Failed to reset the slave processor");
- }
- else {
-#endif
- GT_0trace(curTrace, GT_1CLASS,
- "DM8168VPSSM3PROC_attach: slave is now in reset");
-
- if (object->params.mmuEnable) {
- mmuEnableArgs.numMemEntries = 0;
- status = DM8168VPSSM3_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_Enable, &mmuEnableArgs);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_attach", status,
- "Failed to enable the slave MMU");
- }
-#endif
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168VPSSM3PROC_attach: Slave MMU "
- "is configured!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
-
- GT_1trace(curTrace, GT_LEAVE,
- "DM8168VPSSM3PROC_attach: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to detach from the Processor.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168VPSSM3PROC_attach
- */
-Int
-DM8168VPSSM3PROC_detach (Processor_Handle handle)
-{
- Int status = PROCESSOR_SUCCESS;
- Int tmpStatus = PROCESSOR_SUCCESS;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168VPSSM3PROC_Object * object = NULL;
- Int i = 0;
- ProcMgr_AddrInfo * ai;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_detach", handle);
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_detach",
- PROCESSOR_E_HANDLE,
- "Invalid handle specified");
- }
- else {
-#endif
- object = (DM8168VPSSM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)) {
-
- if (object->params.mmuEnable) {
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168VPSSM3PROC_detach: Disabling Slave MMU ...");
-
- status = DM8168VPSSM3_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_Disable, NULL);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_detach", status,
- "Failed to disable the slave MMU");
- }
-#endif
- }
-
- /* delete all dynamically added entries */
- for (i = AddrTable_STATIC_COUNT; i < AddrTable_count; i++) {
- ai = &AddrTable[i];
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
- ai->refCount = 0u;
- }
- object->params.numMemEntries = AddrTable_STATIC_COUNT;
- AddrTable_count = AddrTable_STATIC_COUNT;
-
- /* place the slave processor into reset */
- tmpStatus = DM8168VPSSM3_halResetCtrl(object->halObject,
- Processor_ResetCtrlCmd_Reset, NULL);
-
- GT_0trace(curTrace, GT_2CLASS,
- "DM8168VPSSM3PROC_detach: Slave processor is now in reset");
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if ((tmpStatus < 0) && (status >= 0)) {
- status = tmpStatus;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_detach",
- status,
- "Failed to reset the slave processor");
- }
-#endif
- }
-
- GT_0trace (curTrace,
- GT_2CLASS,
- " DM8168VPSSM3PROC_detach: Unmapping memory regions\n");
-
- tmpStatus = DM8168VPSSM3_halExit (object->halObject);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if ((tmpStatus < 0) && (status >= 0)) {
- status = tmpStatus;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_detach",
- status,
- "Failed to finalize HAL object");
- }
- }
-#endif
-
- GT_1trace(curTrace, GT_LEAVE,
- "DM8168VPSSM3PROC_detach: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to start the slave processor
- *
- * Start the slave processor running from its entry point.
- * Depending on the boot mode, this involves configuring the boot
- * address and releasing the slave from reset.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168VPSSM3PROC_stop, DM8168VPSSM3_halBootCtrl, DM8168VPSSM3_halResetCtrl
- */
-Int
-DM8168VPSSM3PROC_start (Processor_Handle handle,
- UInt32 entryPt,
- Processor_StartParams * params)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168VPSSM3PROC_Object * object = NULL;
-
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_start",
- handle, entryPt, params);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (params != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_start",
- status,
- "Invalid handle specified");
- }
- else if (params == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_start",
- status,
- "Invalid params specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168VPSSM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_NoPwr)) {
- GT_1trace (curTrace,
- GT_2CLASS,
- " DM8168VPSSM3PROC_start: Configuring boot register\n"
- " Reset vector [0x%x]!\n",
- entryPt);
- /* Specify the VPSSM3 boot address in the boot config register */
- status = DM8168VPSSM3_halBootCtrl (
- object->halObject,
- Processor_BootCtrlCmd_SetEntryPoint,
- (Ptr) entryPt);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_start",
- status,
- "Failed to set slave boot entry point");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* Write the branch instruction to at the boot address to
- * branch to _c_int00
- */
-
-
- /* Release the slave from reset */
- status = DM8168VPSSM3_halResetCtrl (object->halObject,
- Processor_ResetCtrlCmd_Release,
- NULL);
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_start",
- status,
- "Failed to release slave from reset");
- }
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
-
- /* For NoBoot mode, send an interrupt to the slave.
- * TBD: How should Dm8168M3VideoProc interface with Notify for this?
- */
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- if (status >= 0) {
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168VPSSM3PROC_start: Slave successfully started!\n");
- }
- else {
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168VPSSM3PROC_start: Slave could not be started!\n");
- }
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_start", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to stop the slave processor
- *
- * Stop the execution of the slave processor. Depending on the boot
- * mode, this may result in placing the slave processor in reset.
- *
- * @param handle Handle to the Processor instance
- *
- * @sa DM8168VPSSM3PROC_start, DM8168VPSSM3_halResetCtrl
- */
-Int
-DM8168VPSSM3PROC_stop (Processor_Handle handle)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *) handle;
- DM8168VPSSM3PROC_Object * object = NULL;
-
- GT_1trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_stop", handle);
-
- GT_assert (curTrace, (handle != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_stop",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- object = (DM8168VPSSM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
- if ( (procHandle->bootMode == ProcMgr_BootMode_Boot)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_Pwr)
- || (procHandle->bootMode == ProcMgr_BootMode_NoLoad_NoPwr)) {
- /* Slave is to be stopped only for Boot mode and NoLoad mode. */
- /* Place the slave processor in reset. */
- status = DM8168VPSSM3_halResetCtrl (object->halObject,
- Processor_ResetCtrlCmd_Reset,
- NULL);
- GT_0trace (curTrace,
- GT_1CLASS,
- " DM8168VPSSM3PROC_stop: Slave is now in reset!\n");
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_stop",
- status,
- "Failed to place slave in reset");
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_stop", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to read from the slave processor's memory.
- *
- * Read from the slave processor's memory and copy into the
- * provided buffer.
- *
- * @param handle Handle to the Processor instance
- * @param procAddr Address in host processor's address space of the
- * memory region to read from.
- * @param numBytes IN/OUT parameter. As an IN-parameter, it takes in the
- * number of bytes to be read. When the function
- * returns, this parameter contains the number of bytes
- * actually read.
- * @param buffer User-provided buffer in which the slave processor's
- * memory contents are to be copied.
- *
- * @sa DM8168VPSSM3PROC_write
- */
-Int
-DM8168VPSSM3PROC_read (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer)
-{
- Int status = PROCESSOR_SUCCESS ;
- UInt8 * procPtr8 = NULL;
-
- GT_4trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_read",
- handle, procAddr, numBytes, buffer);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (numBytes != NULL));
- GT_assert (curTrace, (buffer != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_read",
- status,
- "Invalid handle specified");
- }
- else if (numBytes == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_read",
- status,
- "Invalid numBytes specified");
- }
- else if (buffer == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_read",
- status,
- "Invalid buffer specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- procPtr8 = (UInt8 *) procAddr ;
- buffer = memcpy (buffer, procPtr8, *numBytes);
- GT_assert (curTrace, (buffer != (UInt32) NULL));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (buffer == (UInt32) NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed in memcpy */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_read",
- status,
- "Failed in memcpy");
- *numBytes = 0;
- }
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_read",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to write into the slave processor's memory.
- *
- * Read from the provided buffer and copy into the slave
- * processor's memory.
- *
- * @param handle Handle to the Processor object
- * @param procAddr Address in host processor's address space of the
- * memory region to write into.
- * @param numBytes IN/OUT parameter. As an IN-parameter, it takes in the
- * number of bytes to be written. When the function
- * returns, this parameter contains the number of bytes
- * actually written.
- * @param buffer User-provided buffer from which the data is to be
- * written into the slave processor's memory.
- *
- * @sa DM8168VPSSM3PROC_read, DM8168VPSSM3PROC_translateAddr
- */
-Int
-DM8168VPSSM3PROC_write (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer)
-{
- Int status = PROCESSOR_SUCCESS ;
- UInt8 * procPtr8 = NULL;
- UInt8 temp8_1;
- UInt8 temp8_2;
- UInt8 temp8_3;
- UInt8 temp8_4;
- UInt32 temp;
-
- GT_4trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_write",
- handle, procAddr, numBytes, buffer);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (numBytes != NULL));
- GT_assert (curTrace, (buffer != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_write",
- status,
- "Invalid handle specified");
- }
- else if (numBytes == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_write",
- status,
- "Invalid numBytes specified");
- }
- else if (buffer == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_write",
- status,
- "Invalid buffer specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- if (*numBytes != sizeof (UInt32)) {
- procPtr8 = (UInt8 *) procAddr ;
- procAddr = (UInt32) memcpy (procPtr8,
- buffer,
- *numBytes);
- GT_assert (curTrace, (procAddr != (UInt32) NULL));
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (procAddr == (UInt32) NULL) {
- /*! @retval PROCESSOR_E_FAIL Failed in memcpy */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_write",
- status,
- "Failed in memcpy");
- *numBytes = 0;
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- }
- else {
- /* For 4 bytes, directly write as a UInt32 */
- temp8_1 = ((UInt8 *) buffer) [0];
- temp8_2 = ((UInt8 *) buffer) [1];
- temp8_3 = ((UInt8 *) buffer) [2];
- temp8_4 = ((UInt8 *) buffer) [3];
- temp = (UInt32) ( ((UInt32) temp8_4 << 24)
- | ((UInt32) temp8_3 << 16)
- | ((UInt32) temp8_2 << 8)
- | ((UInt32) temp8_1));
- *((UInt32*) procAddr) = temp;
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
-
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC_write", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to perform device-dependent operations.
- *
- * Performs device-dependent control operations as exposed by this
- * implementation of the Processor module.
- *
- * @param handle Handle to the Processor object
- * @param cmd Device specific processor command
- * @param arg Arguments specific to the type of command.
- *
- * @sa
- */
-Int
-DM8168VPSSM3PROC_control (Processor_Handle handle, Int32 cmd, Ptr arg)
-{
- Int status = PROCESSOR_SUCCESS ;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_control", handle, cmd, arg);
-
- GT_assert (curTrace, (handle != NULL));
- /* cmd and arg can be 0/NULL, so cannot check for validity. */
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_control",
- status,
- "Invalid handle specified");
- }
- else {
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- /* No control operations currently implemented. */
- /*! @retval PROCESSOR_E_NOTSUPPORTED No control operations are supported
- for this device. */
- status = PROCESSOR_E_NOTSUPPORTED;
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif /* #if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3PROC ",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Translate slave virtual address to master physical address.
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Returned: master physical address.
- * @param srcAddr Slave virtual address.
- *
- * @sa
- */
-Int
-DM8168VPSSM3PROC_translate(
- Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 srcAddr)
-{
- Int status = PROCESSOR_SUCCESS;
- Processor_Object * procHandle= (Processor_Object *)handle;
- DM8168VPSSM3PROC_Object * object = NULL;
- UInt32 i;
- UInt32 startAddr;
- UInt32 endAddr;
- UInt32 offset;
- ProcMgr_AddrInfo * ai;
-
- GT_3trace(curTrace, GT_ENTER,
- "DM8168VPSSM3PROC_translate: handle=0x%x, dstAddr=0x%x, srcAddr=0x%x",
- handle, dstAddr, srcAddr);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (dstAddr != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_translate",
- status,
- "Invalid handle specified");
- }
- else if (dstAddr == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG sglist provided as NULL */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_translate",
- status,
- "dstAddr provided as NULL");
- }
- else {
-#endif
- object = (DM8168VPSSM3PROC_Object *)procHandle->object;
- GT_assert(curTrace, (object != NULL));
- *dstAddr = -1u;
-
- /* search all entries AddrTable */
- for (i = 0; i < AddrTable_count; i++) {
- ai = &AddrTable[i];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= srcAddr) && (srcAddr < endAddr)) {
- offset = srcAddr - startAddr;
- *dstAddr = ai->addr[ProcMgr_AddrType_MasterPhys] + offset;
- GT_3trace(curTrace, GT_1CLASS, "DM8168VPSSM3PROC_translate: "
- "translated [%d] srcAddr=0x%x --> dstAddr=0x%x",
- i, srcAddr, *dstAddr);
- break;
- }
- }
-
- if (*dstAddr == -1u) {
- if (!object->params.mmuEnable) {
- /* default to direct mapping (i.e. v=p) */
- *dstAddr = srcAddr;
- GT_2trace(curTrace, GT_1CLASS, "DM8168VPSSM3PROC_translate: "
- "(default) srcAddr=0x%x --> dstAddr=0x%x",
- srcAddr, *dstAddr);
- }
- else {
- /* srcAddr not found in slave address space */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_translate", status,
- "srcAddr not found in slave address space");
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE,
- "DM8168VPSSM3PROC_translate: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Map the given address translation into the slave mmu
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Base virtual address
- * @param nSegs Number of given segments
- * @param sglist Segment list
- */
-Int
-DM8168VPSSM3PROC_map(
- Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 nSegs,
- Memory_SGList * sglist)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168VPSSM3PROC_Object * object = NULL;
- Bool found = FALSE;
- UInt32 startAddr;
- UInt32 endAddr;
- UInt32 i;
- UInt32 j;
- ProcMgr_AddrInfo * ai;
- DM8168VPSSM3_HalMmuCtrlArgs_AddEntry addEntryArgs;
-
- GT_4trace(curTrace, GT_ENTER, "DM8168VPSSM3PROC_map:",
- handle, *dstAddr, nSegs, sglist);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (sglist != NULL));
- GT_assert (curTrace, (nSegs > 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_map",
- status,
- "Invalid handle specified");
- }
- else if (sglist == NULL) {
- /*! @retval PROCESSOR_E_INVALIDARG sglist provided as NULL */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_map",
- status,
- "sglist provided as NULL");
- }
- else if (nSegs == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Number of segments provided is 0 */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_map",
- status,
- "Number of segments provided is 0");
- }
- else {
-#endif
- object = (DM8168VPSSM3PROC_Object *)procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- for (i = 0; (i < nSegs) && (status >= 0); i++) {
- /* Update the translation table with entries for which mapping
- * is required. Add the entry only if the range does not exist
- * in the translation table.
- */
-
- /* check in static entries first */
- for (j = 0; j < AddrTable_STATIC_COUNT; j++) {
- ai = &AddrTable[j];
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)) {
- found = TRUE;
- ai->refCount++;
- GT_4trace(curTrace, GT_1CLASS, "DM8168VPSSM3PROC_map: "
- "found static entry: [%d] sva=0x%x, mpa=0x%x size=0x%x",
- j, ai->addr[ProcMgr_AddrType_SlaveVirt],
- ai->addr[ProcMgr_AddrType_MasterPhys], ai->size);
- break;
- }
- }
-
- /* if not found in static entries, check in dynamic entries */
- if (!found) {
- for (j = AddrTable_STATIC_COUNT; j < AddrTable_count; j++) {
- ai = &AddrTable[j];
-
- if (ai->isMapped == TRUE) {
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= *dstAddr) && (*dstAddr < endAddr)
- && ((*dstAddr + sglist[i].size) <= endAddr)) {
- found = TRUE;
- ai->refCount++;
- GT_4trace(curTrace, GT_1CLASS,
- "DM8168VPSSM3PROC_map: found dynamic entry: "
- "[%d] sva=0x%x, mpa=0x%x, size=0x%x",
- j, ai->addr[ProcMgr_AddrType_SlaveVirt],
- ai->addr[ProcMgr_AddrType_MasterPhys],ai->size);
- break;
- }
- }
- }
- }
-
- /* If not found, add new entry to table. If mmu is disabled,
- * the assumption is that the ammu will be used.
- */
- if (!found) {
- if (AddrTable_count != AddrTable_SIZE) {
- ai = &AddrTable[AddrTable_count];
-
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = sglist[i].paddr;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = *dstAddr;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = sglist[i].size;
- ai->isCached = sglist[i].isCached;
- ai->refCount++;
-
- AddrTable_count++;
-
- GT_4trace(curTrace, GT_1CLASS,
- "DM8168VPSSM3PROC_map: adding dynamic entry: "
- "[%d] sva=0x%x, mpa=0x%x, size=0x%x",
- (AddrTable_count - 1), *dstAddr, sglist[i].paddr,
- sglist[i].size);
- }
- else {
- status = PROCESSOR_E_FAIL;
- ai = NULL;
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_map", status,
- "AddrTable_SIZE reached!");
- }
- }
-
- /* if new entry, map into dsp mmu */
- if ((ai != NULL) && (ai->refCount == 1) && (status >= 0)) {
- ai->isMapped = TRUE;
-
- if (object->params.mmuEnable) {
- GT_3trace(curTrace, GT_1CLASS,
- "DM8168VPSSM3PROC_map: adding entry to L2MMU: "
- "sva=0x%x, spa=0x%x, size=0x%x",
- *dstAddr, sglist[i].paddr, sglist[i].size);
-
- /* add entry to L2 MMU */
- addEntryArgs.masterPhyAddr = sglist [i].paddr;
- addEntryArgs.size = sglist [i].size;
- addEntryArgs.slaveVirtAddr = (UInt32)*dstAddr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- addEntryArgs.elementSize = ELEM_SIZE_16BIT;
- addEntryArgs.endianism = LITTLE_ENDIAN;
- addEntryArgs.mixedSize = MMU_TLBES;
-
- status = DM8168VPSSM3_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_AddEntry, &addEntryArgs);
-
- GT_3trace(curTrace, GT_1CLASS,
- "DM8168VIDEOM3PROC_map: mmu add entry, "
- "masterPhyAddr=0x%x, slaveVirAddr=0x%x, size=0x%x",
- addEntryArgs.masterPhyAddr, addEntryArgs.slaveVirtAddr,
- addEntryArgs.size);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_map", status,
- "Processor_MmuCtrlCmd_AddEntry failed");
- }
-#endif
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_map", status,
- "VPSSM3 MMU configuration failed");
- }
-#endif
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE, "DM8168VPSSM3PROC_map:", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-/*!
- * @brief Function to unmap slave address from host address space
- *
- * @param handle Handle to the Processor object
- * @param dstAddr Return parameter: Pointer to receive the mapped
- * address.
- * @param size Size of the region to be mapped.
- *
- * @sa
- */
-Int
-DM8168VPSSM3PROC_unmap(
- Processor_Handle handle,
- UInt32 addr,
- UInt32 size)
-{
- Int status = PROCESSOR_SUCCESS ;
- Processor_Object * procHandle = (Processor_Object *)handle;
- DM8168VPSSM3PROC_Object * object = NULL;
- ProcMgr_AddrInfo * ai;
- Int i;
- UInt32 startAddr;
- UInt32 endAddr;
- DM8168VPSSM3_HalMmuCtrlArgs_DeleteEntry deleteEntryArgs;
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VPSSM3PROC_unmap",
- handle, addr, size);
-
- GT_assert (curTrace, (handle != NULL));
- GT_assert (curTrace, (size != 0));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- if (handle == NULL) {
- /*! @retval PROCESSOR_E_HANDLE Invalid argument */
- status = PROCESSOR_E_HANDLE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_unmap",
- status,
- "Invalid handle specified");
- }
- else if (size == 0) {
- /*! @retval PROCESSOR_E_INVALIDARG Size provided is zero */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3PROC_unmap",
- status,
- "Size provided is zero");
- }
- else {
-#endif
- object = (DM8168VPSSM3PROC_Object *) procHandle->object;
- GT_assert (curTrace, (object != NULL));
-
- /* Delete dynamically added non-default entries from translation
- * table only in last unmap called on that entry
- */
- for (i = AddrTable_STATIC_COUNT; i < AddrTable_count; i++) {
- ai = &AddrTable[i];
-
- if (!ai->isMapped) {
- continue;
- }
-
- startAddr = ai->addr[ProcMgr_AddrType_SlaveVirt];
- endAddr = startAddr + ai->size;
-
- if ((startAddr <= addr) && (addr < endAddr)) {
- ai->refCount--;
-
- if (ai->refCount == 0) {
- ai->addr[ProcMgr_AddrType_MasterKnlVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterUsrVirt] = -1u;
- ai->addr[ProcMgr_AddrType_MasterPhys] = -1u;
- ai->addr[ProcMgr_AddrType_SlaveVirt] = -1u;
- ai->addr[ProcMgr_AddrType_SlavePhys] = -1u;
- ai->size = 0u;
- ai->isCached = FALSE;
- ai->mapMask = 0u;
- ai->isMapped = FALSE;
-
- if (object->params.mmuEnable) {
- /* Remove the entry from the VPSSM3 MMU also */
- deleteEntryArgs.size = size;
- deleteEntryArgs.slaveVirtAddr = addr;
- /* TBD: elementSize, endianism, mixedSized are
- * hard coded now, must be configurable later
- */
- deleteEntryArgs.elementSize = ELEM_SIZE_16BIT;
- deleteEntryArgs.endianism = LITTLE_ENDIAN;
- deleteEntryArgs.mixedSize = MMU_TLBES;
-
- status = DM8168VPSSM3_halMmuCtrl(object->halObject,
- Processor_MmuCtrlCmd_DeleteEntry, &deleteEntryArgs);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason(curTrace, GT_4CLASS,
- "DM8168VPSSM3PROC_unmap", status,
- "VPSSM3 MMU configuration failed");
- }
-#endif
- }
- }
- }
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE) && defined (SYSLINK_BUILD_HLOS)
- }
-#endif
- GT_1trace(curTrace, GT_LEAVE,
- "DM8168VPSSM3PROC_unmap: status=0x%x", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/VAYUIpuMmu.c b/qnx/src/ipc3x_dev/ti/syslink/family/common/vayu/vayuipu/VAYUIpuMmu.c
index 1299de79dd3b1a61ed7506ead080d2abc1b14e5e..283db9160b5f0541a98a64158e799dbe8c7e929f 100644 (file)
/*Enable the Ipu Logic*/
CLEAR_BIT(REG(object->prcmVA + RM_DEFAULT_RSTCTRL), 0x4);
while((((REG(object->prcmVA + RM_DEFAULT_RSTST)&0x10))!=0x10));
-#if defined(SYSLINK_VARIANT_TI814X) || \
- defined(SYSLINK_VARIANT_TI813X) || \
- defined(SYSLINK_VARIANT_TI811X)
- /* This delay is required only in case of centaurus*/
-// OsalDelay_udelay(2);
- OsalThread_delay(2); //2ms sec delay
-#endif
/* Write a while(1) so that even if m3 comes out of reset
* m3 wont crash */
REG(object->ipubaseVA) = 0x10000;
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/Platform.c b/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/Platform.c
+++ /dev/null
@@ -1,1373 +0,0 @@
-/*
- * @file Platform.c
- *
- * @brief Implementation of Platform initialization logic.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-/* Standard header files */
-#include <ti/syslink/Std.h>
-
-/* Utilities & Osal headers */
-#include <ti/syslink/utils/Gate.h>
-#include <ti/syslink/utils/GateMutex.h>
-#include <ti/syslink/utils/Memory.h>
-#include <ti/syslink/utils/Trace.h>
-#include <ti/ipc/MultiProc.h>
-#include <ti/syslink/utils/OsalPrint.h>
-#include <ti/syslink/inc/knl/OsalThread.h>
-#include <ti/syslink/utils/String.h>
-#include <ti/syslink/utils/Cfg.h>
-
-/* SysLink device specific headers */
-#include <Dm8168IpcInt.h>
-#include <Dm8168DspPwr.h>
-#include <Dm8168DspProc.h>
-#include <Dm8168M3VideoProc.h>
-#include <Dm8168M3DssProc.h>
-#include <Dm8168DucatiPwr.h>
-
-/* Module level headers */
-#include <_MessageQCopy.h>
-#include <ti/ipc/MessageQCopy.h>
-#include <_MessageQCopyDefs.h>
-
-#include <ti/syslink/ProcMgr.h>
-#include <_ProcMgr.h>
-#include <ti/syslink/inc/knl/Platform.h>
-#if defined(SYSLINK_LOADER_COFF)
-#include <CoffLoader.h>
-#endif
-#include <ElfLoader.h>
-
-#include <ti/ipc/Ipc.h>
-#include <_Ipc.h>
-#include <IpcKnl.h>
-#include <GateHWSpinlock.h>
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-/* this macro is only used on Linux builds */
-#ifndef EXPORT_SYMBOL
-#define EXPORT_SYMBOL(s)
-#endif
-
-
-/** ============================================================================
- * Macros.
- * ============================================================================
- */
-#define RESETVECTOR_SYMBOL "_Ipc_ResetVector"
-
-#define IPC_MEM_VRING0 0xA0000000
-#define IPC_MEM_VRING1 0xA0004000
-#define IPC_MEM_VRING2 0xA0008000
-#define IPC_MEM_VRING3 0xA000c000
-
-#define IPC_DSP_MEM_VRING0 0x9EF00000
-#define IPC_DSP_MEM_VRING1 0x9EF04000
-
-/* This tag is used as an identifier by Ipc_readConfig
- * to get different modules' configuration on slave
- */
-#define SLAVE_CONFIG_TAG 0xDADA0000
-
-#define HWSPINLOCK_BASE 0x480CA000
-#define HWSPINLOCK_SIZE 0x1000
-#define HWSPINLOCK_OFFSET 0x800
-
-
-/* Defines used for timeout value for start/stopCallback */
-#define TIMEOUT_LOOPCNT 1000
-#define TIMEOUT_SLEEPTIME 10
-#define ATTACH_LOOPCNT 5000000
-#define ATTACH_SLEEPTIME 1
-
-/** ============================================================================
- * Application specific configuration, please change these value according to
- * your application's need.
- * ============================================================================
- */
-
- /* This structure is used to get different modules' configuration on host
- * to match it with that of Slaves'
- */
-typedef struct Platform_ModuleConfig {
- UInt16 sharedRegionNumEntries;
-}Platform_ModuleConfig;
-
-/*!
- * @brief Structure defining config parameters for overall System.
- */
-typedef struct Platform_Config {
- MultiProc_Config multiProcConfig;
- /*!< Multiproc config parameter */
-
- MessageQCopy_Config MQCopyConfig;
- /*!< MessageQCopy config parameter */
-
-
- ProcMgr_Config procMgrConfig;
- /*!< Processor manager config parameter */
-
-#if defined(SYSLINK_LOADER_COFF)
- CoffLoader_Config coffLoaderConfig;
- /*!< Coff loader config parameter */
-#endif
-
- ElfLoader_Config elfLoaderConfig;
- /*!< Elf loader config parameter */
-
- GateHWSpinlock_Config gateHWSpinlockConfig;
- /*!< GateHWSpinlock config parameter */
-} Platform_Config;
-
-
-/* Struct embedded into slave binary */
-typedef struct Platform_SlaveConfig {
- UInt32 cacheLineSize;
- UInt32 brOffset;
-} Platform_SlaveConfig;
-
-/* Shared region configuration */
-typedef struct Platform_SlaveSRConfig {
- UInt32 entryBase;
- UInt32 entryLen;
- UInt32 ownerProcId;
- UInt32 id;
- UInt32 createHeap;
- UInt32 cacheLineSize;
-} Platform_SlaveSRConfig;
-
-/*! @brief structure for platform instance */
-typedef struct Platform_Object {
- /*!< Flag to indicate platform initialization status */
- ProcMgr_Handle pmHandle;
- /*!< Handle to the ProcMgr instance used */
- union {
- struct {
- DM8168DSPPROC_Handle pHandle;
- /*!< Handle to the Processor instance used */
- DM8168DSPPWR_Handle pwrHandle;
- /*!< Handle to the PwrMgr instance used */
- ElfLoader_Handle ldrHandle;
- /*!< Handle to the Loader instance used */
- } dsp;
- struct {
- DM8168VIDEOM3PROC_Handle pHandle;
- /*!< Handle to the Processor instance used */
- DM8168DUCATIPWR_Handle pwrHandle;
- /*!< Handle to the PwrMgr instance used */
- ElfLoader_Handle ldrHandle;
- /*!< Handle to the Loader instance used */
- } m3video;
- struct {
- DM8168VPSSM3PROC_Handle pHandle;
- /*!< Handle to the Processor instance used */
- DM8168DUCATIPWR_Handle pwrHandle;
- /*!< Handle to the PwrMgr instance used */
- ElfLoader_Handle ldrHandle;
- /*!< Handle to the Loader instance used */
- } m3vpss;
- } sHandles;
- /*!< Slave specific handles */
- Platform_SlaveConfig slaveCfg;
- /*!< Slave embedded config */
- Platform_SlaveSRConfig * slaveSRCfg;
- /*!< Shared region details from slave */
-
- UInt8 *bslaveAdditionalReg;
- /*!< To keep track of additional shared regions configured in the slave */
-} Platform_Object, *Platform_Handle;
-
-
-/*! @brief structure for platform instance */
-typedef struct Platform_Module_State {
- Bool multiProcInitFlag;
- /*!< MultiProc Initialize flag */
- Bool messageQCopyInitFlag;
- /*!< MessageQCopy Initialize flag */
- Bool procMgrInitFlag;
- /*!< Processor manager Initialize flag */
-#if defined(SYSLINK_LOADER_COFF)
- Bool coffLoaderInitFlag;
- /*!< Coff loader Initialize flag */
-#endif
- Bool elfLoaderInitFlag;
- /*!< Elf loader Initialize flag */
- Bool ipcIntInitFlag;
- /*!< IpcInt Initialize flag */
- Bool platformInitFlag;
- /*!< Flag to indicate platform initialization status */
- Platform_ModuleConfig hostModuleConfig;
- /*!< Configuration of various Modules' parameters on host */
- Bool gateHWSpinlockInitFlag;
- /*!< GateHWSpinlock Initialize flag */
- Ptr gateHWSpinlockVAddr;
- /*!< GateHWSpinlock Virtual Address */
-} Platform_Module_State;
-
-
-/* =============================================================================
- * GLOBALS
- * =============================================================================
- */
-static Platform_Object Platform_objects [MultiProc_MAXPROCESSORS];
-static Platform_Module_State Platform_Module_state;
-static Platform_Module_State * Platform_module = &Platform_Module_state;
-
-
-Int32 _Platform_setup (Ipc_Config * cfg);
-Int32 _Platform_destroy (void);
-
-extern String ProcMgr_sysLinkCfgParams;
-
-String Syslink_Override_Params = "ProcMgr.proc[DSP].mmuEnable=FALSE;"
- "ProcMgr.proc[DSP].carveoutAddr=0x9FB00000;"
- "ProcMgr.proc[DSP].carveoutSize=0x500000;"
- "ProcMgr.proc[DSP].carveoutAddr1=0x9DB00000;"
- "ProcMgr.proc[DSP].carveoutSize1=0x1000000;"
- "ProcMgr.proc[DSP].carveoutAddr2=0x9EB00000;"
- "ProcMgr.proc[DSP].carveoutSize2=0x1000000;";
-
-/** ============================================================================
- * APIs.
- * ============================================================================
- */
-/* Function to read slave memory */
-Int32
-_Platform_readSlaveMemory (UInt16 procId,
- UInt32 addr,
- Ptr value,
- UInt32 * numBytes);
-
-/* Function to write slave memory */
-Int32
-_Platform_writeSlaveMemory (UInt16 procId,
- UInt32 addr,
- Ptr value,
- UInt32 * numBytes);
-/*!
- * @brief Function to get tyhe default values for confiurations.
- *
- * @param config Configuration values.
- */
-Void
-Platform_getConfig (Platform_Config * config)
-{
- GT_1trace (curTrace, GT_ENTER, "Platform_getConfig", config);
-
- GT_assert (curTrace, (config != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (config == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_getConfig",
- Platform_E_INVALIDARG,
- "Argument of type (Platform_getConfig *) passed "
- "is null!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- /* Get the gatepeterson default config */
- MultiProc_getConfig (&config->multiProcConfig);
-
- /* Get the PROCMGR default config */
- ProcMgr_getConfig (&config->procMgrConfig);
-
- /* Get the ElfLoader default config */
- ElfLoader_getConfig (&config->elfLoaderConfig);
-
- /* Get the HWSpinlock default config */
- GateHWSpinlock_getConfig (&config->gateHWSpinlockConfig);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_0trace (curTrace, GT_LEAVE, "Platform_getConfig");
-}
-
-/*!
- * @brief Function to override the default configuration values.
- *
- * @param config Configuration values.
- */
-Int32
-Platform_overrideConfig (Platform_Config * config, Ipc_Config * cfg)
-{
- Int32 status = Platform_S_SUCCESS;
- char *pSL_PARAMS;
-
- GT_1trace (curTrace, GT_ENTER, "Platform_overrideConfig", config);
-
- GT_assert (curTrace, (config != NULL));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (config == NULL) {
- /*! @retval Platform_E_INVALIDARG Argument of type
- * (Platform_Config *) passed is null*/
- status = Platform_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_overrideConfig",
- status,
- "Argument of type (Platform_getConfig *) passed "
- "is null!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- /* assign config->params - overriding with SL_PARAMS env var, if set */
- pSL_PARAMS = getenv("SL_PARAMS");
- if (pSL_PARAMS != NULL) {
- GT_2trace(curTrace, GT_1CLASS, "Overriding SysLink_params \"%s\""
- " with SL_PARAMS \"%s\"\n", Syslink_Override_Params, pSL_PARAMS);
- cfg->params = Memory_alloc(NULL, String_len(pSL_PARAMS), 0, NULL);
- if (cfg->params) {
- String_cpy(cfg->params, pSL_PARAMS);
- }
- }
- else {
- cfg->params = Memory_alloc(NULL,
- String_len(Syslink_Override_Params) + 1, 0,
- NULL);
- if (cfg->params) {
- String_cpy(cfg->params, Syslink_Override_Params);
- }
- }
-
- _ProcMgr_saveParams(cfg->params, String_len(cfg->params));
-
-#if !defined (SYSLINK_VARIANT_TI813X)
- /* Override the gatepeterson default config */
- config->multiProcConfig.numProcessors = 4;
- config->multiProcConfig.id = 0;
- String_cpy (config->multiProcConfig.nameList [0],
- "HOST");
- String_cpy (config->multiProcConfig.nameList [1],
- "VPSS-M3");
- String_cpy (config->multiProcConfig.nameList [2],
- "VIDEO-M3");
- String_cpy (config->multiProcConfig.nameList [3],
- "DSP");
-#else
- config->multiProcConfig.numProcessors = 3;
- config->multiProcConfig.id = 0;
- String_cpy (config->multiProcConfig.nameList [0],
- "HOST");
- String_cpy (config->multiProcConfig.nameList [1],
- "VPSS-M3");
- String_cpy (config->multiProcConfig.nameList [2],
- "VIDEO-M3");
-#endif /* #if !defined (SYSLINK_VARIANT_TI813X) */
-
- /* Override the MESSAGEQCOPY default config */
- config->MQCopyConfig.intId[1] = 77;
- config->MQCopyConfig.intId[2] = 77;
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_1trace (curTrace, GT_ENTER, "Platform_overrideConfig", status);
-
- /*! @retval Platform_S_SUCCESS operation was successful */
- return status;
-}
-
-
-
-
-
-/*!
- * @brief Function to setup platform.
- * TBD: logic would change completely in the final system.
- */
-Int32
-Platform_setup (Ipc_Config * cfg)
-{
- Int32 status = Platform_S_SUCCESS;
- Platform_Config _config;
- Platform_Config * config;
- Dm8168IpcInt_Config dm8168cfg;
- Memory_MapInfo minfo;
-
- Platform_getConfig (&_config);
- config = &_config;
-
- Platform_overrideConfig (config, cfg);
-
- status = MultiProc_setup (&(config->multiProcConfig));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_setup",
- status,
- "MultiProc_setup failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->multiProcInitFlag = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
-/* Initialize PROCMGR */
- if (status >= 0) {
- status = ProcMgr_setup (&(config->procMgrConfig));
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_setup",
- status,
- "ProcMgr_setup failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->procMgrInitFlag = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- /* Initialize IpcInt required for VirtQueue/MessageQCopy. */
- if (status >= 0) {
- /* Do the IPC interrupts setup for the full platform (cfg is not used) */
- Dm8168IpcInt_setup (&dm8168cfg);
- Platform_module->ipcIntInitFlag = TRUE;
- }
-
-
-/* Intialize MESSAGEQCOPY */
- if (status >= 0) {
- status = MessageQCopy_setup (&config->MQCopyConfig);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_setup",
- status,
- "MessageQCopy_setup failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->messageQCopyInitFlag = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
-/* Intialize Elf loader */
- if (status >= 0) {
- status = ElfLoader_setup (&config->elfLoaderConfig);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_setup",
- status,
- "ElfLoader_setup failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->elfLoaderInitFlag = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- if (status >= 0) {
- Memory_set (Platform_objects,
- 0,
- (sizeof (Platform_Object) * MultiProc_getNumProcessors()));
- }
-
- if (status >= 0) {
- status = _Platform_setup (cfg);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_setup",
- status,
- "_Platform_setup failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->platformInitFlag = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- if (status >= 0) {
- minfo.src = HWSPINLOCK_BASE;
- minfo.size = HWSPINLOCK_SIZE;
- minfo.isCached = FALSE;
- status = Memory_map (&minfo);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_setup",
- status,
- "Memory_map failed!");
- }
- else {
- Platform_module->gateHWSpinlockVAddr = (Ptr)minfo.dst;
- config->gateHWSpinlockConfig.numLocks = 128;
- config->gateHWSpinlockConfig.baseAddr = minfo.dst + HWSPINLOCK_OFFSET;
- status = GateHWSpinlock_setup (&config->gateHWSpinlockConfig);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_setup",
- status,
- "GateHWSpinlock_setup failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->gateHWSpinlockInitFlag = TRUE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- if (status < 0) {
- Platform_destroy();
- }
- return status;
-}
-
-
-/*!
- * @brief Function to destroy the System.
- *
- * @sa Platform_setup
- */
-Int32
-Platform_destroy (void)
-{
- Int32 status = Platform_S_SUCCESS;
- Memory_UnmapInfo minfo;
-
- GT_0trace (curTrace, GT_ENTER, "Platform_destroy");
-
- /* Finalize Platform-specific destroy */
- if (Platform_module->platformInitFlag == TRUE) {
- status = _Platform_destroy ();
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_destroy",
- status,
- "Platform_destroy failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->platformInitFlag = FALSE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- /* Finalize elf loader */
- if (Platform_module->elfLoaderInitFlag == TRUE) {
- status = ElfLoader_destroy ();
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_destroy",
- status,
- "ElfLoader_destroy failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->elfLoaderInitFlag = FALSE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- /* Finalize MESSAGEQCOPY */
- if (Platform_module->messageQCopyInitFlag == TRUE) {
- status = MessageQCopy_destroy ();
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_destroy",
- status,
- "MessageQCopy_destroy failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->messageQCopyInitFlag = FALSE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
-
- if (Platform_module->ipcIntInitFlag == TRUE) {
- Dm8168IpcInt_destroy ();
- Platform_module->ipcIntInitFlag = FALSE;
- }
-
- /* Finalize PROCMGR */
- if (Platform_module->procMgrInitFlag == TRUE) {
- status = ProcMgr_destroy ();
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_destroy",
- status,
- "ProcMgr_destroy failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->procMgrInitFlag = FALSE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- /* Finalize MultiProc */
- if (Platform_module->multiProcInitFlag == TRUE) {
- status = MultiProc_destroy ();
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_destroy",
- status,
- "MultiProc_destroy failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->multiProcInitFlag = FALSE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- if (status >= 0) {
- Memory_set (Platform_objects,
- 0,
- (sizeof (Platform_Object) * MultiProc_getNumProcessors()));
- }
-
- if (Platform_module->gateHWSpinlockInitFlag == TRUE) {
- status = GateHWSpinlock_destroy();
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_destroy",
- status,
- "GateHWSpinlock_destroy failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->gateHWSpinlockInitFlag = FALSE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- if (Platform_module->gateHWSpinlockVAddr) {
- minfo.addr = (UInt32)Platform_module->gateHWSpinlockVAddr;
- minfo.size = HWSPINLOCK_SIZE;
- minfo.isCached = FALSE;
- status = Memory_unmap(&minfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Platform_destroy",
- status,
- "Memory_unmap failed!");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Platform_module->gateHWSpinlockVAddr = NULL;
- }
-
-
- GT_1trace (curTrace, GT_LEAVE, "Platform_destroy", status);
-
- /*! @retval Platform_S_SUCCESS Operation successful */
- return status;
-}
-
-/*
- * union _Platform_setup_Local exists so that we don't waste stack or
- * alloc'ed memory on storage for things that exist for just a few
- * statements of the function _Platform_setup(). The *PROC_Params
- * elements are large and variably sized, depending on the macro
- * ProcMgr_MAX_MEMORY_REGIONS.
- */
-typedef union _Platform_setup_Local {
- ProcMgr_Params params;
- DM8168DSPPROC_Config dspProcConfig;
- DM8168VIDEOM3PROC_Config videoProcConfig;
- DM8168VPSSM3PROC_Config vpssProcConfig;
- DM8168DSPPWR_Config dspPwrConfig;
- DM8168DUCATIPWR_Config videoPwrConfig;
- DM8168DUCATIPWR_Config vpssPwrConfig;
- DM8168DSPPROC_Params dspProcParams;
- DM8168VIDEOM3PROC_Params videoProcParams;
- DM8168VPSSM3PROC_Params vpssProcParams;
- DM8168DSPPWR_Params dspPwrParams;
- DM8168DUCATIPWR_Params videoPwrParams;
- DM8168DUCATIPWR_Params vpssPwrParams;
- ElfLoader_Params elfLoaderParams;
-#if defined(SYSLINK_LOADER_COFF)
- CoffLoader_Params coffLoaderParams;
-#endif
-} _Platform_setup_Local;
-
-
-/*!
- * @brief Function to setup platform.
- * TBD: logic would change completely in the final system.
- */
-Int32
-_Platform_setup (Ipc_Config * cfg)
-{
- Int32 status = Platform_S_SUCCESS;
- _Platform_setup_Local *lv;
- UInt16 procId;
- Platform_Handle handle;
-
- GT_0trace (curTrace, GT_ENTER, "_Platform_setup");
-
- lv = Memory_alloc(NULL, sizeof(_Platform_setup_Local), 0, NULL);
- if (lv == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "Memory_alloc failed");
- goto ret;
- }
-
- /* Get MultiProc ID by name. */
- procId = MultiProc_getId ("VIDEO-M3");
-
- handle = &Platform_objects [procId];
- DM8168VIDEOM3PROC_getConfig (&lv->videoProcConfig);
- status = DM8168VIDEOM3PROC_setup (&lv->videoProcConfig);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168VIDEOM3PROC_setup failed!");
- }
- else {
- DM8168DUCATIPWR_getConfig (&lv->videoPwrConfig);
- status = DM8168DUCATIPWR_setup (&lv->videoPwrConfig);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168DUCATIPWR_setup failed!");
- }
- }
-
- if (status >= 0) {
- /* Create an instance of the Processor object for
- * DM8168VIDEOM3 */
- DM8168VIDEOM3PROC_Params_init (NULL, &lv->videoProcParams);
- handle->sHandles.m3video.pHandle = DM8168VIDEOM3PROC_create (
- procId,
- &lv->videoProcParams);
-
- /* Create an instance of the ELF Loader object */
- ElfLoader_Params_init (NULL, &lv->elfLoaderParams);
- handle->sHandles.m3video.ldrHandle = ElfLoader_create (procId,
- &lv->elfLoaderParams);
-
- /* Create an instance of the PwrMgr object for DM8168VIDEOM3 */
- DM8168DUCATIPWR_Params_init (&lv->videoPwrParams);
- handle->sHandles.m3video.pwrHandle = DM8168DUCATIPWR_create (
- procId,
- &lv->videoPwrParams);
-
- if (handle->sHandles.m3video.pHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168VIDEOM3PROC_create failed!");
- }
- else if (handle->sHandles.m3video.ldrHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "Failed to create loader instance!");
- }
- else if (handle->sHandles.m3video.pwrHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168DUCATIPWR_create failed!");
- }
- else {
- /* Initialize parameters */
- ProcMgr_Params_init (NULL, &lv->params);
- lv->params.procHandle = handle->sHandles.m3video.pHandle;
- lv->params.loaderHandle = handle->sHandles.m3video.ldrHandle;
- lv->params.pwrHandle = handle->sHandles.m3video.pwrHandle;
- String_cpy (lv->params.rstVectorSectionName,
- RESETVECTOR_SYMBOL);
- handle->pmHandle = ProcMgr_create (procId, &lv->params);
- if (handle->pmHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "ProcMgr_create failed!");
- }
- }
- }
-
- if (status >= 0) {
- /* Get MultiProc ID by name. */
- procId = MultiProc_getId ("VPSS-M3");
-
- handle = &Platform_objects [procId];
- DM8168VPSSM3PROC_getConfig (&lv->vpssProcConfig);
- status = DM8168VPSSM3PROC_setup (&lv->vpssProcConfig);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168VPSSM3PROC_setup failed!");
- }
- else {
- DM8168DUCATIPWR_getConfig (&lv->vpssPwrConfig);
- status = DM8168DUCATIPWR_setup (&lv->vpssPwrConfig);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168DUCATIPWR_setup failed!");
- }
- }
-
- if (status >= 0) {
- /* Create an instance of the Processor object for
- * DM8168VPSSM3 */
- DM8168VPSSM3PROC_Params_init (NULL, &lv->vpssProcParams);
- handle->sHandles.m3vpss.pHandle = DM8168VPSSM3PROC_create (procId,
- &lv->vpssProcParams);
-
- /* Create an instance of the ELF Loader object */
- ElfLoader_Params_init (NULL, &lv->elfLoaderParams);
- handle->sHandles.m3vpss.ldrHandle = ElfLoader_create (procId,
- &lv->elfLoaderParams);
-
- /* Create an instance of the PwrMgr object for DM8168VPSSM3 */
- DM8168DUCATIPWR_Params_init (&lv->vpssPwrParams);
- handle->sHandles.m3vpss.pwrHandle = DM8168DUCATIPWR_create (
- procId,
- &lv->vpssPwrParams);
-
- if (handle->sHandles.m3vpss.pHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168VPSSM3PROC_create failed!");
- }
- else if (handle->sHandles.m3vpss.ldrHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "Failed to create loader instance!");
- }
- else if (handle->sHandles.m3vpss.pwrHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168DUCATIPWR_create failed!");
- }
- else {
- /* Initialize parameters */
- ProcMgr_Params_init (NULL, &lv->params);
- lv->params.procHandle = handle->sHandles.m3vpss.pHandle;
- lv->params.loaderHandle = handle->sHandles.m3vpss.ldrHandle;
- lv->params.pwrHandle = handle->sHandles.m3vpss.pwrHandle;
- String_cpy (lv->params.rstVectorSectionName,
- RESETVECTOR_SYMBOL);
- handle->pmHandle = ProcMgr_create (procId, &lv->params);
- if (handle->pmHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "ProcMgr_create failed!");
- }
- }
- }
- }
-
-#if !defined (SYSLINK_VARIANT_TI813X)
- if (status >= 0) {
- /* Get MultiProc ID by name. */
- procId = MultiProc_getId ("DSP");
-
- handle = &Platform_objects [procId];
- DM8168DSPPROC_getConfig (&lv->dspProcConfig);
- status = DM8168DSPPROC_setup (&lv->dspProcConfig);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168DSPPROC_setup failed!");
- }
- else {
- DM8168DSPPWR_getConfig (&lv->dspPwrConfig);
- status = DM8168DSPPWR_setup (&lv->dspPwrConfig);
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168DSPPWR_setup failed!");
- }
- }
-
- if (status >= 0) {
- /* Create an instance of the Processor object for
- * DM8168DSP */
- DM8168DSPPROC_Params_init (NULL, &lv->dspProcParams);
- handle->sHandles.dsp.pHandle = DM8168DSPPROC_create (procId,
- &lv->dspProcParams);
-
- /* Create an instance of the ELF Loader object */
- ElfLoader_Params_init (NULL, &lv->elfLoaderParams);
- handle->sHandles.dsp.ldrHandle =
- ElfLoader_create (procId,
- &lv->elfLoaderParams);
- /* Create an instance of the PwrMgr object for DM8168DSP */
- DM8168DSPPWR_Params_init (&lv->dspPwrParams);
- handle->sHandles.dsp.pwrHandle = DM8168DSPPWR_create (procId,
- &lv->dspPwrParams);
-
- if (handle->sHandles.dsp.pHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168DSPPROC_create failed!");
- }
- else if (handle->sHandles.dsp.ldrHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "Failed to create loader instance!");
- }
- else if (handle->sHandles.dsp.pwrHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "DM8168DSPPWR_create failed!");
- }
- else {
- /* Initialize parameters */
- ProcMgr_Params_init (NULL, &lv->params);
- lv->params.procHandle = handle->sHandles.dsp.pHandle;
- lv->params.loaderHandle = handle->sHandles.dsp.ldrHandle;
- lv->params.pwrHandle = handle->sHandles.dsp.pwrHandle;
- String_cpy (lv->params.rstVectorSectionName,
- RESETVECTOR_SYMBOL);
- handle->pmHandle = ProcMgr_create (procId, &lv->params);
- if (handle->pmHandle == NULL) {
- status = Platform_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_setup",
- status,
- "ProcMgr_create failed!");
- }
- }
- }
- }
-#endif /* #if !defined (SYSLINK_VARIANT_TI813X) */
-
- Memory_free(NULL, lv, sizeof(_Platform_setup_Local));
-
-ret:
- GT_1trace (curTrace, GT_LEAVE, "_Platform_setup", status);
-
- /*! @retval Platform_S_SUCCESS operation was successful */
- return status;
-}
-
-
-/*!
- * @brief Function to setup platform.
- * TBD: logic would change completely in the final system.
- */
-Int32
-_Platform_destroy (void)
-{
- Int32 status = Platform_S_SUCCESS;
- Int32 tmpStatus = Platform_S_SUCCESS;
- Platform_Handle handle;
-
- GT_0trace (curTrace, GT_ENTER, "_Platform_destroy");
-
-#if !defined (SYSLINK_VARIANT_TI813X)
- /* ------------------------- DSP cleanup -------------------------------- */
- handle = &Platform_objects [MultiProc_getId ("DSP")];
- if (handle->pmHandle != NULL) {
- status = ProcMgr_delete (&handle->pmHandle);
- GT_assert (curTrace, (status >= 0));
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "ProcMgr_delete failed!");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- /* Delete the Processor, Loader and PwrMgr instances */
- if (handle->sHandles.dsp.pwrHandle != NULL) {
- tmpStatus = DM8168DSPPWR_delete (&handle->sHandles.dsp.pwrHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168DSPPWR_delete failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- if (handle->sHandles.dsp.ldrHandle != NULL) {
- tmpStatus = ElfLoader_delete (&handle->sHandles.dsp.ldrHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "Failed to delete loader instance!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- if (handle->sHandles.dsp.pHandle != NULL) {
- tmpStatus = DM8168DSPPROC_delete (&handle->sHandles.dsp.pHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168DSPPROC_delete failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- tmpStatus = DM8168DSPPWR_destroy ();
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168DSPPWR_destroy failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- tmpStatus = DM8168DSPPROC_destroy ();
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168DSPPROC_destroy failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-#endif /* #if !defined (SYSLINK_VARIANT_TI813X) */
- /* ------------------------- VIDEOM3 cleanup ------------------------------ */
- handle = &Platform_objects [MultiProc_getId ("VIDEO-M3")];
- if (handle->pmHandle != NULL) {
- tmpStatus = ProcMgr_delete (&handle->pmHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "ProcMgr_delete failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- /* Delete the Processor, Loader and PwrMgr instances */
- if (handle->sHandles.m3video.pwrHandle != NULL) {
- tmpStatus = DM8168DUCATIPWR_delete (&handle->sHandles.m3video.pwrHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168DUCATIPWR_delete failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- if (handle->sHandles.m3video.ldrHandle != NULL) {
- tmpStatus = ElfLoader_delete (&handle->sHandles.m3video.ldrHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "Failed to delete loader instance!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- if (handle->sHandles.m3video.pHandle != NULL) {
- tmpStatus = DM8168VIDEOM3PROC_delete (&handle->sHandles.m3video.pHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168VIDEOM3PROC_delete failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- tmpStatus = DM8168DUCATIPWR_destroy ();
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168DUCATIPWR_destroy failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- tmpStatus = DM8168VIDEOM3PROC_destroy ();
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168VIDEOM3PROC_destroy failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- /* ------------------------- VPSSM3 cleanup -------------------------------- */
- handle = &Platform_objects [MultiProc_getId ("VPSS-M3")];
- if (handle->pmHandle != NULL) {
- tmpStatus = ProcMgr_delete (&handle->pmHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "ProcMgr_delete failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- /* Delete the Processor, Loader and PwrMgr instances */
- if (handle->sHandles.m3vpss.pwrHandle != NULL) {
- tmpStatus = DM8168DUCATIPWR_delete (&handle->sHandles.m3vpss.pwrHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168DUCATIPWR_delete failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- if (handle->sHandles.m3vpss.ldrHandle != NULL) {
- tmpStatus = ElfLoader_delete (&handle->sHandles.m3vpss.ldrHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "Failed to delete loader instance!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- if (handle->sHandles.m3vpss.pHandle != NULL) {
- tmpStatus = DM8168VPSSM3PROC_delete (&handle->sHandles.m3vpss.pHandle);
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168VPSSM3PROC_delete failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- tmpStatus = DM8168DUCATIPWR_destroy ();
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168DUCATIPWR_destroy failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- tmpStatus = DM8168VPSSM3PROC_destroy ();
- GT_assert (curTrace, (tmpStatus >= 0));
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_Platform_destroy",
- status,
- "DM8168VPSSM3PROC_destroy failed!");
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- GT_1trace (curTrace, GT_LEAVE, "_Platform_destroy", status);
-
- /*! @retval Platform_S_SUCCESS operation was successful */
- return status;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/Qnx/Cache.c b/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/Qnx/Cache.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * @file Cache.c
- *
- * @brief Cache API implementation for TI81XX platform
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-/* Standard headers */
-#include <ti/syslink/Std.h>
-#ifdef SYSLINK_BUILDOS_LINUX
-#include <asm/cache.h>
-#elif SYSLINK_BUILDOS_QNX
-#include <sys/cache.h>
-#endif
-
-/* OSAL & Utils headers */
-#include <ti/syslink/utils/Cache.h>
-#include <ti/syslink/utils/Trace.h>
-#include <Bitops.h>
-
-/* Module level headers */
-#include <CacheDrv.h>
-#include <CacheDrvDefs.h>
-
-#if defined (__cplusplus)
-extern "C" {
-#endif /* defined (__cplusplus) */
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to invalidate the Cache module */
-Void Cache_inv(Ptr blockPtr, UInt32 byteCnt, Bits16 type, Bool wait) {
- GT_4trace (curTrace, GT_ENTER, "Cache_inv", blockPtr, byteCnt, type, wait);
-
- GT_0trace (curTrace, GT_LEAVE, "Cache_inv");
-}
-
-/* Function to write back the Cache module */
-Void Cache_wb(Ptr blockPtr, UInt32 byteCnt, Bits16 type, Bool wait) {
- GT_4trace (curTrace, GT_ENTER, "Cache_wb", blockPtr, byteCnt, type, wait);
-
- GT_0trace (curTrace, GT_LEAVE, "Cache_wb");
-}
-
-/* Function to write back invalidate the Cache module */
-Void Cache_wbInv(Ptr blockPtr, UInt32 byteCnt, Bits16 type, Bool wait) {
- GT_4trace (curTrace, GT_ENTER, "Cache_wbInv", blockPtr, byteCnt, type, wait);
-
- GT_0trace (curTrace, GT_LEAVE, "Cache_wbInv");
-}
-
-/* Function to write back invalidate the Cache module */
-Void Cache_wait(Void) {
- GT_0trace (curTrace, GT_ENTER, "Cache_wait");
-
- GT_0trace (curTrace, GT_LEAVE, "Cache_wait");
-}
-
-/* Function to set the mode of Cache module */
-enum Cache_Mode Cache_setMode(Bits16 type, enum Cache_Mode mode)
-{
- enum Cache_Mode returnVal = Cache_Mode_FREEZE;
- GT_2trace (curTrace, GT_ENTER, "Cache_setMode", type, mode);
-
- GT_1trace (curTrace, GT_LEAVE, "Cache_setMode", returnVal);
- return returnVal;
-}
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/ti81xxdsp/Dm8168DspHalMmu.c b/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/ti81xxdsp/Dm8168DspHalMmu.c
+++ /dev/null
@@ -1,886 +0,0 @@
-/*
- * @file Dm8168DspHalMmu.c
- *
- * @brief Hardware abstraction for Memory Management Unit module.
- *
- * This module is responsible for handling slave MMU-related
- * hardware- specific operations.
- * The implementation is specific to DM8168DSP.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-/* Standard headers */
-#include <ti/syslink/Std.h>
-
-/* OSAL and utils headers */
-#include <ti/syslink/utils/List.h>
-#include <ti/syslink/utils/Trace.h>
-#include <ti/syslink/utils/OsalPrint.h>
-#include <ti/syslink/utils/Memory.h>
-#include <Bitops.h>
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168DspHal.h>
-#include <Dm8168DspHalMmu.h>
-#include <Dm8168DspPhyShmem.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Defines default mixedSize i.e same types of pages in one segment
- */
-#define MMU_RAM_DEFAULT 0
-/*!
- * @brief returns page number based on physical address
- */
-#define ti_syslink_phys_to_page(phys) pfn_to_page((phys) >> PAGE_SHIFT)
-
-/*!
- * @brief helper macros
- */
-#define SLAVEVIRTADDR(x) ((x)->addr [ProcMgr_AddrType_SlaveVirt])
-#define SLAVEPHYSADDR(x) ((x)->addr [ProcMgr_AddrType_SlavePhys])
-#define MASTERPHYSADDR(x) ((x)->addr [ProcMgr_AddrType_MasterPhys])
-
-#define MMUPAGE_ALIGN(size, psz) (((size) + psz - 1) & ~(psz -1))
-
-/* =============================================================================
- * Forward declarations of internal functions
- * =============================================================================
- */
-#if defined(SYSLINK_BUILDOS_LINUX)
-/* Enables the MMU for GEM Module. */
-Int _DM8168DSP_halMmuEnable (DM8168DSP_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable);
-
-/* Disables the MMU for GEM Module. */
-Int _DM8168DSP_halMmuDisable (DM8168DSP_HalObject * halObject);
-
-/* Add entry in TWL. */
-Int
-_DM8168DSP_halMmuAddEntry (DM8168DSP_HalObject * halObject,
- DM8168DSP_HalMmuEntryInfo * entry);
-/* Add static entries in TWL. */
-Int
-_DM8168DSP_halMmuAddStaticEntries (DM8168DSP_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable);
-
-/* Delete entry from TLB. */
-Int
-_DM8168DSP_halMmuDeleteEntry (DM8168DSP_HalObject * halObject,
- DM8168DSP_HalMmuEntryInfo * entry);
-/* Set entry in to TLB. */
-Int
-_DM8168DSP_halMmuPteSet (DM8168DSP_HalObject * halObject,
- DM8168DSP_HalMmuEntryInfo * setPteInfo);
-/* Print page dump */
-Int
-_DM8168DSP_badPageDump(UInt32 phyAddr, struct page *pg);
-
-/* IOMMU Exported function */
-extern
-void
-iopgtable_lookup_entry (struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte);
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-/* =============================================================================
- * APIs called by DM8168DSPPROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control MMU operations for this slave device.
- *
- * @param halObj Pointer to the HAL object
- * @param cmd MMU control command
- * @param arg Arguments specific to the MMU control command
- *
- * @sa
- */
-Int
-DM8168DSP_halMmuCtrl (Ptr halObj, Processor_MmuCtrlCmd cmd, Ptr args)
-{
- Int status = PROCESSOR_SUCCESS;
-#if defined(SYSLINK_BUILDOS_LINUX)
- DM8168DSP_HalObject * halObject = NULL;
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
- GT_3trace (curTrace, GT_ENTER, "DM8168DSP_halMmuCtrl", halObj, cmd, args);
-#if defined(SYSLINK_BUILDOS_LINUX)
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168DSP_HalObject *) halObj ;
-
- switch (cmd) {
- case Processor_MmuCtrlCmd_Enable:
- {
- DM8168DSP_HalMmuCtrlArgs_Enable * enableArgs;
- enableArgs = (DM8168DSP_HalMmuCtrlArgs_Enable *) args;
- halObject = (DM8168DSP_HalObject *) halObj;
- status = _DM8168DSP_halMmuEnable (halObject,
- enableArgs->numMemEntries,
- enableArgs->memEntries);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to configure DSP MMU. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halMmuCtrl",
- status,
- "Failed to configure DSP MMU"
- "at _DM8168DSP_halMmuEnable");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- case Processor_MmuCtrlCmd_Disable:
- {
- /* args are not used. */
- halObject = (DM8168DSP_HalObject *) halObj;
- status = _DM8168DSP_halMmuDisable (halObject);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to disable DSP MMU. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halMmuCtrl",
- status,
- "Failed to disable DSP MMU");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break ;
-
- case Processor_MmuCtrlCmd_AddEntry:
- {
- DM8168DSP_HalMmuCtrlArgs_AddEntry * addEntry;
- addEntry = (DM8168DSP_HalMmuCtrlArgs_AddEntry *) args;
-
- halObject = (DM8168DSP_HalObject *) halObj;
- /* Add the entry in TLB for new request */
- status = _DM8168DSP_halMmuAddEntry (halObject,addEntry) ;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to dynamically add DSP MMU
- * entry. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halMmuCtrl",
- status,
- "Failed to dynamically add DSP MMU entry");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- case Processor_MmuCtrlCmd_DeleteEntry:
- {
- DM8168DSP_HalMmuCtrlArgs_DeleteEntry * deleteEntry;
- deleteEntry = (DM8168DSP_HalMmuCtrlArgs_DeleteEntry *) args;
-
- halObject = (DM8168DSP_HalObject *) halObj;
- /* Add the entry in TLB for new request */
- status = _DM8168DSP_halMmuDeleteEntry (halObject,deleteEntry);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to dynamically delete DSP
- * MMU entry */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halMmuCtrl",
- status,
- "Failed to dynamically add DSP MMU entry");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168DSP_halMmuCtrl",
- status,
- "Unsupported MMU ctrl cmd specified");
- }
- break;
- }
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168DSP_halMmuCtrl",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-/* =============================================================================
- * Internal functions
- * =============================================================================
- */
-/*!
- * @brief Enables and configures the DSP MMU as per provided memory map.
- *
- * @param halObject Pointer to the HAL object
- * @param numMemEntries Number of memory entries in memTable
- * @param memTable Table of memory entries to be configured
- *
- * @sa
- */
-Int
-_DM8168DSP_halMmuAddStaticEntries (DM8168DSP_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSP_HalMmuEntryInfo staticEntry;
- UInt32 i;
-
- GT_3trace (curTrace, GT_ENTER, "_DM8168DSP_halMmuAddStaticEntries",
- halObject, numMemEntries, memTable);
-
- GT_assert (curTrace, (halObject != NULL));
- /* It is possible that numMemEntries may be 0, if user does not want to
- * configure any default regions.
- * memTable may also be NULL.
- */
-
- for (i = 0 ; i < numMemEntries && (status >= 0) ; i++) {
- if (SLAVEVIRTADDR (&memTable [i]) >= MMU_GLOBAL_MEMORY) {
- /* Configure the TLB */
- if (memTable [i].size != 0) {
- staticEntry.slaveVirtAddr =
- SLAVEVIRTADDR (&memTable [i]);
- staticEntry.size = memTable[i].size;
- staticEntry.masterPhyAddr =
- MASTERPHYSADDR (&memTable [i]);
- /*TBD : elementSize, endianism, mixedSized are hard
- * coded now, must be configurable later*/
- staticEntry.elementSize = MMU_RAM_ELSZ_16;
- staticEntry.endianism = LITTLE_ENDIAN;
- staticEntry.mixedSize = MMU_TLBES;
- status = _DM8168DSP_halMmuAddEntry (halObject,
- &staticEntry);
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to add MMU entry. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuAddStaticEntries",
- status,
- "Failed to add MMU entry!");
- }
- }
- }
- }
- GT_1trace (curTrace, GT_LEAVE, "_DM8168DSP_halMmuAddStaticEntries", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status ;
-}
-
-
-/*!
- * @brief Enables and configures the DSP MMU as per provided memory map.
- *
- * @param halObject Pointer to the HAL object
- * @param numMemEntries Number of memory entries in memTable
- * @param memTable Table of memory entries to be configured
- *
- * @sa
- */
-Int
-_DM8168DSP_halMmuEnable (DM8168DSP_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSP_HalMmuObject * mmuObj;
-
- GT_3trace (curTrace, GT_ENTER, "_DM8168DSP_halMmuEnable",
- halObject, numMemEntries, memTable);
-
- GT_assert (curTrace, (halObject != NULL));
- /* It is possible that numMemEntries may be 0, if user does not want to
- * configure any default regions.
- * memTable may also be NULL.
- */
- mmuObj = &(halObject->mmuObj);
- /* Check if dspMmuHandler is alreaday available if yes put it back and get
- * new one */
- if(mmuObj->dspMmuHandler)
- {
- iommu_put(mmuObj->dspMmuHandler);
- mmuObj->dspMmuHandler = NULL;
- }
- mmuObj->dspMmuHandler = iommu_get("sys");
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (IS_ERR(mmuObj->dspMmuHandler)) {
- /*! @retval PROCESSOR_E_FAIL Failed at iommu_get. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuEnable",
- status,
- "iommu_get failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- if ((status >= 0) && (numMemEntries != 0)) {
- /* Only statically created entries are being added here. */
- status = _DM8168DSP_halMmuAddStaticEntries(halObject,
- numMemEntries,
- memTable);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed at
- * _DM8168DSP_halMmuAddStaticEntries. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuEnable",
- status,
- "_DM8168DSP_halMmuAddStaticEntries failed !");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168DSP_halMmuEnable", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status ;
-}
-
-
-/*!
- * @brief Disables the DSP MMU.
- *
- * @param halObject Pointer to the HAL object
- *
- * @sa
- */
-Int
-_DM8168DSP_halMmuDisable (DM8168DSP_HalObject * halObject)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168DSP_HalMmuObject * mmuObj;
-
- GT_1trace (curTrace, GT_ENTER, "_DM8168DSP_halMmuDisable", halObject);
-
- GT_assert (curTrace, (halObject != NULL));
- mmuObj = &(halObject->mmuObj);
-
- /*TBD : Delete all added static entries in TWL*/
-
- /* Disable iommu. */
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if(mmuObj->dspMmuHandler == NULL){
- /*! @retval PROCESSOR_E_FAIL mmuObj->clkHandle is NULL ! */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuDisable",
- status,
- "dspMmuHandler is NULL !");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- iommu_put(mmuObj->dspMmuHandler);
- mmuObj->dspMmuHandler = NULL;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- GT_1trace (curTrace, GT_LEAVE, "_DM8168DSP_halMmuDisable", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief This function adds an MMU entry for the specfied address and
- * size.
- *
- * @param halObject Pointer to the HAL object
- * @param entry entry to be added
- *
- * @sa
- */
-Int
-_DM8168DSP_halMmuAddEntry (DM8168DSP_HalObject * halObject,
- DM8168DSP_HalMmuEntryInfo * entry)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt32 * ppgd = NULL;
- UInt32 * ppte = NULL;
- DM8168DSP_HalMmuEntryInfo te;
- DM8168DSP_HalMmuEntryInfo currentEntry;
- Int32 currentEntrySize;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168DSP_halMmuAddEntry",
- halObject, entry);
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (entry != NULL));
-
- /* Add the entry (or entries) */
- Memory_copy(¤tEntry,
- entry,
- sizeof(DM8168DSP_HalMmuEntryInfo));
-
- /* Align the addresses to page size */
- currentEntry.size += (currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB -1));
- currentEntry.slaveVirtAddr &= ~(PAGE_SIZE_4KB-1);
- currentEntry.masterPhyAddr &= ~(PAGE_SIZE_4KB-1);
-
- /* Align the size as well */
- currentEntry.size = MMUPAGE_ALIGN(currentEntry.size, PAGE_SIZE_4KB);
- currentEntrySize = currentEntry.size;
-
- /* To find the max. page size with which both PA & VA are
- * aligned */
- while ((currentEntrySize != 0) &&
- (status >= 0) &&
- (currentEntry.slaveVirtAddr > MMU_GLOBAL_MEMORY)) {
- if (currentEntrySize >= PAGE_SIZE_16MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_16MB - 1))) {
- currentEntry.size = PAGE_SIZE_16MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_1MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_1MB - 1))) {
- currentEntry.size = PAGE_SIZE_1MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_64KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_64KB - 1))){
- currentEntry.size = PAGE_SIZE_64KB;
- }
- else if (currentEntrySize >= PAGE_SIZE_4KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB - 1))){
- currentEntry.size = PAGE_SIZE_4KB;
- }
- else {
- Osal_printf ("Configuration error: "
- " MMU entries must be aligned to their"
- "page size(4KB,"
- " 64KB, 1MB, or 16MB).\n");
- Osal_printf ("Since the addresses are not aligned buffer"
- "of size: %x at address: %x cannot be "
- "TLB entries\n",
- currentEntrySize, currentEntry.slaveVirtAddr);
- /*! @retval DM8168DSPPROC_E_MMUCONFIG Memory region is not
- aligned to page size */
- status = DM8168DSPPROC_E_MMUCONFIG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuAddEntry",
- status,
- "Memory region is not aligned to page size!");
- break ;
- }
-
- /* DO NOT put this check under SYSLINK_BUILD_OPTIMIZE */
- if (status >= 0) {
- /* Check every page if exists */
- iopgtable_lookup_entry (halObject->mmuObj.dspMmuHandler,
- currentEntry.slaveVirtAddr,
- (u32 **) &ppgd,
- (u32 **) &ppte);
-
- /* Lookup if the entry exists */
- if (!ppgd || !ppte) {
- /* Entry doesnot exists, insert this page */
- te.size = currentEntry.size;
- te.slaveVirtAddr = currentEntry.slaveVirtAddr;
- te.masterPhyAddr = currentEntry.masterPhyAddr;
- te.elementSize = currentEntry.elementSize;
- te.endianism = currentEntry.endianism;
- te.mixedSize = currentEntry.mixedSize;
- status = _DM8168DSP_halMmuPteSet (halObject, &te);
- }
- else if (ppgd && ppte) {
- if (currentEntry.masterPhyAddr != (*ppte & IOPAGE_MASK)) {
- /* Entry doesnot exists, insert this page */
- te.size = currentEntry.size;
- te.slaveVirtAddr = currentEntry.slaveVirtAddr;
- te.masterPhyAddr = currentEntry.masterPhyAddr;
- te.elementSize = currentEntry.elementSize;
- te.endianism = currentEntry.endianism;
- te.mixedSize = currentEntry.mixedSize;
- status = _DM8168DSP_halMmuPteSet (halObject, &te);
- }
- }
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (
- curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuAddEntry",
- status,
- "Failed to in _DM8168DSP_halMmuPteSet!");
- break;
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- currentEntrySize -= currentEntry.size;
- currentEntry.masterPhyAddr += currentEntry.size;
- currentEntry.slaveVirtAddr += currentEntry.size;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168DSP_halMmuAddEntry", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief Prints the page dump in case of error.
- *
- * @param phyAddr Physical address
- * @param pg Mapped page
- *
- * @sa
- */
-Int
-_DM8168DSP_badPageDump(UInt32 phyAddr, struct page *pg)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168DSP_badPageDump",
- phyAddr, pg);
-
- GT_assert (curTrace, (pg != NULL));
-
- Osal_printf("Bad page state in process \n"
- "page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n"
- "Backtrace:\n",
- pg, (Int)(2*sizeof(UInt32)),
- (UInt32)pg->flags, pg->mapping,
- page_mapcount(pg), page_count(pg));
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief This function deletes an MMU entry for the specfied address and
- * size.
- *
- * @param halObject Pointer to the HAL object
- * @param slaveVirtAddr DSP virtual address of the memory region
- * @param size Size of the memory region to be configured
- * @param isDynamic Is the MMU entry being dynamically added?
- *
- * @sa
- */
-Int
-_DM8168DSP_halMmuDeleteEntry (DM8168DSP_HalObject * halObject,
- DM8168DSP_HalMmuEntryInfo * entry)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt32 * iopgd = NULL;
- UInt32 currentEntrySize;
- DM8168DSP_HalMmuEntryInfo currentEntry;
- DM8168DSP_HalMmuObject * mmuObj;
- UInt32 clearBytes = 0;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168DSP_halMmuDeleteEntry",
- halObject, entry);
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (entry != NULL));
- GT_assert (curTrace, (entry->size != 0));
-
- mmuObj = &(halObject->mmuObj);
-
- /* Add the entry (or entries) */
- Memory_copy(¤tEntry,
- entry,
- sizeof(DM8168DSP_HalMmuEntryInfo));
-
- /* Align the addresses to page size */
- currentEntry.size += (currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB -1));
- currentEntry.slaveVirtAddr &= ~(PAGE_SIZE_4KB-1);
-
- /* Align the size as well */
- currentEntry.size = MMUPAGE_ALIGN(currentEntry.size, PAGE_SIZE_4KB);
- currentEntrySize = currentEntry.size;
-
- /* To find the max. page size with which both PA & VA are
- * aligned */
- while ((currentEntrySize != 0)
- && (status >= 0)
- && (currentEntry.slaveVirtAddr > MMU_GLOBAL_MEMORY)) {
- if (currentEntrySize >= PAGE_SIZE_16MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_16MB - 1))) {
- currentEntry.size = PAGE_SIZE_16MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_1MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_1MB - 1))) {
- currentEntry.size = PAGE_SIZE_1MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_64KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_64KB - 1))){
- currentEntry.size = PAGE_SIZE_64KB;
- }
- else if (currentEntrySize >= PAGE_SIZE_4KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB - 1))){
- currentEntry.size = PAGE_SIZE_4KB;
- }
- else {
- Osal_printf ("Configuration error: "
- " MMU entries must be aligned to their"
- "page size(4KB,"
- " 64KB, 1MB, or 16MB).\n");
- Osal_printf ("Since the addresses are not aligned buffer"
- "of size: %x at address: %x cannot be "
- "TLB entries\n",
- currentEntrySize, currentEntry.slaveVirtAddr);
- /*! @retval DM8168DSPPROC_E_MMUCONFIG Memory region is not
- aligned to page size */
- status = DM8168DSPPROC_E_MMUCONFIG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuAddEntry",
- status,
- "Memory region is not aligned to page size!");
- break ;
- }
- /* DO NOT put this check under SYSLINK_BUILD_OPTIMIZE */
- if (status >= 0) {
- /* Check every page if exists */
- iopgd = iopgd_offset(mmuObj->dspMmuHandler,
- currentEntry.slaveVirtAddr);
-
- if (*iopgd) {
- /* Clear the requested page entry */
- clearBytes = iopgtable_clear_entry(mmuObj->dspMmuHandler,
- currentEntry.slaveVirtAddr);
- }
-
- currentEntry.slaveVirtAddr += currentEntry.size;
- currentEntrySize -= currentEntry.size;
- }
- }
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168DSP_halMmuDeleteEntry", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief Updates entries in table.
- *
- * @param refData Argument provided to the ISR registration function
- *
- * @sa
- */
-Int
-_DM8168DSP_halMmuPteSet (DM8168DSP_HalObject * halObject,
- DM8168DSP_HalMmuEntryInfo* setPteInfo)
-{
- DM8168DSP_HalMmuObject * mmuObj;
- struct iotlb_entry tlb_entry;
- Int status = PROCESSOR_SUCCESS;
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (setPteInfo != NULL));
-
- mmuObj = &(halObject->mmuObj);
- GT_assert(curTrace, (mmuObj != NULL));
-
- switch (setPteInfo->size) {
- case PAGE_SIZE_16MB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_16M;
- break;
- case PAGE_SIZE_1MB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_1M;
- break;
- case PAGE_SIZE_64KB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_64K;
- break;
- case PAGE_SIZE_4KB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_4K;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid Page size passed!. */
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuPteSet",
- status,
- "Invalid Page size passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- tlb_entry.prsvd = MMU_CAM_PRESERVE;
- tlb_entry.valid = MMU_CAM_VALID;
- /*TBD : elsz parameter has to be configured*/
- switch (setPteInfo->elementSize) {
- case ELEM_SIZE_8BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_8;
- break;
- case ELEM_SIZE_16BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_16;
- break;
- case ELEM_SIZE_32BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_32;
- break;
- case ELEM_SIZE_64BIT:
- tlb_entry.elsz = 0x3; /* No translation */
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid elementSize passed!*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuPteSet",
- status,
- "Invalid elementSize passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- /*TBD : endian parameter has to configured*/
- switch (setPteInfo->endianism) {
- case LITTLE_ENDIAN:
- tlb_entry.endian = MMU_RAM_ENDIAN_LITTLE;
- break;
- case BIG_ENDIAN:
- tlb_entry.endian = MMU_RAM_ENDIAN_BIG;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid endianism
- * passed!. */
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuPteSet",
- status,
- "Invalid endianism passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- /*TBD : mixed parameter has to configured*/
- switch (setPteInfo->mixedSize) {
- case MMU_TLBES:
- tlb_entry.mixed = MMU_RAM_DEFAULT;
- break;
- case MMU_CPUES:
- tlb_entry.mixed = MMU_RAM_MIXED;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid
- * mixed size passed!*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuPteSet",
- status,
- "Invalid mixed size passed!");
- }
-
- tlb_entry.da = setPteInfo->slaveVirtAddr;
- tlb_entry.pa = setPteInfo->masterPhyAddr;
-
- if (iopgtable_store_entry(mmuObj->dspMmuHandler, &tlb_entry)){
- status = PROCESSOR_E_STOREENTERY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168DSP_halMmuPteSet",
- status,
- "iopgtable_store_entry failed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
- }
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
-// GT_1trace (curTrace, GT_LEAVE, "_DM8168DSP_halMmuPteSet", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalMmu.c b/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalMmu.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/ti81xxducati/ti81xxvideom3/Dm8168M3VideoHalMmu.c
+++ /dev/null
@@ -1,877 +0,0 @@
-/*
- * @file Dm8168M3VideoHalMmu.c
- *
- * @brief Hardware abstraction for Memory Management Unit module.
- *
- * This module is responsible for handling slave MMU-related
- * hardware- specific operations.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-/* Standard headers */
-#include <ti/syslink/Std.h>
-
-/* OSAL and utils headers */
-#include <ti/syslink/utils/List.h>
-#include <ti/syslink/utils/Trace.h>
-#include <ti/syslink/utils/OsalPrint.h>
-#include <ti/syslink/utils/Memory.h>
-#include <Bitops.h>
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168M3VideoHal.h>
-#include <Dm8168M3VideoHalMmu.h>
-#include <Dm8168M3VideoPhyShmem.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Defines default mixedSize i.e same types of pages in one segment
- */
-#define MMU_RAM_DEFAULT 0
-/*!
- * @brief returns page number based on physical address
- */
-#define ti_syslink_phys_to_page(phys) pfn_to_page((phys) >> PAGE_SHIFT)
-
-/*!
- * @brief helper macros
- */
-#define SLAVEVIRTADDR(x) ((x)->addr [ProcMgr_AddrType_SlaveVirt])
-#define SLAVEPHYSADDR(x) ((x)->addr [ProcMgr_AddrType_SlavePhys])
-#define MASTERPHYSADDR(x) ((x)->addr [ProcMgr_AddrType_MasterPhys])
-
-#define MMUPAGE_ALIGN(size, psz) (((size) + psz - 1) & ~(psz -1))
-
-/* =============================================================================
- * Forward declarations of internal functions
- * =============================================================================
- */
-#if defined(SYSLINK_BUILDOS_LINUX)
-/* Enables the MMU for GEM Module. */
-Int _DM8168VIDEOM3_halMmuEnable (DM8168VIDEOM3_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable);
-
-/* Disables the MMU for GEM Module. */
-Int _DM8168VIDEOM3_halMmuDisable (DM8168VIDEOM3_HalObject * halObject);
-
-/* Add entry in TWL. */
-Int
-_DM8168VIDEOM3_halMmuAddEntry (DM8168VIDEOM3_HalObject * halObject,
- DM8168VIDEOM3_HalMmuEntryInfo * entry);
-/* Add static entries in TWL. */
-Int
-_DM8168VIDEOM3_halMmuAddStaticEntries (DM8168VIDEOM3_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable);
-
-/* Delete entry from TLB. */
-Int
-_DM8168VIDEOM3_halMmuDeleteEntry (DM8168VIDEOM3_HalObject * halObject,
- DM8168VIDEOM3_HalMmuEntryInfo * entry);
-/* Set entry in to TLB. */
-Int
-_DM8168VIDEOM3_halMmuPteSet (DM8168VIDEOM3_HalObject * halObject,
- DM8168VIDEOM3_HalMmuEntryInfo * setPteInfo);
-/* Print page dump */
-Int
-_DM8168VIDEOM3_badPageDump(UInt32 phyAddr, struct page *pg);
-
-/* IOMMU Exported function */
-extern
-void
-iopgtable_lookup_entry (struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte);
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-/* =============================================================================
- * APIs called by DM8168VIDEOM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control MMU operations for this slave device.
- *
- * @param halObj Pointer to the HAL object
- * @param cmd MMU control command
- * @param arg Arguments specific to the MMU control command
- *
- * @sa
- */
-Int
-DM8168VIDEOM3_halMmuCtrl (Ptr halObj, Processor_MmuCtrlCmd cmd, Ptr args)
-{
- Int status = PROCESSOR_SUCCESS;
-#if defined(SYSLINK_BUILDOS_LINUX)
- DM8168VIDEOM3_HalObject * halObject = NULL;
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
- GT_3trace (curTrace, GT_ENTER, "DM8168VIDEOM3_halMmuCtrl", halObj, cmd, args);
-#if defined(SYSLINK_BUILDOS_LINUX)
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168VIDEOM3_HalObject *) halObj ;
-
- switch (cmd) {
- case Processor_MmuCtrlCmd_Enable:
- {
- DM8168VIDEOM3_HalMmuCtrlArgs_Enable * enableArgs;
- enableArgs = (DM8168VIDEOM3_HalMmuCtrlArgs_Enable *) args;
- halObject = (DM8168VIDEOM3_HalObject *) halObj;
- status = _DM8168VIDEOM3_halMmuEnable (halObject,
- enableArgs->numMemEntries,
- enableArgs->memEntries);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to configure VIDEOM3 MMU. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halMmuCtrl",
- status,
- "Failed to configure VIDEOM3 MMU"
- "at _DM8168VIDEOM3_halMmuEnable");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- case Processor_MmuCtrlCmd_Disable:
- {
- /* args are not used. */
- halObject = (DM8168VIDEOM3_HalObject *) halObj;
- status = _DM8168VIDEOM3_halMmuDisable (halObject);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to disable VIDEOM3 MMU. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halMmuCtrl",
- status,
- "Failed to disable VIDEOM3 MMU");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break ;
-
- case Processor_MmuCtrlCmd_AddEntry:
- {
- DM8168VIDEOM3_HalMmuCtrlArgs_AddEntry * addEntry;
- addEntry = (DM8168VIDEOM3_HalMmuCtrlArgs_AddEntry *) args;
-
- halObject = (DM8168VIDEOM3_HalObject *) halObj;
- /* Add the entry in TLB for new request */
- status = _DM8168VIDEOM3_halMmuAddEntry (halObject,addEntry) ;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to dynamically add VIDEOM3 MMU
- * entry. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halMmuCtrl",
- status,
- "Failed to dynamically add VIDEOM3 MMU entry");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- case Processor_MmuCtrlCmd_DeleteEntry:
- {
- DM8168VIDEOM3_HalMmuCtrlArgs_DeleteEntry * deleteEntry;
- deleteEntry = (DM8168VIDEOM3_HalMmuCtrlArgs_DeleteEntry *) args;
-
- halObject = (DM8168VIDEOM3_HalObject *) halObj;
- /* Add the entry in TLB for new request */
- status = _DM8168VIDEOM3_halMmuDeleteEntry (halObject,deleteEntry);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to dynamically delete VIDEOM3
- * MMU entry */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halMmuCtrl",
- status,
- "Failed to dynamically add VIDEOM3 MMU entry");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VIDEOM3_halMmuCtrl",
- status,
- "Unsupported MMU ctrl cmd specified");
- }
- break;
- }
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168VIDEOM3_halMmuCtrl",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-/* =============================================================================
- * Internal functions
- * =============================================================================
- */
-/*!
- * @brief Enables and configures the VIDEOM3 MMU as per provided memory map.
- *
- * @param halObject Pointer to the HAL object
- * @param numMemEntries Number of memory entries in memTable
- * @param memTable Table of memory entries to be configured
- *
- * @sa
- */
-
-Int
-_DM8168VIDEOM3_halMmuAddStaticEntries (DM8168VIDEOM3_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3_HalMmuEntryInfo staticEntry;
- UInt32 i;
-
- GT_3trace (curTrace, GT_ENTER, "_DM8168VIDEOM3_halMmuAddStaticEntries",
- halObject, numMemEntries, memTable);
-
- GT_assert (curTrace, (halObject != NULL));
- /* It is possible that numMemEntries may be 0, if user does not want to
- * configure any default regions.
- * memTable may also be NULL.
- */
-
- for (i = 0 ; i < numMemEntries && (status >= 0) ; i++) {
- if (SLAVEVIRTADDR (&memTable [i]) >= MMU_GLOBAL_MEMORY) {
- /* Configure the TLB */
- if (memTable [i].size != 0) {
- staticEntry.slaveVirtAddr =
- SLAVEVIRTADDR (&memTable [i]);
- staticEntry.size = memTable[i].size;
- staticEntry.masterPhyAddr =
- MASTERPHYSADDR (&memTable [i]);
- /*TBD : elementSize, endianism, mixedSized are hard
- * coded now, must be configurable later*/
- staticEntry.elementSize = MMU_RAM_ELSZ_16;
- staticEntry.endianism = LITTLE_ENDIAN;
- staticEntry.mixedSize = MMU_TLBES;
- status = _DM8168VIDEOM3_halMmuAddEntry (halObject,
- &staticEntry);
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to add MMU entry. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuAddStaticEntries",
- status,
- "Failed to add MMU entry!");
- }
- }
- }
- }
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VIDEOM3_halMmuAddStaticEntries", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status ;
-}
-Int
-_DM8168VIDEOM3_halMmuEnable (DM8168VIDEOM3_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3_HalMmuObject * mmuObj;
-
- GT_3trace (curTrace, GT_ENTER, "_DM8168VIDEOM3_halMmuEnable",
- halObject, numMemEntries, memTable);
-
- GT_assert (curTrace, (halObject != NULL));
- /* It is possible that numMemEntries may be 0, if user does not want to
- * configure any default regions.
- * memTable may also be NULL.
- */
- mmuObj = &(halObject->mmuObj);
- /* Check if videoMmuHandler is alreaday available if yes put it back and get
- * new one */
- if(mmuObj->videoMmuHandler)
- {
- iommu_put(mmuObj->videoMmuHandler);
- mmuObj->videoMmuHandler = NULL;
- }
- mmuObj->videoMmuHandler = iommu_get("ducati");
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (IS_ERR(mmuObj->videoMmuHandler)) {
- /*! @retval PROCESSOR_E_FAIL Failed at iommu_get. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuEnable",
- status,
- "iommu_get failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- if ((status >= 0) && (numMemEntries != 0)) {
- /* Only statically created entries are being added here. */
- status = _DM8168VIDEOM3_halMmuAddStaticEntries(halObject,
- numMemEntries,
- memTable);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed at
- * _DM8168VIDEOM3_halMmuAddStaticEntries. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuEnable",
- status,
- "_DM8168VIDEOM3_halMmuAddStaticEntries failed !");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VIDEOM3_halMmuEnable", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status ;
-}
-
-
-/*!
- * @brief Disables the VIDEOM3 MMU.
- *
- * @param halObject Pointer to the HAL object
- *
- * @sa
- */
-Int
-_DM8168VIDEOM3_halMmuDisable (DM8168VIDEOM3_HalObject * halObject)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VIDEOM3_HalMmuObject * mmuObj;
-
- GT_1trace (curTrace, GT_ENTER, "_DM8168VIDEOM3_halMmuDisable", halObject);
-
- GT_assert (curTrace, (halObject != NULL));
- mmuObj = &(halObject->mmuObj);
-
- /*TBD : Delete all added static entries in TWL*/
-
- /* Disable iommu. */
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if(mmuObj->videoMmuHandler == NULL){
- /*! @retval PROCESSOR_E_FAIL mmuObj->clkHandle is NULL ! */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuDisable",
- status,
- "videoMmuHandler is NULL !");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- iommu_put(mmuObj->videoMmuHandler);
- mmuObj->videoMmuHandler = NULL;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VIDEOM3_halMmuDisable", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief This function adds an MMU entry for the specfied address and
- * size.
- *
- * @param halObject Pointer to the HAL object
- * @param entry entry to be added
- *
- * @sa
- */
-Int
-_DM8168VIDEOM3_halMmuAddEntry (DM8168VIDEOM3_HalObject * halObject,
- DM8168VIDEOM3_HalMmuEntryInfo * entry)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt32 * ppgd = NULL;
- UInt32 * ppte = NULL;
- DM8168VIDEOM3_HalMmuEntryInfo te;
- DM8168VIDEOM3_HalMmuEntryInfo currentEntry;
- Int32 currentEntrySize;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168VIDEOM3_halMmuAddEntry",
- halObject, entry);
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (entry != NULL));
-
- /* copy the entry (or entries) */
- Memory_copy(¤tEntry,
- entry,
- sizeof(DM8168VIDEOM3_HalMmuEntryInfo));
-
- /* Align the addresses to page size */
- currentEntry.size += (currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB -1));
- currentEntry.slaveVirtAddr &= ~(PAGE_SIZE_4KB-1);
- currentEntry.masterPhyAddr &= ~(PAGE_SIZE_4KB-1);
-
- /* Align the size as well */
- currentEntry.size = MMUPAGE_ALIGN(currentEntry.size, PAGE_SIZE_4KB);
- currentEntrySize = currentEntry.size;
-
- /* To find the max. page size with which both PA & VA are
- * aligned */
- while ((currentEntrySize != 0) &&
- (status >= 0) &&
- (currentEntry.slaveVirtAddr > MMU_GLOBAL_MEMORY)) {
- if (currentEntrySize >= PAGE_SIZE_16MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_16MB - 1))) {
- currentEntry.size = PAGE_SIZE_16MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_1MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_1MB - 1))) {
- currentEntry.size = PAGE_SIZE_1MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_64KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_64KB - 1))){
- currentEntry.size = PAGE_SIZE_64KB;
- }
- else if (currentEntrySize >= PAGE_SIZE_4KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB - 1))){
- currentEntry.size = PAGE_SIZE_4KB;
- }
- else {
- Osal_printf ("Configuration error: "
- " MMU entries must be aligned to their"
- "page size(4KB,"
- " 64KB, 1MB, or 16MB).\n");
- Osal_printf ("Since the addresses are not aligned buffer"
- "of size: %x at address: %x cannot be "
- "TLB entries\n",
- currentEntrySize, currentEntry.slaveVirtAddr);
- /*! @retval DM8168VIDEOM3PROC_E_MMUCONFIG Memory region is not
- aligned to page size */
- status = DM8168VIDEOM3PROC_E_MMUCONFIG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuAddEntry",
- status,
- "Memory region is not aligned to page size!");
- break ;
- }
-
- /* DO NOT put this check under SYSLINK_BUILD_OPTIMIZE */
- if (status >= 0) {
- /* Check every page if exists */
- iopgtable_lookup_entry (halObject->mmuObj.videoMmuHandler,
- currentEntry.slaveVirtAddr,
- (u32 **) &ppgd,
- (u32 **) &ppte);
-
- /* Lookup if the entry exists */
- if (!ppgd || !ppte) {
- /* Entry doesnot exists, insert this page */
- te.size = currentEntry.size;
- te.slaveVirtAddr = currentEntry.slaveVirtAddr;
- te.masterPhyAddr = currentEntry.masterPhyAddr;
- te.elementSize = currentEntry.elementSize;
- te.endianism = currentEntry.endianism;
- te.mixedSize = currentEntry.mixedSize;
- status = _DM8168VIDEOM3_halMmuPteSet (halObject, &te);
- }
- else if (ppgd && ppte) {
- if (currentEntry.masterPhyAddr != (*ppte & IOPAGE_MASK)) {
- /* Entry doesnot exists, insert this page */
- te.size = currentEntry.size;
- te.slaveVirtAddr = currentEntry.slaveVirtAddr;
- te.masterPhyAddr = currentEntry.masterPhyAddr;
- te.elementSize = currentEntry.elementSize;
- te.endianism = currentEntry.endianism;
- te.mixedSize = currentEntry.mixedSize;
- status = _DM8168VIDEOM3_halMmuPteSet (halObject, &te);
- }
- }
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (
- curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuAddEntry",
- status,
- "Failed to in _DM8168VIDEOM3_halMmuPteSet!");
- break;
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- currentEntrySize -= currentEntry.size;
- currentEntry.masterPhyAddr += currentEntry.size;
- currentEntry.slaveVirtAddr += currentEntry.size;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VIDEOM3_halMmuAddEntry", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief Prints the page dump in case of error.
- *
- * @param phyAddr Physical address
- * @param pg Mapped page
- *
- * @sa
- */
-Int
-_DM8168VIDEOM3_badPageDump(UInt32 phyAddr, struct page *pg)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168VIDEOM3_badPageDump",
- phyAddr, pg);
-
- GT_assert (curTrace, (pg != NULL));
-
- Osal_printf("Bad page state in process \n"
- "page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n"
- "Backtrace:\n",
- pg, (Int)(2*sizeof(UInt32)),
- (UInt32)pg->flags, pg->mapping,
- page_mapcount(pg), page_count(pg));
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief This function deletes an MMU entry for the specfied address and
- * size.
- *
- * @param halObject Pointer to the HAL object
- * @param slaveVirtAddr VIDEOM3 virtual address of the memory region
- * @param size Size of the memory region to be configured
- * @param isDynamic Is the MMU entry being dynamically added?
- *
- * @sa
- */
-Int
-_DM8168VIDEOM3_halMmuDeleteEntry (DM8168VIDEOM3_HalObject * halObject,
- DM8168VIDEOM3_HalMmuEntryInfo * entry)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt32 * iopgd = NULL;
- UInt32 currentEntrySize;
- DM8168VIDEOM3_HalMmuEntryInfo currentEntry;
- DM8168VIDEOM3_HalMmuObject * mmuObj;
- UInt32 clearBytes = 0;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168VIDEOM3_halMmuDeleteEntry",
- halObject, entry);
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (entry != NULL));
- GT_assert (curTrace, (entry->size != 0));
-
- mmuObj = &(halObject->mmuObj);
-
- /* copy the entry (or entries) */
- Memory_copy(¤tEntry,
- entry,
- sizeof(DM8168VIDEOM3_HalMmuEntryInfo));
-
- /* Align the addresses to page size */
- currentEntry.size += (currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB -1));
- currentEntry.slaveVirtAddr &= ~(PAGE_SIZE_4KB-1);
-
- /* Align the size as well */
- currentEntry.size = MMUPAGE_ALIGN(currentEntry.size, PAGE_SIZE_4KB);
- currentEntrySize = currentEntry.size;
-
- /* To find the max. page size with which both PA & VA are
- * aligned */
- while ((currentEntrySize != 0)
- && (status >= 0)
- && (currentEntry.slaveVirtAddr > MMU_GLOBAL_MEMORY)) {
- if (currentEntrySize >= PAGE_SIZE_16MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_16MB - 1))) {
- currentEntry.size = PAGE_SIZE_16MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_1MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_1MB - 1))) {
- currentEntry.size = PAGE_SIZE_1MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_64KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_64KB - 1))){
- currentEntry.size = PAGE_SIZE_64KB;
- }
- else if (currentEntrySize >= PAGE_SIZE_4KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB - 1))){
- currentEntry.size = PAGE_SIZE_4KB;
- }
- else {
- Osal_printf ("Configuration error: "
- " MMU entries must be aligned to their"
- "page size(4KB,"
- " 64KB, 1MB, or 16MB).\n");
- Osal_printf ("Since the addresses are not aligned buffer"
- "of size: %x at address: %x cannot be "
- "TLB entries\n",
- currentEntrySize, currentEntry.slaveVirtAddr);
- /*! @retval DM8168VIDEOM3PROC_E_MMUCONFIG Memory region is not
- aligned to page size */
- status = DM8168VIDEOM3PROC_E_MMUCONFIG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuDeleteEntry",
- status,
- "Memory region is not aligned to page size!");
- break ;
- }
- /* DO NOT put this check under SYSLINK_BUILD_OPTIMIZE */
- if (status >= 0) {
- /* Check every page if exists */
- iopgd = iopgd_offset(mmuObj->videoMmuHandler,
- currentEntry.slaveVirtAddr);
-
- if (*iopgd) {
- /* Clear the requested page entry */
- clearBytes = iopgtable_clear_entry(mmuObj->videoMmuHandler,
- currentEntry.slaveVirtAddr);
- }
-
- currentEntry.slaveVirtAddr += currentEntry.size;
- currentEntrySize -= currentEntry.size;
- }
- }
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VIDEOM3_halMmuDeleteEntry", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief Updates entries in table.
- *
- * @param refData Argument provided to the ISR registration function
- *
- * @sa
- */
-Int
-_DM8168VIDEOM3_halMmuPteSet (DM8168VIDEOM3_HalObject * halObject,
- DM8168VIDEOM3_HalMmuEntryInfo* setPteInfo)
-{
- DM8168VIDEOM3_HalMmuObject * mmuObj;
- struct iotlb_entry tlb_entry;
- Int status = PROCESSOR_SUCCESS;
- UInt32 * iopgd = NULL;
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (setPteInfo != NULL));
-
- mmuObj = &(halObject->mmuObj);
- GT_assert(curTrace, (mmuObj != NULL));
-
- switch (setPteInfo->size) {
- case PAGE_SIZE_16MB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_16M;
- break;
- case PAGE_SIZE_1MB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_1M;
- break;
- case PAGE_SIZE_64KB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_64K;
- break;
- case PAGE_SIZE_4KB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_4K;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid Page size passed!. */
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuPteSet",
- status,
- "Invalid Page size passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- tlb_entry.prsvd = MMU_CAM_PRESERVE;
- tlb_entry.valid = MMU_CAM_VALID;
- /*TBD : elsz parameter has to be configured*/
- switch (setPteInfo->elementSize) {
- case ELEM_SIZE_8BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_8;
- break;
- case ELEM_SIZE_16BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_16;
- break;
- case ELEM_SIZE_32BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_32;
- break;
- case ELEM_SIZE_64BIT:
- tlb_entry.elsz = 0x3; /* No translation */
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid elementSize passed!*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuPteSet",
- status,
- "Invalid elementSize passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- /*TBD : endian parameter has to configured*/
- switch (setPteInfo->endianism) {
- case LITTLE_ENDIAN:
- tlb_entry.endian = MMU_RAM_ENDIAN_LITTLE;
- break;
- case BIG_ENDIAN:
- tlb_entry.endian = MMU_RAM_ENDIAN_BIG;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid endianism
- * passed!. */
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuPteSet",
- status,
- "Invalid endianism passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- /*TBD : mixed parameter has to configured*/
- switch (setPteInfo->mixedSize) {
- case MMU_TLBES:
- tlb_entry.mixed = MMU_RAM_DEFAULT;
- break;
- case MMU_CPUES:
- tlb_entry.mixed = MMU_RAM_MIXED;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid
- * mixed size passed!*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuPteSet",
- status,
- "Invalid mixed size passed!");
- }
-
- tlb_entry.da = setPteInfo->slaveVirtAddr;
- tlb_entry.pa = setPteInfo->masterPhyAddr;
- iopgd = iopgd_offset(mmuObj->videoMmuHandler,
- tlb_entry.da);
-
- if (iopgtable_store_entry(mmuObj->videoMmuHandler, &tlb_entry)){
- status = PROCESSOR_E_STOREENTERY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VIDEOM3_halMmuPteSet",
- status,
- "iopgtable_store_entry failed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
- }
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
-// GT_1trace (curTrace, GT_LEAVE, "_DM8168VIDEOM3_halMmuPteSet", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalMmu.c b/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalMmu.c
--- a/qnx/src/ipc3x_dev/ti/syslink/family/hlos/knl/ti81xx/ti81xxducati/ti81xxvpssm3/Dm8168M3DssHalMmu.c
+++ /dev/null
@@ -1,876 +0,0 @@
-/*
- * @file Dm8168M3DssHalMmu.c
- *
- * @brief Hardware abstraction for Memory Management Unit module.
- *
- * This module is responsible for handling slave MMU-related
- * hardware- specific operations.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-/* Standard headers */
-#include <ti/syslink/Std.h>
-
-/* OSAL and utils headers */
-#include <ti/syslink/utils/List.h>
-#include <ti/syslink/utils/Trace.h>
-#include <ti/syslink/utils/OsalPrint.h>
-#include <ti/syslink/utils/Memory.h>
-#include <Bitops.h>
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Processor.h>
-
-/* Hardware Abstraction Layer headers */
-#include <Dm8168M3DssHal.h>
-#include <Dm8168M3DssHalMmu.h>
-#include <Dm8168M3DssPhyShmem.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Defines default mixedSize i.e same types of pages in one segment
- */
-#define MMU_RAM_DEFAULT 0
-/*!
- * @brief returns page number based on physical address
- */
-#define ti_syslink_phys_to_page(phys) pfn_to_page((phys) >> PAGE_SHIFT)
-
-/*!
- * @brief helper macros
- */
-#define SLAVEVIRTADDR(x) ((x)->addr [ProcMgr_AddrType_SlaveVirt])
-#define SLAVEPHYSADDR(x) ((x)->addr [ProcMgr_AddrType_SlavePhys])
-#define MASTERPHYSADDR(x) ((x)->addr [ProcMgr_AddrType_MasterPhys])
-
-#define MMUPAGE_ALIGN(size, psz) (((size) + psz - 1) & ~(psz -1))
-
-/* =============================================================================
- * Forward declarations of internal functions
- * =============================================================================
- */
-#if defined(SYSLINK_BUILDOS_LINUX)
-/* Enables the MMU for GEM Module. */
-Int _DM8168VPSSM3_halMmuEnable (DM8168VPSSM3_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable);
-
-/* Disables the MMU for GEM Module. */
-Int _DM8168VPSSM3_halMmuDisable (DM8168VPSSM3_HalObject * halObject);
-
-/* Add entry in TWL. */
-Int
-_DM8168VPSSM3_halMmuAddEntry (DM8168VPSSM3_HalObject * halObject,
- DM8168VPSSM3_HalMmuEntryInfo * entry);
-/* Add static entries in TWL. */
-Int
-_DM8168VPSSM3_halMmuAddStaticEntries (DM8168VPSSM3_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable);
-
-/* Delete entry from TLB. */
-Int
-_DM8168VPSSM3_halMmuDeleteEntry (DM8168VPSSM3_HalObject * halObject,
- DM8168VPSSM3_HalMmuEntryInfo * entry);
-/* Set entry in to TLB. */
-Int
-_DM8168VPSSM3_halMmuPteSet (DM8168VPSSM3_HalObject * halObject,
- DM8168VPSSM3_HalMmuEntryInfo * setPteInfo);
-/* Print page dump */
-Int
-_DM8168VPSSM3_badPageDump(UInt32 phyAddr, struct page *pg);
-
-/* IOMMU Exported function */
-extern
-void
-iopgtable_lookup_entry (struct iommu *obj, u32 da, u32 **ppgd, u32 **ppte);
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-/* =============================================================================
- * APIs called by DM8168VPSSM3PROC module
- * =============================================================================
- */
-/*!
- * @brief Function to control MMU operations for this slave device.
- *
- * @param halObj Pointer to the HAL object
- * @param cmd MMU control command
- * @param arg Arguments specific to the MMU control command
- *
- * @sa
- */
-Int
-DM8168VPSSM3_halMmuCtrl (Ptr halObj, Processor_MmuCtrlCmd cmd, Ptr args)
-{
- Int status = PROCESSOR_SUCCESS;
-#if defined(SYSLINK_BUILDOS_LINUX)
- DM8168VPSSM3_HalObject * halObject = NULL;
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
- GT_3trace (curTrace, GT_ENTER, "DM8168VPSSM3_halMmuCtrl", halObj, cmd, args);
-#if defined(SYSLINK_BUILDOS_LINUX)
- GT_assert (curTrace, (halObj != NULL));
-
- halObject = (DM8168VPSSM3_HalObject *) halObj ;
-
- switch (cmd) {
- case Processor_MmuCtrlCmd_Enable:
- {
- DM8168VPSSM3_HalMmuCtrlArgs_Enable * enableArgs;
- enableArgs = (DM8168VPSSM3_HalMmuCtrlArgs_Enable *) args;
- halObject = (DM8168VPSSM3_HalObject *) halObj;
- status = _DM8168VPSSM3_halMmuEnable (halObject,
- enableArgs->numMemEntries,
- enableArgs->memEntries);
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to configure VPSSM3 MMU. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halMmuCtrl",
- status,
- "Failed to configure VPSSM3 MMU"
- "at _DM8168VPSSM3_halMmuEnable");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- case Processor_MmuCtrlCmd_Disable:
- {
- /* args are not used. */
- halObject = (DM8168VPSSM3_HalObject *) halObj;
- status = _DM8168VPSSM3_halMmuDisable (halObject);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to disable VPSSM3 MMU. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halMmuCtrl",
- status,
- "Failed to disable VPSSM3 MMU");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break ;
-
- case Processor_MmuCtrlCmd_AddEntry:
- {
- DM8168VPSSM3_HalMmuCtrlArgs_AddEntry * addEntry;
- addEntry = (DM8168VPSSM3_HalMmuCtrlArgs_AddEntry *) args;
-
- halObject = (DM8168VPSSM3_HalObject *) halObj;
- /* Add the entry in TLB for new request */
- status = _DM8168VPSSM3_halMmuAddEntry (halObject,addEntry) ;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to dynamically add VPSSM3 MMU
- * entry. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halMmuCtrl",
- status,
- "Failed to dynamically add VPSSM3 MMU entry");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- case Processor_MmuCtrlCmd_DeleteEntry:
- {
- DM8168VPSSM3_HalMmuCtrlArgs_DeleteEntry * deleteEntry;
- deleteEntry = (DM8168VPSSM3_HalMmuCtrlArgs_DeleteEntry *) args;
-
- halObject = (DM8168VPSSM3_HalObject *) halObj;
- /* Add the entry in TLB for new request */
- status = _DM8168VPSSM3_halMmuDeleteEntry (halObject,deleteEntry);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to dynamically delete VPSSM3
- * MMU entry */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halMmuCtrl",
- status,
- "Failed to dynamically add VPSSM3 MMU entry");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- break;
-
- default:
- {
- /*! @retval PROCESSOR_E_INVALIDARG Invalid argument */
- status = PROCESSOR_E_INVALIDARG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "DM8168VPSSM3_halMmuCtrl",
- status,
- "Unsupported MMU ctrl cmd specified");
- }
- break;
- }
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
- GT_1trace (curTrace, GT_LEAVE, "DM8168VPSSM3_halMmuCtrl",status);
-
- /*! @retval PROCESSOR_SUCCESS Operation successful */
- return status;
-}
-
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-/* =============================================================================
- * Internal functions
- * =============================================================================
- */
-/*!
- * @brief Enables and configures the VPSSM3 MMU as per provided memory map.
- *
- * @param halObject Pointer to the HAL object
- * @param numMemEntries Number of memory entries in memTable
- * @param memTable Table of memory entries to be configured
- *
- * @sa
- */
-Int
-_DM8168VPSSM3_halMmuAddStaticEntries (DM8168VPSSM3_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3_HalMmuEntryInfo staticEntry;
- UInt32 i;
-
- GT_3trace (curTrace, GT_ENTER, "_DM8168VPSSM3_halMmuAddStaticEntries",
- halObject, numMemEntries, memTable);
-
- GT_assert (curTrace, (halObject != NULL));
- /* It is possible that numMemEntries may be 0, if user does not want to
- * configure any default regions.
- * memTable may also be NULL.
- */
-
- for (i = 0 ; i < numMemEntries && (status >= 0) ; i++) {
- if (SLAVEVIRTADDR (&memTable [i]) >= MMU_GLOBAL_MEMORY) {
- /* Configure the TLB */
- if (memTable [i].size != 0) {
- staticEntry.slaveVirtAddr =
- SLAVEVIRTADDR (&memTable [i]);
- staticEntry.size = memTable[i].size;
- staticEntry.masterPhyAddr =
- MASTERPHYSADDR (&memTable [i]);
- /*TBD : elementSize, endianism, mixedSized are hard
- * coded now, must be configurable later*/
- staticEntry.elementSize = MMU_RAM_ELSZ_16;
- staticEntry.endianism = LITTLE_ENDIAN;
- staticEntry.mixedSize = MMU_TLBES;
- status = _DM8168VPSSM3_halMmuAddEntry (halObject,
- &staticEntry);
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed to add MMU entry. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuAddStaticEntries",
- status,
- "Failed to add MMU entry!");
- }
- }
- }
- }
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VPSSM3_halMmuAddStaticEntries", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status ;
-}
-Int
-_DM8168VPSSM3_halMmuEnable (DM8168VPSSM3_HalObject * halObject,
- UInt32 numMemEntries,
- ProcMgr_AddrInfo * memTable)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3_HalMmuObject * mmuObj;
-
- GT_3trace (curTrace, GT_ENTER, "_DM8168VPSSM3_halMmuEnable",
- halObject, numMemEntries, memTable);
-
- GT_assert (curTrace, (halObject != NULL));
- /* It is possible that numMemEntries may be 0, if user does not want to
- * configure any default regions.
- * memTable may also be NULL.
- */
- mmuObj = &(halObject->mmuObj);
- /* Check if vpssMmuHandler is alreaday available if yes put it back and get
- * new one */
- if(mmuObj->vpssMmuHandler)
- {
- iommu_put(mmuObj->vpssMmuHandler);
- mmuObj->vpssMmuHandler = NULL;
- }
- mmuObj->vpssMmuHandler = iommu_get("ducati");
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (IS_ERR(mmuObj->vpssMmuHandler)) {
- /*! @retval PROCESSOR_E_FAIL Failed at iommu_get. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuEnable",
- status,
- "iommu_get failed!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- if ((status >= 0) && (numMemEntries != 0)) {
- /* Only statically created entries are being added here. */
- status = _DM8168VPSSM3_halMmuAddStaticEntries(halObject,
- numMemEntries,
- memTable);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- /*! @retval PROCESSOR_E_FAIL Failed at
- * _DM8168VPSSM3_halMmuAddStaticEntries. */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuEnable",
- status,
- "_DM8168VPSSM3_halMmuAddStaticEntries failed !");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VPSSM3_halMmuEnable", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status ;
-}
-
-
-/*!
- * @brief Disables the VPSSM3 MMU.
- *
- * @param halObject Pointer to the HAL object
- *
- * @sa
- */
-Int
-_DM8168VPSSM3_halMmuDisable (DM8168VPSSM3_HalObject * halObject)
-{
- Int status = PROCESSOR_SUCCESS;
- DM8168VPSSM3_HalMmuObject * mmuObj;
-
- GT_1trace (curTrace, GT_ENTER, "_DM8168VPSSM3_halMmuDisable", halObject);
-
- GT_assert (curTrace, (halObject != NULL));
- mmuObj = &(halObject->mmuObj);
-
- /*TBD : Delete all added static entries in TWL*/
-
- /* Disable iommu. */
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if(mmuObj->vpssMmuHandler == NULL){
- /*! @retval PROCESSOR_E_FAIL mmuObj->clkHandle is NULL ! */
- status = PROCESSOR_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuDisable",
- status,
- "vpssMmuHandler is NULL !");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- iommu_put(mmuObj->vpssMmuHandler);
- mmuObj->vpssMmuHandler = NULL;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VPSSM3_halMmuDisable", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief This function adds an MMU entry for the specfied address and
- * size.
- *
- * @param halObject Pointer to the HAL object
- * @param entry entry to be added
- *
- * @sa
- */
-Int
-_DM8168VPSSM3_halMmuAddEntry (DM8168VPSSM3_HalObject * halObject,
- DM8168VPSSM3_HalMmuEntryInfo * entry)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt32 * ppgd = NULL;
- UInt32 * ppte = NULL;
- DM8168VPSSM3_HalMmuEntryInfo te;
- DM8168VPSSM3_HalMmuEntryInfo currentEntry;
- Int32 currentEntrySize;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168VPSSM3_halMmuAddEntry",
- halObject, entry);
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (entry != NULL));
-
- /* Add the entry (or entries) */
- Memory_copy(¤tEntry,
- entry,
- sizeof(DM8168VPSSM3_HalMmuEntryInfo));
-
- /* Align the addresses to page size */
- currentEntry.size += (currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB -1));
- currentEntry.slaveVirtAddr &= ~(PAGE_SIZE_4KB-1);
- currentEntry.masterPhyAddr &= ~(PAGE_SIZE_4KB-1);
-
- /* Align the size as well */
- currentEntry.size = MMUPAGE_ALIGN(currentEntry.size, PAGE_SIZE_4KB);
- currentEntrySize = currentEntry.size;
-
- /* To find the max. page size with which both PA & VA are
- * aligned */
- while ((currentEntrySize != 0) &&
- (status >= 0) &&
- (currentEntry.slaveVirtAddr > MMU_GLOBAL_MEMORY)) {
- if (currentEntrySize >= PAGE_SIZE_16MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_16MB - 1))) {
- currentEntry.size = PAGE_SIZE_16MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_1MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_1MB - 1))) {
- currentEntry.size = PAGE_SIZE_1MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_64KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_64KB - 1))){
- currentEntry.size = PAGE_SIZE_64KB;
- }
- else if (currentEntrySize >= PAGE_SIZE_4KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB - 1))){
- currentEntry.size = PAGE_SIZE_4KB;
- }
- else {
- Osal_printf ("Configuration error: "
- " MMU entries must be aligned to their"
- "page size(4KB,"
- " 64KB, 1MB, or 16MB).\n");
- Osal_printf ("Since the addresses are not aligned buffer"
- "of size: %x at address: %x cannot be "
- "TLB entries\n",
- currentEntrySize, currentEntry.slaveVirtAddr);
- /*! @retval DM8168VPSSM3PROC_E_MMUCONFIG Memory region is not
- aligned to page size */
- status = DM8168VPSSM3PROC_E_MMUCONFIG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuAddEntry",
- status,
- "Memory region is not aligned to page size!");
- break ;
- }
-
- /* DO NOT put this check under SYSLINK_BUILD_OPTIMIZE */
- if (status >= 0) {
- /* Check every page if exists */
- iopgtable_lookup_entry (halObject->mmuObj.vpssMmuHandler,
- currentEntry.slaveVirtAddr,
- (u32 **) &ppgd,
- (u32 **) &ppte);
-
- /* Lookup if the entry exists */
- if (!ppgd || !ppte) {
- /* Entry doesnot exists, insert this page */
- te.size = currentEntry.size;
- te.slaveVirtAddr = currentEntry.slaveVirtAddr;
- te.masterPhyAddr = currentEntry.masterPhyAddr;
- te.elementSize = currentEntry.elementSize;
- te.endianism = currentEntry.endianism;
- te.mixedSize = currentEntry.mixedSize;
- status = _DM8168VPSSM3_halMmuPteSet (halObject, &te);
- }
- else if (ppgd && ppte) {
- if (currentEntry.masterPhyAddr != (*ppte & IOPAGE_MASK)) {
- /* Entry doesnot exists, insert this page */
- te.size = currentEntry.size;
- te.slaveVirtAddr = currentEntry.slaveVirtAddr;
- te.masterPhyAddr = currentEntry.masterPhyAddr;
- te.elementSize = currentEntry.elementSize;
- te.endianism = currentEntry.endianism;
- te.mixedSize = currentEntry.mixedSize;
- status = _DM8168VPSSM3_halMmuPteSet (halObject, &te);
- }
- }
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (
- curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuAddEntry",
- status,
- "Failed to in _DM8168VPSSM3_halMmuPteSet!");
- break;
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- currentEntrySize -= currentEntry.size;
- currentEntry.masterPhyAddr += currentEntry.size;
- currentEntry.slaveVirtAddr += currentEntry.size;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
- }
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VPSSM3_halMmuAddEntry", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief Prints the page dump in case of error.
- *
- * @param phyAddr Physical address
- * @param pg Mapped page
- *
- * @sa
- */
-Int
-_DM8168VPSSM3_badPageDump(UInt32 phyAddr, struct page *pg)
-{
- Int status = PROCESSOR_SUCCESS;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168VPSSM3_badPageDump",
- phyAddr, pg);
-
- GT_assert (curTrace, (pg != NULL));
-
- Osal_printf("Bad page state in process \n"
- "page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n"
- "Backtrace:\n",
- pg, (Int)(2*sizeof(UInt32)),
- (UInt32)pg->flags, pg->mapping,
- page_mapcount(pg), page_count(pg));
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief This function deletes an MMU entry for the specfied address and
- * size.
- *
- * @param halObject Pointer to the HAL object
- * @param slaveVirtAddr VPSSM3 virtual address of the memory region
- * @param size Size of the memory region to be configured
- * @param isDynamic Is the MMU entry being dynamically added?
- *
- * @sa
- */
-Int
-_DM8168VPSSM3_halMmuDeleteEntry (DM8168VPSSM3_HalObject * halObject,
- DM8168VPSSM3_HalMmuEntryInfo * entry)
-{
- Int status = PROCESSOR_SUCCESS;
- UInt32 * iopgd = NULL;
- UInt32 currentEntrySize;
- DM8168VPSSM3_HalMmuEntryInfo currentEntry;
- DM8168VPSSM3_HalMmuObject * mmuObj;
- UInt32 clearBytes = 0;
-
- GT_2trace (curTrace, GT_ENTER, "_DM8168VPSSM3_halMmuDeleteEntry",
- halObject, entry);
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (entry != NULL));
- GT_assert (curTrace, (entry->size != 0));
-
- mmuObj = &(halObject->mmuObj);
-
- /* Add the entry (or entries) */
- Memory_copy(¤tEntry,
- entry,
- sizeof(DM8168VPSSM3_HalMmuEntryInfo));
-
- /* Align the addresses to page size */
- currentEntry.size += (currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB -1));
- currentEntry.slaveVirtAddr &= ~(PAGE_SIZE_4KB-1);
-
- /* Align the size as well */
- currentEntry.size = MMUPAGE_ALIGN(currentEntry.size, PAGE_SIZE_4KB);
- currentEntrySize = currentEntry.size;
-
- /* To find the max. page size with which both PA & VA are
- * aligned */
- while ((currentEntrySize != 0)
- && (status >= 0)
- && (currentEntry.slaveVirtAddr > MMU_GLOBAL_MEMORY)) {
- if (currentEntrySize >= PAGE_SIZE_16MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_16MB - 1))) {
- currentEntry.size = PAGE_SIZE_16MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_1MB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_1MB - 1))) {
- currentEntry.size = PAGE_SIZE_1MB;
- }
- else if (currentEntrySize >= PAGE_SIZE_64KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_64KB - 1))){
- currentEntry.size = PAGE_SIZE_64KB;
- }
- else if (currentEntrySize >= PAGE_SIZE_4KB
- && !(currentEntry.slaveVirtAddr & (PAGE_SIZE_4KB - 1))){
- currentEntry.size = PAGE_SIZE_4KB;
- }
- else {
- Osal_printf ("Configuration error: "
- " MMU entries must be aligned to their"
- "page size(4KB,"
- " 64KB, 1MB, or 16MB).\n");
- Osal_printf ("Since the addresses are not aligned buffer"
- "of size: %x at address: %x cannot be "
- "TLB entries\n",
- currentEntrySize, currentEntry.slaveVirtAddr);
- /*! @retval DM8168VPSSM3PROC_E_MMUCONFIG Memory region is not
- aligned to page size */
- status = DM8168VPSSM3PROC_E_MMUCONFIG;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuAddEntry",
- status,
- "Memory region is not aligned to page size!");
- break ;
- }
- /* DO NOT put this check under SYSLINK_BUILD_OPTIMIZE */
- if (status >= 0) {
- /* Check every page if exists */
- iopgd = iopgd_offset(mmuObj->vpssMmuHandler,
- currentEntry.slaveVirtAddr);
-
- if (*iopgd) {
- /* Clear the requested page entry */
- clearBytes = iopgtable_clear_entry(mmuObj->vpssMmuHandler,
- currentEntry.slaveVirtAddr);
- }
-
- currentEntry.slaveVirtAddr += currentEntry.size;
- currentEntrySize -= currentEntry.size;
- }
- }
-
- GT_1trace (curTrace, GT_LEAVE, "_DM8168VPSSM3_halMmuDeleteEntry", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-
-
-/*!
- * @brief Updates entries in table.
- *
- * @param refData Argument provided to the ISR registration function
- *
- * @sa
- */
-Int
-_DM8168VPSSM3_halMmuPteSet (DM8168VPSSM3_HalObject * halObject,
- DM8168VPSSM3_HalMmuEntryInfo* setPteInfo)
-{
- DM8168VPSSM3_HalMmuObject * mmuObj;
- struct iotlb_entry tlb_entry;
- Int status = PROCESSOR_SUCCESS;
-
- GT_assert (curTrace, (halObject != NULL));
- GT_assert (curTrace, (setPteInfo != NULL));
-
- mmuObj = &(halObject->mmuObj);
- GT_assert(curTrace, (mmuObj != NULL));
-
- switch (setPteInfo->size) {
- case PAGE_SIZE_16MB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_16M;
- break;
- case PAGE_SIZE_1MB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_1M;
- break;
- case PAGE_SIZE_64KB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_64K;
- break;
- case PAGE_SIZE_4KB:
- tlb_entry.pgsz = MMU_CAM_PGSZ_4K;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid Page size passed!. */
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuPteSet",
- status,
- "Invalid Page size passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- tlb_entry.prsvd = MMU_CAM_PRESERVE;
- tlb_entry.valid = MMU_CAM_VALID;
- /*TBD : elsz parameter has to be configured*/
- switch (setPteInfo->elementSize) {
- case ELEM_SIZE_8BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_8;
- break;
- case ELEM_SIZE_16BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_16;
- break;
- case ELEM_SIZE_32BIT:
- tlb_entry.elsz = MMU_RAM_ELSZ_32;
- break;
- case ELEM_SIZE_64BIT:
- tlb_entry.elsz = 0x3; /* No translation */
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid elementSize passed!*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuPteSet",
- status,
- "Invalid elementSize passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- /*TBD : endian parameter has to configured*/
- switch (setPteInfo->endianism) {
- case LITTLE_ENDIAN:
- tlb_entry.endian = MMU_RAM_ENDIAN_LITTLE;
- break;
- case BIG_ENDIAN:
- tlb_entry.endian = MMU_RAM_ENDIAN_BIG;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid endianism
- * passed!. */
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuPteSet",
- status,
- "Invalid endianism passed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status >= 0) {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- /*TBD : mixed parameter has to configured*/
- switch (setPteInfo->mixedSize) {
- case MMU_TLBES:
- tlb_entry.mixed = MMU_RAM_DEFAULT;
- break;
- case MMU_CPUES:
- tlb_entry.mixed = MMU_RAM_MIXED;
- break;
- default :
- status = PROCESSOR_E_INVALIDARG;
- /*! @retval PROCESSOR_E_INVALIDARG Invalid
- * mixed size passed!*/
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuPteSet",
- status,
- "Invalid mixed size passed!");
- }
-
- tlb_entry.da = setPteInfo->slaveVirtAddr;
- tlb_entry.pa = setPteInfo->masterPhyAddr;
-
- if (iopgtable_store_entry(mmuObj->vpssMmuHandler, &tlb_entry)){
- status = PROCESSOR_E_STOREENTERY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "_DM8168VPSSM3_halMmuPteSet",
- status,
- "iopgtable_store_entry failed!");
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
- }
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
-// GT_1trace (curTrace, GT_LEAVE, "_DM8168VPSSM3_halMmuPteSet", status);
-
- /*! @retval PROCESSOR_SUCCESS Operation completed successfully. */
- return status;
-}
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/ipu_pm.c b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/ipu_pm.c
index 0a7ac1ca1b69507566cfa8ef51adffe0ee9490b4..277b81a9c0930a890bb32cc953d2a0f32ecc88d8 100644 (file)
uint32_t tcar2;
} GPTIMER_REGS;
-#define OMAP44XX_IRQ_GPT6 74
-#define OMAP44XX_IRQ_GPT9 77
-#define OMAP44XX_IRQ_GPT11 79
+#define OMAP54XX_IRQ_GPT6 74
+#define OMAP54XX_IRQ_GPT9 77
+#define OMAP54XX_IRQ_GPT11 79
#define GPTIMER3_BASE 0x48034000
#define GPTIMER4_BASE 0x48036000
/* get IVA OPPs */
dvfsMessage.dvfs.type = getListOfDomainOPPs;
dvfsMessage.dvfs.domain = CPUDLL_OMAP_IVA;
- if (MsgSend( cpudll_coid, &dvfsMessage, sizeof( dvfsMessage ), &cpudll_iva_opp, sizeof(cpudll_iva_opp) ) == -1) {
+ if (MsgSend( cpudll_coid, &dvfsMessage, sizeof( dvfsMessage ), &cpudll_iva_opp, sizeof(cpudll_iva_opp) ) == -1) {
GT_setFailureReason(curTrace, GT_4CLASS, "powman_init", ENOMEM,
"Could not get list of IVA OPPs.");
return -ENOMEM;
ipu_pm_gpt_enable(GPTIMER_9);
isrParams.checkAndClearFxn = ipu_pm_clr_gptimer_interrupt;
isrParams.fxnArgs = (Ptr)GPTIMER_9;
- isrParams.intId = OMAP44XX_IRQ_GPT9;
+ isrParams.intId = OMAP54XX_IRQ_GPT9;
isrParams.sharedInt = FALSE;
ipu_pm_state.gpt9IsrObject =
OsalIsr_create(&ipu_pm_gptimer_interrupt,
ipu_pm_gpt_enable(GPTIMER_11);
isrParams.checkAndClearFxn = ipu_pm_clr_gptimer_interrupt;
isrParams.fxnArgs = (Ptr)GPTIMER_11;
- isrParams.intId = OMAP44XX_IRQ_GPT11;
+ isrParams.intId = OMAP54XX_IRQ_GPT11;
isrParams.sharedInt = FALSE;
ipu_pm_state.gpt11IsrObject =
OsalIsr_create(&ipu_pm_gptimer_interrupt,
ipu_pm_gpt_enable(GPTIMER_6);
isrParams.checkAndClearFxn = ipu_pm_clr_gptimer_interrupt;
isrParams.fxnArgs = (Ptr)GPTIMER_6;
- isrParams.intId = OMAP44XX_IRQ_GPT6;
+ isrParams.intId = OMAP54XX_IRQ_GPT6;
isrParams.sharedInt = FALSE;
ipu_pm_state.gpt6IsrObject =
OsalIsr_create(&ipu_pm_gptimer_interrupt,
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 2801205956200d70b331880c3cfe95bfd27681ba..abd895a25dcc4ab7f9e87d58b06e7cc6ed19a5b3 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2010-2011, Texas Instruments Incorporated
+ * Copyright (c) 2010-2013, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
OUTREG32(&mmuRegs->LOCK, reg);
}
-static void omap4_tlb_read_cr (OMAP5430BENELLI_HalObject * halObject,
+static void omap5_tlb_read_cr (OMAP5430BENELLI_HalObject * halObject,
struct cr_regs *cr)
{
OMAP5430Benelli_MMURegs * mmuRegs =
iotlb_getLock(halObject, &l);
l.vict = n;
iotlb_setLock(halObject, &l);
- omap4_tlb_read_cr(halObject, &cr);
+ omap5_tlb_read_cr(halObject, &cr);
return cr;
}
-static struct cr_regs *omap4_alloc_cr (struct iotlb_entry *e)
+static struct cr_regs *omap5_alloc_cr (struct iotlb_entry *e)
{
struct cr_regs *cr;
if (e->da & ~(get_cam_va_mask(e->pgsz))) {
GT_setFailureReason (curTrace,
GT_4CLASS,
- "omap4_alloc_cr",
+ "omap5_alloc_cr",
-EINVAL,
"failed mask check");
return NULL;
{
GT_setFailureReason (curTrace,
GT_4CLASS,
- "omap4_alloc_cr",
+ "omap5_alloc_cr",
-EINVAL,
"mmap failed");
return NULL;
return NULL;
}
- return omap4_alloc_cr(e);
+ return omap5_alloc_cr(e);
}
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliHalReset.c b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430BenelliHalReset.c
index 3a8a5b1f2fbe72724efecea7b0fdddd99dd9a62e..c7985f33b36c6fcc15576e244b8eb0fdf22934e9 100644 (file)
if (ret != EOK) {
status = PROCESSOR_E_FAIL;
GT_setFailureReason (curTrace, GT_4CLASS,
- "OMAP4430DUCATI_halResetCtrl",
+ "OMAP5430DUCATI_halResetCtrl",
status,
"Failed to stop gpt 3");
}
if (ret != EOK) {
status = PROCESSOR_E_FAIL;
GT_setFailureReason (curTrace, GT_4CLASS,
- "OMAP4430DUCATI_halResetCtrl",
+ "OMAP5430DUCATI_halResetCtrl",
status,
"Failed to disable gpt 3");
}
if (ret != EOK) {
status = PROCESSOR_E_FAIL;
GT_setFailureReason (curTrace, GT_4CLASS,
- "OMAP4430DUCATI_halResetCtrl",
+ "OMAP5430DUCATI_halResetCtrl",
status,
"Failed to stop gpt 4");
}
if (ret != EOK) {
status = PROCESSOR_E_FAIL;
GT_setFailureReason (curTrace, GT_4CLASS,
- "OMAP4430DUCATI_halResetCtrl",
+ "OMAP5430DUCATI_halResetCtrl",
status,
"Failed to disable gpt 4");
}
if (ret != EOK) {
status = PROCESSOR_E_FAIL;
GT_setFailureReason (curTrace, GT_4CLASS,
- "OMAP4430DUCATI_halResetCtrl",
+ "OMAP5430DUCATI_halResetCtrl",
status,
"Failed to stop gpt 5");
}
if (ret != EOK) {
status = PROCESSOR_E_FAIL;
GT_setFailureReason (curTrace, GT_4CLASS,
- "OMAP4430DUCATI_halResetCtrl",
+ "OMAP5430DUCATI_halResetCtrl",
status,
"Failed to disable gpt 5");
}
/* Check that releasing resets would indeed be effective */
reg = INREG32(DSPRstCtrl);
if (reg != 3) {
- Osal_printf("proc4430_start: DSP Resets in not proper state! [0x%x]", reg);
+ Osal_printf("proc5430_start: DSP Resets in not proper state! [0x%x]", reg);
OUTREG32(DSPRstCtrl,0x3);
counter = 1000;
while ((--counter)&&((INREG32(DSPRstCtrl) & 0x3) != 0x3));
}
break;
default:
- Osal_printf("proc4430_start: ERROR input");
+ Osal_printf("proc5430_start: ERROR input");
break;
}
}
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430Dmm.c b/qnx/src/ipc3x_dev/ti/syslink/family/omap5430/ipu/omap5430Dmm.c
index c93b060b19c19a4b7702e27f065a08950b9c1809..918d00acd14dd5203716bebd61b09633cf79e8ad 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2010-2011, Texas Instruments Incorporated
+ * Copyright (c) 2010-2013, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#include <errno.h>
#include <ti/syslink/Std.h>
-#include "OMAP4430Dmm.h"
+#include "OMAP5430Dmm.h"
#include <OsalMutex.h>
#define DMM_ADDR_VIRTUAL(x, a) \
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspEnabler.c b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayudsp/VAYUDspEnabler.c
index 94035b62c0d2d5737d56fb21bfb5830bb07ce64e..aab0af5981db734706187455927fe652ec7d687b 100644 (file)
OUTREG32(&mmuRegs->LOCK, reg);
}
-static void omap4_tlb_read_cr (UInt32 mmuBase, struct cr_regs *cr)
+static void omap5_tlb_read_cr (UInt32 mmuBase, struct cr_regs *cr)
{
VAYUDsp_MMURegs * mmuRegs = (VAYUDsp_MMURegs *)mmuBase;
iotlb_getLock(mmuBase, &l);
l.vict = n;
iotlb_setLock(mmuBase, &l);
- omap4_tlb_read_cr(mmuBase, &cr);
+ omap5_tlb_read_cr(mmuBase, &cr);
return cr;
}
-static struct cr_regs *omap4_alloc_cr (struct iotlb_entry *e)
+static struct cr_regs *omap5_alloc_cr (struct iotlb_entry *e)
{
struct cr_regs *cr;
if (e->da & ~(get_cam_va_mask(e->pgsz))) {
GT_setFailureReason (curTrace,
GT_4CLASS,
- "omap4_alloc_cr",
+ "omap5_alloc_cr",
-EINVAL,
"failed mask check");
return NULL;
{
GT_setFailureReason (curTrace,
GT_4CLASS,
- "omap4_alloc_cr",
+ "omap5_alloc_cr",
-EINVAL,
"mmap failed");
return NULL;
return NULL;
}
- return omap4_alloc_cr(e);
+ return omap5_alloc_cr(e);
}
diff --git a/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuEnabler.c b/qnx/src/ipc3x_dev/ti/syslink/family/vayu/vayuipu/VAYUIpuEnabler.c
index db72611e55dc40604aca8d137aaec7b4ba312ef0..e3ae4b227ed3b10b0c55e4b9e9e49fd5cd7f229a 100644 (file)
OUTREG32(&mmuRegs->LOCK, reg);
}
-static void omap4_tlb_read_cr (VAYUIPU_HalObject * halObject,
+static void omap5_tlb_read_cr (VAYUIPU_HalObject * halObject,
struct cr_regs *cr)
{
VAYUIpu_MMURegs * mmuRegs = (VAYUIpu_MMURegs *)halObject->mmuBase;
iotlb_getLock(halObject, &l);
l.vict = n;
iotlb_setLock(halObject, &l);
- omap4_tlb_read_cr(halObject, &cr);
+ omap5_tlb_read_cr(halObject, &cr);
return cr;
}
-static struct cr_regs *omap4_alloc_cr (struct iotlb_entry *e)
+static struct cr_regs *omap5_alloc_cr (struct iotlb_entry *e)
{
struct cr_regs *cr;
if (e->da & ~(get_cam_va_mask(e->pgsz))) {
GT_setFailureReason (curTrace,
GT_4CLASS,
- "omap4_alloc_cr",
+ "omap5_alloc_cr",
-EINVAL,
"failed mask check");
return NULL;
{
GT_setFailureReason (curTrace,
GT_4CLASS,
- "omap4_alloc_cr",
+ "omap5_alloc_cr",
-EINVAL,
"mmap failed");
return NULL;
return NULL;
}
- return omap4_alloc_cr(e);
+ return omap5_alloc_cr(e);
}
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/Dm8168Clock.h b/qnx/src/ipc3x_dev/ti/syslink/inc/Dm8168Clock.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * @file Dm8168Clock.h
- *
- * @brief RTOS side Clock interface for DM8168
- *
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168CLOCK_H_0xbbec
-#define DM8168CLOCK_H_0xbbec
-
-#include <ClockOps.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function creates the clock object */
-ClockOps_Handle DM8168CLOCK_create(Void);
-/* Function deletes the clock object */
-Int DM8168CLOCK_delete (ClockOps_Handle handle);
-/* Function to get handle to a clock given its name */
-Ptr DM8168CLOCK_get(String clkname);
-/* Function to release a Clock. */
-Void DM8168CLOCK_put(Ptr clkHandle);
-/* Function to enable a clock. */
-Int32 DM8168CLOCK_enable(Ptr clkHandle);
-/* Function to disable a clock */
-Void DM8168CLOCK_disable(Ptr clkHandle);
-/* Function to get clock speed */
-ULong DM8168CLOCK_getRate(Ptr clkHandle);
-/* Function to set clock speed */
-Int32 DM8168CLOCK_setRate(Ptr clkHandle, ULong rate);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* omap3530_hal_mmu_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/_MultiProcPlat.h b/qnx/src/ipc3x_dev/ti/syslink/inc/_MultiProcPlat.h
index 2fdb51f0066f492b72b4bdfa49b4cc0f9633ccfb..5ff73a244296a92763aafd32732080866ee3a07a 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2011-2012, Texas Instruments Incorporated
+ * Copyright (c) 2011-2013, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* Platform-specific definitions.
* =============================================================================
*/
-#if defined(SYSLINK_PLATFORM_OMAP4430)
-MultiProc_Config MultiProc_PlatformConfig = {
- .numProcessors = 4, /* numProcessors */
- .nameList[0] = "HOST",
- .nameList[1] = "CORE0",
- .nameList[2] = "CORE1",
- .nameList[3] = "DSP",
- .id = 0,
-};
-#endif
-
#if defined(SYSLINK_PLATFORM_OMAP5430)
#ifdef SYSLINK_SYSBIOS_SMP
MultiProc_Config MultiProc_PlatformConfig = {
#endif
#endif
-#if defined(SYSLINK_PLATFORM_TI81XX)
-#if !defined (SYSLINK_VARIANT_TI813X)
-MultiProc_Config MultiProc_PlatformConfig = {
- .numProcessors = 4, /* numProcessors */
- .nameList[0] = "HOST",
- .nameList[1] = "VPSS-M3",
- .nameList[2] = "VIDEO-M3",
- .nameList[3] = "DSP",
- .id = 0,
-};
-#else
-MultiProc_Config MultiProc_PlatformConfig = {
- .numProcessors = 4, /* numProcessors */
- .nameList[0] = "HOST",
- .nameList[1] = "VPSS-M3",
- .nameList[2] = "DSP",
- .id = 0,
-};
-#endif
-#endif
-
#if defined (__cplusplus)
}
#endif /* defined (__cplusplus) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspHal.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspHal.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/**
- * @file Dm8168DspHal.h
- *
- * @brief Top-level header file for DM8168DSP Hardware Abstraction Layer.
- *
- * This module is responsible for handling device-specific
- * operations.
- * The implementation is specific to DM8168DSP.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168DSPDSPHAL_H_0xbbed
-#define DM8168DSPDSPHAL_H_0xbbed
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Dm8168DspHalMmu.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-/*!
- * @brief Register access method.
- */
-#define REG(x) *((volatile UInt32 *) (x))
-
-/*!
- * @brief Hardware Abstraction object.
- */
-typedef struct DM8168DSP_HalObject_tag {
- UInt32 generalCtrlBase;
- /*!< Virtual base address of the General Control module. */
- UInt32 prcmBase;
- /*!< Virtual base address of the General Control module. */
- UInt32 l2ClkBase;
- /*!< Virtual base address of the General Control module. */
- UInt32 bootStatBase;
- /*!< Virtual base address of the General Control module. */
- UInt32 mmuBase;
- /*!< Base address of the MMU module. */
- UInt32 procId;
- /*!< Processor ID. */
- DM8168DSP_HalMmuObject mmuObj;
- /*!< MMU abstraction. */
-} DM8168DSP_HalObject;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to initialize the HAL object */
-Int DM8168DSP_halInit (Ptr * halObj, Ptr params);
-
-/* Function to finalize the HAL object */
-Int DM8168DSP_halExit (Ptr halObj);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168DspHal_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspHalBoot.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspHalBoot.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file Dm8168DspHalBoot.h
- *
- * @brief Boot control module header file.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM8168DSP.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168DSPDSPHALBOOT_H_0xbbed
-#define DM8168DSPDSPHALBOOT_H_0xbbed
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control boot operations for this slave device. */
-Int DM8168DSP_halBootCtrl (Ptr halObj, Processor_BootCtrlCmd cmd, Ptr arg);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168DspHalBoot_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspHalMmu.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspHalMmu.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/**
- * @file Dm8168DspHalMmu.h
- *
- * @brief Hardware abstraction for Memory Management Unit module.
- *
- * This module is responsible for handling slave MMU related
- * hardware- specific operations.
- * The implementation is specific to DM8168DSP.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168DSPHALMMU_H_0xbbed
-#define DM8168DSPHALMMU_H_0xbbed
-
-
-/* OSAL and utils headers */
-#include <ti/syslink/utils/List.h>
-#include <OsalIsr.h>
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Dm8168DspProc.h>
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-/*Linux specific headers*/
-#include <plat/iommu.h>
-#include <plat/iovmm.h>
-#include <asm/page.h>
-#include <linux/pagemap.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros
- * =============================================================================
- */
-/*!
- * @brief Mmu Sysconfig register offset
- */
-#define MMU_SYSCONFIG_OFFSET 0x10
-/*!
- * @brief Mmu Sysstatus register offset
- */
-
-#define MMU_SYSSTATUS_OFFSET 0x14
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_IRQSTATUS_OFFSET 0x18
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_IRQENABLE_OFFSET 0x1C
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_CNTL_OFFSET 0x44
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_FAULT_AD_OFFSET 0x48
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_LOCK_OFFSET 0x50
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_LD_TBL_OFFSET 0x54
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_CAM_OFFSET 0x58
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_RAM_OFFSET 0x5C
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_FLUSH_ENTRY 0x64
-
-/*!
- * @brief CAM register field values
- */
-#define MMU_CAM_PRESERVE (1 << 3)
-/*!
- * @brief CAM register field values
- */
-
-#define MMU_CAM_VALID (1 << 2)
-
-/*!
- * @brief Addresses lower than this do not go through the DSP's MMU
- */
-#define MMU_GLOBAL_MEMORY 0x11000000
-/* TBD: Update MMU global memory for ti81xx */
-/*!
- * @brief Faults to enable (MULTIHITFAULT and TLBMISS)
- */
-#define MMU_IRQENABLE_FAULTS 0x11
-
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_4KB 0x1000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_64KB 0x10000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_1MB 0x100000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_16MB 0x1000000
-
-/*
- * "L2 table" address mask and size definitions.
- */
-#define IOPGD_SHIFT 20
-#define IOPGD_SIZE (1UL << IOPGD_SHIFT)
-#define IOPGD_MASK (~(IOPGD_SIZE - 1))
-
-/*
- * "small page" address mask and size definitions.
- */
-#define IOPTE_SHIFT 12
-#define IOPTE_SIZE (1UL << IOPTE_SHIFT)
-#define IOPTE_MASK (~(IOPTE_SIZE - 1))
-#define IOPAGE_MASK IOPTE_MASK
-
-#define PTRS_PER_IOPGD (1UL << (32 - IOPGD_SHIFT))
-
-/* to find an entry in a page-table-directory */
-#define iopgd_index(da) (((da) >> IOPGD_SHIFT) & (PTRS_PER_IOPGD - 1))
-#define iopgd_offset(obj, da) ((obj)->iopgd + iopgd_index(da))
-
-
-/* =============================================================================
- * Enums
- * =============================================================================
- */
-/*!
- * @brief enum for Element size.
- */
-enum Dm8168Dsp_Hal_Mmu_Element_Size_tag {
- ELEM_SIZE_8BIT,
- ELEM_SIZE_16BIT,
- ELEM_SIZE_32BIT,
- ELEM_SIZE_64BIT
-};
-
-/*!
- * @brief enum for endianism.
- */
-enum Dm8168Dsp_Hal_Mmu_Endianism_tag {
- LITTLE_ENDIAN,
- BIG_ENDIAN
-};
-
-/*!
- * @brief enum for endianism.
- */
-enum Dm8168Dsp_Hal_Mmu_Mixed_Size_tag {
- MMU_TLBES,
- MMU_CPUES
-};
-
-/* =============================================================================
- * structs
- * =============================================================================
- */
-
-/*!
- * @brief Hardware Abstraction object for MMU module.
- */
-#if defined(SYSLINK_BUILD_HLOS)
-typedef struct DM8168DSP_HalMmuObject_tag {
- UInt32 mmuFaultAddr;
- /*!< Pointer to IsrObject. */
- struct clk * clkHandle;
- /*!< Enables and disables the iva2_ck clock. */
-#if defined(SYSLINK_BUILDOS_LINUX)
- struct platform_device iva2Device;
- /*!< Pltdorm device defined for iva2 sub system. */
- struct iommu * dspMmuHandler;
- /*!< Mmu handle returned by iommu_get. */
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-} DM8168DSP_HalMmuObject;
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-#if defined(SYSLINK_BUILD_RTOS)
-typedef struct DM8168DSP_HalMmuObject_tag {
- UInt32 mmuFaultAddr;
- /*!< Pointer to IsrObject. */
- Ptr clkHandle;
- /*!< Enables and disables the iva2_ck clock. */
- UInt32 iva2Device;
- /*!< Pltdorm device defined for iva2 sub system. */
- Ptr dspMmuHandler;
- /*!< Mmu handle returned by iommu_get. */
-} DM8168DSP_HalMmuObject;
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_Enable
- */
-typedef struct DM8168DSP_HalMmuCtrlArgs_Enable_tag {
- UInt32 numMemEntries;
- /*!< Number of memory regions to be configured. */
- ProcMgr_AddrInfo * memEntries;
- /*!< Array of information structures for memory regions to be configured. */
-} DM8168DSP_HalMmuCtrlArgs_Enable;
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_AddEntry
- */
-typedef struct DM8168DSP_HalMmuEntryInfo_tag {
- UInt32 slaveVirtAddr;
- /*!< Slave address to be mapped */
- UInt32 size;
- /*!< Size (in bytes) of region to be mapped */
- UInt32 masterPhyAddr;
- /*!< Mapped address in host address space */
- UInt32 elementSize;
- /*!< element size */
- UInt32 endianism;
- /*!< Little / big endian */
- UInt32 mixedSize;
- /*!< Types of pages in on segment*/
-}DM8168DSP_HalMmuEntryInfo ;
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_DeleteEntry
- */
-typedef DM8168DSP_HalMmuEntryInfo DM8168DSP_HalMmuCtrlArgs_AddEntry;
-typedef DM8168DSP_HalMmuEntryInfo DM8168DSP_HalMmuCtrlArgs_DeleteEntry;
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control MMU operations for this slave device. */
-Int DM8168DSP_halMmuCtrl (Ptr halObj, Processor_MmuCtrlCmd cmd, Ptr arg);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168DspHalMmu_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspHalReset.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspHalReset.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * @file Dm8168DspHalReset.h
- *
- * @brief Reset control module header file.
- *
- * This module is responsible for handling reset-related hardware-
- * specific operations.
- * The implementation is specific to DM8168DSP.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168DSPDSPHALRESET_H_0xbbed
-#define DM8168DSPDSPHALRESET_H_0xbbed
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-typedef enum {
- Dm8168DspHal_Reset_Attach = 0u,
- /*!< Assert both resets, release global reset, keep cpu in reset. */
- Dm8168DspHal_Reset_Start = 1u,
- /*!< Release the slave cpu from reset. */
- Dm8168DspHal_Reset_Stop = 2u,
- /*!< Assert CPU reset. */
- Dm8168DspHal_Reset_Detach = 3u,
- /*!< Assert both resets. */
- Dm8168DspHal_Reset_EndValue = 4u
- /*!< End delimiter indicating start of invalid values for this enum */
-} Dm8168DspHal_ResetCmd;
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control reset operations for this slave device. */
-Int Dm8168DspHal_reset(Ptr halObj, Dm8168DspHal_ResetCmd cmd);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168DspHalReset_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspPhyShmem.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspPhyShmem.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * @file Dm8168DspPhyShmem.h
- *
- * @brief Physical Interface Abstraction Layer for DM8168DSP.
- *
- * This file contains the definitions for shared memory physical
- * link being used with DM8168DSP.
- * The implementation is specific to DM8168DSP.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168DSPPHYSHMEM_H_0xbbed
-#define DM8168DSPPHYSHMEM_H_0xbbed
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-/*!
- * @brief Base addresses of dsp boot stat reg to indicate the boot complete.
- */
-#define DSP_BOOT_STAT 0x48140044
-
-#define DSP_BOOT_STAT_SIZE 0x4
-/*!
- * @brief Base addresses of L2_RAM for Ducati.
- */
-#define DSP_BOOT_ADDR 0x48140048
-
-/*!
- * @brief Base addresses of L2_RAM for Ducati.
- */
-#define DSP_BOOT_ADDR_SIZE 0x4
-
-/*!
- * @brief Base addresses of L2_RAM for clock enable.
- */
-#define L2_RAM_CLK_ENABLE 0x48140650
-
-#define L2_RAM_CLK_ENABLE_SIZE 0x4
-/*!
- * @brief Base addresses of PRCM module.
- */
-#define PRCM_BASE_ADDR 0x48180000
-/*!
- * @brief Base addresses of different peripherals.
- */
-
-#define PRCM_SIZE 0x00002FFF
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Initializes Shared Driver/device. */
-Int DM8168DSP_phyShmemInit (Ptr halObj);
-
-/* Finalizes Shared Driver/device. */
-Int DM8168DSP_phyShmemExit (Ptr halObj);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* dm8168_phy_shmem_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspProc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspProc.h
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * @file Dm8168DspProc.h
- *
- * @brief Processor interface for DM8168SLAVE.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef DM8168DSPPROC_H_0xbbed
-#define DM8168DSPPROC_H_0xbbed
-
-
-/* Module headers */
-#include <ti/syslink/ProcMgr.h>
-#include <ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/*!
- * @def DM8168DSPPROC_MODULEID
- * @brief Module ID for DM8168SLAVE.
- */
-#define DM8168DSPPROC_MODULEID (UInt16) 0xbbec
-
-/* =============================================================================
- * All success and failure codes for the module
- * =============================================================================
- */
-/*!
- * @def DM8168DSPPROC_STATUSCODEBASE
- * @brief Error code base for ProcMgr.
- */
-#define DM8168DSPPROC_STATUSCODEBASE (DM8168DSPPROC_MODULEID << 12u)
-
-/*!
- * @def DM8168DSPPROC_MAKE_FAILURE
- * @brief Macro to make failure code.
- */
-#define DM8168DSPPROC_MAKE_FAILURE(x) ((Int)( 0x80000000 \
- | (DM8168DSPPROC_STATUSCODEBASE + (x))))
-
-/*!
- * @def DM8168DSPPROC_MAKE_SUCCESS
- * @brief Macro to make success code.
- */
-#define DM8168DSPPROC_MAKE_SUCCESS(x) (DM8168DSPPROC_STATUSCODEBASE + (x))
-
-/*!
- * @def DM8168DSPPROC_E_MMUENTRYEXISTS
- * @brief Specified MMU entry already exists.
- */
-#define DM8168DSPPROC_E_MMUENTRYEXISTS DM8168DSPPROC_MAKE_FAILURE(1)
-
-/*!
- * @def DM8168DSPPROC_E_ISR
- * @brief Error occurred during ISR operation.
- */
-#define DM8168DSPPROC_E_ISR DM8168DSPPROC_MAKE_FAILURE(2)
-
-/*!
- * @def DM8168DSPPROC_E_MMUCONFIG
- * @brief Error occurred during MMU configuration
- */
-#define DM8168DSPPROC_E_MMUCONFIG DM8168DSPPROC_MAKE_FAILURE(3)
-
-/*!
- * @def DM8168DSPPROC_E_OSFAILURE
- * @brief Failure in an OS-specific operation.
- */
-#define DM8168DSPPROC_E_OSFAILURE DM8168DSPPROC_MAKE_FAILURE(4)
-
-/*!
- * @def DM8168DSPPROC_E_INVALIDARG
- * @brief Argument passed to a function is invalid.
- */
-#define DM8168DSPPROC_E_INVALIDARG DM8168DSPPROC_MAKE_FAILURE(5)
-
-/*!
- * @def DM8168DSPPROC_E_MEMORY
- * @brief Memory allocation failed.
- */
-#define DM8168DSPPROC_E_MEMORY DM8168DSPPROC_MAKE_FAILURE(6)
-
-/*!
- * @def DM8168DSPPROC_E_HANDLE
- * @brief Invalid object handle specified
- */
-#define DM8168DSPPROC_E_HANDLE DM8168DSPPROC_MAKE_FAILURE(7)
-
-/*!
- * @def DM8168DSPPROC_E_ACCESSDENIED
- * @brief The operation is not permitted in this process.
- */
-#define DM8168DSPPROC_E_ACCESSDENIED DM8168DSPPROC_MAKE_FAILURE(8)
-
-/*!
- * @def DM8168DSPPROC_E_FAIL
- * @brief Generic failure.
- */
-#define DM8168DSPPROC_E_FAIL DM8168DSPPROC_MAKE_FAILURE(9)
-
-/*!
- * @def DM8168DSPPROC_SUCCESS
- * @brief Operation successful.
- */
-#define DM8168DSPPROC_SUCCESS DM8168DSPPROC_MAKE_SUCCESS(0)
-
-/*!
- * @def DM8168DSPPROC_S_ALREADYSETUP
- * @brief The DM8168DSPPROC module has already been setup in this process.
- */
-#define DM8168DSPPROC_S_ALREADYSETUP DM8168DSPPROC_MAKE_SUCCESS(1)
-
-/*!
- * @def DM8168DSPPROC_S_OPENHANDLE
- * @brief Other DM8168DSPPROC clients have still setup the DM8168DSPPROC module.
- */
-#define DM8168DSPPROC_S_SETUP DM8168DSPPROC_MAKE_SUCCESS(2)
-
-/*!
- * @def DM8168DSPPROC_S_OPENHANDLE
- * @brief Other DM8168DSPPROC handles are still open in this process.
- */
-#define DM8168DSPPROC_S_OPENHANDLE DM8168DSPPROC_MAKE_SUCCESS(3)
-
-/*!
- * @def DM8168DSPPROC_S_ALREADYEXISTS
- * @brief The DM8168DSPPROC instance has already been created/opened in this
- * process
- */
-#define DM8168DSPPROC_S_ALREADYEXISTS DM8168DSPPROC_MAKE_SUCCESS(4)
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Module configuration structure.
- */
-typedef struct DM8168DSPPROC_Config {
- UInt32 reserved; /*!< Reserved field (not currently required) */
-} DM8168DSPPROC_Config;
-
-/*!
- * @brief Configuration parameters specific to this processor.
- */
-typedef struct DM8168DSPPROC_Params_tag {
- Bool mmuEnable;
- /*!< Determines if mmu should be used (enabled) */
- UInt32 numMemEntries;
- /*!< Number of memory regions to be configured. */
- ProcMgr_AddrInfo memEntries[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< Array of information structures for memory regions to be configured. */
- UInt32 carveoutAddr;
- /*!< The address of the carveout for shared mem */
- UInt32 carveoutSize;
- /*!< The length of the carveout for shared mem */
-} DM8168DSPPROC_Params;
-
-/*!
- * @brief Defines DM8168DSPPROC object handle
- */
-typedef struct DM8168DSPPROC_Object * DM8168DSPPROC_Handle;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-
-/* Function to get the default configuration for the DM8168DSPPROC module. */
-Void DM8168DSPPROC_getConfig (DM8168DSPPROC_Config * cfg);
-
-/* Function to setup the DM8168DSPPROC module. */
-Int DM8168DSPPROC_setup (DM8168DSPPROC_Config * cfg);
-
-/* Function to destroy the DM8168DSPPROC module. */
-Int DM8168DSPPROC_destroy (Void);
-
-/* Function to initialize the parameters for this processor instance. */
-Void DM8168DSPPROC_Params_init (DM8168DSPPROC_Handle handle,
- DM8168DSPPROC_Params * params);
-
-/* Function to create an instance of this processor. */
-DM8168DSPPROC_Handle DM8168DSPPROC_create ( UInt16 procId,
- const DM8168DSPPROC_Params * params);
-
-/* Function to delete an instance of this processor. */
-Int DM8168DSPPROC_delete (DM8168DSPPROC_Handle * handlePtr);
-
-/* Function to open an instance of this processor. */
-Int DM8168DSPPROC_open (DM8168DSPPROC_Handle * handlePtr, UInt16 procId);
-
-/* Function to close an instance of this processor. */
-Int DM8168DSPPROC_close (DM8168DSPPROC_Handle * handlePtr);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* DM8168DSPPROC_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspPwr.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DspPwr.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/**
- * @file Dm8168DspPwr.h
- *
- * @brief Power Manager interface for DM8168DSPPWR.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef DM8168DSPPWR_H_0xa861
-#define DM8168DSPPWR_H_0xa861
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/*!
- * @def DM8168DSPPWR_MODULEID
- * @brief Module ID for DM8168DSPPWR.
- */
-#define DM8168DSPPWR_MODULEID (UInt16) 0xa860
-
-/* =============================================================================
- * All success and failure codes for the module
- * =============================================================================
- */
-/*!
- * @def DM8168DSPPWR_STATUSCODEBASE
- * @brief Error code base for DM8168DSPPWR.
- */
-#define DM8168DSPPWR_STATUSCODEBASE (DM8168DSPPWR_MODULEID << 12u)
-
-/*!
- * @def DM8168DSPPWR_MAKE_FAILURE
- * @brief Macro to make failure code.
- */
-#define DM8168DSPPWR_MAKE_FAILURE(x) ((Int)( 0x80000000 \
- | (DM8168DSPPWR_STATUSCODEBASE + (x))))
-
-/*!
- * @def DM8168DSPPWR_MAKE_SUCCESS
- * @brief Macro to make success code.
- */
-#define DM8168DSPPWR_MAKE_SUCCESS(x) (DM8168DSPPWR_STATUSCODEBASE + (x))
-
-/*!
- * @def DM8168DSPPWR_E_OSFAILURE
- * @brief Failure in an OS-specific operation.
- */
-#define DM8168DSPPWR_E_OSFAILURE DM8168DSPPWR_MAKE_FAILURE(1)
-
-/*!
- * @def DM8168DSPPWR_E_INVALIDARG
- * @brief Argument passed to a function is invalid.
- */
-#define DM8168DSPPWR_E_INVALIDARG DM8168DSPPWR_MAKE_FAILURE(2)
-
-/*!
- * @def DM8168DSPPWR_E_MEMORY
- * @brief Memory allocation failed.
- */
-#define DM8168DSPPWR_E_MEMORY DM8168DSPPWR_MAKE_FAILURE(3)
-
-/*!
- * @def DM8168DSPPWR_E_HANDLE
- * @brief Invalid object handle specified
- */
-#define DM8168DSPPWR_E_HANDLE DM8168DSPPWR_MAKE_FAILURE(4)
-
-/*!
- * @def DM8168DSPPWR_E_ACCESSDENIED
- * @brief The operation is not permitted in this process.
- */
-#define DM8168DSPPWR_E_ACCESSDENIED DM8168DSPPWR_MAKE_FAILURE(5)
-
-/*!
- * @def DM8168DSPPWR_E_FAIL
- * @brief Generic failure.
- */
-#define DM8168DSPPWR_E_FAIL DM8168DSPPWR_MAKE_FAILURE(6)
-
-/*!
- * @def DM8168DSPPWR_SUCCESS
- * @brief Operation successful.
- */
-#define DM8168DSPPWR_SUCCESS DM8168DSPPWR_MAKE_SUCCESS(0)
-
-/*!
- * @def DM8168DSPPWR_S_ALREADYSETUP
- * @brief The DM8168DSPPWR module has already been setup in this process.
- */
-#define DM8168DSPPWR_S_ALREADYSETUP DM8168DSPPWR_MAKE_SUCCESS(1)
-
-/*!
- * @def DM8168DSPPWR_S_OPENHANDLE
- * @brief Other DM8168DSPPWR clients have still setup the DM8168DSPPWR module.
- */
-#define DM8168DSPPWR_S_SETUP DM8168DSPPWR_MAKE_SUCCESS(2)
-
-/*!
- * @def DM8168DSPPWR_S_OPENHANDLE
- * @brief Other DM8168DSPPWR handles are still open in this process.
- */
-#define DM8168DSPPWR_S_OPENHANDLE DM8168DSPPWR_MAKE_SUCCESS(3)
-
-/*!
- * @def DM8168DSPPWR_S_ALREADYEXISTS
- * @brief The DM8168DSPPWR instance has already been created/opened in this
- * process
- */
-#define DM8168DSPPWR_S_ALREADYEXISTS DM8168DSPPWR_MAKE_SUCCESS(4)
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Module configuration structure.
- */
-typedef struct DM8168DSPPWR_Config {
- UInt32 reserved; /*!< Reserved field (not currently required) */
-} DM8168DSPPWR_Config;
-
-/*!
- * @brief Configuration parameters specific to this processor.
- */
-typedef struct DM8168DSPPWR_Params_tag {
- UInt32 reserved;
- /*!< Reserved field (not currently required) */
- Ptr clockHandle;
- /*!< Pointer to the Clock Object that will be passed to create */
-
-} DM8168DSPPWR_Params;
-
-/*!
- * @brief Defines DM8168DSPPWR object handle
- */
-typedef struct DM8168DSPPWR_Object * DM8168DSPPWR_Handle;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-
-/* Function to get the default configuration for the DM8168DSPPWR module. */
-Void DM8168DSPPWR_getConfig (DM8168DSPPWR_Config * cfg);
-
-/* Function to setup the DM8168DSPPWR module. */
-Int DM8168DSPPWR_setup (DM8168DSPPWR_Config * cfg);
-
-/* Function to destroy the DM8168DSPPWR module. */
-Int DM8168DSPPWR_destroy (Void);
-
-/* Function to initialize the parameters for this PwrMgr instance. */
-Void DM8168DSPPWR_Params_init (DM8168DSPPWR_Params * params);
-
-/* Function to create an instance of this PwrMgr. */
-DM8168DSPPWR_Handle DM8168DSPPWR_create ( UInt16 procId,
- const DM8168DSPPWR_Params * params);
-
-/* Function to delete an instance of this PwrMgr. */
-Int DM8168DSPPWR_delete (DM8168DSPPWR_Handle * handlePtr);
-
-/* Function to open an instance of this PwrMgr. */
-Int DM8168DSPPWR_open (DM8168DSPPWR_Handle * handlePtr, UInt16 procId);
-
-/* Function to close an instance of this PwrMgr. */
-Int DM8168DSPPWR_close (DM8168DSPPWR_Handle * handlePtr);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* DM8168DSPPWR_H_0xa860 */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DucatiPwr.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168DucatiPwr.h
+++ /dev/null
@@ -1,258 +0,0 @@
-/**
- * @file Dm8168DucatiPwr.h
- *
- * @brief Power Manager interface for DM8168DUCATIPWR.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef DM8168DUCATIPWR_H_0xa862
-#define DM8168DUCATIPWR_H_0xa862
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-#include <ti/syslink/inc/ClockOps.h>
-
-/*!
- * @def DM8168DUCATIPWR_MODULEID
- * @brief Module ID for DM8168DUCATIPWR.
- */
-#define DM8168DUCATIPWR_MODULEID (UInt16) 0xa860
-
-/* =============================================================================
- * All success and failure codes for the module
- * =============================================================================
- */
-/*!
- * @def DM8168DUCATIPWR_STATUSCODEBASE
- * @brief Error code base for DM8168DUCATIPWR.
- */
-#define DM8168DUCATIPWR_STATUSCODEBASE (DM8168DUCATIPWR_MODULEID << 12u)
-
-/*!
- * @def DM8168DUCATIPWR_MAKE_FAILURE
- * @brief Macro to make failure code.
- */
-#define DM8168DUCATIPWR_MAKE_FAILURE(x)((Int)( 0x80000000 \
- | (DM8168DUCATIPWR_STATUSCODEBASE + (x))))
-
-/*!
- * @def DM8168DUCATIPWR_MAKE_SUCCESS
- * @brief Macro to make success code.
- */
-#define DM8168DUCATIPWR_MAKE_SUCCESS(x) (DM8168DUCATIPWR_STATUSCODEBASE + (x))
-
-/*!
- * @def DM8168DUCATIPWR_E_OSFAILURE
- * @brief Failure in an OS-specific operation.
- */
-#define DM8168DUCATIPWR_E_OSFAILURE DM8168DUCATIPWR_MAKE_FAILURE(1)
-
-/*!
- * @def DM8168DUCATIPWR_E_INVALIDARG
- * @brief Argument passed to a function is invalid.
- */
-#define DM8168DUCATIPWR_E_INVALIDARG DM8168DUCATIPWR_MAKE_FAILURE(2)
-
-/*!
- * @def DM8168DUCATIPWR_E_MEMORY
- * @brief Memory allocation failed.
- */
-#define DM8168DUCATIPWR_E_MEMORY DM8168DUCATIPWR_MAKE_FAILURE(3)
-
-/*!
- * @def DM8168DUCATIPWR_E_HANDLE
- * @brief Invalid object handle specified
- */
-#define DM8168DUCATIPWR_E_HANDLE DM8168DUCATIPWR_MAKE_FAILURE(4)
-
-/*!
- * @def DM8168DUCATIPWR_E_ACCESSDENIED
- * @brief The operation is not permitted in this process.
- */
-#define DM8168DUCATIPWR_E_ACCESSDENIED DM8168DUCATIPWR_MAKE_FAILURE(5)
-
-/*!
- * @def DM8168DUCATIPWR_E_FAIL
- * @brief Generic failure.
- */
-#define DM8168DUCATIPWR_E_FAIL DM8168DUCATIPWR_MAKE_FAILURE(6)
-/*!
- * @def DM8168DUCATIPWR_E_FAIL
- * @brief Generic failure.
- */
-#define DM8168DUCATIPWR_E_INVALIDSTATE DM8168DUCATIPWR_MAKE_FAILURE(7)
-
-/*!
- * @def DM8168DUCATIPWR_SUCCESS
- * @brief Operation successful.
- */
-#define DM8168DUCATIPWR_SUCCESS DM8168DUCATIPWR_MAKE_SUCCESS(0)
-
-/*!
- * @def DM8168DUCATIPWR_S_ALREADYSETUP
- * @brief The DM8168DUCATIPWR module has already been setup in this process.
- */
-#define DM8168DUCATIPWR_S_ALREADYSETUP DM8168DUCATIPWR_MAKE_SUCCESS(1)
-
-/*!
- * @def DM8168DUCATIPWR_S_OPENHANDLE
- * @brief Other DM8168DUCATIPWR clients have still setup the DM8168DUCATIPWR module.
- */
-#define DM8168DUCATIPWR_S_SETUP DM8168DUCATIPWR_MAKE_SUCCESS(2)
-
-/*!
- * @def DM8168DUCATIPWR_S_OPENHANDLE
- * @brief Other DM8168DUCATIPWR handles are still open in this process.
- */
-#define DM8168DUCATIPWR_S_OPENHANDLE DM8168DUCATIPWR_MAKE_SUCCESS(3)
-
-/*!
- * @def DM8168DUCATIPWR_S_ALREADYEXISTS
- * @brief The DM8168DUCATIPWR instance has already been created/opened in this
- * process
- */
-#define DM8168DUCATIPWR_S_ALREADYEXISTS DM8168DUCATIPWR_MAKE_SUCCESS(4)
-/*!
- * @def DM8168DUCATIPWR_S_ALREADYPOWEREDON
- * @brief The DM8168DUCATIPWR power on code has been executed
- */
-#define DM8168DUCATIPWR_S_ALREADYPOWEREDON DM8168DUCATIPWR_MAKE_SUCCESS(5)
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Module configuration structure.
- */
-typedef struct DM8168DUCATIPWR_Config {
- UInt32 reserved; /*!< Reserved field (not currently required) */
-} DM8168DUCATIPWR_Config;
-
-/*!
- * @brief Configuration parameters specific to this processor.
- */
-typedef struct DM8168DUCATIPWR_Params_tag {
- UInt32 reserved;
- /*!< Reserved field (not currently required) */
- Ptr clockHandle;
- /*!< Pointer to the Clock Object that will be passed to create */
-} DM8168DUCATIPWR_Params;
-
-
-
-/*!
- * @brief DM8168DUCATIPWR instance object.
- */
-struct DM8168DUCATIPWR_Object_tag {
-
- DM8168DUCATIPWR_Params params;
- /*!< Instance parameters (configuration values) */
- UInt32 prcmVA;
- /*!< Virtual address for prcm module */
- UInt32 ducatiMmuVA;
- /*!< Virtual address for prcm module */
- UInt32 ducatibaseVA;
- /*!< Virtual address for prcm module */
- ClockOps_Handle clockHandle;
- /*!< Pointer to the Clock object. */
-
-};
-
-
-/*!
- * @brief Defines DM8168DUCATIPWR object handle
- */
-typedef struct DM8168DUCATIPWR_Object_tag DM8168DUCATIPWR_Object;
-
-
-/*!
- * @brief Defines DM8168DUCATIPWR object handle
- */
-typedef struct DM8168DUCATIPWR_Object * DM8168DUCATIPWR_Handle;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-
-/* Function to get the default configuration for the DM8168DUCATIPWR module. */
-Void DM8168DUCATIPWR_getConfig (DM8168DUCATIPWR_Config * cfg);
-
-/* Function to setup the DM8168DUCATIPWR module. */
-Int DM8168DUCATIPWR_setup (DM8168DUCATIPWR_Config * cfg);
-
-/* Function to destroy the DM8168DUCATIPWR module. */
-Int DM8168DUCATIPWR_destroy (Void);
-
-/* Function to initialize the parameters for this PwrMgr instance. */
-Void DM8168DUCATIPWR_Params_init (DM8168DUCATIPWR_Params * params);
-
-/* Function to create an instance of this PwrMgr. */
-DM8168DUCATIPWR_Handle DM8168DUCATIPWR_create ( UInt16 procId,
- const DM8168DUCATIPWR_Params * params);
-
-/* Function to delete an instance of this PwrMgr. */
-Int DM8168DUCATIPWR_delete (DM8168DUCATIPWR_Handle * handlePtr);
-
-/* Function to open an instance of this PwrMgr. */
-Int DM8168DUCATIPWR_open (DM8168DUCATIPWR_Handle * handlePtr, UInt16 procId);
-
-/* Function to close an instance of this PwrMgr. */
-Int DM8168DUCATIPWR_close (DM8168DUCATIPWR_Handle * handlePtr);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* DM8168DUCATIPWR_H_0xa860 */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168IpcInt.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168IpcInt.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/**
- * @file Dm8168IpcInt.h
- *
- * @brief Header file for OMAP3530 DSP IPC interrupts
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-
-#if !defined (DM8168IPCINT_H)
-#define DM8168IPCINT_H
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif /* defined (__cplusplus) */
-
-
-/*!
- * @def DM8168IPCINT_MODULEID
- * @brief Module ID for Notify.
- */
-#define DM8168IPCINT_MODULEID (UInt16) 0x5f85
-
-
-/* =============================================================================
- * All success and failure codes for the module
- * =============================================================================
- */
-
-/*!
- * @def DM8168IPCINT_STATUSCODEBASE
- * @brief Status code base for DM8168IPCINT module.
- */
-#define DM8168IPCINT_STATUSCODEBASE (DM8168IPCINT_MODULEID << 12u)
-
-/*!
- * @def DM8168IPCINT_MAKE_FAILURE
- * @brief Macro to make error code.
- */
-#define DM8168IPCINT_MAKE_FAILURE(x) ((Int)( 0x80000000 \
- | (DM8168IPCINT_STATUSCODEBASE + (x))))
-
-/*!
- * @def DM8168IPCINT_MAKE_SUCCESS
- *
- * @brief Macro to make success code.
- */
-#define DM8168IPCINT_MAKE_SUCCESS(x)(DM8168IPCINT_STATUSCODEBASE +(x))
-
-/*!
- * @def DM8168IPCINT_E_FAIL
- * @brief Generic failure.
- */
-#define DM8168IPCINT_E_FAIL DM8168IPCINT_MAKE_FAILURE(1)
-
-/*!
- * @def DM8168IPCINT_E_INVALIDSTATE
- * @brief Generic failure.
- */
-#define DM8168IPCINT_E_INVALIDSTATE DM8168IPCINT_MAKE_FAILURE(2)
-
-/*!
- * @def DM8168IPCINT_E_MEMORY
- * @brief Out of memory error.
- */
-#define DM8168IPCINT_E_MEMORY DM8168IPCINT_MAKE_FAILURE(3)
-/*!
- * @def DM8168IPCINT_SUCCESS
- * @brief Generic failure.
- */
-#define DM8168IPCINT_SUCCESS DM8168IPCINT_MAKE_SUCCESS(0)
-/*!
- * @def DM8168IPCINT_S_ALREADYSETUP
- * @brief Set up already called.
- */
-#define DM8168IPCINT_S_ALREADYSETUP DM8168IPCINT_MAKE_SUCCESS(1)
-
-/*!
- * @def DM8168IPCINT_S_ALREADYREGISTERED
- * @brief ISR already registered.
- */
-#define DM8168IPCINT_S_ALREADYREGISTERED DM8168IPCINT_MAKE_SUCCESS(2)
-/* =============================================================================
- * Structures and enums
- * =============================================================================
- */
-typedef struct Dm8168IpcInt_Config_tag {
- UInt16 procId;
- /*!< Processor id of destination processor. */
- UInt32 recvIntId;
- /* recevive interrupt id */
-} Dm8168IpcInt_Config ;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to setup interrupts for omap3530 */
-Void Dm8168IpcInt_setup (Dm8168IpcInt_Config * cfg);
-
-/* Function to destroy interrupt setup for omap3530 */
-Void Dm8168IpcInt_destroy (Void);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-
-#endif /* !defined (DM8168IPCINT_H) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssHal.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssHal.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * @file Dm8168M3DssHal.h
- *
- * @brief Top-level header file for DM8168VPSSM3 Hardware Abstraction Layer.
- *
- * This module is responsible for handling device-specific
- * operations.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VPSSM3HAL_H_0xbbed
-#define DM8168VPSSM3HAL_H_0xbbed
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Dm8168M3DssHalMmu.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-/*!
- * @brief Register access method.
- */
-#define REG(x) *((volatile UInt32 *) (x))
-
-/*!
- * @brief Hardware Abstraction object.
- */
-typedef struct DM8168VPSSM3_HalObject_tag {
- UInt32 generalCtrlBase;
- /*!< Virtual base address of the General Control module. */
- UInt32 prcmBase;
- /*!< Virtual base address of the General Control module. */
- UInt32 mmuBase;
- /*!< Base address of the MMU module. */
- UInt32 procId;
- /*!< Processor ID. */
- DM8168VPSSM3_HalMmuObject mmuObj;
- /*!< MMU abstraction. */
-} DM8168VPSSM3_HalObject;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to initialize the HAL object */
-Int DM8168VPSSM3_halInit (Ptr * halObj, Ptr params);
-
-/* Function to finalize the HAL object */
-Int DM8168VPSSM3_halExit (Ptr halObj);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168M3DssHal_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssHalBoot.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssHalBoot.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file Dm8168M3DssHalBoot.h
- *
- * @brief Boot control module header file.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VPSSM3HALBOOT_H_0xbbef
-#define DM8168VPSSM3HALBOOT_H_0xbbef
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control boot operations for this slave device. */
-Int DM8168VPSSM3_halBootCtrl (Ptr halObj, Processor_BootCtrlCmd cmd, Ptr arg);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168M3DssHalBoot_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssHalMmu.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssHalMmu.h
+++ /dev/null
@@ -1,310 +0,0 @@
-/**
- * @file Dm8168M3DssHalMmu.h
- *
- * @brief Hardware abstraction for Memory Management Unit module.
- *
- * This module is responsible for handling slave MMU related
- * hardware- specific operations.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VPSSM3HALMMU_H_0xbbef
-#define DM8168VPSSM3HALMMU_H_0xbbef
-
-
-/* OSAL and utils headers */
-#include <ti/syslink/utils/List.h>
-#include <OsalIsr.h>
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Dm8168M3DssProc.h>
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-/*Linux specific headers*/
-#include <plat/iommu.h>
-#include <plat/iovmm.h>
-#include <asm/page.h>
-#include <linux/pagemap.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros
- * =============================================================================
- */
-/*!
- * @brief Mmu Sysconfig register offset
- */
-#define MMU_SYSCONFIG_OFFSET 0x10
-/*!
- * @brief Mmu Sysstatus register offset
- */
-
-#define MMU_SYSSTATUS_OFFSET 0x14
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_IRQSTATUS_OFFSET 0x18
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_IRQENABLE_OFFSET 0x1C
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_CNTL_OFFSET 0x44
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_FAULT_AD_OFFSET 0x48
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_LOCK_OFFSET 0x50
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_LD_TBL_OFFSET 0x54
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_CAM_OFFSET 0x58
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_RAM_OFFSET 0x5C
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_FLUSH_ENTRY 0x64
-
-/*!
- * @brief CAM register field values
- */
-#define MMU_CAM_PRESERVE (1 << 3)
-/*!
- * @brief CAM register field values
- */
-
-#define MMU_CAM_VALID (1 << 2)
-
-/*!
- * @brief Addresses lower than this do not go through the VPSS's MMU
- */
-#define MMU_GLOBAL_MEMORY 0x11000000
-
-/*!
- * @brief Faults to enable (MULTIHITFAULT and TLBMISS)
- */
-#define MMU_IRQENABLE_FAULTS 0x11
-
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_4KB 0x1000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_64KB 0x10000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_1MB 0x100000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_16MB 0x1000000
-/*
- * "L2 table" address mask and size definitions.
- */
-#define IOPGD_SHIFT 20
-#define IOPGD_SIZE (1UL << IOPGD_SHIFT)
-#define IOPGD_MASK (~(IOPGD_SIZE - 1))
-
-/*
- * "small page" address mask and size definitions.
- */
-#define IOPTE_SHIFT 12
-#define IOPTE_SIZE (1UL << IOPTE_SHIFT)
-#define IOPTE_MASK (~(IOPTE_SIZE - 1))
-#define IOPAGE_MASK IOPTE_MASK
-
-#define PTRS_PER_IOPGD (1UL << (32 - IOPGD_SHIFT))
-
-/* to find an entry in a page-table-directory */
-#define iopgd_index(da) (((da) >> IOPGD_SHIFT) & (PTRS_PER_IOPGD - 1))
-#define iopgd_offset(obj, da) ((obj)->iopgd + iopgd_index(da))
-
-
-/* =============================================================================
- * Enums
- * =============================================================================
- */
-/*!
- * @brief enum for Element size.
- */
-enum Dm8168VpssM3_Hal_Mmu_Element_Size_tag {
- ELEM_SIZE_8BIT,
- ELEM_SIZE_16BIT,
- ELEM_SIZE_32BIT,
- ELEM_SIZE_64BIT
-};
-
-/*!
- * @brief enum for endianism.
- */
-enum Dm8168VpssM3_Hal_Mmu_Endianism_tag {
- LITTLE_ENDIAN,
- BIG_ENDIAN
-};
-
-/*!
- * @brief enum for endianism.
- */
-enum Dm8168VpssM3_Hal_Mmu_Mixed_Size_tag {
- MMU_TLBES,
- MMU_CPUES
-};
-
-/* =============================================================================
- * structs
- * =============================================================================
- */
-
-/*!
- * @brief Hardware Abstraction object for MMU module.
- */
-#if defined(SYSLINK_BUILD_HLOS)
-typedef struct DM8168VPSSM3_HalMmuObject_tag {
- UInt32 mmuFaultAddr;
- /*!< Pointer to IsrObject. */
- struct clk * clkHandle;
-#if defined(SYSLINK_BUILDOS_LINUX)
- /*!< Enables and disables the iva2_ck clock. */
- struct platform_device iva2Device;
- /*!< Pltdorm device defined for iva2 sub system. */
- struct iommu * vpssMmuHandler;
- /*!< Mmu handle returned by iommu_get. */
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-} DM8168VPSSM3_HalMmuObject;
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-#if defined(SYSLINK_BUILD_RTOS)
-typedef struct DM8168VPSSM3_HalMmuObject_tag {
- UInt32 mmuFaultAddr;
- /*!< Pointer to IsrObject. */
- Ptr clkHandle;
- /*!< Enables and disables the iva2_ck clock. */
- UInt32 iva2Device;
- /*!< Pltdorm device defined for iva2 sub system. */
- Ptr vpssMmuHandler;
- /*!< Mmu handle returned by iommu_get. */
-} DM8168VPSSM3_HalMmuObject;
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_Enable
- */
-typedef struct DM8168VPSSM3_HalMmuCtrlArgs_Enable_tag {
- UInt32 numMemEntries;
- /*!< Number of memory regions to be configured. */
- ProcMgr_AddrInfo * memEntries;
- /*!< Array of information structures for memory regions to be configured. */
-} DM8168VPSSM3_HalMmuCtrlArgs_Enable;
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_AddEntry
- */
-typedef struct DM8168VPSSM3_HalMmuEntryInfo_tag {
- UInt32 slaveVirtAddr;
- /*!< Slave address to be mapped */
- UInt32 size;
- /*!< Size (in bytes) of region to be mapped */
- UInt32 masterPhyAddr;
- /*!< Mapped address in host address space */
- UInt32 elementSize;
- /*!< element size */
- UInt32 endianism;
- /*!< Little / big endian */
- UInt32 mixedSize;
- /*!< Types of pages in on segment*/
-}DM8168VPSSM3_HalMmuEntryInfo ;
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_DeleteEntry
- */
-typedef DM8168VPSSM3_HalMmuEntryInfo DM8168VPSSM3_HalMmuCtrlArgs_AddEntry;
-typedef DM8168VPSSM3_HalMmuEntryInfo DM8168VPSSM3_HalMmuCtrlArgs_DeleteEntry;
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control MMU operations for this slave device. */
-Int DM8168VPSSM3_halMmuCtrl (Ptr halObj, Processor_MmuCtrlCmd cmd, Ptr arg);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168M3DssHalMmu_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssHalReset.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssHalReset.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file Dm8168M3DssHalReset.h
- *
- * @brief Reset control module header file.
- *
- * This module is responsible for handling reset-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VPSSM3HALRESET_H_0xbbef
-#define DM8168VPSSM3HALRESET_H_0xbbef
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control reset operations for this slave device. */
-Int DM8168VPSSM3_halResetCtrl (Ptr halObj, Processor_ResetCtrlCmd cmd, Ptr args);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168M3DssHalReset_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssPhyShmem.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssPhyShmem.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * @file Dm8168M3DssPhyShmem.h
- *
- * @brief Physical Interface Abstraction Layer for DM8168VPSSM3.
- *
- * This file contains the definitions for shared memory physical
- * link being used with DM8168VPSSM3.
- * The implementation is specific to DM8168VPSSM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VPSSM3PHYSHMEM_H_0xbbed
-#define DM8168VPSSM3PHYSHMEM_H_0xbbed
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-/*!
- * @brief Base addresses of L2_RAM for Ducati.
- */
-#define GENERAL_CONTROL_BASE 0x55020000
-
-#define VPSSM3_BOOT_ADDR (GENERAL_CONTROL_BASE + 0x4)
-
-#define VPSSM3_BOOT_ADDR_SIZE 0x4
-/*!
- * @brief Base addresses of PRCM module.
- */
-#define PRCM_BASE_ADDR 0x48180000
-/*!
- * @brief Base addresses of different peripherals.
- */
-
-#define PRCM_SIZE 0x00002FFF
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Initializes Shared Driver/device. */
-Int DM8168VPSSM3_phyShmemInit (Ptr halObj);
-
-/* Finalizes Shared Driver/device. */
-Int DM8168VPSSM3_phyShmemExit (Ptr halObj);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* dm8168_phy_shmem_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssProc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3DssProc.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/**
- * @file Dm8168M3DssProc.h
- *
- * @brief Processor interface for DM8168SLAVE.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef DM8168VPSSM3PROC_H_0xbbef
-#define DM8168VPSSM3PROC_H_0xbbef
-
-
-/* Module headers */
-#include <ti/syslink/ProcMgr.h>
-#include <ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/*!
- * @def DM8168VPSSM3PROC_MODULEID
- * @brief Module ID for DM8168SLAVE.
- */
-#define DM8168VPSSM3PROC_MODULEID (UInt16) 0xbbec
-
-/* =============================================================================
- * All success and failure codes for the module
- * =============================================================================
- */
-/*!
- * @def DM8168VPSSM3PROC_STATUSCODEBASE
- * @brief Error code base for ProcMgr.
- */
-#define DM8168VPSSM3PROC_STATUSCODEBASE (DM8168VPSSM3PROC_MODULEID << 12u)
-
-/*!
- * @def DM8168VPSSM3PROC_MAKE_FAILURE
- * @brief Macro to make failure code.
- */
-#define DM8168VPSSM3PROC_MAKE_FAILURE(x) ((Int)( 0x80000000 \
- | (DM8168VPSSM3PROC_STATUSCODEBASE + (x))))
-
-/*!
- * @def DM8168VPSSM3PROC_MAKE_SUCCESS
- * @brief Macro to make success code.
- */
-#define DM8168VPSSM3PROC_MAKE_SUCCESS(x) (DM8168VPSSM3PROC_STATUSCODEBASE + (x))
-
-/*!
- * @def DM8168VPSSM3PROC_E_MMUENTRYEXISTS
- * @brief Specified MMU entry already exists.
- */
-#define DM8168VPSSM3PROC_E_MMUENTRYEXISTS DM8168VPSSM3PROC_MAKE_FAILURE(1)
-
-/*!
- * @def DM8168VPSSM3PROC_E_ISR
- * @brief Error occurred during ISR operation.
- */
-#define DM8168VPSSM3PROC_E_ISR DM8168VPSSM3PROC_MAKE_FAILURE(2)
-
-/*!
- * @def DM8168VPSSM3PROC_E_MMUCONFIG
- * @brief Error occurred during MMU configuration
- */
-#define DM8168VPSSM3PROC_E_MMUCONFIG DM8168VPSSM3PROC_MAKE_FAILURE(3)
-
-/*!
- * @def DM8168VPSSM3PROC_E_OSFAILURE
- * @brief Failure in an OS-specific operation.
- */
-#define DM8168VPSSM3PROC_E_OSFAILURE DM8168VPSSM3PROC_MAKE_FAILURE(4)
-
-/*!
- * @def DM8168VPSSM3PROC_E_INVALIDARG
- * @brief Argument passed to a function is invalid.
- */
-#define DM8168VPSSM3PROC_E_INVALIDARG DM8168VPSSM3PROC_MAKE_FAILURE(5)
-
-/*!
- * @def DM8168VPSSM3PROC_E_MEMORY
- * @brief Memory allocation failed.
- */
-#define DM8168VPSSM3PROC_E_MEMORY DM8168VPSSM3PROC_MAKE_FAILURE(6)
-
-/*!
- * @def DM8168VPSSM3PROC_E_HANDLE
- * @brief Invalid object handle specified
- */
-#define DM8168VPSSM3PROC_E_HANDLE DM8168VPSSM3PROC_MAKE_FAILURE(7)
-
-/*!
- * @def DM8168VPSSM3PROC_E_ACCESSDENIED
- * @brief The operation is not permitted in this process.
- */
-#define DM8168VPSSM3PROC_E_ACCESSDENIED DM8168VPSSM3PROC_MAKE_FAILURE(8)
-
-/*!
- * @def DM8168VPSSM3PROC_E_FAIL
- * @brief Generic failure.
- */
-#define DM8168VPSSM3PROC_E_FAIL DM8168VPSSM3PROC_MAKE_FAILURE(9)
-
-/*!
- * @def DM8168VPSSM3PROC_SUCCESS
- * @brief Operation successful.
- */
-#define DM8168VPSSM3PROC_SUCCESS DM8168VPSSM3PROC_MAKE_SUCCESS(0)
-
-/*!
- * @def DM8168VPSSM3PROC_S_ALREADYSETUP
- * @brief The DM8168VPSSM3PROC module has already been setup in this process.
- */
-#define DM8168VPSSM3PROC_S_ALREADYSETUP DM8168VPSSM3PROC_MAKE_SUCCESS(1)
-
-/*!
- * @def DM8168VPSSM3PROC_S_OPENHANDLE
- * @brief Other DM8168VPSSM3PROC clients have still setup the
- * DM8168VPSSM3PROC module.
- */
-#define DM8168VPSSM3PROC_S_SETUP DM8168VPSSM3PROC_MAKE_SUCCESS(2)
-
-/*!
- * @def DM8168VPSSM3PROC_S_OPENHANDLE
- * @brief Other DM8168VPSSM3PROC handles are still open in this process.
- */
-#define DM8168VPSSM3PROC_S_OPENHANDLE DM8168VPSSM3PROC_MAKE_SUCCESS(3)
-
-/*!
- * @def DM8168VPSSM3PROC_S_ALREADYEXISTS
- * @brief The DM8168VPSSM3PROC instance has already been created/opened in this
- * process
- */
-#define DM8168VPSSM3PROC_S_ALREADYEXISTS DM8168VPSSM3PROC_MAKE_SUCCESS(4)
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Module configuration structure.
- */
-typedef struct DM8168VPSSM3PROC_Config {
- UInt32 reserved; /*!< Reserved field (not currently required) */
-} DM8168VPSSM3PROC_Config;
-
-/*!
- * @brief Configuration parameters specific to this processor.
- */
-typedef struct DM8168VPSSM3PROC_Params_tag {
- Bool mmuEnable;
- /*!< Determines if mmu should be used (enabled) */
- UInt32 numMemEntries;
- /*!< Number of memory regions to be configured. */
- ProcMgr_AddrInfo memEntries[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< Array of information structures for memory regions to be configured. */
-} DM8168VPSSM3PROC_Params;
-
-/*!
- * @brief Defines DM8168VPSSM3PROC object handle
- */
-typedef struct DM8168VPSSM3PROC_Object * DM8168VPSSM3PROC_Handle;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-
-/* Function to get the default configuration for the DM8168VPSSM3PROC module. */
-Void DM8168VPSSM3PROC_getConfig (DM8168VPSSM3PROC_Config * cfg);
-
-/* Function to setup the DM8168VPSSM3PROC module. */
-Int DM8168VPSSM3PROC_setup (DM8168VPSSM3PROC_Config * cfg);
-
-/* Function to destroy the DM8168VPSSM3PROC module. */
-Int DM8168VPSSM3PROC_destroy (Void);
-
-/* Function to initialize the parameters for this processor instance. */
-Void DM8168VPSSM3PROC_Params_init (DM8168VPSSM3PROC_Handle handle,
- DM8168VPSSM3PROC_Params * params);
-
-/* Function to create an instance of this processor. */
-DM8168VPSSM3PROC_Handle DM8168VPSSM3PROC_create ( UInt16 procId,
- const DM8168VPSSM3PROC_Params * params);
-
-/* Function to delete an instance of this processor. */
-Int DM8168VPSSM3PROC_delete (DM8168VPSSM3PROC_Handle * handlePtr);
-
-/* Function to open an instance of this processor. */
-Int DM8168VPSSM3PROC_open (DM8168VPSSM3PROC_Handle * handlePtr, UInt16 procId);
-
-/* Function to close an instance of this processor. */
-Int DM8168VPSSM3PROC_close (DM8168VPSSM3PROC_Handle * handlePtr);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* DM8168VPSSM3PROC_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoHal.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoHal.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * @file Dm8168M3VideoHal.h
- *
- * @brief Top-level header file for DM8168VIDEOM3 Hardware Abstraction Layer.
- *
- * This module is responsible for handling device-specific
- * operations.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VIDEOM3HAL_H_0xbbed
-#define DM8168VIDEOM3HAL_H_0xbbed
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Dm8168M3VideoHalMmu.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-/*!
- * @brief Register access method.
- */
-#define REG(x) *((volatile UInt32 *) (x))
-
-/*!
- * @brief Hardware Abstraction object.
- */
-typedef struct DM8168VIDEOM3_HalObject_tag {
- UInt32 generalCtrlBase;
- /*!< Virtual base address of the General Control module. */
- UInt32 prcmBase;
- /*!< Virtual base address of the General Control module. */
- UInt32 mmuBase;
- /*!< Base address of the MMU module. */
- UInt32 procId;
- /*!< Processor ID. */
- DM8168VIDEOM3_HalMmuObject mmuObj;
- /*!< MMU abstraction. */
-} DM8168VIDEOM3_HalObject;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to initialize the HAL object */
-Int DM8168VIDEOM3_halInit (Ptr * halObj, Ptr params);
-
-/* Function to finalize the HAL object */
-Int DM8168VIDEOM3_halExit (Ptr halObj);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168M3VideoHal_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoHalBoot.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoHalBoot.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file Dm8168M3VideoHalBoot.h
- *
- * @brief Boot control module header file.
- *
- * This module is responsible for handling boot-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VIDEOM3HALBOOT_H_0xbbee
-#define DM8168VIDEOM3HALBOOT_H_0xbbee
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control boot operations for this slave device. */
-Int DM8168VIDEOM3_halBootCtrl (Ptr halObj, Processor_BootCtrlCmd cmd, Ptr arg);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168M3VideoHalBoot_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoHalMmu.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoHalMmu.h
+++ /dev/null
@@ -1,310 +0,0 @@
-/**
- * @file Dm8168M3VideoHalMmu.h
- *
- * @brief Hardware abstraction for Memory Management Unit module.
- *
- * This module is responsible for handling slave MMU related
- * hardware- specific operations.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VIDEOM3HALMMU_H_0xbbee
-#define DM8168VIDEOM3HALMMU_H_0xbbee
-
-
-/* OSAL and utils headers */
-#include <ti/syslink/utils/List.h>
-#include <OsalIsr.h>
-
-/* Module level headers */
-#include <_ProcDefs.h>
-#include <Dm8168M3VideoProc.h>
-
-#if defined(SYSLINK_BUILDOS_LINUX)
-/*Linux specific headers*/
-#include <plat/iommu.h>
-#include <plat/iovmm.h>
-#include <asm/page.h>
-#include <linux/pagemap.h>
-#include <linux/platform_device.h>
-#include <linux/clk.h>
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros
- * =============================================================================
- */
-/*!
- * @brief Mmu Sysconfig register offset
- */
-#define MMU_SYSCONFIG_OFFSET 0x10
-/*!
- * @brief Mmu Sysstatus register offset
- */
-
-#define MMU_SYSSTATUS_OFFSET 0x14
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_IRQSTATUS_OFFSET 0x18
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_IRQENABLE_OFFSET 0x1C
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_CNTL_OFFSET 0x44
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_FAULT_AD_OFFSET 0x48
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_LOCK_OFFSET 0x50
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_LD_TBL_OFFSET 0x54
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_CAM_OFFSET 0x58
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_RAM_OFFSET 0x5C
-/*!
- * @brief Offsets from the MMU base address
- */
-
-#define MMU_FLUSH_ENTRY 0x64
-
-/*!
- * @brief CAM register field values
- */
-#define MMU_CAM_PRESERVE (1 << 3)
-/*!
- * @brief CAM register field values
- */
-
-#define MMU_CAM_VALID (1 << 2)
-
-/*!
- * @brief Addresses lower than this do not go through the VIDEOM3's MMU
- */
-#define MMU_GLOBAL_MEMORY 0x11000000
-
-/*!
- * @brief Faults to enable (MULTIHITFAULT and TLBMISS)
- */
-#define MMU_IRQENABLE_FAULTS 0x11
-
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_4KB 0x1000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_64KB 0x10000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_1MB 0x100000
-/*!
- * @brief Page size constants
- */
-#define PAGE_SIZE_16MB 0x1000000
-/*
- * "L2 table" address mask and size definitions.
- */
-#define IOPGD_SHIFT 20
-#define IOPGD_SIZE (1UL << IOPGD_SHIFT)
-#define IOPGD_MASK (~(IOPGD_SIZE - 1))
-
-/*
- * "small page" address mask and size definitions.
- */
-#define IOPTE_SHIFT 12
-#define IOPTE_SIZE (1UL << IOPTE_SHIFT)
-#define IOPTE_MASK (~(IOPTE_SIZE - 1))
-#define IOPAGE_MASK IOPTE_MASK
-
-#define PTRS_PER_IOPGD (1UL << (32 - IOPGD_SHIFT))
-
-/* to find an entry in a page-table-directory */
-#define iopgd_index(da) (((da) >> IOPGD_SHIFT) & (PTRS_PER_IOPGD - 1))
-#define iopgd_offset(obj, da) ((obj)->iopgd + iopgd_index(da))
-
-
-/* =============================================================================
- * Enums
- * =============================================================================
- */
-/*!
- * @brief enum for Element size.
- */
-enum Dm8168VideoM3_Hal_Mmu_Element_Size_tag {
- ELEM_SIZE_8BIT,
- ELEM_SIZE_16BIT,
- ELEM_SIZE_32BIT,
- ELEM_SIZE_64BIT
-};
-
-/*!
- * @brief enum for endianism.
- */
-enum Dm8168VideoM3_Hal_Mmu_Endianism_tag {
- LITTLE_ENDIAN,
- BIG_ENDIAN
-};
-
-/*!
- * @brief enum for endianism.
- */
-enum Dm8168VideoM3_Hal_Mmu_Mixed_Size_tag {
- MMU_TLBES,
- MMU_CPUES
-};
-
-/* =============================================================================
- * structs
- * =============================================================================
- */
-
-/*!
- * @brief Hardware Abstraction object for MMU module.
- */
-#if defined(SYSLINK_BUILD_HLOS)
-typedef struct DM8168VIDEOM3_HalMmuObject_tag {
- UInt32 mmuFaultAddr;
- /*!< Pointer to IsrObject. */
- struct clk * clkHandle;
-#if defined(SYSLINK_BUILDOS_LINUX)
- /*!< Enables and disables the iva2_ck clock. */
- struct platform_device iva2Device;
- /*!< Pltdorm device defined for iva2 sub system. */
- struct iommu * videoMmuHandler;
- /*!< Mmu handle returned by iommu_get. */
-#endif /* #if defined(SYSLINK_BUILDOS_LINUX) */
-} DM8168VIDEOM3_HalMmuObject;
-#endif /* #if defined(SYSLINK_BUILD_HLOS) */
-#if defined(SYSLINK_BUILD_RTOS)
-typedef struct DM8168VIDEOM3_HalMmuObject_tag {
- UInt32 mmuFaultAddr;
- /*!< Pointer to IsrObject. */
- Ptr clkHandle;
- /*!< Enables and disables the iva2_ck clock. */
- UInt32 iva2Device;
- /*!< Pltdorm device defined for iva2 sub system. */
- Ptr videoMmuHandler;
- /*!< Mmu handle returned by iommu_get. */
-} DM8168VIDEOM3_HalMmuObject;
-#endif /* #if defined(SYSLINK_BUILD_RTOS) */
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_Enable
- */
-typedef struct DM8168VIDEOM3_HalMmuCtrlArgs_Enable_tag {
- UInt32 numMemEntries;
- /*!< Number of memory regions to be configured. */
- ProcMgr_AddrInfo * memEntries;
- /*!< Array of information structures for memory regions to be configured. */
-} DM8168VIDEOM3_HalMmuCtrlArgs_Enable;
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_AddEntry
- */
-typedef struct DM8168VIDEOM3_HalMmuEntryInfo_tag {
- UInt32 slaveVirtAddr;
- /*!< Slave address to be mapped */
- UInt32 size;
- /*!< Size (in bytes) of region to be mapped */
- UInt32 masterPhyAddr;
- /*!< Mapped address in host address space */
- UInt32 elementSize;
- /*!< element size */
- UInt32 endianism;
- /*!< Little / big endian */
- UInt32 mixedSize;
- /*!< Types of pages in on segment*/
-}DM8168VIDEOM3_HalMmuEntryInfo ;
-
-/*!
- * @brief Args type for Processor_MmuCtrlCmd_DeleteEntry
- */
-typedef DM8168VIDEOM3_HalMmuEntryInfo DM8168VIDEOM3_HalMmuCtrlArgs_AddEntry;
-typedef DM8168VIDEOM3_HalMmuEntryInfo DM8168VIDEOM3_HalMmuCtrlArgs_DeleteEntry;
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control MMU operations for this slave device. */
-Int DM8168VIDEOM3_halMmuCtrl (Ptr halObj, Processor_MmuCtrlCmd cmd, Ptr arg);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168M3VideoHalMmu_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoHalReset.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoHalReset.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * @file Dm8168M3VideoHalReset.h
- *
- * @brief Reset control module header file.
- *
- * This module is responsible for handling reset-related hardware-
- * specific operations.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VIDEOM3HALRESET_H_0xbbee
-#define DM8168VIDEOM3HALRESET_H_0xbbee
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control reset operations for this slave device. */
-Int DM8168VIDEOM3_halResetCtrl (Ptr halObj, Processor_ResetCtrlCmd cmd, Ptr args);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* Dm8168M3VideoHalReset_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoPhyShmem.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoPhyShmem.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * @file Dm8168M3VideoPhyShmem.h
- *
- * @brief Physical Interface Abstraction Layer for DM8168VIDEOM3.
- *
- * This file contains the definitions for shared memory physical
- * link being used with DM8168VIDEOM3.
- * The implementation is specific to DM8168VIDEOM3.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168VIDEOM3PHYSHMEM_H_0xbbed
-#define DM8168VIDEOM3PHYSHMEM_H_0xbbed
-
-
-/* Module level headers */
-#include <_ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See _ProcDefs.h
- * =============================================================================
- */
-/*!
- * @brief Base addresses of L2_RAM for Ducati.
- */
-#define GENERAL_CONTROL_BASE 0x55020000
-
-#define VIDEOM3_BOOT_ADDR (GENERAL_CONTROL_BASE + 0x4)
-
-#define VIDEOM3_BOOT_ADDR_SIZE 0x4
-/*!
- * @brief Base addresses of PRCM module.
- */
-#define PRCM_BASE_ADDR 0x48180000
-/*!
- * @brief Base addresses of different peripherals.
- */
-
-#define PRCM_SIZE 0x00002FFF
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Initializes Shared Driver/device. */
-Int DM8168VIDEOM3_phyShmemInit (Ptr halObj);
-
-/* Finalizes Shared Driver/device. */
-Int DM8168VIDEOM3_phyShmemExit (Ptr halObj);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* dm8168_phy_shmem_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoProc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Dm8168M3VideoProc.h
+++ /dev/null
@@ -1,246 +0,0 @@
-/**
- * @file Dm8168M3VideoProc.h
- *
- * @brief Processor interface for DM8168SLAVE.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef DM8168VIDEOM3PROC_H_0xbbed
-#define DM8168VIDEOM3PROC_H_0xbbed
-
-
-/* Module headers */
-#include <ti/syslink/ProcMgr.h>
-#include <ProcDefs.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/*!
- * @def DM8168VIDEOM3PROC_MODULEID
- * @brief Module ID for DM8168SLAVE.
- */
-#define DM8168VIDEOM3PROC_MODULEID (UInt16) 0xbbec
-
-/* =============================================================================
- * All success and failure codes for the module
- * =============================================================================
- */
-/*!
- * @def DM8168VIDEOM3PROC_STATUSCODEBASE
- * @brief Error code base for ProcMgr.
- */
-#define DM8168VIDEOM3PROC_STATUSCODEBASE (DM8168VIDEOM3PROC_MODULEID << 12u)
-
-/*!
- * @def DM8168VIDEOM3PROC_MAKE_FAILURE
- * @brief Macro to make failure code.
- */
-#define DM8168VIDEOM3PROC_MAKE_FAILURE(x) ((Int)( 0x80000000 \
- | (DM8168VIDEOM3PROC_STATUSCODEBASE + (x))))
-
-/*!
- * @def DM8168VIDEOM3PROC_MAKE_SUCCESS
- * @brief Macro to make success code.
- */
-#define DM8168VIDEOM3PROC_MAKE_SUCCESS(x) (DM8168VIDEOM3PROC_STATUSCODEBASE + (x))
-
-/*!
- * @def DM8168VIDEOM3PROC_E_MMUENTRYEXISTS
- * @brief Specified MMU entry already exists.
- */
-#define DM8168VIDEOM3PROC_E_MMUENTRYEXISTS DM8168VIDEOM3PROC_MAKE_FAILURE(1)
-
-/*!
- * @def DM8168VIDEOM3PROC_E_ISR
- * @brief Error occurred during ISR operation.
- */
-#define DM8168VIDEOM3PROC_E_ISR DM8168VIDEOM3PROC_MAKE_FAILURE(2)
-
-/*!
- * @def DM8168VIDEOM3PROC_E_MMUCONFIG
- * @brief Error occurred during MMU configuration
- */
-#define DM8168VIDEOM3PROC_E_MMUCONFIG DM8168VIDEOM3PROC_MAKE_FAILURE(3)
-
-/*!
- * @def DM8168VIDEOM3PROC_E_OSFAILURE
- * @brief Failure in an OS-specific operation.
- */
-#define DM8168VIDEOM3PROC_E_OSFAILURE DM8168VIDEOM3PROC_MAKE_FAILURE(4)
-
-/*!
- * @def DM8168VIDEOM3PROC_E_INVALIDARG
- * @brief Argument passed to a function is invalid.
- */
-#define DM8168VIDEOM3PROC_E_INVALIDARG DM8168VIDEOM3PROC_MAKE_FAILURE(5)
-
-/*!
- * @def DM8168VIDEOM3PROC_E_MEMORY
- * @brief Memory allocation failed.
- */
-#define DM8168VIDEOM3PROC_E_MEMORY DM8168VIDEOM3PROC_MAKE_FAILURE(6)
-
-/*!
- * @def DM8168VIDEOM3PROC_E_HANDLE
- * @brief Invalid object handle specified
- */
-#define DM8168VIDEOM3PROC_E_HANDLE DM8168VIDEOM3PROC_MAKE_FAILURE(7)
-
-/*!
- * @def DM8168VIDEOM3PROC_E_ACCESSDENIED
- * @brief The operation is not permitted in this process.
- */
-#define DM8168VIDEOM3PROC_E_ACCESSDENIED DM8168VIDEOM3PROC_MAKE_FAILURE(8)
-
-/*!
- * @def DM8168VIDEOM3PROC_E_FAIL
- * @brief Generic failure.
- */
-#define DM8168VIDEOM3PROC_E_FAIL DM8168VIDEOM3PROC_MAKE_FAILURE(9)
-
-/*!
- * @def DM8168VIDEOM3PROC_SUCCESS
- * @brief Operation successful.
- */
-#define DM8168VIDEOM3PROC_SUCCESS DM8168VIDEOM3PROC_MAKE_SUCCESS(0)
-
-/*!
- * @def DM8168VIDEOM3PROC_S_ALREADYSETUP
- * @brief The DM8168VIDEOM3PROC module has already been setup in this process.
- */
-#define DM8168VIDEOM3PROC_S_ALREADYSETUP DM8168VIDEOM3PROC_MAKE_SUCCESS(1)
-
-/*!
- * @def DM8168VIDEOM3PROC_S_OPENHANDLE
- * @brief Other DM8168VIDEOM3PROC clients have still setup the DM8168VIDEOM3PROC module.
- */
-#define DM8168VIDEOM3PROC_S_SETUP DM8168VIDEOM3PROC_MAKE_SUCCESS(2)
-
-/*!
- * @def DM8168VIDEOM3PROC_S_OPENHANDLE
- * @brief Other DM8168VIDEOM3PROC handles are still open in this process.
- */
-#define DM8168VIDEOM3PROC_S_OPENHANDLE DM8168VIDEOM3PROC_MAKE_SUCCESS(3)
-
-/*!
- * @def DM8168VIDEOM3PROC_S_ALREADYEXISTS
- * @brief The DM8168VIDEOM3PROC instance has already been created/opened in this
- * process
- */
-#define DM8168VIDEOM3PROC_S_ALREADYEXISTS DM8168VIDEOM3PROC_MAKE_SUCCESS(4)
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-/*!
- * @brief Module configuration structure.
- */
-typedef struct DM8168VIDEOM3PROC_Config {
- UInt32 reserved; /*!< Reserved field (not currently required) */
-} DM8168VIDEOM3PROC_Config;
-
-/*!
- * @brief Configuration parameters specific to this processor.
- */
-typedef struct DM8168VIDEOM3PROC_Params_tag {
- Bool mmuEnable;
- /*!< Determines if mmu should be used (enabled) */
- UInt32 numMemEntries;
- /*!< Number of memory regions to be configured. */
- ProcMgr_AddrInfo memEntries[ProcMgr_MAX_MEMORY_REGIONS];
- /*!< Array of information structures for memory regions to be configured. */
-} DM8168VIDEOM3PROC_Params;
-
-/*!
- * @brief Defines DM8168VIDEOM3PROC object handle
- */
-typedef struct DM8168VIDEOM3PROC_Object * DM8168VIDEOM3PROC_Handle;
-
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-
-/* Function to get the default configuration for the DM8168VIDEOM3PROC module. */
-Void DM8168VIDEOM3PROC_getConfig (DM8168VIDEOM3PROC_Config * cfg);
-
-/* Function to setup the DM8168VIDEOM3PROC module. */
-Int DM8168VIDEOM3PROC_setup (DM8168VIDEOM3PROC_Config * cfg);
-
-/* Function to destroy the DM8168VIDEOM3PROC module. */
-Int DM8168VIDEOM3PROC_destroy (Void);
-
-/* Function to initialize the parameters for this processor instance. */
-Void DM8168VIDEOM3PROC_Params_init (DM8168VIDEOM3PROC_Handle handle,
- DM8168VIDEOM3PROC_Params * params);
-
-/* Function to create an instance of this processor. */
-DM8168VIDEOM3PROC_Handle DM8168VIDEOM3PROC_create ( UInt16 procId,
- const DM8168VIDEOM3PROC_Params * params);
-
-/* Function to delete an instance of this processor. */
-Int DM8168VIDEOM3PROC_delete (DM8168VIDEOM3PROC_Handle * handlePtr);
-
-/* Function to open an instance of this processor. */
-Int DM8168VIDEOM3PROC_open (DM8168VIDEOM3PROC_Handle * handlePtr, UInt16 procId);
-
-/* Function to close an instance of this processor. */
-Int DM8168VIDEOM3PROC_close (DM8168VIDEOM3PROC_Handle * handlePtr);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* DM8168VIDEOM3PROC_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Linux/Dm8168DucatiMmu.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/Linux/Dm8168DucatiMmu.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * @file Dm8168DucatiMmu.h
- *
- * @brief Hardware abstraction for Memory Management Unit module.
- *
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-#ifndef DM8168DUCATIMMU_H_0xbbec
-#define DM8168DUCATIMMU_H_0xbbec
-
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-/* Function to control MMU operations for this slave device. */
-Void DM8168DUCATIMMU_enable(PwrMgr_Handle handle);
-/* Function to control MMU operations for this slave device. */
-Void DM8168DUCATIMMU_disable(PwrMgr_Handle handle);
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* omap3530_hal_mmu_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/OMAP4430Dmm.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/OMAP4430Dmm.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * @file OMAP4430Dmm.h
- *
- * @brief Dynamic Memory Management
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2010-2011, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
- /*
- * ======== dmm.h ========
- * Purpose:
- *The Dynamic Memory Mapping(DMM) module manages the DSP Virtual address
- *space that can be directly mapped to any MPU buffer or memory region
- *
- * Public Functions:
- *
- */
-
-#ifndef DMM_4430_
-#define DMM_4430_
-
-typedef unsigned long u32;
-#define false FALSE
-#define true TRUE
-
-#define PAGE_SIZE 4096
-
-int dmm_reserve_memory(u32 size, u32 *p_rsv_addr);
-
-int dmm_unreserve_memory(u32 rsv_addr, u32 *psize);
-
-void dmm_destroy(void);
-
-void dmm_delete_tables(void);
-
-int dmm_create(void);
-
-void dmm_init(void);
-
-int dmm_create_tables(u32 addr, u32 size);
-
-#ifdef DSP_DMM_DEBUG
-int dmm_mem_map_dump(void);
-#endif
-#endif/* DMM_4430_ */
-
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168DspProc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168DspProc.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * @file _Dm8168DspProc.h
- *
- * @brief Internal header for Processor interface for omap3530dsp.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef _DM8168DSPPROC_H_0xbbed
-#define _DM8168DSPPROC_H_0xbbed
-
-
-/* Module level headers */
-#include <ProcDefs.h>
-#include <ti/syslink/ProcMgr.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See ProcDefs.h and Dm8168DspProc.h
- * =============================================================================
- */
-
-
-/* =============================================================================
- * Internal functions accessed through function table
- * =============================================================================
- */
-/* Function to initialize the slave processor */
-Int DM8168DSPPROC_attach (Processor_Handle handle,
- Processor_AttachParams * params);
-
-/* Function to finalize the slave processor */
-Int DM8168DSPPROC_detach (Processor_Handle handle);
-
-/* Function to start the slave processor */
-Int DM8168DSPPROC_start (Processor_Handle handle,
- UInt32 entryPt,
- Processor_StartParams * params);
-
-/* Function to start the stop processor */
-Int DM8168DSPPROC_stop (Processor_Handle handle);
-
-/* Function to read from the slave processor's memory. */
-Int DM8168DSPPROC_read (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer);
-
-/* Function to write into the slave processor's memory. */
-Int DM8168DSPPROC_write (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer);
-
-/* Function to perform device-dependent operations. */
-Int DM8168DSPPROC_control (Processor_Handle handle, Int32 cmd, Ptr arg);
-
-/* Function to translate a slave physical address to master physical address */
-Int DM8168DSPPROC_translate (Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 srcAddr);
-
-/* Function to map slave address to host address space */
-Int DM8168DSPPROC_map (Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 nSegs,
- Memory_SGList * sglist);
-
-/* Function to map slave address to host address space */
-Int DM8168DSPPROC_unmap (Processor_Handle handle,
- UInt32 slaveVirtAddr,
- UInt32 size);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* _DM8168DSPPROC_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168DspPwr.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168DspPwr.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * @file _Dm8168DspPwr.h
- *
- * @brief Internal header for Power Manager interface for dm8168dsp.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef _DM8168DSPPWR_H_0xa861
-#define _DM8168DSPPWR_H_0xa861
-
-
-/* Module level headers */
-#include <PwrDefs.h>
-#include <ti/syslink/ProcMgr.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See PwrDefs.h and Dm8168DspPwr.h
- * =============================================================================
- */
-
-
-/* =============================================================================
- * Internal functions accessed through function table
- * =============================================================================
- */
-/* Function to attach to the PwrMgr. */
-Int DM8168DSPPWR_attach (PwrMgr_Handle handle, PwrMgr_AttachParams * params);
-
-/* Function to detach from the PwrMgr. */
-Int DM8168DSPPWR_detach (PwrMgr_Handle handle);
-
-/* Function to power on the slave processor. */
-Int DM8168DSPPWR_on (PwrMgr_Handle handle);
-
-/* Function to power off the slave processor. */
-Int DM8168DSPPWR_off (PwrMgr_Handle handle, Bool force);
-
-/* TBD: Other functions. */
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* _DM8168DSPPWR_H_0xa860 */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168DucatiPwr.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168DucatiPwr.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * @file _Dm8168DucatiPwr.h
- *
- * @brief Internal header for Power Manager interface for Dm8168M3Video.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef _DM8168DUCATIPWR_H_0xa862
-#define _DM8168DUCATIPWR_H_0xa862
-
-
-/* Module level headers */
-#include <PwrDefs.h>
-#include <ti/syslink/ProcMgr.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See PwrDefs.h and Dm8168DucatiPwr.h
- * =============================================================================
- */
-
-
-/* =============================================================================
- * Internal functions accessed through function table
- * =============================================================================
- */
-/* Function to attach to the PwrMgr. */
-Int DM8168DUCATIPWR_attach (PwrMgr_Handle handle, PwrMgr_AttachParams * params);
-
-/* Function to detach from the PwrMgr. */
-Int DM8168DUCATIPWR_detach (PwrMgr_Handle handle);
-
-/* Function to power on the slave processor. */
-Int DM8168DUCATIPWR_on (PwrMgr_Handle handle);
-
-/* Function to power off the slave processor. */
-Int DM8168DUCATIPWR_off (PwrMgr_Handle handle, Bool force);
-
-/* TBD: Other functions. */
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* _DM8168DUCATIPWR_H_0xa860 */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168IpcInt.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168IpcInt.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/**
- * @file _Dm8168IpcInt.h
- *
- * @brief Internal header file for OMAP3530 DSP IPC interrupts
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-
-#if !defined (_DM8168IPCINT_H)
-#define _DM8168IPCINT_H
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif /* defined (__cplusplus) */
-
-/* Function to register interrupts*/
-Int32 Dm8168IpcInt_interruptRegister (UInt16 procId,
- UInt32 intId,
- ArchIpcInt_CallbackFxn fxn,
- Ptr fxnArgs);
-/* Function to unregister interrupts*/
-Int32 Dm8168IpcInt_interruptUnregister (UInt16 procId);
-/* Function to enable interrupts*/
-Void Dm8168IpcInt_interruptEnable (UInt16 procId, UInt32 intId);
-/*Function to disable interrupts*/
-Void Dm8168IpcInt_interruptDisable (UInt16 procId, UInt32 intId);
-/*Function to wait clear interrupt*/
-Int32 Dm8168IpcInt_waitClearInterrupt (UInt16 procId, UInt32 intId);
-/*Function to interrupt DSP*/
-Int32 Dm8168IpcInt_sendInterrupt (UInt16 procId,
- UInt32 intId,
- UInt32 value);
-/*Function to clear DSP interrupt*/
-UInt32 Dm8168IpcInt_clearInterrupt (UInt16 mboxNum);
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-
-#endif /* !defined (DM8168IPCINT_H) */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168M3DssProc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168M3DssProc.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * @file _Dm8168M3DssProc.h
- *
- * @brief Internal header for Processor interface for omap3530dsp.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef _DM8168VPSSM3PROC_H_0xbbef
-#define _DM8168VPSSM3PROC_H_0xbbef
-
-
-/* Module level headers */
-#include <ProcDefs.h>
-#include <ti/syslink/ProcMgr.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See ProcDefs.h and Dm8168M3DssProc.h
- * =============================================================================
- */
-
-
-/* =============================================================================
- * Internal functions accessed through function table
- * =============================================================================
- */
-/* Function to initialize the slave processor */
-Int DM8168VPSSM3PROC_attach (Processor_Handle handle,
- Processor_AttachParams * params);
-
-/* Function to finalize the slave processor */
-Int DM8168VPSSM3PROC_detach (Processor_Handle handle);
-
-/* Function to start the slave processor */
-Int DM8168VPSSM3PROC_start (Processor_Handle handle,
- UInt32 entryPt,
- Processor_StartParams * params);
-
-/* Function to start the stop processor */
-Int DM8168VPSSM3PROC_stop (Processor_Handle handle);
-
-/* Function to read from the slave processor's memory. */
-Int DM8168VPSSM3PROC_read (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer);
-
-/* Function to write into the slave processor's memory. */
-Int DM8168VPSSM3PROC_write (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer);
-
-/* Function to perform device-dependent operations. */
-Int DM8168VPSSM3PROC_control (Processor_Handle handle, Int32 cmd, Ptr arg);
-
-/* Function to translate a slave physical address to master physical address */
-Int DM8168VPSSM3PROC_translate (Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 srcAddr);
-
-/* Function to map slave address to host address space */
-Int DM8168VPSSM3PROC_map (Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 nSegs,
- Memory_SGList * sglist);
-
-/* Function to unmap slave address to host address space */
-Int DM8168VPSSM3PROC_unmap (Processor_Handle handle,
- UInt32 slaveVirtAddr,
- UInt32 size);
-
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* _DM8168VPSSM3PROC_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168M3VideoProc.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_Dm8168M3VideoProc.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/**
- * @file _Dm8168M3VideoProc.h
- *
- * @brief Internal header for Processor interface for Dm8168M3Video.
- *
- *
- */
-/*
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-#ifndef _DM8168VIDEOM3PROC_H_0xbbee
-#define _DM8168VIDEOM3PROC_H_0xbbee
-
-
-/* Module level headers */
-#include <ProcDefs.h>
-#include <ti/syslink/ProcMgr.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * See ProcDefs.h and Dm8168M3VideoProc.h
- * =============================================================================
- */
-
-
-/* =============================================================================
- * Internal functions accessed through function table
- * =============================================================================
- */
-/* Function to initialize the slave processor */
-Int DM8168VIDEOM3PROC_attach (Processor_Handle handle,
- Processor_AttachParams * params);
-
-/* Function to finalize the slave processor */
-Int DM8168VIDEOM3PROC_detach (Processor_Handle handle);
-
-/* Function to start the slave processor */
-Int DM8168VIDEOM3PROC_start (Processor_Handle handle,
- UInt32 entryPt,
- Processor_StartParams * params);
-
-/* Function to start the stop processor */
-Int DM8168VIDEOM3PROC_stop (Processor_Handle handle);
-
-/* Function to read from the slave processor's memory. */
-Int DM8168VIDEOM3PROC_read (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer);
-
-/* Function to write into the slave processor's memory. */
-Int DM8168VIDEOM3PROC_write (Processor_Handle handle,
- UInt32 procAddr,
- UInt32 * numBytes,
- Ptr buffer);
-
-/* Function to perform device-dependent operations. */
-Int DM8168VIDEOM3PROC_control (Processor_Handle handle, Int32 cmd, Ptr arg);
-
-/* Function to translate a slave physical address to master physical address */
-Int DM8168VIDEOM3PROC_translate (Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 srcAddr);
-
-/* Function to map slave address to host address space */
-Int DM8168VIDEOM3PROC_map (Processor_Handle handle,
- UInt32 * dstAddr,
- UInt32 nSegs,
- Memory_SGList * sglist);
-
-/* Function to unmap slave address to host address space */
-Int DM8168VIDEOM3PROC_unmap (Processor_Handle handle,
- UInt32 slaveVirtAddr,
- UInt32 size);
-
-
-
-#if defined (__cplusplus)
-}
-#endif /* defined (__cplusplus) */
-
-#endif /* _DM8168VIDEOM3PROC_H_0xbbec */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_VAYUDspPwr.h b/qnx/src/ipc3x_dev/ti/syslink/inc/knl/_VAYUDspPwr.h
index 96088dbde31f08310dd8c7c3dc8fae2862c73ba5..653c253791a5cc988eb581a59f39515b19866511 100644 (file)
/**
* @file _VAYUDspPwr.h
*
- * @brief Internal header for Power Manager interface for dm8168dsp.
+ * @brief Internal header for Power Manager interface for vayu dsp.
*
*
*/
diff --git a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/arch/omap5430/Omap5430IpcInt.c b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/arch/omap5430/Omap5430IpcInt.c
index bf841f748702142abf0b19d2e86c8528e87d2bea..1e74b1fa8d5ef6b628cd5031b414d2640d8b47af 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2011-2012, Texas Instruments Incorporated
+ * Copyright (c) 2011-2013, Texas Instruments Incorporated
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#define OMAP5_MAILBOX_IRQENABLE(u) (0x108 + 0x10 * (u))
/* Macro for size of the mailbox FIFO */
-#define OMAP4_MAILBOX_FIFO_LENGTH 4
+#define OMAP5_MAILBOX_FIFO_LENGTH 4
/* Msg elem used to store messages from the remote proc */
typedef struct Omap5430IpcInt_MsgListElem_tag {
Memory_MapInfo mapInfo;
List_Params listParams;
UInt32 msg;
- int max_tries = OMAP4_MAILBOX_FIFO_LENGTH;
+ int max_tries = OMAP5_MAILBOX_FIFO_LENGTH;
GT_1trace (curTrace, GT_ENTER, "Omap5430IpcInt_setup", cfg);
MAILBOX_MESSAGE_m_OFFSET(1));
}
/* Clear the messages in the HOST->CORE0 mailbox */
- max_tries = OMAP4_MAILBOX_FIFO_LENGTH;
+ max_tries = OMAP5_MAILBOX_FIFO_LENGTH;
while ((REG32(Omap5430IpcInt_state.mailboxBase + \
MAILBOX_MSGSTATUS_m_OFFSET(0))) && (max_tries-- > 0)) {
/* Read the register to get the msg from the mailbox FIFO */
MAILBOX_MESSAGE_m_OFFSET(0));
}
/* Clear the messages in the DSP->HOST mailbox */
- max_tries = OMAP4_MAILBOX_FIFO_LENGTH;
+ max_tries = OMAP5_MAILBOX_FIFO_LENGTH;
while ((REG32(Omap5430IpcInt_state.mailboxBase + \
MAILBOX_MSGSTATUS_m_OFFSET(2))) && (max_tries-- > 0)) {
/* Read the register to get the msg from the mailbox FIFO */
MAILBOX_MESSAGE_m_OFFSET(2));
}
/* Clear the messages in the HOST->DSP mailbox */
- max_tries = OMAP4_MAILBOX_FIFO_LENGTH;
+ max_tries = OMAP5_MAILBOX_FIFO_LENGTH;
while ((REG32(Omap5430IpcInt_state.mailboxBase + \
MAILBOX_MSGSTATUS_m_OFFSET(3))) && (max_tries-- > 0)) {
/* Read the register to get the msg from the mailbox FIFO */
((MAILBOX_NUMBER_3) << 1));
/* Clear the messages in the CORE0->CORE1 mailbox */
- max_tries = OMAP4_MAILBOX_FIFO_LENGTH;
+ max_tries = OMAP5_MAILBOX_FIFO_LENGTH;
while ((REG32(Omap5430IpcInt_state.mailboxBase + \
MAILBOX_MSGSTATUS_m_OFFSET(4))) && (max_tries-- > 0)) {
/* Read the register to get the msg from the mailbox FIFO */
diff --git a/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/arch/ti81xx/Dm8168IpcInt.c b/qnx/src/ipc3x_dev/ti/syslink/ipc/hlos/knl/arch/ti81xx/Dm8168IpcInt.c
+++ /dev/null
@@ -1,1365 +0,0 @@
-/*
- * @file Dm8168IpcInt.c
- *
- * @brief DM8168 interrupt handling code.
- * Defines necessary functions for Interrupt Handling.
- *
- *
- * ============================================================================
- *
- * Copyright (c) 2008-2012, Texas Instruments Incorporated
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of Texas Instruments Incorporated nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * Contact information for paper mail:
- * Texas Instruments
- * Post Office Box 655303
- * Dallas, Texas 75265
- * Contact information:
- * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
- * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
- * ============================================================================
- *
- */
-
-
-
-/* Standard headers */
-#include <ti/syslink/Std.h>
-
-/* OSAL headers */
-#include <ti/syslink/utils/Trace.h>
-#include <ti/syslink/utils/List.h>
-#include <Bitops.h>
-
-/* OSAL and utils headers */
-#include <OsalIsr.h>
-#include <_MultiProc.h>
-#include <ti/ipc/MultiProc.h>
-#include <ti/syslink/utils/Memory.h>
-#include <ti/syslink/utils/Gate.h>
-#include <ti/syslink/utils/GateMutex.h>
-
-/* Hardware Abstraction Layer */
-#include <_ArchIpcInt.h>
-#include <_Dm8168IpcInt.h>
-#include <Dm8168IpcInt.h>
-#include <errno.h>
-
-
-#if defined (__cplusplus)
-extern "C" {
-#endif
-
-
-/* =============================================================================
- * Macros and types
- * =============================================================================
- */
-
-/*!
- * @def DM8168_DM8168_NUMPROCS
- * @brief Number of processors supported on this platform
- */
-#define DM8168_NUMPROCS 4
-/*!
- * @def DM8168_DM8168_INDEX_DSP
- * @brief Dsp index.
- */
-#define DM8168_INDEX_DSP 0
-/*!
- * @def DM8168_INDEX_VIDEOM3
- * @brief M3Video index.
- */
-#define DM8168_INDEX_VIDEOM3 1
-/*!
- * @def DM8168_INDEX_VPSSM3
- * @brief M3Dss index.
- */
-#define DM8168_INDEX_VPSSM3 2
-/*!
- * @def DM8168_INDEX_HOST
- * @brief HOST index.
- */
-#define DM8168_INDEX_HOST 3
-
-/* Macro to make a correct module magic number with refCount */
-#define DM8168IPCINT_MAKE_MAGICSTAMP(x) \
- ((DM8168IPCINT_MODULEID << 12u) | (x))
-
-/*!
- * @def REG
- * @brief Regsiter access method.
- */
-#define REG(x) *((volatile UInt32 *) (x))
-#define REG32(x) (*(volatile UInt32 *) (x))
-
-/* Register access method. */
-#define REG16(A) (*(volatile UInt16 *) (A))
-
-/*!
- * @def AINTC_BASE_ADDR
- * @brief configuraion address.
- */
-#define AINTC_BASE_ADDR 0x48200000
-
-/*!
- * @def AINTC_BASE_SIZE
- * @brief size to be ioremapped.
- */
-#define AINTC_BASE_SIZE 0x1000
-
-/* Mailbox management values */
-/*!
- * @def DM8168_MAILBOX_BASE
- * @brief configuraion address.
- */
-#define MAILBOX_BASE 0x480C8000
-
-/*!
- * @def MAILBOX_SIZE
- * @brief size to be ioremapped.
- */
-#define MAILBOX_SIZE 0x1000
-
-/*!
- * @def MAILBOX_SYSCONFIG_OFFSET
- * @brief Offset from the Mailbox base address.
- */
-#define MAILBOX_SYSCONFIG_OFFSET 0x10
-
-/*!
- * @def MAILBOX_MAXNUM
- * @brief maximum number of mailbox.
- */
-#define MAILBOX_MAXNUM 0x8
-
-/*!
- * @def MAILBOX_MESSAGE_m_OFFSET
- * @brief mailbox message address Offset from the Mailbox base
- * address. m = 0 to 7 => offset = 0x40 + 0x4*m
- */
-#define MAILBOX_MESSAGE_m_OFFSET(m) (0x40 + (m<<2))
-
-/*!
- * @def MAILBOX_MESSAGE_0_OFFSET
- * @brief Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_0_OFFSET 0x40
-
-/*!
- * @def MAILBOX_MESSAGE_1_OFFSET
- * @brief Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_1_OFFSET 0x44
-
-/*!
- * @def MAILBOX_MESSAGE_2_OFFSET
- * @brief Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_2_OFFSET 0x48
-
-/*!
- * @def MAILBOX_MESSAGE_3_OFFSET
- * @brief Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_3_OFFSET 0x4C
-
-/*!
- * @def MAILBOX_MESSAGE_4_OFFSET
- * @brief mailbox message 4 address Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_4_OFFSET 0x50
-
-/*!
- * @def MAILBOX_MESSAGE_5_OFFSET
- * @brief mailbox message 5 address Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_5_OFFSET 0x54
-
-/*!
- * @def MAILBOX_MESSAGE_6_OFFSET
- * @brief mailbox message 6 address Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_6_OFFSET 0x58
-
-/*!
- * @def DM8168_MAILBOX_BASE_OFFSET
- * @brief mailbox message 7 address Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_7_OFFSET 0x5C
-
-/*!
- * @def DM8168_MAILBOX_BASE_OFFSET
- * @brief mailbox message 8 address Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_8_OFFSET 0x60
-
-/*!
- * @def MAILBOX_MESSAGE_9_OFFSET
- * @brief mailbox message 9 address Offset from the Mailbox base address.
- */
-#define MAILBOX_MESSAGE_9_OFFSET 0x64
-/*!
- * @def MAILBOX_MSGSTATUS_m_OFFSET
- * @brief mailbox message status address Offset from the Mailbox base
- * address. m = 0 to 7 => offset = 0x40 + 0x4*m
- */
-#define MAILBOX_MSGSTATUS_m_OFFSET(m) (0xC0 + (m<<2))
-
-/*!
- * @def MAILBOX_MSGSTATUS_0_OFFSET
- * @brief mailbox message 0 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_0_OFFSET 0xC0
-
-/*!
- * @def MAILBOX_MSGSTATUS_1_OFFSET
- * @brief mailbox message 1 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_1_OFFSET 0xC4
-
-/*!
- * @def MAILBOX_MSGSTATUS_2_OFFSET
- * @brief mailbox message 2 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_2_OFFSET 0xC8
-
-/*!
- * @def MAILBOX_MSGSTATUS_3_OFFSET
- * @brief mailbox message 3 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_3_OFFSET 0xCC
-
-/*!
- * @def MAILBOX_MSGSTATUS_4_OFFSET
- * @brief mailbox message 4 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_4_OFFSET 0xD0
-
-/*!
- * @def MAILBOX_MSGSTATUS_5_OFFSET
- * @brief mailbox message 5 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_5_OFFSET 0xD4
-
-/*!
- * @def MAILBOX_MSGSTATUS_6_OFFSET
- * @brief mailbox message 6 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_6_OFFSET 0xD8
-
-/*!
- * @def MAILBOX_MSGSTATUS_7_OFFSET
- * @brief mailbox message 7 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_7_OFFSET 0xDC
-/*!
- * @def MAILBOX_MSGSTATUS_8_OFFSET
- * @brief mailbox message 8 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_8_OFFSET 0xE0
-/*!
- * @def MAILBOX_MSGSTATUS_9_OFFSET
- * @brief mailbox message 9 status address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_MSGSTATUS_9_OFFSET 0xE4
-/*!
- * @def MAILBOX_IRQSTATUS_CLEAR_OFFSET
- * @brief mailbox IRQSTATUS clear address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_IRQSTATUS_CLEAR_OFFSET 0x104
-
-/*!
- * @def MAILBOX_IRQENABLE_SET_OFFSET
- * @brief mailbox IRQ enable set address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_IRQENABLE_SET_OFFSET 0x108
-/*!
- * @def MAILBOX_IRQENABLE_CLR_OFFSET
- * @brief mailbox IRQ enable clear address Offset from the Mailbox base
- * address.
- */
-#define MAILBOX_IRQENABLE_CLR_OFFSET 0x10C
-
-
-/*!
- * @def MAILBOX_NUMBER_0
- * @brief mailbox number 0 used by HOST ARM to receive interrupts from DSP.
- */
-#define MAILBOX_NUMBER_0 0
-/*!
- * @def MAILBOX_NUMBER_1
- * @brief mailbox number 1 used by HOST to receive interrupts from CORE0.
- */
-#define MAILBOX_NUMBER_1 1
-/*!
- * @def MAILBOX_NUMBER_2
- * @brief mailbox number 2 used by HOST to receive interrupts from DSP.
- */
-#define MAILBOX_NUMBER_2 2
-/*!
- * @def MAILBOX_NUMBER_3
- * @brief mailbox number 3 used by DSP to receive interrupts from HOST.
- */
-#define MAILBOX_NUMBER_3 3
-/*!
- * @def MAILBOX_NUMBER_4
- * @brief mailbox number 4 used by CORE1 to receive interrupts from CORE0/DSP.
- */
-#define MAILBOX_NUMBER_4 4
-
-/*!
- * @def MAILBOX_NUMBER_6
- * @brief mailbox number 6 used by HOST ARM to receive interrupts from VIDEOM3
- */
-#define MAILBOX_NUMBER_6 6
-/*!
- * @def MAILBOX_NUMBER_8
- * @brief mailbox number 8 used by HOST ARM to receive interrupts from VPSSM3.
- */
-#define MAILBOX_NUMBER_8 8
-
-/* Macro used when saving the mailbox context */
-#define DM8168_MAILBOX_IRQENABLE(u) (0x108 + 0x10 * (u))
-
-/* Msg elem used to store messages from the remote proc */
-typedef struct Dm8168IpcInt_MsgListElem_tag {
- List_Elem elem;
- UInt32 msg;
- struct Dm8168IpcInt_MsgListElem * next;
- struct Dm8168IpcInt_MsgListElem * prev;
-} Dm8168IpcInt_MsgListElem;
-
-/*!
- * @brief Device specific object
- * It can be populated as per device need and it is used internally in
- * the device specific implementation only.
- */
-typedef struct Dm8168IpcInt_Object_tag {
- Atomic isrRefCount;
- /*!< ISR Reference count */
- Atomic asserted;
- /*!< Indicates receipt of interrupt from particular processor */
- UInt32 recvIntId;
- /*!<recevive interrupt id */
- ArchIpcInt_CallbackFxn fxn;
- /*!< Callbck function to be registered for particular instance of driver*/
- Ptr fxnArgs;
- /*!< Argument to the call back function */
-} Dm8168IpcInt_Object;
-
-
-/*!
- * @brief Device specific object
- * It can be populated as per device need and it is used internally in
- * the device specific implementation only.
- */
-typedef struct Dm8168IpcInt_ModuleObject_tag {
- Atomic isrRefCount;
- /*!< ISR Reference count */
- OsalIsr_Handle isrHandle;
- /*!< Handle to the OsalIsr object */
- UInt16 procIds [DM8168_NUMPROCS];
- /*!< Processors supported */
- UInt16 maxProcessors;
- /*!< Maximum number of processors supported by this platform*/
- Dm8168IpcInt_Object isrObjects [MultiProc_MAXPROCESSORS];
- /*!< Array of Isr objects */
- List_Handle isrLists [MultiProc_MAXPROCESSORS];
- /*!< Array of Isr lists */
- UInt32 archCoreCmBase;
- /*!< configuration mgmt base */
- UInt32 mailboxBase;
- /*!< mail box configuration mgmt base */
- UInt32 intId;
- /*!< interrupt id for this proc */
-} Dm8168IpcInt_ModuleObject;
-
-
-
-/* =============================================================================
- * Forward declarations of internal functions.
- * =============================================================================
- */
-/* This function implements the interrupt service routine for the interrupt
- * received from the remote processor.
- */
-static Bool _Dm8168IpcInt_isr (Ptr ref);
-
-/*!
- * @brief Forward declaration of check and clear function
- */
-static Bool _Dm8168IpcInt_checkAndClearFunc (Ptr arg);
-
-
-/* =============================================================================
- * Globals
- * =============================================================================
- */
-/*!
- * @brief State object for Dm8168IpcInt
- */
-Dm8168IpcInt_ModuleObject Dm8168IpcInt_state;
-
-/*!
- * @brief Function table for OMAP3530
- */
-ArchIpcInt_FxnTable Dm8168IpcInt_fxnTable = {
- Dm8168IpcInt_interruptRegister,
- Dm8168IpcInt_interruptUnregister,
- Dm8168IpcInt_interruptEnable,
- Dm8168IpcInt_interruptDisable,
- Dm8168IpcInt_waitClearInterrupt,
- Dm8168IpcInt_sendInterrupt,
- Dm8168IpcInt_clearInterrupt,
-};
-
-int mailbox_context[MAILBOX_SIZE];
-
-/* =============================================================================
- * APIs
- * =============================================================================
- */
-
-/*!
- * @brief Function to initialize the Dm8168IpcInt module.
- *
- * @param cfg Configuration for setup
- *
- * @sa Dm8168IpcInt_destroy
- */
-Void
-Dm8168IpcInt_setup (Dm8168IpcInt_Config * cfg)
-{
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- Int status = DM8168IPCINT_SUCCESS;
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Int i = 0;
- Memory_MapInfo mapInfo;
- List_Params listParams;
-
- GT_1trace (curTrace, GT_ENTER, "Dm8168IpcInt_setup", cfg);
-
- GT_assert (curTrace, (cfg != NULL));
-
- /* The setup will be called only once, either from SysMgr or from
- * archipcdm8168 module. Hence it does not need to be atomic.
- */
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (cfg == NULL) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_setup",
- DM8168IPCINT_E_FAIL,
- "config for driver specific setup can not be NULL");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- /* Map general control base */
- mapInfo.src = AINTC_BASE_ADDR;
- mapInfo.size = AINTC_BASE_SIZE;
- mapInfo.isCached = FALSE;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- status =
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Memory_map (&mapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_setup",
- status,
- "Failure in Memory_map for general ctrl base");
- Dm8168IpcInt_state.archCoreCmBase = 0;
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Dm8168IpcInt_state.archCoreCmBase = mapInfo.dst;
- /* Map mailboxBase */
- mapInfo.src = MAILBOX_BASE;
- mapInfo.size = MAILBOX_SIZE;
- mapInfo.isCached = FALSE;
- #if !defined(SYSLINK_BUILD_OPTIMIZE)
- status =
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Memory_map (&mapInfo);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_setup",
- status,
- "Failure in Memory_map for mailboxBase");
- Dm8168IpcInt_state.mailboxBase = 0;
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Dm8168IpcInt_state.mailboxBase = mapInfo.dst;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
- }
- if (status >= 0) {
- /*Registering dm8168 platform with ArchIpcInt*/
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- ArchIpcInt_object.fxnTable = &Dm8168IpcInt_fxnTable;
- ArchIpcInt_object.obj = &Dm8168IpcInt_state;
-
- for (i = 0; i < MultiProc_getNumProcessors(); i++ ) {
- Atomic_set (&(Dm8168IpcInt_state.isrObjects [i].asserted), 1);
- List_Params_init(&listParams);
- Dm8168IpcInt_state.isrLists [i] = List_create(&listParams);
- if (Dm8168IpcInt_state.isrLists [i] == NULL) {
- status = DM8168IPCINT_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_setup",
- status,
- "Failure in List_create");
- for (i = i - 1; i >= 0; i--) {
- List_delete(&Dm8168IpcInt_state.isrLists [i]);
- }
- break;
- }
- }
-
- /* Calling MultiProc APIs here in setup save time in ISR and makes
- * it small and fast with less overhead. This can be done
- * regardless of status.
- */
- Dm8168IpcInt_state.procIds [DM8168_INDEX_DSP] =
- MultiProc_getId ("DSP");
- Dm8168IpcInt_state.procIds [DM8168_INDEX_VIDEOM3] =
- MultiProc_getId ("VIDEO-M3");
- Dm8168IpcInt_state.procIds [DM8168_INDEX_VPSSM3] =
- MultiProc_getId ("VPSS-M3");
- Dm8168IpcInt_state.maxProcessors = MultiProc_getNumProcessors();
-
- if (status >= 0) {
- ArchIpcInt_object.isSetup = TRUE;
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_0trace (curTrace, GT_LEAVE, "Dm8168IpcInt_setup");
-}
-
-
-/*!
- * @brief Function to finalize the Dm8168IpcInt module
- *
- * @sa Dm8168IpcInt_setup
- */
-Void
-Dm8168IpcInt_destroy (Void)
-{
- Memory_UnmapInfo unmapInfo;
- UInt32 i = 0;
-
- GT_0trace (curTrace, GT_ENTER, "Dm8168IpcInt_destroy");
-
- GT_assert (curTrace,(ArchIpcInt_object.isSetup == TRUE));
-
- ArchIpcInt_object.isSetup = FALSE;
- ArchIpcInt_object.obj = NULL;
- ArchIpcInt_object.fxnTable = NULL;
-
- for (i = 0; i < MultiProc_getNumProcessors(); i++ ) {
- if (Dm8168IpcInt_state.isrLists [i]) {
- List_delete(&Dm8168IpcInt_state.isrLists [i]);
- }
- }
-
- if (Dm8168IpcInt_state.archCoreCmBase != (UInt32) NULL) {
- unmapInfo.addr = Dm8168IpcInt_state.archCoreCmBase;
- unmapInfo.size = AINTC_BASE_SIZE;
- unmapInfo.isCached = FALSE;
- Memory_unmap (&unmapInfo);
- Dm8168IpcInt_state.archCoreCmBase = (UInt32) NULL;
- }
-
- if (Dm8168IpcInt_state.mailboxBase != (UInt32) NULL) {
- unmapInfo.addr = Dm8168IpcInt_state.mailboxBase;
- unmapInfo.size = MAILBOX_SIZE;
- unmapInfo.isCached = FALSE;
- Memory_unmap (&unmapInfo);
- Dm8168IpcInt_state.mailboxBase = (UInt32) NULL;
- }
-
- GT_0trace (curTrace, GT_ENTER, "Dm8168IpcInt_destroy");
-}
-
-
-/*!
- * @brief Function to register the interrupt.
- *
- * @param procId destination procId.
- * @param intId interrupt id.
- * @param fxn callback function to be called on receiving interrupt.
- * @param fxnArgs arguments to the callback function.
- *
- * @sa Dm8168IpcInt_interruptEnable
- */
-
-Int32
-Dm8168IpcInt_interruptRegister (UInt16 procId,
- UInt32 intId,
- ArchIpcInt_CallbackFxn fxn,
- Ptr fxnArgs)
-{
- Int32 status = DM8168IPCINT_SUCCESS;
- OsalIsr_Params isrParams;
-
- GT_4trace (curTrace,
- GT_ENTER,
- "Dm8168IpcInt_interruptRegister",
- procId,
- intId,
- fxn,
- fxnArgs);
-
- GT_assert (curTrace,(ArchIpcInt_object.isSetup == TRUE));
- GT_assert(curTrace, (procId < MultiProc_MAXPROCESSORS));
- GT_assert(curTrace, (fxn != NULL));
-
-
- /* This sets the refCount variable is not initialized, upper 16 bits is
- * written with module Id to ensure correctness of refCount variable.
- */
- Atomic_cmpmask_and_set (
- &Dm8168IpcInt_state.isrObjects [procId].isrRefCount,
- DM8168IPCINT_MAKE_MAGICSTAMP(0),
- DM8168IPCINT_MAKE_MAGICSTAMP(0));
-
- /* This is a normal use-case, so should not be inside
- * SYSLINK_BUILD_OPTIMIZE.
- */
- if (Atomic_inc_return (
- &Dm8168IpcInt_state.isrObjects [procId].isrRefCount)
- != DM8168IPCINT_MAKE_MAGICSTAMP(1u)) {
- /*! @retval DM8168IPCINT_S_ALREADYREGISTERED ISR already registered!
- */
- status = DM8168IPCINT_S_ALREADYREGISTERED;
- GT_0trace (curTrace,
- GT_2CLASS,
- "ISR already registered!");
- }
- else {
- Dm8168IpcInt_state.isrObjects [procId].fxn = fxn;
- Dm8168IpcInt_state.isrObjects [procId].fxnArgs = fxnArgs;
- Dm8168IpcInt_state.isrObjects [procId].recvIntId = intId;
- /* Enable hardware interrupt. */
- Dm8168IpcInt_interruptEnable (procId, intId);
- }
-
- Atomic_cmpmask_and_set (&Dm8168IpcInt_state.isrRefCount,
- DM8168IPCINT_MAKE_MAGICSTAMP(0),
- DM8168IPCINT_MAKE_MAGICSTAMP(0));
-
- /* This is a normal use-case, so should not be inside
- * SYSLINK_BUILD_OPTIMIZE.
- */
- if ( Atomic_inc_return (&Dm8168IpcInt_state.isrRefCount)
- != DM8168IPCINT_MAKE_MAGICSTAMP(1u)) {
- /*! @retval DM8168IPCINT_S_ALREADYREGISTERED Generic ISR already set!
- */
- status = DM8168IPCINT_S_ALREADYREGISTERED;
- GT_0trace (curTrace,
- GT_2CLASS,
- "Generic ISR already set !");
- }
- else {
- isrParams.sharedInt = FALSE;
- isrParams.checkAndClearFxn = &_Dm8168IpcInt_checkAndClearFunc;
- isrParams.fxnArgs = NULL;
- isrParams.intId = intId;
-
- Dm8168IpcInt_state.isrHandle = OsalIsr_create (&_Dm8168IpcInt_isr,
- NULL,
- &isrParams);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (Dm8168IpcInt_state.isrHandle == NULL) {
- /*! @retval DM8168IPCINT_E_FAIL OsalIsr_create failed */
- status = DM8168IPCINT_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_interruptRegister",
- status,
- "OsalIsr_create failed");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- status = OsalIsr_install (Dm8168IpcInt_state.isrHandle);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_interruptRegister",
- status,
- "OsalIsr_install failed");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- Dm8168IpcInt_state.intId = intId;
-
- /* Clear the messages in the CORE0->HOST mailbox */
- while (REG32(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_MSGSTATUS_m_OFFSET(1))) {
- Dm8168IpcInt_clearInterrupt(1);
- }
- /* Clear the messages in the HOST->CORE0 mailbox */
- while (REG32(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_MSGSTATUS_m_OFFSET(0))) {
- Dm8168IpcInt_clearInterrupt(0);
- }
- /* Clear the messages in the DSP->HOST mailbox */
- while (REG32(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_MSGSTATUS_m_OFFSET(2))) {
- Dm8168IpcInt_clearInterrupt(2);
- }
- /* Clear the messages in the HOST->DSP mailbox */
- while (REG32(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_MSGSTATUS_m_OFFSET(3))) {
- Dm8168IpcInt_clearInterrupt(3);
- }
- /* The below seems to be needed for OMAP5 Virtio for
- * slaying/restarting syslink properly
- */
- /* Disables interrupts from HOST->CORE0 */
- SET_BIT(REG(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_IRQENABLE_CLR_OFFSET + 0x20),
- ((MAILBOX_NUMBER_0) << 1));
- /* Disables interrupts from HOST->DSP */
- SET_BIT(REG(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_IRQENABLE_CLR_OFFSET + 0x10),
- ((MAILBOX_NUMBER_3) << 1));
-
- /* Set mailbox to smart-idle */
- REG(Dm8168IpcInt_state.mailboxBase + MAILBOX_SYSCONFIG_OFFSET) = 0x8;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-
- GT_1trace (curTrace, GT_LEAVE, "Dm8168IpcInt_interruptRegister", status);
-
- /*! @retval DM8168IPCINT_SUCCESS Interrupt successfully registered */
- return status;
-}
-
-/*!
- * @brief Function to Save context.
- *
- * @param procId The procId associated with the mailbox context being
- * saved.
- *
- * @sa Dm8168IpcInt_mbxRestoreCtxt
- */
-
-Int32
-Dm8168IpcInt_mboxSaveCtxt (UInt16 procId)
-{
- Int32 status = DM8168IPCINT_SUCCESS;
- UInt32 i = 0;
-
- if (Dm8168IpcInt_state.mailboxBase == NULL) {
- status = DM8168IPCINT_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_mboxSaveCtxt",
- status,
- "Unable to map the Mailbox memory in SaveCtxt");
- }
- else {
- for (i = 0; i < 4; i++) {
- mailbox_context[i] = REG32(Dm8168IpcInt_state.mailboxBase + \
- DM8168_MAILBOX_IRQENABLE(i));
- }
- Dm8168IpcInt_interruptDisable(procId, Dm8168IpcInt_state.intId);
- }
- return status;
-}
-
-/*!
- * @brief Function to Restore context.
- *
- * @param procId The procId associated with the mailbox context being
- * restored.
- *
- * @sa Dm8168IpcInt_mbxSaveCtxt
- */
-
-Int32
-Dm8168IpcInt_mboxRestoreCtxt (UInt16 procId)
-{
- Int32 status = DM8168IPCINT_SUCCESS;
- UInt32 i = 0;
-
- if (Dm8168IpcInt_state.mailboxBase == NULL) {
- status = DM8168IPCINT_E_MEMORY;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_mboxRestoreCtxt",
- status,
- "Unable to map the Mailbox memory in RestoreCtxt");
- }
- else {
- /* Set to Smart Idle mode*/
- REG(Dm8168IpcInt_state.mailboxBase + MAILBOX_SYSCONFIG_OFFSET) = 0x8;
-
- for (i = 0; i < 4; i++) {
- REG32(Dm8168IpcInt_state.mailboxBase + \
- DM8168_MAILBOX_IRQENABLE(i)) = mailbox_context[i];
- }
-
- Dm8168IpcInt_interruptEnable(procId, Dm8168IpcInt_state.intId);
- }
-
- return status;
-}
-
-
-/*!
- * @brief Function to unregister interrupt.
- *
- * @param procId destination procId
- *
- * @sa Dm8168IpcInt_interruptRegister
- */
-Int32
-Dm8168IpcInt_interruptUnregister (UInt16 procId)
-{
- Int32 status = DM8168IPCINT_SUCCESS;
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- Int32 tmpStatus = DM8168IPCINT_SUCCESS;
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_1trace (curTrace,GT_ENTER,"Dm8168IpcInt_interruptUnregister", procId);
-
- GT_assert (curTrace,(ArchIpcInt_object.isSetup == TRUE));
- GT_assert(curTrace, (procId < MultiProc_MAXPROCESSORS));
-
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if ( Atomic_cmpmask_and_lt (
- &Dm8168IpcInt_state.isrObjects [procId].isrRefCount,
- DM8168IPCINT_MAKE_MAGICSTAMP(0),
- DM8168IPCINT_MAKE_MAGICSTAMP(1))
- == TRUE) {
- /*! @retval DM8168IPCINT_E_INVALIDSTATE ISR was not registered */
- status = DM8168IPCINT_E_INVALIDSTATE;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_interruptUnregister",
- status,
- "ISR was not registered!");
- }
- else {
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- /* This is a normal use-case, so should not be inside
- * SYSLINK_BUILD_OPTIMIZE.
- */
- if (Atomic_dec_return(&Dm8168IpcInt_state.isrObjects[procId].isrRefCount)
- == DM8168IPCINT_MAKE_MAGICSTAMP(0)) {
- /* Disable hardware interrupt. */
- Dm8168IpcInt_interruptDisable (procId,
- Dm8168IpcInt_state.isrObjects [procId].recvIntId);
-
- Dm8168IpcInt_state.isrObjects [procId].fxn = NULL;
- Dm8168IpcInt_state.isrObjects [procId].fxnArgs = NULL;
- Dm8168IpcInt_state.isrObjects [procId].recvIntId = -1u;
- }
-
- if ( Atomic_dec_return (&Dm8168IpcInt_state.isrRefCount)
- == DM8168IPCINT_MAKE_MAGICSTAMP(0)) {
- status = OsalIsr_uninstall (Dm8168IpcInt_state.isrHandle);
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if (status < 0) {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_interruptUnregister",
- status,
- "OsalIsr_uninstall failed");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- /* Clear the messages in the CORE0->HOST mailbox */
- while (REG32(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_MSGSTATUS_m_OFFSET(1))) {
- Dm8168IpcInt_clearInterrupt(1);
- }
- /* Clear the messages in the HOST->CORE0 mailbox */
- while (REG32(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_MSGSTATUS_m_OFFSET(0))) {
- Dm8168IpcInt_clearInterrupt(0);
- }
- /* Clear the messages in the DSP->HOST mailbox */
- while (REG32(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_MSGSTATUS_m_OFFSET(2))) {
- Dm8168IpcInt_clearInterrupt(2);
- }
- /* Clear the messages in the HOST->DSP mailbox */
- while (REG32(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_MSGSTATUS_m_OFFSET(3))) {
- Dm8168IpcInt_clearInterrupt(3);
- }
- /* The below seems to be needed for OMAP5 Virtio for
- * slaying/restarting syslink properly
- */
- /* Disables interrupts from HOST->CORE0 */
- SET_BIT(REG(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_IRQENABLE_CLR_OFFSET + 0x20),
- ((MAILBOX_NUMBER_0) << 1));
- /* Disables interrupts from HOST->DSP */
- SET_BIT(REG(Dm8168IpcInt_state.mailboxBase + \
- MAILBOX_IRQENABLE_CLR_OFFSET + 0x10),
- ((MAILBOX_NUMBER_3) << 1));
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- tmpStatus =
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- OsalIsr_delete (&(Dm8168IpcInt_state.isrHandle));
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- if ((status >= 0) && (tmpStatus < 0)) {
- status = tmpStatus;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_interruptUnregister",
- status,
- "OsalIsr_delete failed");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_1trace (curTrace, GT_LEAVE, "Dm8168IpcInt_interruptUnregister",
- status);
-
- /*! @retval DM8168IPCINT_SUCCESS Interrupt successfully unregistered */
- return status;
-}
-
-
-/*!
- * @brief Function to enable the specified interrupt
- *
- * @param procId Remote processor ID
- * @param intId interrupt id
- *
- * @sa Dm8168IpcInt_interruptDisable
- */
-Void
-Dm8168IpcInt_interruptEnable (UInt16 procId, UInt32 intId)
-{
- GT_2trace (curTrace, GT_ENTER, "Dm8168IpcInt_interruptEnable",
- procId, intId);
-
- GT_assert (curTrace,(ArchIpcInt_object.isSetup == TRUE));
- GT_assert (curTrace, (procId < MultiProc_MAXPROCESSORS));
-
- if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_DSP]) {
- /*
- * Mailbox 2 is used by HOST for receiving interrupts from DSP
- * Mailbox 3 is used by DSP for receiving interrupts from HOST
- *
- */
- SET_BIT(REG(Dm8168IpcInt_state.mailboxBase + MAILBOX_IRQENABLE_SET_OFFSET),
- ( (MAILBOX_NUMBER_2) << 1));
- }
- else if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_VIDEOM3]) {
- /*
- * Do nothing. Interrupt is handled through CORE0 interrupt.
- */
- }
- else if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_VPSSM3]) {
- /*
- * Mailbox 1 is used by HOST for receiving interrupts from VPSSM3
- * Mailbox 0 is used by VPSSM3 for receiving interrupts from HOST
- *
- */
- SET_BIT(REG(Dm8168IpcInt_state.mailboxBase + MAILBOX_IRQENABLE_SET_OFFSET),
- ( (MAILBOX_NUMBER_1) << 1));
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- else {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_interruptEnable",
- DM8168IPCINT_E_FAIL,
- "Invalid procId specified");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_0trace (curTrace, GT_LEAVE, "Dm8168IpcInt_interruptEnable");
-}
-
-
-/*!
- * @brief Function to disable the specified interrupt
- *
- * @param procId Remote processor ID
- * @param intId interrupt id
- *
- * @sa Dm8168IpcInt_interruptEnable
- */
-Void
-Dm8168IpcInt_interruptDisable (UInt16 procId, UInt32 intId)
-{
- GT_2trace (curTrace, GT_ENTER, "Dm8168IpcInt_interruptDisable",
- procId, intId);
-
- GT_assert (curTrace,(ArchIpcInt_object.isSetup == TRUE));
- GT_assert (curTrace, (procId < MultiProc_MAXPROCESSORS));
-
- if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_DSP]) {
- /*
- * Mailbox 2 is used by HOST for receiving interrupts from DSP
- * Mailbox 3 is used by DSP for receiving interrupts from HOST
- *
- */
- SET_BIT(REG(Dm8168IpcInt_state.mailboxBase + MAILBOX_IRQENABLE_CLR_OFFSET),
- ( (MAILBOX_NUMBER_2) << 1));
- }
- else if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_VIDEOM3]) {
- /*
- * Do nothing. Interrupt is handled through VPSSM3 interrupt.
- */
- }
- else if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_VPSSM3]) {
- /*
- * Mailbox 1 is used by HOST for receiving interrupts from VPSSM3
- * Mailbox 0 is used by VPSSM3 for receiving interrupts from HOST
- *
- */
- SET_BIT(REG(Dm8168IpcInt_state.mailboxBase + MAILBOX_IRQENABLE_CLR_OFFSET),
- ( (MAILBOX_NUMBER_1) << 1));
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- else {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_interruptDisable",
- DM8168IPCINT_E_FAIL,
- "Invalid procId specified");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_0trace (curTrace, GT_LEAVE, "Dm8168IpcInt_interruptDisable");
-}
-
-
-/*!
- * @brief Function to wait for interrupt to be cleared.
- *
- * @param procId Remote processor ID
- * @param intId interrupt id
- *
- * @sa Dm8168IpcInt_sendInterrupt
- */
-Int32
-Dm8168IpcInt_waitClearInterrupt (UInt16 procId, UInt32 intId)
-{
- Int32 status = DM8168IPCINT_SUCCESS;
-
- GT_2trace (curTrace,GT_ENTER,"Dm8168IpcInt_waitClearInterrupt",
- procId, intId);
-
- GT_assert (curTrace,(ArchIpcInt_object.isSetup == TRUE));
- GT_assert (curTrace, (procId < MultiProc_MAXPROCESSORS));
-
- if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_DSP]) {
- /* Wait for DSP to clear the previous interrupt */
- while( ( REG32(( Dm8168IpcInt_state.mailboxBase
- + MAILBOX_MSGSTATUS_3_OFFSET))
- & 0x3F ));
- }
- else if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_VIDEOM3]) {
- /* Wait for VIDEOM3 to clear the previous interrupt */
- while( ( REG32((Dm8168IpcInt_state.mailboxBase
- + MAILBOX_MSGSTATUS_0_OFFSET))
- & 0x3F ));
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- else {
- /*! @retval DM8168IPCINT_E_FAIL Invalid procId specified */
- status = DM8168IPCINT_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_waitClearInterrupt",
- status,
- "Invalid procId specified");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_1trace (curTrace,GT_LEAVE,"Dm8168IpcInt_waitClearInterrupt", status);
-
- /*! @retval DM8168IPCINT_SUCCESS Wait for interrupt clearing successfully
- completed. */
- return status ;
-}
-
-
-/*!
- * @brief Function to send a specified interrupt to the DSP.
- *
- * @param procId Remote processor ID
- * @param intId interrupt id
- * @param value Value to be sent with the interrupt
- *
- * @sa Dm8168IpcInt_waitClearInterrupt
- */
-Int32
-Dm8168IpcInt_sendInterrupt (UInt16 procId, UInt32 intId, UInt32 value)
-{
- Int32 status = DM8168IPCINT_SUCCESS;
-
- GT_3trace (curTrace, GT_ENTER, "Dm8168IpcInt_sendInterrupt",
- procId, intId, value);
-
- GT_assert (curTrace,(ArchIpcInt_object.isSetup == TRUE));
- GT_assert (curTrace, (procId < MultiProc_MAXPROCESSORS));
-
- if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_DSP]) {
- /*
- * Mailbox 2 is used by HOST for receiving interrupts from DSP
- * Mailbox 3 is used by DSP for receiving interrupts from HOST
- *
- */
- REG32(Dm8168IpcInt_state.mailboxBase + MAILBOX_MESSAGE_3_OFFSET) = value;
- } else if (procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_VIDEOM3]||
- procId == Dm8168IpcInt_state.procIds [DM8168_INDEX_VPSSM3]) {
- /*
- * Mailbox 1 is used by HOST for receiving interrupts from CORE0
- * Mailbox 0 is used by CORE0 for receiving interrupts from DSP
- *
- */
- REG32(Dm8168IpcInt_state.mailboxBase + MAILBOX_MESSAGE_0_OFFSET) = value;
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- else {
- /*! @retval DM8168IPCINT_E_FAIL Invalid procId specified */
- status = DM8168IPCINT_E_FAIL;
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_sendInterrupt",
- status,
- "Invalid procId specified");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_1trace (curTrace, GT_LEAVE, "Dm8168IpcInt_sendInterrupt",status);
-
- /*! @retval DM8168IPCINT_SUCCESS Interrupt successfully sent */
- return status;
-}
-
-
-/*!
- * @brief Function to clear the specified interrupt received from the
- * remote core.
- *
- * @param procId Remote processor ID
- * @param intId interrupt id
- *
- * @sa Dm8168IpcInt_sendInterrupt
- */
-UInt32
-Dm8168IpcInt_clearInterrupt (UInt16 mboxNum)
-{
- UInt32 retVal = 0;
-
- GT_1trace (curTrace,GT_ENTER,"Dm8168IpcInt_clearInterrupt", mboxNum);
-
- GT_assert (curTrace,(ArchIpcInt_object.isSetup == TRUE));
-
- if (mboxNum < MAILBOX_MAXNUM) {
- /* Read the register to get the entry from the mailbox FIFO */
- retVal = REG32(Dm8168IpcInt_state.mailboxBase
- + MAILBOX_MESSAGE_m_OFFSET(mboxNum));
-
- /* Clear the IRQ status.
- * If there are more in the mailbox FIFO, it will re-assert.
- */
- SET_BIT(REG((Dm8168IpcInt_state.mailboxBase
- + MAILBOX_IRQSTATUS_CLEAR_OFFSET)),
- (mboxNum<<1));
- }
-#if !defined(SYSLINK_BUILD_OPTIMIZE)
- else {
- GT_setFailureReason (curTrace,
- GT_4CLASS,
- "Dm8168IpcInt_clearInterrupt",
- DM8168IPCINT_E_FAIL,
- "Invalid mailbox number specified");
- }
-#endif /* if !defined(SYSLINK_BUILD_OPTIMIZE) */
-
- GT_0trace (curTrace, GT_LEAVE, "Dm8168IpcInt_clearInterrupt");
-
- /*! @retval Value Value received with the interrupt. */
- return retVal;
-}
-
-
-/*
- * Instead of constantly allocating and freeing the msg structures
- * we just cache a few of them, and recycle them instead.
- */
-#define CACHE_NUM 20
-static Dm8168IpcInt_MsgListElem *msg_cache;
-static int num_msg = 0;
-
-static Dm8168IpcInt_MsgListElem *get_msg()
-{
- Dm8168IpcInt_MsgListElem *msg;
- IArg key = NULL;
-
- key = Gate_enterSystem();
- msg = msg_cache;
- if (msg != NULL) {
- msg_cache = (Dm8168IpcInt_MsgListElem *)msg_cache->next;
- num_msg--;
- Gate_leaveSystem(key);
- } else {
- Gate_leaveSystem(key);
- msg = Memory_alloc(NULL, sizeof(Dm8168IpcInt_MsgListElem), 0, NULL);
- }
- return(msg);
-}
-
-static void put_msg(Dm8168IpcInt_MsgListElem * msg)
-{
- IArg key = NULL;
- key = Gate_enterSystem();
- if (num_msg >= CACHE_NUM) {
- Gate_leaveSystem(key);
- Memory_free(NULL, msg, sizeof(*msg));
- } else {
- msg->next = (struct Dm8168IpcInt_MsgListElem *)msg_cache;
- msg_cache = msg;
- num_msg++;
- Gate_leaveSystem(key);
- }
- return;
-}
-
-
-/*!
- * @brief Function to check and clear the remote proc interrupt
- *
- * @param arg Optional argument to the function.
- *
- * @sa _Dm8168IpcInt_isr
- */
-static
-Bool
-_Dm8168IpcInt_checkAndClearFunc (Ptr arg)
-{
- UInt16 procId;
- UInt32 msg;
- Dm8168IpcInt_MsgListElem * elem = NULL;
-
- if( REG32( Dm8168IpcInt_state.mailboxBase
- + MAILBOX_MSGSTATUS_1_OFFSET) != 0 ){
- msg = Dm8168IpcInt_clearInterrupt (1);
- procId = Dm8168IpcInt_state.procIds [DM8168_INDEX_VIDEOM3];
- /* This is a message from CORE0, put the message in CORE0's list */
- elem = get_msg();
- if (elem) {
- elem->msg = msg;
- List_put(Dm8168IpcInt_state.isrLists[procId], (List_Elem *)elem);
- }
- }
- if( REG32( Dm8168IpcInt_state.mailboxBase
- + MAILBOX_MSGSTATUS_2_OFFSET) != 0 ){
- msg = Dm8168IpcInt_clearInterrupt (2);
- procId = Dm8168IpcInt_state.procIds [DM8168_INDEX_DSP];
- /* This is a message from DSP, put the message in DSP's list */
- elem = get_msg();
- if (elem) {
- elem->msg = msg;
- List_put(Dm8168IpcInt_state.isrLists[procId], (List_Elem *)elem);
- }
- }
-
- /* This is not a shared interrupt, so interrupt has always occurred */
- /*! @retval TRUE Interrupt has occurred. */
- return (TRUE);
-}
-
-
-/*!
- * @brief Interrupt Service Routine for Dm8168IpcInt module
- *
- * @param arg Optional argument to the function.
- *
- * @sa _Dm8168IpcInt_checkAndClearFunc
- */
-static
-Bool
-_Dm8168IpcInt_isr (Ptr ref)
-{
- UInt16 i = 0;
- Dm8168IpcInt_MsgListElem * elem = NULL;
- GT_1trace (curTrace, GT_ENTER, "_Dm8168IpcInt_isr", ref);
-
- for (i = 0 ; i < Dm8168IpcInt_state.maxProcessors ; i++) {
- if ((elem = List_get(Dm8168IpcInt_state.isrLists [i])) != NULL) {
- /*Calling the particular ISR */
- GT_assert(curTrace,(Dm8168IpcInt_state.isrObjects [i].fxn != NULL));
- if (Dm8168IpcInt_state.isrObjects [i].fxn != NULL) {
- Dm8168IpcInt_state.isrObjects [i].fxn (elem->msg,
- Dm8168IpcInt_state.isrObjects [i].fxnArgs);
- }
- put_msg(elem);
- }
- }
-
- GT_1trace (curTrace, GT_LEAVE, "_Dm8168IpcInt_isr", TRUE);
-
- /*! @retval TRUE Interrupt has been handled. */
- return (TRUE);
-}
-
-#if defined (__cplusplus)
-}
-#endif
diff --git a/qnx/src/ipc3x_dev/ti/syslink/samples/hlos/MessageQCopy/usr/common.mk b/qnx/src/ipc3x_dev/ti/syslink/samples/hlos/MessageQCopy/usr/common.mk
index b82bf4618f21795e98fa2e30d7231135238fc061..f79b616092426ecc2b1b31e5a830cd651ca75ba7 100644 (file)
EXTRA_SRCVPATH+=$(PROJECT_ROOT)/$(SYSLINK_BUILDOS) \
$(PROJECT_ROOT)/..
-CCOPTS+=-g -O0 -DSYSLINK_PLATFORM_OMAP4430 -DSYSLINK_BUILDOS_QNX
+CCOPTS+=-g -O0 -DSYSLINK_BUILDOS_QNX
EXTRA_LIBVPATH += $(SYSLINK_ROOT)/ti/syslink/build/$(SYSLINK_BUILDOS)/lib/arm/so.le.v7 \
$(SYSLINK_ROOT)/ti/syslink/build/$(SYSLINK_BUILDOS)/lib/arm/a.le.v7