Version 1.3.2 of the V6M6 host library contains some significant changes
for the interface to the TDM Subsystem, the IMSCSA module and
building TDM Maps for the IMHDLC Module.
TDM Subsystem Control Changes in Version 1.3.2
Some situations may require the TDM controller on the V6M6 baseboard to generate superframe pulses but not frame pulses. One example is when an IMSCSA module is being used. The IMSCSA module must be the source of TDM frame pulses but is not capable of generating superframe pulses.
To allow the hardware to do this, the TDM FPGA configuration requires the modification available in the flash object file, progtdm19.mcs. The TDM controller needs to know both the number of frames per superframe and the number of slots per frame, but be told not to generate frame pulses.
The library function, pci_tdm_init, was modified to provide a way to specify these parameters. The function still takes the same five arguments. Note that the spf (slots-per-frame) argument may now be passed as a negative value to specify that no frame pulses should be generated.
int
pci_tdm_init (tdm, clk, bps, spf, fps)
PCI_TDM *tdm - pointer from pci_tdmopen.
int clk - clock freq in MHz: 0, 1, 2, 4, 8, or 16
int bps - bits per time slot: 8, 16, or 32
int spf - slots per frame: 0 or 1 to 128, or -1 to -128
int fps - frames per super frame: 0 or 2 to 31
A new function, pci_tdm_timing, was added to the library. This function provides the functionality of pci_tdm_init plus the ability to specify the source of TDM clock.
int
pci_tdm_timing (tdm, clksrc, clk, bps, spf, fps)
PCI_TDM *tdm - pointer from pci_tdmopen.
int clksrc - TDM clock source: see below
int clkfrq - clock freq in MHz: 1, 2, 4, 8, or 16
int bps - bits per time slot: 8, 16, or 32
int spf - slots per frame: 0 or 1 to 128, or -1 to -128
int fps - frames per super frame: 0 or 2 to 31
The clkfrq, bps, spf and fps
arguments are used in the same way as for pci_tdm_init.
The function returns 1 for successful TDM setup or 0 in case of an error.
The following macros, defined in <pciutil.h>, may be used for the clksrc argument:
TDM_BASECLK - clocks generated from the TDM controller
TDM_EXPCLK - clocks from the front panel TDM expansion,
which is set to SLAVE mode.
TDM_MODCLK(mod) - clocks generated from module mod
where mod is a number from 0 to 5.
When TDM_MODCLK is used, it's value may be offset by a unit number
to specify, for example, which of the two T1 lines on an IM2T1 module
should be used to source the clock.
IMSCSA Module Control Changes in Version 1.3.2
The host library functions for controlling the IMSCSA module have been modified to allow for more diverse situations. The changes involve controlling SCSA master and slave modes and TDM clock and sync pulse sourcing. The new and modified SCSA functions no longer affect the TDM control logic directly and, therefore, no longer have a PCI_TDM * argument. The new pci_tdm_timing function (described above) is now used for preparing the TDM subsystem controller.
The following functions, still in the library, no longer have a PCI_TDM * argument:
int
scsa_init (scsa, scsaclk)
int
scsa_close(scsa)
PCI_MOD *scsa - pointer from pciopen for an IMSCSA module
int scsaclk - SCSA clock frequency (MHz): 2, 4 or 8
scsa_init initializes the IMSCSA module to operate at the specified
clock frequency.
The SCSA port is set to slave mode and the IMSCSA module
is set to not drive TDM clock or sync on the V6M6 board.
scsa_close sets the SCSA port to slave mode and the IMSCSA module is set to not drive TDM clock or sync on the V6M6 board. Then it closes the PCI_MOD resource. If the SCSA is to be left running and you want to close the PCI_MOD resource, the pciclose function should be used instead.
The following functions have been deleted from the library:
scsa_slcnxtclk
scsa_deslctclk
These functions were used the set the SCSA module as master or slave
for the SCSA backplane.
They have been replaced by the function:
int
scsa_mode(scsa, mode)
PCI_MOD *scsa - pointer from pciopen for an IMSCSA module>
int mode - SCSA bus mode
This function is used to set the mode of the SCSA module to be the
master or slave on the SCSA backplane.
It may also be used to determine the current mode of the SCSA module.
The following values for mode, defined in <pciutil.h>,
are accepted:
SCSA_MASTER - sets the module to be SCSA master.
SCSA_SLAVE - sets the module to be SCSA slave.
0 - determine current setting.
The function will return the current mode, SCSA_MASTER or SCSA_SLAVE,
or 0 in case of an error.
A new function, scsa_tdm_sync has been added to control the TDM clock and sync generation for the IMSCSA module.
int
scsa_tdm_sync(scsa, enable)
PCI_MOD *scsa - pointer from pciopen for an IMSCSA module>
int enable - TDM clock and sync enable
The following values for enable are defined in <pciutil.h>:
SCSA_TDMNOCLKSYNC - disables both clock and sync.
SCSA_TDMCLK - enables clock, disables sync.
SCSA_TDMSYNC - disables clock, enables sync.
SCSA_TDMCLKSYNC - enables both clock and sync.
IMHDLC Module TDM Map Changes in Version 1.3.2
The method for adding and deleting Munich shift operations to the TDM map has been modified to use the pci_tdm_special_add and pci_tdm_special_del functions.
The pci_tdm_src_del and pci_tdm_dst_del functions no longer affect shift operations. This change was made to allow other modules to use the TDM bus for data transfer during time slots that the IMHDLC is only shifting data into or out of a Munich chip.
The TDM special functions have the following arguments:
pci_tdm_special_add(tdm, slot, devtyp, devnum)
pci_tdm_special_del(tdm, slot, devtyp, devnum)
PCI_TDM *tdm - pointer from pci_tdmopen
int slot - TDM time slot: 1 - 128
int bus - TDM bus: TDM_BUSA, TDM_BUSB,
TDM_BUSC or TDM_BUSD
int devtyp - TDM device type: TDM_DEVIMHDLC
int devnum - module number, Munich chip number
and operation type (see below).
The devnum argument is specified by using the bit-wise OR'ing
the module number with the following macros from <pciutil.h>:
TDM_UNIT(n) - where n is the Munich
chip number, 0 or 1
TDM_HDLC_SHDST - to shift data captured from the
TDM to the Munich.
TDM_HDLC_SHSRC - to shift data from the Munich
to be driven to the TDM.
For example:
pci_tdm_special_add(tdm, 5, TDM_BUSA, TDM_DEVIMHDLC,
mod_num | TDM_UNIT(chip_num) | TDM_HDLC_SHDST);
Although the TDM bus is not used in Munich shift operations, the
argument must be passed to these functions.
Note: the pci_tdm_src_add function may still be used to add shift operations for data from the Munich and pci_tdm_dst_add may still be used to add shift operations to the Munich.