#ifndef _MDRV_MTLB_ST_H_
#define _MDRV_MTLB_ST_H_
//-------------------------------------------------------------------------------------------------
//  Type and Structure
//-------------------------------------------------------------------------------------------------
#include <linux/types.h>

typedef enum {
    E_MTLB_MIU_INVALID = -1,
    E_MTLB_MIU_0 = 0x1,
    E_MTLB_MIU_1 = 0x2,
    E_MTLB_MIU_2 = 0x4,
    E_MTLB_MIU_MAX = 3
} EN_MTLB_Miu;

typedef enum {
    E_MTLB_GE_Src = 0x1,
    E_MTLB_GE_Dest = 0x2,
    E_MTLB_GOP = 0x4
} EN_MTLB_TLB_Client;

typedef enum {
    E_MTLB_GOP0 = 0x1,
    E_MTLB_GOP1 = 0x2,
    E_MTLB_GOP2 = 0x4,
    E_MTLB_GOP3 = 0x8,
    E_MTLB_GOP4 = 0x10,
    E_MTLB_GOP5 = 0x20,
    E_MTLB_GOP6 = 0x40 
} EN_MTLB_GOPID;


typedef struct {
    bool TLB_In_MIU;      //TLB ip in MIU or in GE and GOP	

    bool TLB_GE_Support;  //GE can access memory by TLB address
	unsigned int TLB_GOP_SupportID; //which GOP can access memory by TLB address
	
    bool GE_GOP_Dedicated_TLB_Switch_Support; //ge and gop its dedicated TLB support on-off switch  
    bool GE_Need_CQFlush; //when ge its dedicated TLB on-off switch, whether need flush command queue 

    unsigned int MIU_Reserve_Memory; //which miu need reserve memory for TLB entry

	unsigned long tlb_table_addr_miu0;  //the offset of tlb  table in MIU0
	unsigned long tlb_table_addr_miu1;  //the offset of tlb  table in MIU1
	unsigned long tlb_table_addr_miu2;  //the offset of tlb  table in MIU2    
} mtlb_hardware_info;

typedef struct {
    bool GE_TLB_Source_Enable; //GE source access memory by TLB address or physical address
	bool GE_TLB_Dest_Enable;   //GE dest access memory by TLB address or physical address
	bool GOP_TLB_Enable;       //Gop access memory by TLB address or physical address
} mtlb_hardware_status;

typedef struct {
	unsigned int client; //client is result of EN_MTLB_TLB_Client bit operation
	int gop_id_mask;  //for specify gop id, when client is gop
	bool enable;
} mtlb_tlbclient_enable;


#endif // _MDRV_MTLB_ST_H_

