EDT PDV SDK Documentation 6.2.0
Prominfo

Functions

int edt_parse_devinfo (const char *str, Edt_embinfo *ei)
 Parse the board's embedded information string. More...
 
void edt_get_sns (EdtDev edt_p, char *esn, char *osn)
 Retrieve the board's manufacturer and OEM embedded information strings from the PCI Xilinx information header. More...
 
void edt_get_sns_sector (EdtDev edt_p, char *esn, char *osn, int sector)
 Retrieve the board's manufacturer and OEM embedded information strings from the PCI Xilinx information header. More...
 
void edt_get_osn (EdtDev edt_p, char *osn)
 Retrieve the board's OEM embedded information string from the PCI Xilinx information header. More...
 
void edt_get_esn (EdtDev edt_p, char *esn)
 Retrieve the board's EDT embedded information string from the PCI Xilinx information header. More...
 
char * edt_fmt_pn (const char *pn, char *pn_str)
 Takes a part number portion of the embedded information string, as retrieved from the PCI FPGA information header via edt_get_sns; reformats and returns it in a "human readable" form (dashes added). More...
 
int edt_flash_get_fname (EdtDev edt_p, char *name)
 Extract the name of the on-board firmware in the device's FPGA PROM, minus the extension. More...
 
int edt_flash_get_fname_auto (EdtDev edt_p, char *name)
 Extract the name of the on-board firmware in the device's FPGA PROM, minus the version and extension. More...
 
int edt_flash_prom_detect (EdtDev edt_p, uint16_t *stat)
 Find the flash prom and flash status (jumper positions) for the device. Finds out which flash PROM is used and queries the device PROM status – see EPinfo stat field for status bits values. More...
 
uint32_t edt_get_flashsize (int promcode)
 Get the flash PROM bank size. More...
 
int edt_get_max_promcode (void)
 
Edt_prominfo * edt_get_prominfo (int promcode)
 Returns the pciload device information structure for the specific flash PROM code given. More...
 
const char * edt_get_fpga_mfg (EdtDev edt_p)
 Returns the FPGA manufacturer name string. More...
 
const char * edt_flash_type_string (int ftype)
 Returns a printable name for FTYPE values. Mainly for debug output. More...
 
void edt_readinfo (EdtDev edt_p, int promcode, int sect, char *idstr, char *devinfo, char *oemsn)
 Read the board's FPGA configuration file id and serial numbers. More...
 
void edt_read_prom_data (EdtDev edt_p, int promcode, int segment, EdtPromData *pdata)
 Get the onboard PROM device info as written to unused PROM space by EDT before shipping, or thereafter via -I or -i options to pciload. More...
 
int edt_program_flash_start (EdtDev edt_p)
 
void edt_program_flash_chunk (EdtDev edt_p, const uint8_t *buf, int xfer, int do_sleep)
 
int edt_program_flash_end (EdtDev edt_p)
 
int edt_get_hw_rev (EdtDev edt_p)
 
uint8_t * edt_flash_block_read (EdtDev edt_p, uint32_t addr, uint8_t *buf, unsigned int size, int ftype)
 Read a string out of the FPGA, of a given size, from a given address. Used for Xilinx ID id string and serial number strings. More...
 

Detailed Description

Function Documentation

◆ edt_parse_devinfo()

int edt_parse_devinfo ( const char *  str,
Edt_embinfo ei 
)

Parse the board's embedded information string.

Parameters
strAn embedded information string, from edt_get_esn, etc.
[out]eiEdt_embinfo structure into which the the parsed information will be put.
Returns
0 on success, -1 on error (input string not valid or too long).
See also
edt_readinfo, edt_get_esn, edt_fmt_pn

During manufacturing programming, EDT embeds selected information is embedded into an unused area of the FPGA PROM. This information is preserved across reloads (via pciload, hubload, etc.) unless options to overwrite are invoked in one of those utilities. This subroutine takes as an argument the full information string, as retrieved from edt_get_esn, edt_get_osn or edt_get_sns, into the fields indicated by the Edt_embinfo structure.

(To see the information string, run pciload with no arguments.)

Note
Information embedding was implemented in Sept. 2004; boards shipped before that time will yield a string with all NULLS unless the board's FPGA has since been updated with the embedded information.

◆ edt_get_sns()

void edt_get_sns ( EdtDev  edt_p,
char *  esn,
char *  osn 
)

Retrieve the board's manufacturer and OEM embedded information strings from the PCI Xilinx information header.

Parameters
edt_pThe EDT open device handle.
esnA buffer of size ESN_SIZE or larger to receive the EDT information string.
osnA buffer of size OSN_SIZE or larger to receive the OEM information string.
See also
edt_get_esn, edt_get_osn, edt_parse_devinfo, edt_fmt_pn

◆ edt_get_sns_sector()

void edt_get_sns_sector ( EdtDev  edt_p,
char *  esn,
char *  osn,
int  sector 
)

Retrieve the board's manufacturer and OEM embedded information strings from the PCI Xilinx information header.

Parameters
edt_pThe EDT open device handle.
esnA buffer of size ESN_SIZE or larger to receive the EDT information string.
osnA buffer of size OSN_SIZE or larger to receive the OEM information string.
sectorWhich sector of the PROM to retreive data from.
See also
edt_get_esn, edt_get_osn, edt_get_sns, edt_parse_devinfo, edt_fmt_pn

Certain information about the board, including manufacturer's part number, serial number, clock speed, Xilinx FPGA, and options, is embedded in an unused area of the Xilinx FPGA PROM at the time of manufacture. This information is preserved across reloads (via pciload, hubload, etc.) unless options overwrite are invoked in the utility. This subroutine retrieves EDT and OEM (if present) information. The data is an ASCII string, with the following colon-separated fields:

serial number:part number:clock speed:options:revision:interface xilinx:

(To see the information string, run pciload with no arguments.)

Note
Information embedding was implemented in Sept. 2004; boards shipped before that time will yield a string with all NULLS unless the board's FPGA has since been updated with the embedded information.

◆ edt_get_osn()

void edt_get_osn ( EdtDev  edt_p,
char *  osn 
)

Retrieve the board's OEM embedded information string from the PCI Xilinx information header.

Parameters
edt_pThe EDT open device handle.
[out]osnA buffer of size OSN_SIZE or larger to receive the information string.
See also
edt_get_sns, edt_get_esn, edt_fmt_pn

Some OEMs embed part number or other information about the board in an unused area of the Xilinx FPGA PROM. This information is preserved across reloads (via pciload, hubload, etc.) unless options to overwrite are invoked in one of those utilities.

Note
Information embedding was implemented in Sept. 2004; boards shipped before that time will yield a string with all NULLS unless the board's FPGA has since been updated with the embedded information.

◆ edt_get_esn()

void edt_get_esn ( EdtDev  edt_p,
char *  esn 
)

Retrieve the board's EDT embedded information string from the PCI Xilinx information header.

Parameters
edt_pThe EDT open device handle.
[out]esnA buffer of size ESN_SIZE or larger to receive the information string.
See also
edt_get_sns, edt_get_osn, edt_parse_devinfo, edt_fmt_pn

The EDT information string is embedded in an unused area of the Xilinx FPGA PROM, and is preserved across reloads (via pciload, hubload, etc.) unless options to overwrite are invoked in one of those utilities.

The data is an ASCII string, with the following colon-separated fields:

serial number:part number:clock speed:options:revision:interface xilinx:macaddrs:

(To see the information string, run pciload with no arguments.)

Note
Information embedding was implemented in Sept. 2004; boards shipped before that time will yield a string with all NULLS unless the board's FPGA has since been updated with the embedded information.

◆ edt_fmt_pn()

char * edt_fmt_pn ( const char *  pn,
char *  pn_str 
)

Takes a part number portion of the embedded information string, as retrieved from the PCI FPGA information header via edt_get_sns; reformats and returns it in a "human readable" form (dashes added).

This is mainly for use by pciload and other EDT utility programs, but also can be used by user apps if desired.

Parameters
pnThe part number without dashes.
[out]strA buffer to hold the output string, which must be at least 13 characters long.
See also
edt_get_esn, edt_parse_esn

◆ edt_flash_get_fname()

int edt_flash_get_fname ( EdtDev  edt_p,
char *  name 
)

Extract the name of the on-board firmware in the device's FPGA PROM, minus the extension.

Parameters
edt_pThe EDT open device handle.
[out]nameA buffer of size PCI_ID_SIZE or larger to receive the FPGA filename.
See also
edt_flash_get_fname_auto

Fills in the name string field with the name of the device's onboard PROM, minus the voltage descriptor if any, and extension (.ncd). For devices with two voltage sectors to the firmware, two files with _3v.ncd and _5v.ncd extensions will be present; in such cases the _3v and _5v will be stripped off as well. For example if the device is loaded with "pcidev-10_3v.ncd" and "pcidev-10_5v.ncd", the subroutine will return "pcidev-10".

◆ edt_flash_get_fname_auto()

int edt_flash_get_fname_auto ( EdtDev  edt_p,
char *  name 
)

Extract the name of the on-board firmware in the device's FPGA PROM, minus the version and extension.

Parameters
edt_pThe EDT open device handle.
[out]nameA buffer of size PCI_ID_SIZE or larger to receive the FPGA filename.
See also
edt_flash_get_fname

Fills in the name string field with the name of the device's onboard PROM, minus the version, voltage descriptor if any, and extension (.ncd). For devices with two voltage sectors to the firmware, two files with _3v.ncd and _5v.ncd extensions will be present; in such cases _3v and _5v will be stripped off as well. For example if the device is loaded with "pcidev-10_3v.ncd" and "pcidev-10_5v.ncd", the subroutine will return "pcidev".

◆ edt_flash_prom_detect()

int edt_flash_prom_detect ( EdtDev  edt_p,
uint16_t *  stat 
)

Find the flash prom and flash status (jumper positions) for the device. Finds out which flash PROM is used and queries the device PROM status – see EPinfo stat field for status bits values.

Parameters
edt_pThe EDT open device handle.
[out]statThe device status register value (if stat is NULL, it will be ignored).
Returns
The prom device code.
See also
edt_get_flashsize, edt_get_prominfo

◆ edt_get_flashsize()

uint32_t edt_get_flashsize ( int  promcode)

Get the flash PROM bank size.

Note that this may be the full size of the PROM or the size of one program bank, if the device is split up into multiple banks (program sectors).

Parameters
promcodeThe prom code, from edt_flash_prom_detect.
Returns
The size in bytes of the flash PROM programming bank.

◆ edt_get_max_promcode()

int edt_get_max_promcode ( void  )
Returns
The highest numbered known promcode.

◆ edt_get_prominfo()

Edt_prominfo * edt_get_prominfo ( int  promcode)

Returns the pciload device information structure for the specific flash PROM code given.

Parameters
promcodeThe flash PROM code, from edt_flash_prom_detect.
Returns
A pointer to the #Edt_prominfo struct.

◆ edt_get_fpga_mfg()

const char * edt_get_fpga_mfg ( EdtDev  edt_p)

Returns the FPGA manufacturer name string.

Parameters
edt_pThe EDT open device handle.
Returns
the name of the FPGA type; one of "Xilinx", "Altera", or "" if unknown.

◆ edt_flash_type_string()

const char * edt_flash_type_string ( int  ftype)

Returns a printable name for FTYPE values. Mainly for debug output.

Parameters
ftypeAn FTYPE value.
Returns
A string containing the flash type.

◆ edt_readinfo()

void edt_readinfo ( EdtDev  edt_p,
int  promcode,
int  sect,
char *  idstr,
char *  devinfo,
char *  oemsn 
)

Read the board's FPGA configuration file id and serial numbers.

Parameters
edt_pThe EDT open device handle.
promcodeThe device prom code, from edt_flash_prom_detect.
sectThe sector from which to read the prom (-1 for the default).
[out]idstrA buffer of size PCIE_PID_SIZE FPGA to receive configuration file ID string.
[out]devinfoA buffer of size ESN_SIZE to receive the device information string including serial_number part number, and other information.
[out]osnA buffer of size OSN_SIZE to receive the OEM's part number string, if present.
See also
edt_parse_devinfo, edt_flash_prom_detect

◆ edt_read_prom_data()

void edt_read_prom_data ( EdtDev  edt_p,
int  promcode,
int  segment,
EdtPromData *  pdata 
)

Get the onboard PROM device info as written to unused PROM space by EDT before shipping, or thereafter via -I or -i options to pciload.

Parameters
edt_pThe EDT open device handle.
promcodeThe device prom code, from edt_flash_prom_detect.
segmentWhich segment to read the info from; for the default, call edt_get_prominfo, and use the defaultseg element from the Edt_prominfo struct it returns.
[out]pdataA pointer to an EdtPromData struct, into which the info will be read.

◆ edt_program_flash_start()

int edt_program_flash_start ( EdtDev  edt_p)

Preamble for loading the interface xilinx.

Parameters
edt_ppointer to edt device structure returned by edt_open
Returns
0 on success, nonzero on failure

◆ edt_program_flash_chunk()

void edt_program_flash_chunk ( EdtDev  edt_p,
const uint8_t *  buf,
int  xfer,
int  do_sleep 
)

Write a chunk of interface xilinx. Number of bytes written will be the blocksize, or size-base if it's at the end and smaller than blocksize.

Parameters
edt_ppointer to edt device structure returned by edt_open
bufbuffer containing the data to be loaded
xfernumber of bytes to load
basenumber of bytes loaded so far
do_sleepadd sleeps to slow it down in case of host speed issues
Returns
0 on success, nonzero on failure

◆ edt_program_flash_end()

int edt_program_flash_end ( EdtDev  edt_p)

Wrapup for loading the interface xilinx.

Parameters
edt_ppointer to edt device structure returned by edt_open
Returns
0 on success, nonzero on failure

◆ edt_get_hw_rev()

int edt_get_hw_rev ( EdtDev  edt_p)

Gets the hardware revision number, from the FLASH prom embedded info

Parameters
edt_ppointer to edt device structure returned by edt_open
Returns
the hardware revision, or 0 if no error / no revision

◆ edt_flash_block_read()

uint8_t * edt_flash_block_read ( EdtDev  edt_p,
uint32_t  addr,
uint8_t *  buf,
unsigned int  size,
int  ftype 
)

Read a string out of the FPGA, of a given size, from a given address. Used for Xilinx ID id string and serial number strings.

Parameters
edt_pThe EDT open device handle.
addrThe address to start reading the string.
[out]bufThe buffer to read the string into.
sizeThe number of bytes to read.
Returns
The buffer passed in.