Data Structures | |
| struct | _UNIV_dcp |
| Universe II DMA Control Packet. More... | |
Defines | |
| #define | UNIV_K_DCTL_LD64EN ( 1 << UNIV_V_DCTL_LD64EN) |
| Enable PCI 64 Bit Bus Transactions. | |
| #define | UNIV_K_DCTL_VCT_NO_BLT ( 0 << UNIV_V_DCTL_VCT) |
| Disallow BLT's. | |
| #define | UNIV_K_DCTL_VCT_BLT ( 1 << UNIV_V_DCTL_VCT) |
| Allow BLT's. | |
| #define | UNIV_K_DCTL_SUPER_USER (0x00 << UNIV_V_DCTL_SUPER) |
| User AM Code. | |
| #define | UNIV_K_DCTL_SUPER_SUPER (0x01 << UNIV_V_DCTL_SUPER) |
| Supervisor AM Code. | |
| #define | UNIV_K_DCTL_PGM_DATA (0x00 << UNIV_V_DCTL_PGM) |
| Data AM Code. | |
| #define | UNIV_K_DCTL_PGM_PROGRAM (0x01 << UNIV_V_DCTL_PGM) |
| Program AM Code. | |
| #define | UNIV_K_DCTL_VAS_A16 (0x00 << UNIV_V_DCTL_VAS) |
| VME Address Space = A16. | |
| #define | UNIV_K_DCTL_VAS_A24 (0x01 << UNIV_V_DCTL_VAS) |
| VME Address Space = A24. | |
| #define | UNIV_K_DCTL_VAS_A32 (0x02 << UNIV_V_DCTL_VAS) |
| VME Address Space = A32. | |
| #define | UNIV_K_DCTL_VAS_RSVD_3 (0x03 << UNIV_V_DCTL_VAS) |
| VME Address Space = Reserved. | |
| #define | UNIV_K_DCTL_VAS_RSVD_4 (0x04 << UNIV_V_DCTL_VAS) |
| VME Address Space = Reserved. | |
| #define | UNIV_K_DCTL_VAS_RSVD_5 (0x05 << UNIV_V_DCTL_VAS) |
| VME Address Space = Reserved. | |
| #define | UNIV_K_DCTL_VAS_USER1 (0x06 << UNIV_V_DCTL_VAS) |
| VME Address Space = User 1. | |
| #define | UNIV_K_DCTL_VAS_USER2 (0x07 << UNIV_V_DCTL_VAS) |
| VME Address Space = User 2. | |
| #define | UNIV_K_DCTL_VDW_08 (0x00 << UNIV_V_DCTL_VDW) |
| VME Maximum Datawidth = 8 bits. | |
| #define | UNIV_K_DCTL_VDW_16 (0x01 << UNIV_V_DCTL_VDW) |
| VME Maximum Datawidth = 16 bits. | |
| #define | UNIV_K_DCTL_VDW_32 (0x02 << UNIV_V_DCTL_VDW) |
| VME Maximum Datawidth = 32 bits. | |
| #define | UNIV_K_DCTL_VDW_64 (0x03 << UNIV_V_DCTL_VDW) |
| VME Maximum Datawidth = 64 bits. | |
| #define | UNIV_K_DCTL_L2V_V2L (0x00 << UNIV_V_DCTL_L2V) |
| Transfer direction is PCI => VME. | |
| #define | UNIV_K_DCTL_L2V_L2V (0x01 << UNIV_V_DCTL_V2L) |
| Transfer direction is VME => PCI. | |
Typedefs | |
| typedef _UNIV_dcp * | UNIV_dcpp |
| Typedef for a pointer to struct _UNIV_dcp. More... | |
| typedef _UNIV_dcp | UNIV_dcp |
| Typedef for struct _UNIV_dcp. | |
| typedef void(* | UNIV_isr )(void *parameter) |
| Signature for a UNIV interrupt service routine. More... | |
| typedef enum _UNIV_V_dctl | UNIV_V_dctl |
| Typedef for enum _UNIV_V_dctl. More... | |
| typedef enum _UNIV_S_dctl | UNIV_S_dctl |
| Typedef for enum _UNIV_S_dctl. | |
| typedef enum _UNIV_M_dctl | UNIV_M_dctl |
| Typedef for enum _UNIV_M_dctl. | |
| typedef enum _UNIV_V_dgcs | UNIV_V_dgcs |
| Typedef for enum _UNIV_V_dgcs. More... | |
| typedef enum _UNIV_S_dgcs | UNIV_S_dgcs |
| Typedef for enum _UNIV_S_dgcs. | |
| typedef enum _UNIV_M_dgcs | UNIV_M_dgcs |
| Typedef for enum _UNIV_S_dgcs. | |
Enumerations | |
| enum | _UNIV_V_dctl { UNIV_V_DCTL_RSVD_0 = 6, UNIV_V_DCTL_LD64EN = 7, UNIV_V_DCTL_VCT = 8, UNIV_V_DCTL_RSVD_1 = 9, UNIV_V_DCTL_SUPER = 12, UNIV_V_DCTL_PGM = 14, UNIV_V_DCTL_VAS = 16, UNIV_V_DCTL_RSVD_2 = 19, UNIV_V_DCTL_VDW = 22, UNIV_V_DCTL_RSVD_3 = 24, UNIV_V_DCTL_L2V = 31 } |
| Gives the number of bits to shift needed to right justify the bits field in the DCTL control word. More... | |
| enum | _UNIV_S_dctl { UNIV_S_DCTL_RSVD_0 = 7, UNIV_S_DCTL_LD64EN = 1, UNIV_S_DCTL_VCT = 1, UNIV_S_DCTL_RSVD_1 = 3, UNIV_S_DCTL_SUPER = 3, UNIV_S_DCTL_PGM = 2, UNIV_S_DCTL_VAS = 3, UNIV_S_DCTL_RSVD_2 = 3, UNIV_S_DCTL_VDW = 2, UNIV_S_DCTL_RSVD_3 = 7, UNIV_S_DCTL_L2V = 1 } |
| Gives the size of each of the bit fields in the DCTL control word. More... | |
| enum | _UNIV_M_dctl { UNIV_M_DCTL_RSVD_0 = 0x0000007E, UNIV_M_DCTL_LD64EN = 0x00000080, UNIV_M_DCTL_VCT = 0x00000100, UNIV_M_DCTL_RSVD_1 = 0x00000E00, UNIV_M_DCTL_SUPER = 0x00003000, UNIV_M_DCTL_PGM = 0x0000C000, UNIV_M_DCTL_VAS = 0x00070000, UNIV_M_DCTL_RSVD_2 = 0x00380000, UNIV_M_DCTL_VDW = 0x00C00000, UNIV_M_DCTL_RSVD_3 = 0x7F000000, UNIV_M_DCTL_L2V = 0x80000000 } |
| Gives in place extraction masks for each of the bit fields in the DCTL control word. More... | |
| enum | _UNIV_V_dgcs { UNIV_V_DGCS_INT_P_ERR = 0, UNIV_V_DGCS_INT_VERR = 1, UNIV_V_DGCS_INT_LERR = 2, UNIV_V_DGCS_INT_DONE = 3, UNIV_V_DGCS_INT_RSVD4 = 4, UNIV_V_DGCS_INT_HALT = 5, UNIV_V_DGCS_INT_STOP = 6, UNIV_V_DGCS_INT_RSVD7 = 7, UNIV_V_DGCS_P_ERR = 8, UNIV_V_DGCS_VERR = 9, UNIV_V_DGCS_LERR = 10, UNIV_V_DGCS_DONE = 11, UNIV_V_DGCS_RSVD12 = 12, UNIV_V_DGCS_HALT = 13, UNIV_V_DGCS_STOP = 14, UNIV_V_DGCS_ACT = 15, UNIV_V_DGCS_VOFF = 16, UNIV_V_DGCS_VON = 20, UNIV_V_DGCS_RSVD23 = 23, UNIV_V_DGCS_RSVD24 = 24, UNIV_V_DGCS_CHAIN = 27, UNIV_V_DGCS_RSVD28 = 28, UNIV_V_DGCS_HALT_REQ = 29, UNIV_V_DGCS_STOP_REQ = 30, UNIV_V_DGCS_GO = 31, UNIV_V_DGCS_INT_ENB_ERR = 0, UNIV_V_DGCS_INT_ENB_SUC = 3, UNIV_V_DGCS_INT_ENB_ALL = 0, UNIV_V_DGCS_INT_STS_ERR = 8, UNIV_V_DGCS_INT_STS_SUC = 11, UNIV_V_DGCS_INT_STS_ALL = 8, UNIV_V_DGCS_STS_ALL = 8 } |
| Maps out the DMA General Control/Status Register. More... | |
| enum | _UNIV_S_dgcs { UNIV_S_DGCS_INT_P_ERR = 1, UNIV_S_DGCS_INT_VERR = 1, UNIV_S_DGCS_INT_LERR = 1, UNIV_S_DGCS_INT_RSVD4 = 1, UNIV_S_DGCS_INT_DONE = 1, UNIV_S_DGCS_INT_HALT = 1, UNIV_S_DGCS_INT_STOP = 1, UNIV_S_DGCS_INT_RSVD7 = 1, UNIV_S_DGCS_P_ERR = 1, UNIV_S_DGCS_VERR = 1, UNIV_S_DGCS_LERR = 1, UNIV_S_DGCS_DONE = 1, UNIV_S_DGCS_RSVD12 = 1, UNIV_S_DGCS_HALT = 1, UNIV_S_DGCS_STOP = 1, UNIV_S_DGCS_ACT = 1, UNIV_S_DGCS_VOFF = 4, UNIV_S_DGCS_VON = 3, UNIV_S_DGCS_RSVD23 = 1, UNIV_S_DGCS_RSVD24 = 3, UNIV_S_DGCS_CHAIN = 1, UNIV_S_DGCS_RSVD28 = 1, UNIV_S_DGCS_HALT_REQ = 1, UNIV_S_DGCS_STOP_REQ = 1, UNIV_S_DGCS_GO = 1, UNIV_S_DGCS_INT_ENB_ERR = 3, UNIV_S_DGCS_INT_ENB_SUC = 4, UNIV_S_DGCS_INT_ENB_ALL = 7, UNIV_S_DGCS_INT_STS_ERR = 3, UNIV_S_DGCS_INT_STS_SUC = 4, UNIV_S_DGCS_INT_STS_ALL = 3, UNIV_S_DGCS_STS_ALL = 8 } |
| Maps out the sizes of bit fields in the DMA General Control/Status Register. More... | |
| enum | _UNIV_M_dgcs { UNIV_M_DGCS_INT_P_ERR = (1<<UNIV_V_DGCS_INT_P_ERR), UNIV_M_DGCS_INT_VERR = (1<<UNIV_V_DGCS_INT_VERR ), UNIV_M_DGCS_INT_LERR = (1<<UNIV_V_DGCS_INT_LERR ), UNIV_M_DGCS_INT_DONE = (1<<UNIV_V_DGCS_INT_DONE ), UNIV_M_DGCS_INT_RSVD4 = (1<<UNIV_V_DGCS_INT_RSVD4), UNIV_M_DGCS_INT_HALT = (1<<UNIV_V_DGCS_INT_HALT ), UNIV_M_DGCS_INT_STOP = (1<<UNIV_V_DGCS_INT_STOP ), UNIV_M_DGCS_INT_RSVD7 = (1<<UNIV_V_DGCS_INT_RSVD7), UNIV_M_DGCS_P_ERR = (1 << UNIV_V_DGCS_P_ERR), UNIV_M_DGCS_VERR = (1 << UNIV_V_DGCS_VERR ), UNIV_M_DGCS_LERR = (1 << UNIV_V_DGCS_LERR ), UNIV_M_DGCS_DONE = (1 << UNIV_V_DGCS_DONE ), UNIV_M_DGCS_HALT = (1 << UNIV_V_DGCS_HALT ), UNIV_M_DGCS_STOP = (1 << UNIV_V_DGCS_STOP ), UNIV_M_DGCS_ACT = (1 << UNIV_V_DGCS_ACT ), UNIV_M_DGCS_VOFF = (0xf<<UNIV_V_DGCS_VOFF ), UNIV_M_DGCS_VON = (0x7<<UNIV_V_DGCS_VOFF ), UNIV_M_DGCS_RSVD23 = (1 <<UNIV_V_DGCS_RSVD23), UNIV_M_DGCS_RSVD24 = (0x7<<UNIV_V_DGCS_RSVD24), UNIV_M_DGCS_CHAIN = (1 <<UNIV_V_DGCS_CHAIN), UNIV_M_DGCS_RSVD28 = (1 <<UNIV_V_DGCS_RSVD28), UNIV_M_DGCS_HALT_REQ = (1<<UNIV_V_DGCS_HALT_REQ), UNIV_M_DGCS_STOP_REQ = (1<<UNIV_V_DGCS_STOP_REQ), UNIV_M_DGCS_GO = (1 <<UNIV_V_DGCS_GO), UNIV_M_DGCS_INT_ENB_ERR, UNIV_M_DGCS_INT_ENB_SUC, UNIV_M_DGCS_INT_ENB_ALL, UNIV_M_DGCS_INT_STS_ERR, UNIV_M_DGCS_INT_STS_SUC, UNIV_M_DGCS_INT_STS_ALL, UNIV_M_DGCS_STS_ALL = (UNIV_M_DGCS_INT_STS_ALL | UNIV_M_DGCS_ACT) } |
| Maps out in place masks of the bit fields in the DMA General Control/Status Register. More... | |
Functions | |
| _UNIV_dcp * | UNIV_DCPP_read (void) |
| Reads the DCPP register, (Command Packet Pointer). More... | |
| void | UNIV_DCPP_write (const struct _UNIV_dcp *cmd) |
| Write the DCPP register with the head of a DMA linked list. More... | |
| unsigned int | UNIV_DTBC_read (void) |
| Reads the DTBC register, (Transfer Byte Count). More... | |
| void | UNIV_DTBC_write (unsigned int byte_count) |
| Writes the DTBC register, (Transfer Byte Count). More... | |
| unsigned int | UNIV_DGCS_read (void) |
| Reads the DGCS register, (General Control/Status Register. More... | |
| unsigned int | UNIV_go (void) |
| Initiates a start on on a DMA operation by hitting to GO bit in the DGCS register. More... | |
| unsigned int | UNIV_request_halt (void) |
| Request a halt on an ongoing DMA operation. More... | |
| unsigned int | UNIV_request_stop (void) |
| Request a stop on an ongoing DMA operation. More... | |
| unsigned int | UNIV_DGCS_bclr (unsigned int bits_to_clr) |
| Clears the specified bits in the DGCS register, (General Control/Status Register). More... | |
| unsigned int | UNIV_DGCS_bmod (unsigned int bits_to_mod, unsigned int value) |
| Modifies a selected set of bits in the DGCS register. More... | |
| unsigned int | UNIV_DGCS_bset (unsigned int bits_to_set) |
| Sets the specified bits in the DGCS register. More... | |
| void | UNIV_DGCS_write (unsigned int value) |
| Writes the DGCS register, (General Control/Status Register). More... | |
| int | UNIV_int_connect (unsigned int which, UNIV_isr service, void *parameter) |
| Connects a ISR routine to service the UNIVERSET II interrupts. More... | |
| int | UNIV_int_enable (void) |
| Enables delivery of interrupts from the UNIVERSE II. More... | |
| int | UNIV_int_disable (void) |
| Disables delivery of interrupts from the UNIVERSE II. More... | |
| unsigned int | UNIV_bus_master_set (void) |
| Ensures the UNIVERSE II is a PCI bus master. More... | |
| void | UNIV_dcp_array_init (struct _UNIV_dcp *dcpp, int cnt) |
| Initializes an array of Universe DMA Command packets to form a circular list. Only the link field is filled in. More... | |
| void | UNIV_dcp_complete (struct _UNIV_dcp *dcpp, unsigned int dctl, unsigned int vmeAdr, unsigned char *dstAdr, int nbytes) |
| Complete the DMA Command Packet, ie finishes the job UNIV_dcp_array_init started. More... | |
| void | UNIV_go_at (struct _UNIV_dcp *dcpp) |
| This initiates a chain UNIV transfer by the Universe at the specified command head. More... | |
|
|
Typedef for a pointer to struct _UNIV_dcp.
Defines the DMA Control Packet. These packets can be linked together to form a chained DMA operation, which is seeded in the Universe's DCPP control register. |
|
|
Signature for a UNIV interrupt service routine.
A Universe interrupt is serviced by a callback routine with this signature.
void (*isr)(void *parameter)
|
|
|
Typedef for enum _UNIV_V_dctl.
The UNIVERSE control word contains bit fields which control the transfer of data between the PCI and VME busses. In addition to definitions of the bare bit fields, several useful collections are defined. These are confined to the interrupt and status bits. There are basically two sets of the same bits, one set for enabling interrupt sources and one set of reporting/clearing interrupt status. Each set is confined to a byte, the enabling set in the least significant byte and the reporting/clearing set in the next byte out. These sets are referenced by UNIV_x_DGCS_INT_ENB_xxx and UNIV_x_DGCS_INT_STS_xxx. Each of these sets are broken into two sets, a set which deal with error conditions and a set that deal with normal (expected, like DMA complete) conditions. These are referenced by the symbols with _ERR_ and _SUC_ in their names.
|
|
|
Typedef for enum _UNIV_V_dgcs.
The UNIVERSE DMA General Control/Status Register contains enables, status and action bits. Enable bits are set by the user and are sticky, ie the stay in whatever state the user places them in. Status bits are set by the hardware in response to some condition it detects and cleared by the user after acknowledging them. Action bits are used to initiate some action. They are generally self-clearing. That is one sets them, and after the action is completed or acknowledged, the bit clears.
|
|
|
|
Maps out in place masks of the bit fields in the DMA General Control/Status Register.
|
|
|
Gives the size of each of the bit fields in the DCTL control word.
|
|
|
Maps out the sizes of bit fields in the DMA General Control/Status Register.
|
|
|
Gives the number of bits to shift needed to right justify the bits field in the DCTL control word.
|
|
|
Maps out the DMA General Control/Status Register.
|
|
|
Ensures the UNIVERSE II is a PCI bus master.
|
|
||||||||||||
|
Initializes an array of Universe DMA Command packets to form a circular list. Only the link field is filled in.
|
|
||||||||||||||||||||||||
|
Complete the DMA Command Packet, ie finishes the job UNIV_dcp_array_init started.
|
|
|
Reads the DCPP register, (Command Packet Pointer).
|
|
|
Write the DCPP register with the head of a DMA linked list.
|
|
|
Clears the specified bits in the DGCS register, (General Control/Status Register).
*adr &= ~bitsToClr;
|
|
||||||||||||
|
Modifies a selected set of bits in the DGCS register.
|
|
|
Sets the specified bits in the DGCS register.
*adr |= bitsToSet;
|
|
|
Reads the DGCS register, (General Control/Status Register.
|
|
|
Writes the DGCS register, (General Control/Status Register).
|
|
|
Reads the DTBC register, (Transfer Byte Count).
|
|
|
Writes the DTBC register, (Transfer Byte Count).
|
|
|
Initiates a start on on a DMA operation by hitting to GO bit in the DGCS register.
|
|
|
This initiates a chain UNIV transfer by the Universe at the specified command head.
It is recommended that this function, rather the combination be used, since this function avoids unnecessary EIEIO's. |
|
||||||||||||||||
|
Connects a ISR routine to service the UNIVERSET II interrupts.
void (*isr_routine) (void *parameter)
A possible model is a QIO model, where the user submits IO requests to a central 'driver'. The IOs are placed on a que and the driver services them one by one. Part of the IO information would be a user supplied callback routine to handle the asynchronous completion. The which parameter enable the sources on the Universe to generate interrupts. These are from the set
UNIV_M_DGCS_INT_P_ERR
UNIV_M_DGCS_INT_VERR
UNIV_M_DGCS_INT_LERR
UNIV_M_DGCS_INT_DONE
UNIV_M_DGCS_INT_HALT
UNIV_M_DGCS_INT_STOP
These indicate which sources this particular ISR is willing to service. |
|
|
Disables delivery of interrupts from the UNIVERSE II.
|
|
|
Enables delivery of interrupts from the UNIVERSE II.
|
|
|
Request a halt on an ongoing DMA operation.
"Linked-list operation can be halted by setting the HALT_REQ bit in the DGCS register. When the HALT_REG bit is set, the DMA terminates when all transfers defined by the current command packet is complete. It then load the next command packtet into its registers. The HALT bit in the DGCS register is asserted, and the ACT bit in the DGCS register is cleared. The PROCESSED bit in the linked-list is set to "1" approximately 1us after the HALT bit is set: therefore after a DMA halt the user should wait at least 1us before checking the PROCESSED bit." "The DMA can be restarted by clearing the HALT status bit and setting the GO bit if desired during the same register write. If the DMA is restarted, the ACT is set by the Universe II and execution continues as if no HALT had occurred: i.e. the Universe II processes the current command packet." Note that the HALT is done as an asynchronous operation, it is merely a request to HALT. The user must wait till the halt is actually done by either fielding the HALT interrupt or polling the HALTED status bit. |
|
|
Request a stop on an ongoing DMA operation.
"In contrast to a HALT, the DMA can also be immediately terminated through the STOP_REQ bit. This will stop all DMA operations on the source bus immediately, and set the STOP bit in the same register when the last piece of queued data in the DMA FIFO has been written to the destination bus." "Once stopped the DVA, DLA and DTBC registers contain values indicating the addresses to read/write and the number of bytes remaining in the transfer. Clearing the STOP bit and setting the GO bit will cause the DMA to start up agian from where it left off, including continuing with subsequent command packets in the list." Note that the STOP is done as an asynchronous operation, it is merely a request to STOP. The user must wait till the halt is actually done by either fielding the STOP interrupt or polling the HALTED status bit. |
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001