📄 csl_dspmmu.h
字号:
Uint32 RAM_H_REG;
/** RAM LSB register */
Uint16 RAM_L_REG;
/** Global flush register */
Uint32 GFLUSH_REG;
/** Flush entry register */
Uint32 FLUSH_ENTRY_REG;
/** Idle control register */
Uint32 DSPMMU_IDLE_CTRL;
} CSL_DspmmuConfig;
/**
* Default values for the config-structure
*/
#define CSL_DSPMMU_CONFIG_DEFAULTS { \
CSL_DSPMMU_PREFETCH_REG_RESETVAL, \
CSL_DSPMMU_CNTL_REG_RESETVAL, \
CSL_DSPMMU_IT_ACK_REG_RESETVAL, \
CSL_DSPMMU_TTB_H_REG_RESETVAL, \
CSL_DSPMMU_TTB_L_REG_RESETVAL, \
CSL_DSPMMU_LOCK_REG_RESETVAL, \
CSL_DSPMMU_LD_TLB_REG_RESETVAL, \
CSL_DSPMMU_CAM_H_REG_RESETVAL, \
CSL_DSPMMU_CAM_L_REG_RESETVAL, \
CSL_DSPMMU_RAM_H_REG_RESETVAL, \
CSL_DSPMMU_RAM_L_REG_RESETVAL, \
CSL_DSPMMU_GFLUSH_REG_RESETVAL, \
CSL_DSPMMU_FLUSH_ENTRY_REG_RESETVAL, \
CSL_DSPMMU_DSPMMU_IDLE_CTRL_RESETVAL \
}
/**
* DSP MMU Object structure
*/
typedef struct CSL_DspmmuObj {
/**
* Pointer to the registers of the instance of DSPMMU
*/
CSL_DspmmuRegsOvly regs;
/** This is the instance of DSPMMU being referred to by this object */
CSL_InstNum perNum;
} CSL_DspmmuObj;
/**
* This data type is used to return the handle to the CSL of the
* DSP MMU module
*/
typedef struct CSL_DspmmuObj *CSL_DspmmuHandle;
/**
* Structure describing base-address information for the peripheral
* instance
*/
typedef struct {
/** Base-address of the Configuration registers of the peripheral
*/
CSL_DspmmuRegsOvly regs;
} CSL_DspmmuBaseAddress;
/**
* DSP MMU param structure containing module specific parameters
*/
typedef struct{
/** Bit mask to be used for module specific parameters */
CSL_BitMask16 flags;
} CSL_DspmmuParam;
/**
* DSP MMU module specific context structure
*/
typedef struct {
/** Context information of DSPMMU */
Uint16 contextInfo;
} CSL_DspmmuContext;
/**
* Pointer to the TTB Entry
*/
typedef struct CSL_DspmmuTtbEntry *CSL_DspmmupTTBEntry;
/**
* Pointer to the level-2 page table entry
*/
typedef struct CSL_DspmmuL2ptEntry *CSL_DspmmupL2ptEntry;
/**
* Pointer to the TLB entry
*/
typedef struct CSL_DspmmuTlbEntry *CSL_DspmmupTlbEntry;
/*
* =============================================================================
* @func CSL_dspmmuInit
* @desc
* This is DSP MMU module's initialization function.
* Currently this function is doing nothing.
* This needs to be called before using DSP MMU module.
*
* @arg pContext
* DSP MMU specific context information
*
* @ret CSL_Status
* CSL_SOK : Successful, desired operation is done.
*
* @eg
* status = CSL_dspmmuInit(NULL);
*
* =============================================================================
*/
CSL_Status CSL_dspmmuInit(
CSL_DspmmuContext * pContext
);
/*
* ============================================================================
* @func CSL_dspmmuOpen
*
* @desc
* @n This function returns the handle to the specified DSP MMU instance.
*
* @arg
*
* pDspmmuObj Pointer to the object that holds reference to the
* instance of DSP MMU requested after the call.
*
* dspmmuNum Instance of DSP MMU to which a handle is requested
*
* pDspmmuParam Module specific parameters; currently there are no module
* specificparameters and the user should pass 'NULL'
*
* pStatus This returns the status (success/error) of the call. The
* user may pass NULL', if status information is not required.
*
* @ret CSL_DspmmuHandle handle to the DSP MMU instance
*
* @eg
* CSL_Status status;
* CSL_DspmmuObj dspmmuObj;
* status = CSL_dspmmuOpen (&dspmmuObj, CSL_DSPMMU, NULL, &status);;
*
* =============================================================================
*/
CSL_DspmmuHandle CSL_dspmmuOpen (
CSL_DspmmuObj* pDspmmuObj,
CSL_InstNum dspmmuNum,
CSL_DspmmuParam *pDspmmuParam,
CSL_Status *pStatus
);
/*
* ======================================================
* @func CSL_dspmmuClose
* @desc
* Close (Invalidate) DSP MMU instance (
* passed as handle) after it has finished
* operating. The instance cannot be accessed
* any more.
*
* @arg hDspmmu
* Handle to DSP MMU instance
* @ret CSL_Status
* CSL_SOK : Successful, desired operation is done.
* CSL_ESYS_BADHANDLE : Handle pass is INVALID.
* @eg
* status = CSL_dspmmuClose(hDspmmu);
*
* ======================================================
*/
CSL_Status CSL_dspmmuClose(
CSL_DspmmuHandle hDspmmu
);
/*
* ======================================================
* @func CSL_dspmmuHwSetup
* @desc
* Configures a DSP MMU instance using the different
* config structures. Sets up a particular DSP MMU
* instance (passed as handle) using the configurations
* specified in the structure CSL_dspmmuHwSetup.
* The function will return an error if cannot complete
* the request
*
* @arg hDspmmu
* Handle to the DSP mmu instance
* @arg hwSetup
* DSP MMU's setup structure
* @ret CSL_Status
* CSL_SOK : Successful, desired operation is done.
* CSL_ESYS_INVPARAMS : Parameters passed is NULL.
* @eg
* status = CSL_dspmmuHwSetup (hDspmmu, &hwSetup);
*
* ======================================================
*/
CSL_Status CSL_dspmmuHwSetup(
CSL_DspmmuHandle hDspmmu,
CSL_DspmmuHwSetup *hwSetup
);
/*
* ======================================================
* @func CSL_dspmmuHwSetupRaw
* @desc
* Configures a DSP MMU instance using the register
* values specified in config structure.
* The function will return an error if cannot complete
* the request
*
* @arg hDspmmu
* Handle to the DSP mmu instance
* @arg config
* Pointer to DSP MMU's config structure
* @ret CSL_Status
* CSL_SOK : Successful, desired operation is done.
* CSL_ESYS_INVPARAMS : Parameters passed is NULL.
* @eg
* status = CSL_dspmmuHwSetupRaw (hDspmmu, &dspmmuConfig);
*
* ======================================================
*/
CSL_Status CSL_dspmmuHwSetupRaw (
CSL_DspmmuHandle hDspmmu,
CSL_DspmmuConfig * config
);
/*
* ======================================================
* @func CSL_dspmmuGetHwSetup
* @desc
* Retrieves DSP MMU instance's current register field
* value configuration.
* The function will return an error if cannot complete
* the request
*
* @arg hDspmmu
* Handle to the DSP mmu instance
* @arg hwSetup
* Pointer to place holder for the DSP MMU
* hwsetup structure
* @ret CSL_Status
* CSL_SOK : Successful, desired operation is done.
* CSL_ESYS_INVPARAMS : Parameters passed is NULL.
* @eg
* status = CSL_dspmmuGetHwSetup (hDspmmu, &dspmmuHwSetup);
*
* ======================================================
*/
CSL_Status CSL_dspmmuGetHwSetup(
CSL_DspmmuHandle hDspmmu,
CSL_DspmmuHwSetup *hwSetup
);
/*
* ======================================================
* @func CSL_dspmmuHwControl
* @desc
* Controls the parameters of a particular DSP
* MMU instance (passed as handle)
* Usage Constraints:
* Instance should have been opened before
* with a valid handle
*
* The are various Operations that can be done here are:
* 1) Prefetching a TLB entry
* 2) ENABLE Walking Table Logic
* 3) DISABLE Walking Table Logic
* 4) ENABLE MMU
* 5) DISABLE MMU
* 6) ENABLE reset mode
* 7) RELEASE reset mode
* 8) Clear interrrupt
* 9) Configuring TTB
* 10) Configuring Locked TLB set
* 11) Flushing TLB entries
*
* The function will return an error if cannot complete
* the request
*
*
* @arg hDspmmu
* Handle to the instance
* @arg cmd
* The operation to be performed.
* @arg cmdArg
* This is a void pointer, and will be cast to the
* required type.
* @ret CSL_Status
* @eg
* status = CSL_dspmmuHwControl(hDspmmu,
* CSL_DSPMMU_CMD_TTBCONFIG, &ttbConfig);
*
* ======================================================
*/
CSL_Status CSL_dspmmuHwControl(
CSL_DspmmuHandle hDspmmu,
CSL_DspmmuHwControlCmd cmd,
void *cmdArg
);
/*
* ======================================================
* @func CSL_dspmmuGetHwStatus
* @desc
* Traces the various parameters of DSP MMU instance
* (passed as handle)
*
* Usage Constraints:
* Instance should have been opened before with a valid
* handle. We should know that the registers can be
* read back.
*
* The are various Operations that can be done here are:
* 1) Check the status of Walking Table Logic
* 2) Check the status of prefetching
* 3) Get the fault information
* 4) Get the CAM RAM entry details
*
* The function will return an error if cannot complete
* the request
*
* @arg hDspmmu
* Handle to the DSP MMU instance
* @arg myQuery
* The Values to be traced back
* @arg response
* This is a void pointer, and will be cast to
* the required type.
* @ret CSL_Status
* CSL_SOK : Successful Retreive, (* cmdArg) will have
* the desired value.
* CSL_ESYS_INVQUERY : Query Command is not supported.
*
* ======================================================
*/
CSL_Status CSL_dspmmuGetHwStatus(
CSL_DspmmuHandle hDspmmu,
CSL_DspmmuHwStatusQuery myQuery,
void *response
);
/*
* ======================================================
* @func CSL_dspmmuAddTtbEntry
* @desc
* Adds an entry into the translation table
*
* @arg hDspmmu
* Handle to the instance
* @arg ptrTtbEntry
* This is pointer to the entry to be added
* @ret CSL_Status
* CSL_SOK
* @eg
* status = CSL_dspmmuAddTtbEntry (hDspmmu, &ttbEntry);
*
* ======================================================
*/
CSL_Status CSL_dspmmuAddTtbEntry (
CSL_DspmmuHandle hDspmmu,
CSL_DspmmupTTBEntry ptrTtbEntry
);
/*
* ======================================================
* @func CSL_dspmmuAddL2cptEntry
* @desc
* Adds an entry into the coarse page table
*
* @arg hDspmmu
* Handle to the DSP MMU instance
* @arg ptrTtbEntry
* This is pointer to the entry to be added
* @ret CSL_Status
* CSL_SOK
* @eg
* status = CSL_dspmmuAddL2cptEntry (hDspmmu, &l2cpEntry);
*
* ======================================================
*/
CSL_Status CSL_dspmmuAddL2cptEntry (
CSL_DspmmuHandle hDspmmu,
CSL_DspmmupL2ptEntry ptrL2ptEntry
);
/*
* ======================================================
* @func CSL_dspmmuAddL2fptEntry
* @desc
* Adds an entry into the fine page table
*
* @arg hDspmmu
* Handle to the DSP MMU instance
* @arg ptrL2ptEntry
* This is pointer to the entry to be added
* @ret CSL_Status
* CSL_SOK
* @eg
* status = CSL_dspmmuAddL2fptEntry (hDspmmu, &l2cpEntry);
*
* ======================================================
*/
CSL_Status CSL_dspmmuAddL2fptEntry (
CSL_DspmmuHandle hDspmmu,
CSL_DspmmupL2ptEntry ptrL2ptEntry
);
/*
* ======================================================
* @func CSL_dspmmuUpdateTlbEntry
* @desc
* Adds an entry into Translation Lookaside Buffer (TLB)
*
* @arg hDspmmu
* Handle to the DSP mmu instance
* @arg ptrL2ptEntry
* This is pointer to the entry to be added
* @ret CSL_Status
* CSL_SOK
* @eg
* status = CSL_dspmmuUpdateTlbEntry (hDspmmu, &l2cpEntry);
*
* ======================================================
*/
CSL_Status CSL_dspmmuUpdateTlbEntry (
CSL_DspmmuHandle hDspmmu,
CSL_DspmmupTlbEntry ptrTlbEntry
);
/** ============================================================================
* @n@b CSL_dspmmuGetBaseAddress
*
* @b Description
* @n Function to get the Base-address of the peripheral instance.
* This function is used for getting the base-address of the peripheral
* instance. This function will be called inside the CSL_dspmmuOpen()
* function call.
*
* Note: This function is open for re-implementing if the user wants to modify
* the base address of the peripheral object to point to a different
* location and there by allow CSL initiated write/reads into peripheral
* MMR's go to an alternate location. Please refer the documentation for
* more details.
*
*
* @b Arguments
* @verbatim
dspmmuNum Handle to the DSP MMU instance
pDspmmuParam Pointer to module specific param structure
pBaseAddress Pointer to place holder for base address
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Hardware setup successful
* @li CSL_ESYS_FAIL - Invalid instance number
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n 1. The status is returned. If status
* returned is
* @li CSL_OK Hardware setup successful
* @li CSL_ESYS_FAIL Invalid instance number
*
* 2. "pDspmmuParam" & "pBaseAddress" are populated
*
*
* @b Modifies
* @n 1. Module specific param structure "pDspmmuParam" &
* base address structure "pBaseAddress"
*
*
* @b Example
* @verbatim
CSL_Status status;
CSL_DspmmuBaseAddress baseAddress;
...
status = CSL_dspmmuGetBaseAddress(CSL_DSPMMU, NULL, &baseAddress);
@endverbatim
* ===========================================================================
*/
CSL_Status CSL_dspmmuGetBaseAddress(
CSL_InstNum dspmmuNum,
CSL_DspmmuParam * pDspmmuParam,
CSL_DspmmuBaseAddress * pBaseAddress
);
#ifdef __cplusplus
}
#endif
#endif /* _CSL_DSPMMU_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -