background image

The Embedded I/O Company

TDRV004-SW-82

Linux Device Driver

Reconfigurable FPGA

Version 2.0.x

User Manual

Issue 2.0.0

November 2011

TEWS TECHNOLOGIES GmbH

Am Bahnhof 7

25469 Halstenbek, Germany

Phone: +49 (0) 4101 4058 0

Fax: +49 (0) 4101 4058 19

e-mail: [email protected]

www.tews.com

Содержание TDRV004-SW-82

Страница 1: ...82 Linux Device Driver Reconfigurable FPGA Version 2 0 x User Manual Issue 2 0 0 November 2011 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek Germany Phone 49 0 4101 4058 0 Fax 49 0 4101 4058 1...

Страница 2: ...complete However TEWS TECHNOLOGIES GmbH reserves the right to change the product described in this document at any time without notice TEWS TECHNOLOGIES GmbH is not liable for any damage arising out o...

Страница 3: ...3 1 2 tdrv004Close 10 3 2 Device Access Functions 12 3 2 1 tdrv004XsvfPlay 12 3 2 2 tdrv004XsvfPos 14 3 2 3 tdrv004XsvfLastCommand 16 3 2 4 tdrv004Reconfigure 18 3 2 5 tdrv004SetWaitstates 20 3 2 6 td...

Страница 4: ...t Read write EEPROM blocks located in clock device using the Serial Programming Interface SPI Read write specific PLX9030 registers Wait for local interrupt sources The TDRV004 SW 82 supports the modu...

Страница 5: ...c hardware layer for XSVF player pf_ports h header file for XSVF hardware layer Makefile Device driver make file makenode Script for device node creation api tdrv004api h API include file api tdrv004a...

Страница 6: ...elf takes creating and destroying of device nodes in its responsibility sh makenode On success the device driver will create a minor device for each TDRV004 device found The first TDRV004 device can b...

Страница 7: ...application it is possible to define a major number for the driver To change the major number edit the file tdrv004def h change the following symbol to appropriate value and enter make install to crea...

Страница 8: ...har DeviceName DESCRIPTION Before I O can be performed to a device a file descriptor must be opened by a call to this function PARAMETERS DeviceName This parameter points to a null terminated string t...

Страница 9: ...ce Driver Page 9 of 62 RETURNS A device handle or NULL if the function fails An error code will be stored in errno ERROR CODES The error codes are stored in errno The error code is a standard error co...

Страница 10: ...DESCRIPTION This function closes previously opened devices PARAMETERS hdl This value specifies the device handle to the hardware module retrieved by a call to the corresponding open function EXAMPLE i...

Страница 11: ...Device Driver Page 11 of 62 RETURNS On success TDRV004_OK or an appropriate error code ERROR CODES TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid Other returned error codes are sys...

Страница 12: ...ake sure that the supplied XSVF is of a valid file format PROGRAMMING HINTS Depending on the XSVF file there might be a waiting period of approx 15 seconds at the beginning of programming The programm...

Страница 13: ...available in a local buffer the size of the file must be stored in XsvfFileSize result tdrv004XsvfPlay hdl pXsvfContent XsvfFileSize if result TDRV004_OK handle error RETURNS On success TDRV004_OK is...

Страница 14: ...is function returns the number of the current processed byte in the XSVF file during programming This control function can be used to monitor the programming progress PARAMETERS hdl This argument spec...

Страница 15: ...sition result tdrv004XsvfPos hdl XsvfPos if result TDRV004_OK printf Current XSVF position d n XsvfPos else handle error RETURNS On success TDRV004_OK is returned In the case of an error the appropria...

Страница 16: ...s the number of the last executed XSVF command This value can be used to find errors inside the supplied XSVF file This value refers to the line inside the ASCII SVF file PARAMETERS hdl This argument...

Страница 17: ...mand result tdrv004XsvfLastCommand hdl XsvfLastCmd if result TDRV004_OK printf Last XSVF command d n XsvfLastCmd else handle error RETURNS On success TDRV004_OK is returned In the case of an error the...

Страница 18: ...the FPGA This control function must be called after the FPGA is programmed using tdrv004XsvfPlay The function returns after the reconfiguration is done or an error occurred PARAMETERS hdl This argume...

