⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syscommon.h

📁 Lido PXA270平台开发板的最新BSP,包括源代码
💻 H
字号:
/*!****************************************************************************
@File			syscommon.h

@Title			Common System APIs and structures

@Author			Imagination Technologies

@date   		20 October 2003
 
@Copyright     	Copyright 2003-2004 by Imagination Technologies Limited.
                All rights reserved. No part of this software, either
                material or conceptual may be copied or distributed,
                transmitted, transcribed, stored in a retrieval system
                or translated into any human or computer language in any
                form by any means, electronic, mechanical, manual or
                other-wise, or disclosed to third parties without the
                express written permission of Imagination Technologies
                Limited, Unit 8, HomePark Industrial Estate,
                King's Langley, Hertfordshire, WD4 8LZ, U.K.

@Platform		generic

@Description	This header provides common system-specific declarations and macros
                that are supported by all system's

@DoxygenVer		

******************************************************************************/

/******************************************************************************
Modifications :-
$Log: syscommon.h $
*****************************************************************************/

#ifndef _SYSCOMMON_H
#define _SYSCOMMON_H

#include "sysconfig.h"      /* System specific system defines */
#include "sysinfo.h"		/* globally accessible system inof */

 
#if defined (__cplusplus)
extern "C" {
#endif

/****************************************************************************
 *	common enums
 ****************************************************************************/
 
/*!
 ****************************************************************************
	MMU operation mode enum
 ****************************************************************************/
typedef enum
{
    SYS_MMU_LINEAR, /*!< manages a contiguous range of memory pages */
    SYS_MMU_NORMAL, /*!< normal MMU operation (scatter/gather) */
    SYS_MMU_DISABLE /*!< MMU disabled - dev. virt addr == dev phys addr */
} SYS_MMU_MODE;


/*!
 ****************************************************************************
	Clock gating core enum
	//FIXME: this is not generalised - needs to generic hooks for every device
 ****************************************************************************/
typedef enum _DEV_CLOCKGATE_CORE{
	DEV_CGCORE_MBX_2D          		= 0, 
	DEV_CGCORE_MBX_ASYNC_2D			= 1,
	DEV_CGCORE_MBX_TA				= 2,
	DEV_CGCORE_MBX_3D          		= 3,
	DEV_CGCORE_M24VA           		= 4,
	DEV_CGCORE_PDP_GRAPHICS    		= 5,
	DEV_CGCORE_PDP_OVERLAY     		= 6,
	
	DEV_CLOCKGATE_CORE_FORCE_I32	= 0x7fffffff
} DEV_CLOCKGATE_CORE;


/****************************************************************************
 *	common data structures
 ****************************************************************************/

/*!
 ****************************************************************************
	Pool descriptor for a given system
 ****************************************************************************/
typedef struct _POOL_DESCRIPTOR_TAG
{
    char 			*name;    /*!< memory pool has a unique name for diagnostic purposes */
    
    IMG_SYS_PHYADDR BaseSysPAddr;/*!< System physical base address of the managed memory pool. */

    IMG_SIZE_T 		uSize;    /*!< Size in bytes of the managed memory pool. */

    void (*hook_first_alloc) (void *);    /*!< Hook to be called when an allocation is made from 
    										this memory pool and the pool is currently not used. 
    										Think power control. */

    
    void (*hook_last_free) (void *);	    /*!< Hook (or NULL) to be called when the last allocation 
    											from this memory pool is deallocated. 
    											Think power control. */

    void *hook_handle;						/*!< Arbitrary argument to pass into hook_first_alloc() 
    											and hook_last_free () */
} SYS_POOL_DESCRIPTOR;


/*!
 ****************************************************************************
	Top level system data structure
 ****************************************************************************/
typedef struct _SYS_DATA_TAG_
{
    IMG_BOOL                    bStaticEnumeration;    		/*!< static/dynamic dev. enumeration */
    IMG_UINT32                  ui32InstalledISRs;     	 	/*!< number of installed ISRs */
    IMG_UINT32                  ui32NumDevices;      	   	/*!< number of devices in system */
    IMG_BOOL                    bBMInitialised;         	/*!< has the BM been initialised */
    PVRSRV_DEV_INFO             *psDevInfoList;       	  	/*!< list of device info structures */
    PVRSRV_QUEUE_INFO           *psQueueList;           	/*!< list of all command queues in the system */
    PVRSRV_DEVICE_IDENTIFIER    asDevIdList[MAX_DEVICE_IDENTIFIERS]; /*!< device identifier structures */
    IMG_UINT32                  *pui32KickerAddr;			/*!< CPU linear address of kicker register */
    IMG_PVOID                   pvEnvSpecificData;      	/*!< Environment specific data */
    IMG_PVOID                   pvSysSpecificData;    	  	/*!< Unique to system, accessible at system layer only */
    volatile IMG_BOOL           bDummyProcessing;			/*!< dummy Q processing signal */
	PVRSRV_RES_HANDLE			hQProcessResource;			/*!< Command Q processing access lock */

    PVRSRV_MUTEX_HANDLE         hQueueProcessingAccess;     /*!< Another command Q processing access lock */

    SYS_POOL_DESCRIPTOR         asSysPool[MAX_SYSTEM_POOLS];/*!< system pools */
    IMG_HANDLE					bm_hs;						/*!< buffer manager details */
    struct _DB_STATE_			*db_state;					/*!< dual buffer details */
} SYS_DATA, *PSYS_DATA;


/****************************************************************************
 *	common function prototypes
 ****************************************************************************/

PVRSRV_ERROR SysAcquireData(SYS_DATA **ppsSysData);
PVRSRV_ERROR SysReleaseData(SYS_DATA *psSysData);
PVRSRV_ERROR SysFindLocation(PVRSRV_DEV_INFO *psDevInfo);
PVRSRV_ERROR SysInstallISR(PPVRSRV_DEV_INFO psDevInfo);
PVRSRV_ERROR SysUnInstallISR(PPVRSRV_DEV_INFO psDevInfo);
PVRSRV_ERROR SysGetManagedMemoryInfo (SYS_POOL_DESCRIPTOR **pDescriptor, IMG_UINT32 *pCount);
SYS_MMU_MODE SysMMUMode (IMG_VOID);
IMG_UINT32 SysGetDevicePhysOffset(IMG_VOID);
IMG_VOID SysGlobalDisableInterrupts(IMG_VOID);
IMG_VOID SysGlobalEnableInterrupts(IMG_VOID);
IMG_UINT32 SysDecodeDeviceInterrupts(PVRSRV_DEV_INFO *psDevInfo, IMG_PVOID pvLinRegBaseAddr);
IMG_UINT32 SysEnableDeviceInterrupts(PVRSRV_DEV_INFO *psDevInfo,
                                   IMG_PVOID pvLinRegBaseAddr,
                                   IMG_UINT32 ui32Interrupts);
IMG_UINT32 SysDisableDeviceInterrupts (PVRSRV_DEV_INFO *psDevInfo,
                                       IMG_PVOID pvLinRegBaseAddr,
                                       IMG_UINT32 ui32Interrupts);

IMG_VOID SysClearDeviceInterrupts(PVRSRV_DEV_INFO *psDevInfo,
                                  IMG_PVOID pvLinRegBaseAddr,
                                  IMG_UINT32 ui32Interrupts);
PVRSRV_ERROR SysDeviceReset(SYS_DATA *psSysData, PVRSRV_DEV_INFO *psDevInfo);                            
#ifdef PDUMP
PVRSRV_PDUMP_MEMMAP* SysGetPDUMPData();
IMG_VOID SysReleasePDUMPData(PVRSRV_PDUMP_MEMMAP *psPDData);
#endif

IMG_VOID IMG_EXPORT SysKickCmdProc(IMG_UINT32 *pui32KickerAddr);

PVRSRV_ERROR SysCoreEnable(PPVRSRV_DEV_INFO psDevInfo, DEV_CLOCKGATE_CORE eCGCore, IMG_BOOL bBlockMutex);
PVRSRV_ERROR SysCoreDisable(PPVRSRV_DEV_INFO psDevInfo, DEV_CLOCKGATE_CORE eCGCore, IMG_BOOL bBlockMutex);
IMG_BOOL SysCoreQuery(IMG_UINT32 ui32Core);

#ifdef LOCAL_MEMORY_SELF_REFRESH
/********************************************************************************
FUNCTION: SysLocalMemoryDisable
PURPOSE: Send event to put local memory into self-refresh
*********************************************************************************/
PVRSRV_ERROR SysLocalMemoryDisable(PPVRSRV_DEV_INFO psDevInfo);
/********************************************************************************
FUNCTION: SysLocalMemoryEnable
PURPOSE: Put local memory into active state
*********************************************************************************/
PVRSRV_ERROR SysLocalMemoryEnable(PPVRSRV_DEV_INFO psDevInfo);
#endif // LOCAL_MEMORY_SELF_REFRESH

IMG_VOID SysInitDisplay(IMG_VOID);
IMG_VOID SysDeInitDisplay(IMG_VOID);

#if defined(__cplusplus)
}
#endif

#endif

/*****************************************************************************
 End of file (syscommon.h)
*****************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -