#include <vxWorks.h>
#include <sysLib.h>
#include <intLib.h>
#include <iv.h>
#include "MV2X/mv2600.h"
#include "./universe.h"
#include "UNIV_vxworks.h"
#include "BVME/UNIV.h"
#include "BBC/BSWP.ih"
Defines | |
| #define | UNIV_A_DGCS (volatile unsigned int *)UNIVERSE_DGCS |
| Address of General Control/Status Register. | |
| #define | UNIV_A_DCPP (volatile unsigned int *)UNIVERSE_DCPP |
| Address of Command Packet Pointer Register. | |
| #define | UNIV_A_DTBC (volatile unsigned int *)UNIVERSE_DTBC |
| Address of Transfer Byte Count Register. | |
| #define | UNIV_A_PCI_CSR (volatile unsigned int *)UNIVERSE_PCI_CSR |
| Address of PCI CSR Register. | |
| #define | UNIV_A_LINT_EN (volatile unsigned int *)UNIVERSE_LINT_EN |
| Address of LINT Enable (PCI interrupt). | |
| #define | UNIV_A_LINT_STAT (volatile unsigned int *)UNIVERSE_LINT_STAT |
| Addesss of LINT Status Register. | |
| #define | DGCS_ERRMSK (DGCS_LERR | DGCS_VERR | DGCS_P_ERR) |
| Error status bits. | |
| #define | DGCS_STATUS (DGCS_ACT | DGCS_DONE | DGCS_ERRMSK) |
| Success Status bits. | |
| #define | eieio asm volatile ("eieio"::) |
| Drops an eieio instruction. | |
Functions | |
| unsigned int | readReg (volatile unsigned int *adr) |
| Internal function to read a 32 PCI address, with eieio synch. More... | |
| unsigned int | mreadReg (volatile unsigned int *adr) |
| Internal function to read a 32 PCI address, no eieio synch. More... | |
| unsigned int | bclrReg (volatile unsigned int *adr, unsigned int clrMsk) |
| Clears the specified bits. More... | |
| unsigned int | bmodReg (volatile unsigned int *adr, unsigned int modMsk, unsigned int val) |
| Modifies a selected set of bits. More... | |
| unsigned int | bsetReg (volatile unsigned int *adr, unsigned int setMsk) |
| Sets the specified bits. More... | |
| void | writeReg (volatile unsigned int *adr, unsigned int value) |
| Internal function to write a 32 PCI address, with eieio synch. More... | |
| void | mwriteReg (volatile unsigned int *adr, unsigned int value) |
| Internal function to write a 32 PCI address, no eieio synch. More... | |
| unsigned int | readDGCS (void) |
| Reads the DGCS register. More... | |
| unsigned int | bclrDGCS (unsigned int bitsToClr) |
| Clears the specified bits in the DGCS register. More... | |
| unsigned int | bmodDGCS (unsigned int bitsToMod, unsigned int value) |
| Modifies a selected set of bits in the DGCS register. More... | |
| unsigned int | bsetDGCS (unsigned int bitsToClr) |
| Sets the specified bits in the DGCS register. More... | |
| void | writeDGCS (unsigned int value) |
| Writes the DGCS register. More... | |
| _UNIV_dcp * | UNIV_DCPP_read (void) |
| Reads the DCPP register, (Command Packet Pointer). More... | |
| void | UNIV_DCPP_write (const struct _UNIV_dcp *dcpp) |
| 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 byteCount) |
| 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_DGCS_bclr (unsigned int bitsToClr) |
| Clears the specified bits in the DGCS register, (General Control/Status Register). More... | |
| unsigned int | UNIV_DGCS_bmod (unsigned int bitsToMod, unsigned int value) |
| Modifies a selected set of bits in the DGCS register. More... | |
| unsigned int | UNIV_DGCS_bset (unsigned int bitsToSet) |
| 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... | |
| 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... | |
| void | UNIV_go_at (struct _UNIV_dcp *head) |
| This initiates a chain UNIV transfer by the Universe at the specified command head. 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 *lclAdr, int nbytes) |
| Complete the DMA Command Packet, ie finishes the job UNIV_dcp_array_init started. More... | |
| int | UNIV_int_connect (unsigned int which, UNIV_isr routine, void *parameter) |
| Connects a ISR routine to service the UNIVERSET II interrupts. More... | |
| int | UNIV_int_disable (void) |
| Disables delivery of interrupts from the UNIVERSE II. More... | |
| int | UNIV_int_enable () |
| Enables 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... | |
|
|
Clears the specified bits in the DGCS register.
*adr &= ~clrMsk;
|
|
||||||||||||
|
Clears the specified bits.
*adr &= ~clrMsk;
|
|
||||||||||||
|
Modifies a selected set of bits in the DGCS register.
|
|
||||||||||||||||
|
Modifies a selected set of bits.
|
|
|
Sets the specified bits in the DGCS register.
*adr |= setMsk;
|
|
||||||||||||
|
Sets the specified bits.
*adr |= setMsk;
|
|
|
Internal function to read a 32 PCI address, no eieio synch.
|
|
||||||||||||
|
Internal function to write a 32 PCI address, no eieio synch.
|
|
|
Reads the DGCS register.
|
|
|
Internal function to read a 32 PCI address, with eieio synch.
|
|
|
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. |
|
|
Writes the DGCS register.
|
|
||||||||||||
|
Internal function to write a 32 PCI address, with eieio synch.
|
1.2.13.1 written by Dimitri van Heesch,
© 1997-2001