Страница 19: ...Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid TDRV004_ERR_BUSY The device is already busy with XSVF Reconfig or SPI action TDRV004_ERR_NOT_READY The DONE signal o...

Страница 20: ...clock CLK1 of the onboard clock generator is configured to rather slow The local programming interface is clocked with this frequency which might result in errors during programming for low CLK1 frequ...

Страница 21: ...to use 3 waitstates WaitStates 3 result tdrv004SetWaitstates hdl WaitStates if result TDRV004_OK handle error RETURNS On success TDRV004_OK is returned In the case of an error the appropriate error c...

Страница 22: ...ecifies the device handle to the hardware module retrieved by a call to the corresponding open function pClockParam This parameter specifies a pointer to a TDRV004_CLOCK_PARAM structure typedef struct...

Страница 23: ...frequency divider x10_InputCtrl Specifies value for the Input Pin Control register x40_CPumpPB Specifies value for Charge Pump and PB counter register x41_CPumpPB Specifies value for Charge Pump and...

Страница 24: ...DR_SRAM ClockParam x09_ClkOE 0x6f ClockParam x0C_DIV1SRCN 0x64 ClockParam x10_InputCtrl 0x50 ClockParam x40_CPumpPB 0xc0 ClockParam x41_CPumpPB 0x03 ClockParam x42_POQcnt 0x81 ClockParam x44_SwMatrix...

Страница 25: ...ion TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid TDRV004_ERR_BUSY The device is already busy with XSVF Reconfig or SPI action TDRV004_ERR_INVAL It was tried to disable CLK1 This...

Страница 26: ...SPI address The SPI storages are available in the clock generator device Do not use this control function to setup the clock generator Please use API function tdrv004SetClock instead PARAMETERS hdl T...

Страница 27: ...RV004_CLKADDR_EEBLOCK7 0x46 EEPROM Bank 7 TDRV004_CLKADDR_EEBLOCK8 0x47 EEPROM Bank 8 SubAddr Specifies the sub address starting offset len This value specifies the amount of data items to write A max...

Страница 28: ...n success TDRV004_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HAND...

Страница 29: ...specific sub address of a Serial Programming Interface SPI address The SPI storages are available in the clock generator device PARAMETERS hdl This argument specifies the device handle to the hardware...

Страница 30: ...ank 6 TDRV004_CLKADDR_EEBLOCK7 0x46 EEPROM Bank 7 TDRV004_CLKADDR_EEBLOCK8 0x47 EEPROM Bank 8 SubAddr Specifies the sub address starting offset len This value specifies the amount of data items to wri...

Страница 31: ...f an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid TDRV004_ERR_BUSY The device is a...

Страница 32: ...PLX PCI9030 EEPROM memory offset Please note that the PLX9030 reloads the new configuration from the EEPROM after a PCI reset i e the system must be rebooted to make PLX PCI9030 dependent changes tak...

Страница 33: ...h R W 4Ch 4Eh R 50h 5Eh R W 60h 62h R 64h 7Eh R W 80h 86h R 88h FEh R W Refer to the PLX PCI9030 User Manual for detailed information on these registers Value This value specifies a 16bit word that sh...

Страница 34: ...an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid TDRV004_ERR_BUSY The device is alr...

Страница 35: ...UF pPlxBuf DESCRIPTION This function reads an unsigned short 16bit value from a specific PLX PCI9030 EEPROM memory offset PARAMETERS hdl This argument specifies the device handle to the hardware modul...

Страница 36: ...28h 36h R W 38h 3Ah R 3Ch 4Ah R W 4Ch 4Eh R 50h 5Eh R W 60h 62h R 64h 7Eh R W 80h 86h R 88h FEh R W Refer to the PLX PCI9030 User Manual for detailed information on these registers Value This value ho...

Страница 37: ...se of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid TDRV004_ERR_BUSY The device...

Страница 38: ...rameter specifies a pointer to a TDRV004_MEMIO_BUF structure typedef struct TDRV004_RESOURCE Resource unsigned int Offset unsigned int Size unsigned char pData 1 dynamically expandable TDRV004_MEMIO_B...

