(M)  s i s t e m a   o p e r a c i o n a l   m a g n u x   l i n u x ~/ · documentação · suporte · sobre

  Next Previous Contents

4. How to talk to the Tundra Universe PCI-VME bridge using the devices drivers.

4.1 The device drivers used with VMELinux

  • /dev/vme_ioctl
  • /dev/vme_m0
  • /dev/vme_m1
  • /dev/vme_m2
  • /dev/vme_m3
  • /dev/vme_s0
  • /dev/vme_s1
  • /dev/vme_s2
  • /dev/vme_s3

4.2 VMEMaster Device Drivers

/dev/vme_m* are drivers used to access the VMEbus as a bus master.

The Universe chip offers the programmer four VMEMaster windows to the VMEbus. These windows are called Images. The details of the registers within these windows is beyond the scope of this Howto. Please refer to the Universe documentation for details. Tundra Universe

4.3 VMESlave Device Drivers

/dev/vme_s* are drivers used to allow another VMEbus master to access this device.

The Universe chip offers the programmer four VMESlave windows to the VMEbus. These windows are called Images. The details of the registers within these windows is beyond the scope of this Howto. Please refer to the Universe documentation for details. Tundra Universe

Slave VME modes are not yet supported by VMELinux.

4.4 Direct Control of the Universe Registers

/dev/vme_ioctl allows read and write access to the Universe registers.

For experienced users, this device allows direct access to the Universe chip's internal registers. Explanation of these registers and what they do is beyond the scope of this howto. Please consult the Universe documentation available from Tundra Universe

4.5 read()

n = read(vme_handle,buf,len);

Where:

  • vme_handle = The value returned by "open,"
  • buf = pointer to data block,
  • len = number of bytes to read from the VMEbus.

4.6 write()

write(vme_handle,buf,len);

Where:

  • vme_handle = The value returned by "open,"
  • buf = pointer to data block,
  • len = number of bytes to write to the VMEbus.

4.7 lseek()

lseek(vme_handle,vme_pnt,Seek_Type);

Where:

  • vme_handle = The value returned by "open,"
  • vme_pnt = The actual VME address to access,
  • Seek_Type = SEEK_SET or SEEK_CUR

4.8 ioctl()

ioctl(vme_handle, command, argument);

Where:

  • vme_handle = The value returned by "open,"
  • command = IOCTL_SET_CTL or IOCTL_SET_MODE or IOCTL_SET_BS or IOCTL_SET_BD or IOCTL_SET_TO
  • argument to be sent
And:
  • IOCTL_SET_CTL = Sets the image CTL register to argument. Argument must be 32 bits.
  • IOCTL_SET_MODE = "MODE_DMA" or "MODE_PROGRAMMED" - Sets the mode by which the Universe chips communicates to the PCI bus (Not VME Block Mode)
  • IOCTL_SET_BS = Sets the image BS register to arguments. NOTE: The BD register must already be set prior to making this call.
  • IOCTL_SET_BD = Sets the image BD register to argument.
  • IOCTL_SET_TO = Set the image TO register to argument.

4.9 open() and close()

Here is where you open and close the four VMELinux Master or Slave devices plus the Control device. Slave images are not yet supported.

  • vme_handle = open("//dev//vme_m0",O_RDWR,0);
  • uni_handle = open("//dev//vme_ctl",O_RDWR,0);

  • close(vme_handle);
  • close(uni_handle);


Next Previous Contents