summaryrefslogtreecommitdiffstats
path: root/include/asm-mips/galileo-boards/evb64120A/i2o.h
blob: a42ecabfe8d2e3d234c40cd11ef432185a8854bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* i2o.h - Header file for the I2O`s interface */

/* Copyright - Galileo technology. */

#ifndef __INCi2oh
#define __INCi2oh

/* includes */            
            
#include "core.h"

/* typedefs */           

typedef enum _i2oMessageReg{MESSAGE_REG_0,MESSAGE_REG_1} I2O_MESSAGE_REG;
typedef enum _cirQueSize{I20_16K = 0x1,I20_32K = 0x2,I20_64K = 0x4,\
                  I20_128K = 0x8,I20_256K = 0xc} CIRCULAR_QUEUE_SIZE;

/* Message handle Functions */
unsigned int    getInBoundMassege(I2O_MESSAGE_REG messageRegNum);
bool  sendOutBoundMassege(I2O_MESSAGE_REG messageRegNum,unsigned int message);
bool  checkInBoundIntAndClear(I2O_MESSAGE_REG messageRegNum);
bool  outBoundMessageAcknowledge(I2O_MESSAGE_REG messageRegNum);
bool  maskInBoundMessageInterrupt(I2O_MESSAGE_REG messageRegNum);
bool  enableInBoundMessageInterrupt(I2O_MESSAGE_REG messageRegNum);
bool  maskOutBoundMessageInterrupt(I2O_MESSAGE_REG messageRegNum);
bool  enableOutBoundMessageInterrupt(I2O_MESSAGE_REG messageRegNum);

/* Doorbell handle Functions */
unsigned int    readInBoundDoorBellInt(void);
bool  initiateOutBoundDoorBellInt(unsigned int interruptBits);
bool  clearInBoundDoorBellInt(unsigned int interruptBits);
bool  isInBoundDoorBellInterruptSet(void);
bool  isOutBoundDoorBellInterruptSet(void); /* For acknowledge */
bool  maskInBoundDoorBellInterrupt(void);
bool  enableInBoundDoorBellInterrupt(void);
bool  maskOutBoundDoorBellInterrupt(void);
bool  enableOutBoundDoorBellInterrupt(void);

/* I2O - Circular Queues handle Functions */

/* initialization */
bool  circularQueueEnable(CIRCULAR_QUEUE_SIZE cirQueSize,
                          unsigned int queueBaseAddr);

/* Inbound Post Queue */
unsigned int    inBoundPostQueuePop(void);
bool    isInBoundPostQueueInterruptSet(void);
bool  clearInBoundPostQueueInterrupt(void);
void    maskInBoundPostQueueInterrupt(void);
void    enableInBoundPostQueueInterrupt(void);
/* Outbound Post Queue */
bool  outBoundPostQueuePush(unsigned int data);
bool    isOutBoundPostQueueEmpty(void);
/* Inbound Free Queue */
bool  inBoundFreeQueuePush(unsigned int data);
bool    isInBoundFreeQueueEmpty(void);
/* Outbound Free Queue */
unsigned int    outBoundFreeQueuePop(void);

#endif  /* __INCi2oh */