Страница 39: ...the memory or I O space specified by Resource Size This value specifies the amount of data items to read pData The received values are copied into this buffer It must be large enough to hold the spec...

Страница 40: ...TURNS On success TDRV004_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV0...

Страница 41: ...parameter specifies a pointer to a TDRV004_MEMIO_BUF structure typedef struct TDRV004_RESOURCE Resource unsigned int Offset unsigned int Size unsigned char pData 1 dynamically expandable TDRV004_MEMI...

Страница 42: ...memory or I O space specified by Resource Size This value specifies the amount of data items to read pData The received values are copied into this buffer It must be large enough to hold the specifie...

Страница 43: ...ETURNS On success TDRV004_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV...

Страница 44: ...parameter specifies a pointer to a TDRV004_MEMIO_BUF structure typedef struct TDRV004_RESOURCE Resource unsigned int Offset unsigned int Size unsigned char pData 1 dynamically expandable TDRV004_MEMI...

Страница 45: ...he memory or I O space specified by Resource Size This value specifies the amount of data items to read pData The received values are copied into this buffer It must be large enough to hold the specif...

Страница 46: ...TURNS On success TDRV004_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV0...

Страница 47: ...rameter specifies a pointer to a TDRV004_MEMIO_BUF structure typedef struct TDRV004_RESOURCE Resource unsigned int Offset unsigned int Size unsigned char pData 1 dynamically expandable TDRV004_MEMIO_B...

Страница 48: ...ified by Resource Size This value specifies the amount of data items to write pData The values are copied from this buffer It must be large enough to hold the specified amount of data EXAMPLE include...

Страница 49: ...004_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid...

Страница 50: ...s parameter specifies a pointer to a TDRV004_MEMIO_BUF structure typedef struct TDRV004_RESOURCE Resource unsigned int Offset unsigned int Size unsigned char pData 1 dynamically expandable TDRV004_MEM...

Страница 51: ...y Resource Size This value specifies the amount of data items to write pData The values are copied from this buffer It must be large enough to hold the specified amount of data EXAMPLE include tdrv004...

Страница 52: ...V004_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid...

Страница 53: ...parameter specifies a pointer to a TDRV004_MEMIO_BUF structure typedef struct TDRV004_RESOURCE Resource unsigned int Offset unsigned int Size unsigned char pData 1 dynamically expandable TDRV004_MEMI...

Страница 54: ...Resource Size This value specifies the amount of data items to write pData The values are copied from this buffer It must be large enough to hold the specified amount of data EXAMPLE include tdrv004ap...

Страница 55: ...V004_OK is returned In the case of an error the appropriate error code is returned by the function ERROR CODES Error Code Description TDRV004_ERR_INVALID_HANDLE The specified TDRV004_HANDLE is invalid...

Страница 56: ...0 interrupt sources PARAMETERS hdl This argument specifies the device handle to the hardware module retrieved by a call to the corresponding open function InterruptConfig This value is an OR ed value...

Страница 57: ...DRV004_LINT1_POLLOW TDRV004_LINT2_POLHIGH result tdrv004ConfigureInterrupts hdl IntConfig if result TDRV004_OK handle error RETURNS On success TDRV004_OK is returned In the case of an error the approp...

Страница 58: ...tween an incoming interrupt and the return of the described function is system dependent and is most likely several microseconds For high interrupt load a customized device driver should be used which...

Страница 59: ...succeeded acknowledge interrupt source in FPGA logic to clear the PLX PCI9030 Local Interrupt Source else handle error RETURNS On success TDRV004_OK is returned In the case of an error the appropriat...

Страница 60: ...tween an incoming interrupt and the return of the described function is system dependent and is most likely several microseconds For high interrupt load a customized device driver should be used which...

Страница 61: ...succeeded acknowledge interrupt source in FPGA logic to clear the PLX PCI9030 Local Interrupt Source else handle error RETURNS On success TDRV004_OK is returned In the case of an error the appropriat...

Страница 62: ...essing controller TEWS Technologies GmbH Device 0276 Subsystem TEWS Technologies GmbH Device 000a Flags medium devsel IRQ 17 Memory at feb9fc00 32 bit non prefetchable size 128 I O ports at e880 size...

Отзывы: