December 22, 1997
Overview
Versions 1.5.0 and 1.5.1 of the V6M6 host software and FPGA configurations include the following changes:
New Flash Format for FPGA Configuration Data
The new format includes a directory stored in the flash which allows
configuration data for the modules to use more than one flash segment
and to be located in at variable locations in the flash.
This is necessary to accommodate modules that require more than 32 Kbytes
of configuration data and to accommodate an increasing number of different
module types.
The new version of the pciflashup program manages which configuration
data files are stored in the flash and where they are located.
The new version of the V6M6 micro-controller program is able to locate
configuration data based on information in the flash directory.
New V6M6 boards are being shipped with the new flash format.
When boards with the old flash format are update with pciflashup
their flash memories will be rewritten in the new format.
The main effect of this new format is that only configuration data
for the module types installed on a V6M6 is stored in the flash.
The flash must be updated if a new module type is installed on the board.
This means that when a board is first reinstalled in a system,
after having a new module type added,
it will not be able to configure the new modules.
In order to initialize these boards during system startup,
the pciinit program has been enhanced to compare the flash directory
of the boards it initializes with the modules installed.
If there are modules installed without configuration data in the flash,
pciinit will invoke pciflashup to add the missing
configuration data.
In systems that are unlikely to have new module types added to V6M6 boards,
pciinit may be run with the -f option, telling
the program not to check the flash contents and saving some time.
IMHC4 Host Library and TDM Configurator Support
Several functions were added to the V6M6 host support library for the IMHC4
dual, stereo codec module.
These new functions, plus the original set, are briefly described here.
Each of them require, as their first argument, a PCI_MOD pointer which
is obtained using the pci_open function to access an IMHC4 module.
For example:
The imhc4_init function initializes the codecs on the IMHC4,
clears the module's interrupt mask and loads certain PCI access control
registers.
It is primarily intented for use by the pciinit program but may
be used by application programs.
The TDM Configurator now supports the specification of sampling modes,
initial input gain and output attenuation for the codecs on IMHC4 modules.
The new HC4 keyword and its parameters, in the TDM description file,
specify these values on a per-codec basis.
Each of the the two codecs on the IMHC4 handle two channels of audio:
codec 0 handles channels 0 and 1, codec 1 handles channels 2 and 3.
HC4
mod.codec
samp=rate:format
levels=gain:atten
where:
The HC4 parameter lines must appear before any TDM slot definitions
in the TDM description file.
The TDM Configurator will initialize the codecs on IMHC4 modules during
its board initialization phase, prior to loading the TDM connection map data.
The format for storing FPGA configuration data,
and the V6M6's micro-controller program,
has been modified.
PCI_MOD *pci;
pci = pciopen("pci0c") /* open IMHC4 on module C of pci0 */
int
imhc4_init(pci)
PCI_MOD *pci - pointer to open PCI_MOD structure
The imhc4_tdmclkdiv function sets TDM clock divider for the frequency
synthesizer on an IMHC4.
This function must be called to set the divider for the current TDM clock
frequency.
int
imhc4_tdmclkdiv(pci, clkdiv)
PCI_MOD *pci - pointer to open PCI_MOD structure.
int clkdiv - 0 if TDM clock is 16.048 MHz
1 if TDM clock is 8.192 MHz
2 if TDM clock is 4.096 MHz
3 if TDM clock is 2.048 MHz
The imhc4_sample function controls the sample rate and data format
for codecs on an IMHC4.
int
imhc4_sample(pci, chip, rate, format)
PCI_MOD *pci - pointer to open PCI_MOD structure.
int chip - specifies which codec chip: 0 or 1.
int rate - sample rate in kHz.
Supported values are: 8, 16, 32 or 48.
int format - data format, macros from <pciutil.h>:
IMHC4_ULAW, IMHC4_ALAW, IMHC4_LIN8,
or IMHC4_LIN16.
The imhc4_inputgain function controls the input gain for
a specified codec and audio channel on an IMHC4.
int
imhc4_inputgain(pci, chip, chan, gain)
PCI_MOD *pci - pointer to open PCI_MOD structure.
int chip - specifies which codec chip: 0 or 1.
int chan - specifies which channel: 0 for left,
1 for right or 2 for both.
double gain - input gain value: 0.0 to 42.5 dB in
1.5 dB increments. Values greater than
22.5 enable the 20 dB Mic input gain.
The imhc4_outputatten function controls the output attenuation
for a specified codec and audio channel on an IMHC4.
int
imhc4_outputatten(pci, chip, chan, atten)
PCI_MOD *pci - pointer to open PCI_MOD structure.
int chip - specifies which codec chip: 0 or 1.
int chan - specifies which channel: 0 for left,
1 for right or 2 for both.
double atten - output attenuation: 0.0 to -94.5 dB
in 1.5 dB increments. Values less
than -94.5 specify to mute the output.
The following functions provide access to the direct and indirect
registers in the codecs on an IMHC4 module for cases where additional
or more specific control of the codecs is required.
The _rd functions return the 8 bit value read from
the specified register.
int
imhc4_direct_rd(pci, codec, reg);
int
imhc4_direct_wr(pci, codec, reg, val);
int
imhc4_indirect_rd(pci, chip, reg);
int
imhc4_indirect_wr(pci, chip, reg, val);
PCI_MOD *pci - pointer to open PCI_MOD structure.
int codec - specifies which codec chip: 0 or 1.
int reg - register to read
(0 - 3 for direct, 0 - 31 for indirect)
int val - lower 8 bits are written to register.
The imhc4_instat function reads interrupt status from an
IMHC4 module, which indicates the states of the INT signals from
the two codecs.
The return value has the state on codec 0 INT in bit 0 and
codec 1 in bit 1.
Calling this function does not service the interrupt condition or
clear the status.
int
imhc4_intstat(pci)
PCI_MOD *pci - pointer to open PCI_MOD structure.
The imhc4_intenb function enables PCI interrupts from the
codecs on an IMHC4 module.
int
imhc4_intenb(pci, intmask)
Enable interrupts from IMHC4 interface
PCI_MOD *pci - pointer to open PCI_MOD structure.
int intmask - specifies which codec INT signals are
enabled to PCI INTA and INTB. A 1 in
each bit enables interrupts as follows:
Bit 0 - Codec 0 Int to PCI INT A
Bit 1 - Codec 1 Int to PCI INT A
Bit 2 - unused
Bit 3 - unused
Bit 4 - Codec 0 Int to PCI INT B
Bit 5 - Codec 1 Int to PCI INT B