#ifndef _MAILBOX_H_
#define _MAILBOX_H_
 
#ifndef MAILBOX_MAJOR
#define MAILBOX_MAJOR 0   
#endif
 
struct mailbox_dev                                     
{                                                        
  char *data;                      
  unsigned long size;       
};
/* Use 'k' as magic number */
#define MAILBOX_IOC_MAGIC  'k'
/* Please use a different 8-bit number in your code */

#define MAILBOX_DSP_START    _IOWR(MAILBOX_IOC_MAGIC, 0,int)
#define MAILBOX_SENDMSG      _IOWR(MAILBOX_IOC_MAGIC,1,int)
#define MAILBOX_RECVMSG      _IOWR(MAILBOX_IOC_MAGIC,2,int)
#define MAILBOX_M3_START    _IOWR(MAILBOX_IOC_MAGIC, 3,int)
#define MAILBOX_SENDMSG_M3      _IOWR(MAILBOX_IOC_MAGIC,4,int)


#define  MAILBOX_IOC_MAXNR  7

#define PRCM_BASE_ADDR			0x48180000
#define CTRL_MODULE_BASE_ADDR		0x48140000
#define GEM_L2RAM_BASE_ADDR		0x40800000
#define MAILBOX_BASE_ADDR		0x480c8000

/*GEMSS PRCEM definition*/
int CM_GEM_CLKSTCTRL;
int CM_ACTIVE_GEM_CLKCTRL;
int PM_ACTIVE_PWRSTST;
int RM_ACTIVE_RSTCTRL;
int RM_ACTIVE_RSTST	;

int CM_MMU_CLKSTCTRL;
int CM_ALWON_MMUDATA_CLKCTRL;

int CM_MMUCFG_CLKSTCTRL;
int CM_ALWON_MMUCFG_CLKCTRL;
#define WR_MEM_32(addr, data)    do {*(volatile unsigned int*)(addr) =(unsigned int)(data);}while(0)
#define RD_MEM_32(addr) 	  	 *(volatile unsigned int*)(addr)
#define REG(x)              (*((volatile uint32_t *)(x)))
int DSPBOOTADDR	;
int DSPMEM_SLEEP;
unsigned char* v_PRCM_BASE_ADDR = 0;
unsigned char* v_CTRL_MODULE_BASE_ADDR = 0;
unsigned char* v_GEM_L2RAM_BASE_ADDR = 0;
unsigned char* v_MAILBOX_BASE_ADDR = 0;

int MAILBOX_MESSAGE;
int MAILBOX_FIFOSTATUS;
int MAILBOX_MSGSTATUS;
int MAILBOX_IRQSTATUS_RAW_U1;
int MAILBOX_IRQSTATUS_CLR_U1;
int MAILBOX_IRQENABLE_SET_U1;
int MAILBOX_IRQENABLE_CLR_U1;

int MAILBOX_MESSAGE1;
int MAILBOX_FIFOSTATUS1;
int MAILBOX_MSGSTATUS1;
int MAILBOX_IRQSTATUS_RAW_U0;
int MAILBOX_IRQSTATUS_CLR_U0;
int MAILBOX_IRQENABLE_SET_U0;
int MAILBOX_IRQENABLE_CLR_U0;

int MAILBOX_MESSAGE_M3;
int MAILBOX_FIFOSTATUS_M3;
int MAILBOX_MSGSTATUS_M3;
int MAILBOX_IRQSTATUS_RAW_U2;
int MAILBOX_IRQSTATUS_CLR_U2;
int MAILBOX_IRQENABLE_SET_U2;
int MAILBOX_IRQENABLE_CLR_U2;

unsigned char* v_DUCATI_BASE_ADDR = 0;
unsigned char* v_DUCATI_MMU_CFG = 0;

int RM_DEFAULT_RSTCTRL;
int CM_DEFAULT_DUCATI_CLKSTCTRL;
int CM_DEFAULT_DUCATI_CLKCTRL;
int DUCATI_BASE_ADDR;
int DUCATI_MMU_CFG;
int RM_DEFAULT_RSTST;

#endif