Home

User Manual for the C2I2 Systems` PMC High Speed

image

Contents

1. For HSS Front Panel I O Board HSS_DIAG_ECHO The transmitter program elec_interface automatically resends HSS_RS232_INT_CTL_LINES receive d data bit by bit and connectTXD toRXD TXCLK to RXCLK for synchronous mode Ignore RTS CTL 8 CD HSS_DIAG_LOOPBACK_ECHO Loopback and echo operation occur For synchronous mode simultaneous ly see encoding_method CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 32 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 max_receive_bytes 1 to 2048 CRC bytes 2 or 4 default or up to 32 Kbytes Maximum number of bytes to CRC bytes 2 or 4 depending on how many bytes have been receive before closing buffer Set allocated to the Rx amp Tx buffers See function equal to max_frame_bytes hssCre ate_device_ex max_frame_bytes 1 to 2048 default or up to 32 Kbytes depending on how many Maximum number of bytes per bytes have been allocated to the Rx 8 Tx buffers See function frame Set equal to the number hssCre ate_device_ex of data bytes plus the number of CRC bytes either 2 or 4 per frame address mask 0x0000 OxFFFF HDLC address mask A one z enables comparison and a zero masks it address1 address2 0x0000 OxFFFF Four address registers for address recognition The SCC address3 address4 reads the frame address from the HDLC receiver com pares it with the address registers and mas ks the re su
2. Enable port to detect clock hssClock_detect 0 HSS_PORT_A A Call back function gets called once a clock has been detected After this Call back function has been serviced the user can re initialise the clock detection routine as shown above Clock detection prototype this function is implemented by the user void Process_clk_event int devid int portid int dummy 1 int userid int dumm y2 void dummy3 adding clock_detect callback hssAdd_callback 0 HSS_CB_ON_CLOCK_DETECT Process_cik_detect 0 Note The last 2 variables of the clock detection prototype function are dummy variables and are not initialised CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 6 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 3 3 8 Obtaining the current host and firmware version number The following function prints out the current version number of the driver and firmware software Print current version number hssVersion _print 0 Note Run hssC reate_d evice 0 first 3 3 9 HSS Built In Tests The following function displays each port s statistics e g how many bytes packets have been accepted rejected sent received and how many errors were reported Example Displaying each ports statistics for device 0 hssBit_report 0 To clear the counters of the hssBit_report 0 function use the function hssBit_clear 0 CCII HSS 6 MAN 002 2002 04 11
3. Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 7 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 Application Program Interface API 4 1 High Speed Serial Driver Interface The zip file ccHss4vx y z h_files zip contains the following header files crc h used for crc algorithm hssDefs h hssHo stDriver h hssControllfc h The following files should always be included hssDefs h hssHo stDriver h hssControllfc h CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 8 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 1 Create Device Function hssCreate_device Purpose Create and initialize the HSS device specific structures Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Returns HSS_OK On success HSS_INVALID_PARAM Invalid dev_id supplied HSS_PCI_INIT_FAIL PCI initialisation failed HSS_MEM_ALLOC_FAILED If HSS device structure could not be created in memory HSS_DEVICE_NOT_FOUND If HSS device lt dev_id gt was not found on the PCI bus HSS_MEM_INVALID_ADDRESS If the HSS device PCI address was not valid hssStatus hssCreate_device hssD eviceld dev_id Function hssCreate_device_ex Purpose Create and initialize the HSS device specific structures This extended version allows the user to specify the maximum Rx amp
4. 2 CRC Maximum num ber of bytes to receive y E bytes depending on how many bytes have been allocated to the before closing buffer Rx amp Tx buffers See function hssCreate_device_ex min_no_sync_pairs 0b0000 0 pairs 0b1111 16 pairs Minimum number of SYN1 SYN2 pairs sent between or before messages The entire pair is always sent regardless of the syn_len gth variable crc select HSS_BISYNC_CRC_MODE_16 CRC selection E HSS_BISYNC_CRC_MODE_LRC 1 CRC 16 X16 X15 X2 1 initialise prerc 8 pterc to allzeros or all ones 2 LRC sum check for even LRC initialise prerc 8 ptcrc to zeros for odd LRC initialise to ones receive _bcs Enable Receive Block Check Sequence BCS CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 36 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 rx_transparant_mode Enable Receiver transparent mode FALS E norm al receiver mode with SYNC stripping and controlcharacter recognition TRUE transparent receiver mode SYNC s DLE s and control characters are recognised only after the leading DLE character The receiver calculates the CRC16 sequence even if it is programmed to LRC while in transparent mode Initialize prerc to the CRC16 preset value before setting rx_transparant_mode Enable Reverse data reverse_data disable rx while tx Disable receiver while sending Receive
5. Ltd All rights reserved 2002 preamble _pattern HSS_DPLL_PREAMBLE_PATTERN_00 Determ ines what bit pattern HSS_DPLL_PREAMBLE_PATTERN_10 precedes each Tx frame HSS_DPLL_PREAMBLE_PATTERN_01 HSS_DPLL_PREAMBLE_PATTERN_11 send_idles_or_flags HSS_HDLC_SEND_IDLES Send either idles or flags syncs HSS_HDLC_SEND_FLAGS_SYNCS between frames as defined by the protocol For HDLC the flag is defined as Ox7E NRZI encoding methods may only be used with flags syncs 4 2 2 3 Preamble Requirements Decoding Method Preamble Pattern Minimum Preamble Length Required NRZI Mark All zeros NRZI Space All ones 8 bit FMO All ones 8 bit All zeros Manchester 101010 10 Differential Manchester All ones CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 34 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 2 3 BISYNC Mode This protocol may only be used with the four SCC ports Ports A D 4 2 3 1 BISYNC Protocol Information Structure The followin g structure is defined in the file hssControllfc h and is given here in abbreviated format i e reserved and obsolete members are not shown Always use the structure as defined in hssControllfc h struct hssBisynclnfoStruct hssUIN T32 baud_rate hssUINT32 clock_source hssUINT32 max_receive_bytes hssUINT32 min_no_sync_pairs hssUIN T32 crc_select hssUINT32 receive_bcs hssUINT32 rx_transparant_mode hssUINT32 reverse_d
6. Tx buffer size for each port Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc lt scc_ _size gt maximum Rx amp Tx buffer size for specific scc port lt smc_ _size gt maximum Rx amp Tx buffer size for specific smc port valid arguments HSS_2K HSS_4K HSS_8K HSS_16K HSS_ 32k lt reserved182 gt 2 reserved variables for future use Returns HSS_OK On success HSS_INVALID_PARAM Invalid parameters supplied HSS_PCI_INIT_FAIL PCI initialisation failed HSS_MEM_ALLOC_FAILED If HSS device structure could not be created in memory HSS_DEVICE_NOT_FOUND If HSS device lt dev_id gt was not found on the PCI bus HSS_MEM_INVALID_ADDRESS If the HSS device PCI address was not valid hssStatus hssCreate_device_ex hssDeviceld dev_id unsigned int scc_0_size unsigned int scc_1_size unsigned int scc_2_ size unsigned int scc_3_ size unsigned intsmc_0_size unsigned int smc_1_ size unsigned int reserved1 unsigned int reserved2 Notes One of these two functions has to be called once per device before any other function call to the specified device will be valid The function hssCreate_device sets up the Rx amp Tx buffer size for all ports to the default value of 2Kbytes CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 9 of 45 Copyright C Systems Pty Ltd All rights rese
7. 0 0005 28 42 2 HDLEC Mode 33020000 203 a A ois ale Ba eet a ee ee 31 4 2 2 1 HDLC Protocol Information Structure 0 00000 ce eee 31 4 2 2 2 HDLC Protocol Information Structure Members 2 0 055 32 4 2 2 3 Preamble Requirements cece eee eee ee eee 34 CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 Copyright C Systems Pty Ltd All rights reserved 2002 4 2 35 BISYNC Mode ocacion hehe o oe Be a A dd ade 35 4 2 3 1 BISYNC Protocol Information Structure oo oo ccoo 35 4 2 3 2 BISYNC Protocol Information Structure Members o 36 4 2 4 gt SMC UART Mode tiem it A A Bea E E O a aia 40 4 2 4 1 SMC UART Protocol Information Structure 0 ooo ooo 40 4 2 4 2 SMC UART Protocol Information Structure Members 41 5 Getting Started iii A AE RS Baers Sak eee ARO 43 6 Contact Details sss Serie aa a rad o bt A a ad hs 44 6 1 C nt act Person 3 SA A IA ee ae A a aE 44 6 2 Physical Address nseto nue A TS AS E a A Bele ASA AO ESA AA 44 6 3 Postal Address at AA Ee E Pe es tr Ga o eae Le 44 6 4 Voice and Electronic Contacts eee eens 44 6 5 Product Sup port 33 0 tue tied oi Sus leas es bet a a Mann 2 E ent deeds are it a Abed 2 yaa oe of Ge ae a 44 CCII HSS 6 MAN 002 2002 04 11 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 200
8. Members Options 1200 115kbps RS232 1200 2 4Mbps RS422 RS485 0 Indicates separate transmitter and receiver baudrates will be set Any values pemissible Units in bps HSS_CLOCK_DE FAULT HSS_CLOCK_BRG1 HSS_CLOCK BRG2 HSS_CLOCK_BRG3 HSS_CLOCK_BRG4 Baud rate Ge nerators 1 4 External Clocks connected on Pins RXCLK 1 4 RS232 or CLKIN 1 4 RS48 5 RS4 22 HSS_CLOCK_EXT1 HSS_CLOCK_EXT2 HSS_CLOCK_EXT3 HSS_CLOCK_EXT4 Note HSS_CLOCK_EXT 1 2 can only be usedforSCC Port A amp B while HSS_CLOCK_EXT 3 4 can only be usedforSCC Port C amp D HSS_UART_FLOW_NORMAL HSS_UART_FLOW_ASYNC HSS_UART_STOP_B HSS_UART_STOP_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_DATA_B HSS_UART_MODE_NORMAL HSS_UART_MODE_MAN_MM HSS_UART_MODE_AUTO_MM HSS_UART_FREEZE_TX_NORMAL HSS_UART_FREEZE_TX_FREEZE HSS_UART_RX_ZERO_STOP_BITS_NORMAL HSS_UART_RX_ZERO_STOP_BITS_NONE HSS_UART_SYNC_MODE_ASYNC HSS_UART_SYNC_MODE_SYNC Copyright C Systems Pty Ltd All rights reserved 2002 Description This mem ber is used to specify a single baudrate for both transm itter and receive r HSS_CLOCK_DEFAULT connects BRG 1 4 to Port A D For synchronous UART when transmit clock is set to HSS_CLOCK_BRG 1 4 then receive clock is still set to HSS_CLO
9. OBSOLETE VARIABLES rx_clock_direction HSS_CLOCK_DE FAULT HSS_CLOCK_DE FAULT conn ects B RG 1 4 to Po rt A D For NRZ NRZI when transmit clock is set to HSS_CLOCK_BR G 1 4 then receive clock is still set to HSS_CLOCK_EXT 1 4 for Port A D For FM0 1 Manc hester Diff Manchester transmit amp receive clocks can be setto one of HSS_CLO CK_B RG 1 4 or HSS_CLOCK_EXT 1 4 clock_source HSS_CLOCK_BRG1 HSS_CLOCK_BRG2 HSS_CLOCK_BRG3 HSS_CLOCK_BRG4 Baud rate Generators 1 4 HSS_CLOCK_EXT1 HSS_CLOCK_EXT2 HSS_CLOCK_EXT3 HSS_CLOCK_EXT4 External Clocks connected on Pins RXCLK 1 4 RS232 or CLKIN 1 4 RS48 5 RS4 22 Note HSS_CLOCK_EXT 1 2 can only be usedforSCC Port A amp B while HSS_CLOCK_EXT 3 4 can only be usedforSCC Port C amp D HSS_HDLC_CRC_MODE_16_BIT HDLC CRC mode HSS_HDLC_CRC_MODE_32_BIT crc_mode HSS_DIAG_NORMAL Normal operation Use this for external loopback diag_mode Set diagnostic mode External loopback RS485 connect TXD to RXD TXD to RXD TXCLK to RXCLK and TXCLK to RXCLK for synchronous mode HSS_DIAG_LOOPBACK Internalloopback TXD amp RXD are connected internally The value on RXD CTS 8 CD is ignored The transmitter and receivershare the same clock source External loopback RS232 connect TXD to RXD TXCLK to RXCLK for synchronous mode and RTS to CTS 8 CD
10. and transmit parity Parity is ignored unless cre_select LRC HSS_BISYNC_PARITY_ODD HSS_BISYNC_PARITY_LOW HSS_BISYNC_PARITY_EVEN HSS_BISYNC_PARITY_HIGH rx_parity tx_parity Set diagnostic mode Norm al operation Use this for external loopback diag_mode HSS_DIAG_NORMAL External loopback RS485 connect TXD to RXD TXD to RXD Internal loopback TXD 8 TXC LK to RXC LK and TXCLK to HSS_DIAG_LOOPBACK RXD are connected RXCLK internally The value on RXD CTS 8 CD is External loopback RS232 connect ignored The transmitter TXD to RXD TXCLK to RXCLK and and receivershare the RTS toCTS 8 CD same clock source For HSS Front Panel I O Board program elec_interface HSS_RS232_INT_CTL_LINES and connect TXD to RXD TXCLK to RXCLK Ignore RTS CTL 8 CD The transmitter automaticaly resends receive d data bit by bit HSS_DIAG_ECHO HSS_DIAG_LOOPBACK_ECHO Loopback and echo operation occur simultaneous ly crec CRC constant value Preset receiver transmitter CRC16 LRC These values shoul be preset to all ones or zeros depending on the BCS used 0x0000 or OxFFFF Number of received parity errors CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 37 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 0bv0000000ssssssss BISYNC SYNC register Contains
11. becomes active Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc lt port_id gt Port on which to detect clock signal Returns HSS_OK On success HSS_INVALID_PARAM Invalid dev_id or port_id supplied HSS_PORT_NOT_INSTALLED If the port does nor exists HSS_DEVICE_BUSY If no PCI buffer is available HSS_DEVICE_NOT_RESPONDING If the HSS control block could not be accessed within a certain time hssStatus hssClock_detect hssDeviceld dev_id hssPortld port_id CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 22 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 14 Print out current version number Function hssVersion_print Purpose To obtain the current version number ofthe driver and firmware software Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Returns HSS_OK On success HSS_INVALID_PARAM Invalid dev_id supplied HSS_DEVICE_BUSY If no PCI buffer is available HSS_DEVICE_NOT_RESPONDING If the HSS control block could not be accessed within a certain time hssStatus hssVersion_print hssDevice ld dev_id Note Run first hssC reate_device dev_id CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv w
12. ccHss4 a O From the VxWorks shell type Id lt ccHss4 a CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 3 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 3 3 Using the HSS Driver 3 3 1 Creating the Device The HSS driver supports multiple HSS PMC on a single host To establish a connection and construct all the device specific structures a user must create each of the devices separately using the device ID to identify it The device ID starts at O and increments by 1 foreach of the devices Device 0 refers to the device in the lowest PMC slot The HSS drivercan not be used until the user has created the device Example For device 0 Create all HSS devices hssCreate_device 0 The device ID is used in all calls to the HSS driver to identify the correct device 3 3 2 Configuring the Ports The HSS PMC has four serial communications controllers SCC s Ports A D that support UART and HDLC SDLC protocols and two serial management controllers SMC s Ports I amp J that support only asynchronous UART After the HSS device has been created the user must first set the default configuration for each ofthe ports To set the configuration of a port a protocol specific information structure is used Examples of the required structure is given in ccHssT est c for the U ART protocol and can be used as a starting point The structures allow the user to set
13. detect task HSS_TX_TASK_FP_ENABLE HSS_RX_TASK_FP_ENABLE HSS_CLK_TASK_FP_ENABLE On success If opening of port failed Invalid dev_id or port_id supplied If the port does nor exists If an Open is attempted on a port before configuring the port If no PCI buffer is available If the HSS control block could not be accessed within a certain time If failed to create semaphore or spawn receive task hssStatus hssOpen_port_fp hssD eviceld dev_id hssPortld port_id hssINT32 priority char fp_ options Notes port These functions must be called prior to attempting to send or receive on any channel ofthe specified Opening a port spawns a receive send and clock detect task for that specific port The priority of these tasks is specified by lt priority gt CCII HSS 6 MAN 002 2002 04 11 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Issue 3 5 Page 15 of 45 4 1 7 Close Port Function hssClose_port Purpose Arguments lt dev_id gt lt port_id gt Returns HSS_OK HSS_ERROR HSS_INVALID_PARAM HSS_PORT_NOT_INSTALLED HSS_PORT_NOT_CONFIGURED HSS_DEVICE_BUSY HSS_DEVICE_NOT_RESPONDING Close specified portfor send and receive Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Port to close for send and receive On success If opening of p
14. for a Softw are User Manual 2 3 Other Documents e VxWorks 5 3 1 Programmers Guide Edition 1 e MPC860 PowerQUICC User s Manual Rev 1 CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 2 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 3 Installation Procedure This paragraph describes the installation procedure for the HSS host driver The examples given are for aDY4 DMV 179 PowerPC host 3 1 To Build the HSS Driver into the VxWorks Kernel Assume the BSP directory is given as BSP_DIR tornado target config dmv179 3 1 1 Tornado 1 0 1 Environment e Copy ccHss4vx y z dmv179 to your BSP_DIR lib directory as ccHss4 a e Edit the Makefile in the BSP directory Use hssChanges txt to copy and paste the relevant information Add the following macro or edit the existing one EXTRA_MODULES BSP_DIR lib ccHss4 a O Rebuild all VxWorks images 3 1 2 Tornado 2 0 Environment e Copy ccHss4vx y z dmv179 to your BSP_DIR lib directory as ccHss4 a O Inthe Builds section of the Project Workspace change the Kernel properties to include the ccHss4 a library file in the Macros LIBs option O Rebuild all VxWorks images 3 2 To Load the Driver Software Separately Note this step is not required if the driver was built into the BSP If the driver is not builtinto the BSP a user can load it separately e Copy ccHss4vx y z dmv179 to your present working directory as
15. lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Port to open for send and receive Priority of the send receive and clock detection task servicing this port On success If opening of port failed Invalid dev_id or port_id supplied If the port does nor exists If an Open is attempted on a port before configuring the port If no PCI buffer is available If the HSS control block could not be accessed within a certain time If failed to create semaphore or spawn receive task hssStatus hssOpen_port hssDeviceld dev_id hssPortld port_id hssINT32 priority CCII HSS 6 MAN 002 2002 04 11 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Issue 3 5 Page 14 of 45 Function hssOpen_port_fp Purpose Arguments lt dev_id gt lt port_id gt lt priority gt lt fp_options gt Returns HSS_OK HSS_ERROR HSS_INVALID_PARAM HSS_PORT_NOT_INSTALLED HSS_PORT_NOT_CONFIGURED HSS_DEVICE_BUSY HSS_DEVICE_NOT_RESPONDING HSS_MEM_ALLOC FAILED Open specified port for send and receive with floating point functionality Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Port to open for send and receive Priority of the send receive and clock detection task servicing this port Floating point enable for send receive and clock
16. structures and setup 2000 10 31 options Updated driver data structures to include DPLL and various encoding methods Added version display function for driver and firmware software Updated UART and HDLC descriptions Added clock detection function Added functionality to attach external clocks Added SMC ports 2001 01 19 2001 03 19 2001 04 23 Implemented the BISYNC protocol Included the BIT functions 2001 05 21 ees Added a specifics for the X86 Added HSS Front Panel Added HSS Front Panel functionality 2 6 2 ENE flash programming 2001 07 05 General up date of driver 2001 09 13 ES Updated description of include files 2001 09 25 E HSS Serial I O back amp front panel boards share the same protocol information structure now Updated description of protocol information structure Added new hssOpen_port_fp function which allows for floating point initialisation of send receive and clock tasks o aa 2001 10 12 3 4 Added new hssCreate_device_ex function which allows the user 2002 01 17 to specify the Rx amp Tx buffer size for each port 2002 04 11 Updated callback function description added CRC error and Tx done error reporting Updated BIT structure added oscillator frequency variable CCII HSS 6 MAN 002 2002 04 11 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Issue 3 5 Contents 1 SCODE nS ir Tb a ea
17. the value of the SYNC character stripped from incoming data on receive once the receiver synchronizes to the data using the SYN1 SYN2 pair v if v land the receiver is not in hunt mode when a SYNC character is received this character is discarded ssssss ss 8 bits SY NC character When using 7 bit characters with parity the parity bit should be included in the SYNC register value bsync bdle Obv0000000dddddddd BISYNC DLE register In transparent mode the receiver discards any DLE character received v ifv 1and the receiver is not in hunt mode when a DLE character is received this character is discarded ddddd ddd 8 bits DLE character This character tells the receiver that the next character is text ObObh cccccccc valid entry Control character 1 to 8 Ob1bh cccccccc entry notvalid and is not used cc 8 eden 5 bits reserved Initialise to zero b Bloch check sequence expected A maskable interrupt is generated after the buffer is closed b 0 the character is written into the receive buffer and the bufferis closed b 1 the character is written into the receive buffer The receiver waits for 1 LRC or 2 CRC bytes and then closes the buffer h Enables hunt mode when the current bufferis closed h 0 the BISYNC controller maintains character synchronisation after closing the buffer h 1 the BISYNC controller enter
18. 2 Issue 3 5 Abbreviations and Acronyms API Application Program Interface BIT Built In Test BRG Baudrate Generator BSD Berkeley Socket Devices BSP Board Support Package CCII Communications Computer Intelligence Integration es C I Syste ms Pty Ltd DPLL Digital Phase Locked Loop FTP File Transfer Protocol HCC Host Carrier Card HSS High Speed Serial Acronym for the C 1 PMC Serial I O card project 1 0 Input Output PC Personal Computer PCI Peripheral Component Interconnect PMC PCI Mezzanine Card SBC Single Board Computer SCC Serial Communications Controller SIO Serial Input Output SMC Serial Management Controller TBD To Be Determined VME Versa Module Eurocard CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 Copyright C Systems Pty Ltd All rights reserved 2002 1 Scope This document is the User s Manual for the C l Systems Peripheral Component Interconnect PCI Mezzanine Card PMC High Speed Serial VxWorks Driver This document refers to the High Speed Serial VxWorks driver 1 1 Identification version 3 5 or later 1 2 Introduction The PMC High Speed Serial HSS driver is alow level device de pendant interface for transferring data overa C21 Systems HSS PCI Mezzanine Card PMC The driver binaries are provided with explicit installation instructions The driver software distribution consists of atleast the following files ccHss Lib 4 8 vx y z lt host gt ccHss4vx y zfirmware z
19. 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 2 1 UART Mode This protocol may only be used with the four SCC ports Ports A D 4 2 1 1 UART Protocol Information Structure The following structure is defined in the file hssControllfc h and is given here in abbreviated format i e reserved and obsolete members are not shown Always use the structure as defined in hssControllfc h struct hssUartInfoStruct hssUIN T32 baud_rate hssUINT32 clock_source hssUINT32 flow_control hssUINT32 stop_bits hssUINT32 data_bits hssUINT32 uart_mode hssUINT32 freeze_tx hssUINT32 rx_zero_stop_bits hssUINT32 sync_mode hssUINT32 disable_rx_while_tx hssUINT32 parity_enable hssUINT32 rx_parity hssUINT32 tx_parity hssUINT32 diag_mode hssUINT32 max_receive_bytes hssUINT32 max_idl hssUINT 32 brkcr hssUINT32 parec hssUINT32 frmec hssUINT32 nosec hssUINT32 brkec hssUINT32 uaddr1 hssUINT32 uaddr2 hssUINT32 toseq hssUIN T32 cc 8 hssUINT32 rccm y typedef struct hssUartinfoStruct hssUartinfo CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 27 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 2 1 2 baud_rate clock_source flow_control stop_bits data_bits uart_mode freeze_tx rx_zero_stop_ bits sync_mode CCII HSS 6 MAN 002 2002 04 11 P HSS TECH MAN USERMAN cManHssDrv wpd UART Protocol Information Structure
20. CK_EXT 1 4 for Port A Dj For asynchronous UART transmit amp receive clocks can be set to one of HSS_CLOCK_BRG 1 4 or HSS _CLO CK_EXT 1 4 Normal or asynchronous flow control Number of full stop bits Num ber of data bits N ote only ports amp J i e the SMC ports can select 9 or more data bits Select UART mode normal manual multidrop or autom atic multidrop mode Pause freeze trans mission Transmission continues when set back to normal If setto none the receiver receives data without stop bits Select asynchronous nomal or synchronous mode Issue 3 5 Page 28 of 45 disable rx while tx HSS_UART_DISABLE_RX_WHILE_TX_NORMAL Enab le normal or disa ble 2 E HSS_UART_DISABLE_RX_WHILE_TX_DISABLE receiver while transmitting Used in multidrop mode to prevent reception of own messages parity_enable HSS_UART_PARITY_NO_PARITY Enable or disable parity checking gt HSS_UART_PARITY_ENABLE rx_parity tx_parity HSS_UART_PARITY_ODD Receive and transm it parity HSS_UART_PARITY_LOW Parity will only be checked if parity HSS_UART_PARITY_EVEN is enabled HSS_UART_PARITY_HIGH diag_mode HSS_DIAG_NORMAL Normal operation Use this Set diagnostic mode for external loopback External loopback RS485 connect TXD to RXD TXD to RXD TXCLK to RXCLK and HSS_DIAG_LOOPBACK Internalloopback TXD amp TXCLK to RXCLK for RXD are connected synchronous mode internally The value on RXD CT
21. Detect A clock signal has been detected on that specific port Only one Call back function for each event is recommended For the user to receive data at least the Receive Done Call b ack must be installed While the Receive Done Call ba ck is executed the corresponding buffer will not be accessed by the HSS driver The user can process the data in the Call back function or copy the data somewhere else for processing atthe user s leisure Receive function prototype void Process_rx_data int devid int portid int crc_error int userid int length void pdata Transmit Begin prototype void Process_tx_data int devid int portid int dummy int userid int length void pdata Transmit Done prototype void Process_tx_data int devid int portid int error int userid int length void pdata Clock Detection prototype void Process_clk_detect int devid int portid int dummy 1 int userid int dumm y2 void dum my3 devid device ID portid port ID crc_error HSS_OK no CRC error HSS_ERROR CRC error error HSS_OK send done OK HSS_ERROR buffer underrun or CTS lost send not complete userid userdefined ID length length ofreceived data pdata buffer with received data dummy 1 2 variables not used always 0 dummy3 variable not used always NULL Example Add a Call back function for handling receives Receive function prototype this function is implemented by the user void Process
22. Maximum number of bytes have been allocated to the Rx amp Tx buffers See function that may be copied into a hssCre ate_device_ex buffer max_receive_bytes CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 41 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 0 to 2048 default or up to 32 Kbytes depending on how many bytes Maximum idle characters have been allocated to the Rx amp Tx buffers See function When a character is hssCre ate_device_ex received the receiver begins counting idle characters If max_idl idle characters are received before the next data character an idle timeout occurs and the buffer is closed Thus max_idl offers a way to demarcate frames To disable the feature clear max_idl The bit length of an idle character is calculated as follows 1 data length 5 14 1 if parity is used num ber of stop bits 1 2 For 8 data bits no parity and 1 stop bit the character length is 10 bits CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 42 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 5 Getting Started After installing the host driver according to paragraph 3 1 test the host driver following the test procedure given in hssTe st txt CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 43 of 45 Copyright C Sys
23. S 8 CD is External loopback RS232 ignored The transmitter connect TXD to RXD TXCLK to and receivershare the RXCLK for synchronous mode same clock source and RTS to CTS 8 CD HSS_DIAG_ECHO The transmitter For HSS Front Panel I O Board automatically resends program elec_interface receive d data bit by bit HSS_RS232_INT_CTL_LINES and connect TXD to RXD TXCLK to RXC LK for synchronous mode HSS_DIAG_LOOPBACK_ECHO Loopback and echo Ignore RTS CTL 8 CD operation occur simultaneous ly max_receive_bytes 1 to 2048 default or up to 32 Kbytes depending on how many Maximum number of bytes that E E bytes have been allocated to the Rx 8 Tx buffers See function may be copied into a buffer hssCre ate_device_ex max idl 0 to 2048 default or up to 32 Kbytes depending on how many Maximum idle characters When a a bytes have been allocated to the Rx amp Tx buffers See function characteris received the receiver hssCre ate_device_ex begins counting idle characters If max_idl idle characters are receive d before the next data character an idle time out occurs and the buffer is closed Thus max _idl offers a way to demarcate frames To disable the feature clear max_idl The bit length of an idle character is calculated as follows 1 data length 5 9 1 if parityis used number of stop bits 1 2 For8 data bits no parity and 1 stop bit the character length is 10 bits 0 2048 Number of break characters sent by
24. T_RESPONDING If the HSS control block could not be accessed within a certain time hssStatus hssSend_data hssDeviceld dev_id hssPortld port_id hssChannelld chan_id hssCount nr_bytes hssBufferP tr p_data hssInt32 tim eout Notes The port must be opened before attempting to send data over it CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 17 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 9 Add Receive Buffer Function hssAdd_receive_buffer Purpose Adda receive buffer to a specified channel Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc lt port_id gt Port on which data must be received lt chan_id gt Channel on which data must be received If a port has only one channel lt chan_id gt 0 lt min_nr_bytes gt Minimum number of bytes to receive before Call back function is called lt max_nr_bytes gt Maximum number of bytes to receive into this buffer lt p_data gt Pointer to buffer with space for atleast lt max_nr_bytes gt bytes of data Returns HSS_OK On success hssStatus hssAdd_receive_buffer hssDeviceld dev_id hssPortld port_id hssChannelld chan_id hssCount min_nr_bytes hssCount max_nr_bytes hssBufferPtr p_data Note This function is not used anymore The receive buffers are added intemally The user may still ca
25. YET CO Dam Oo ie epa mar ib DIODOS Communications Computer Intelligence Integration User Manual for the C 1 Systems PMC High Speed Serial VxWorks Driver CCIl Document No nh O OS MAN 002 Issue Date 2002 04 11 Print Date 2002 04 11 File Name P HSS TECH MAN USERMAN cManHssDrv wpd C Il Systems The copyright of this document is the property of C7l Systems The document is issued for the sole purpose for which it is supplied on the express terms that it may not be copied in whole or part used by or disclosed to others except as authorised in writing by C P Systems Document prepared for C4 Systems Pty Ltd Copyright C 1 Systems Pty Ltd All rights reserved 2002 Signature Sheet Completed by lo Software Engineer 2001 04 11 HSS C I Systems Pty Ltd Project Manager da HSS C 1 Systems Pty Ltd gt ae ae Qu lity Assurance R presentative I Systems Pty Ltd Accepted by Accepted by A Keuges 09 05 Da CCIVHSSIG MAN 002 2002 04 11 _ Bee act Wale P HSS TECH MAN USERMAN cManHssDrv wpd Amendment History Initial version created by splitting cM anSioD rv wpd Issue 1 1 into separate SIO and HSS user manuals 1 1 Updated Application Program Interface API to correspond with version 1 release 0 of the host driver Updated for HSS version 2 0 2000 03 16 2000 06 06 al Updated paragraph 4 2 detailing protocol
26. _EXT 1 2 can only be used for SMC Port I while HSS_CLOCK_EXT 3 4 can only be used for SMC Port J stop_bits HSS_UART_STOP_BITS_ONE Number of full stop bits HSS_UART_STOP_BITS_TWO HSS_UART_DATA_BITS_5 Num ber of data bits Note HSS_UART_DATA_BITS_6 only ports amp J i e the HSS_UART_DATA_BITS_7 SMC ports can select 9 or HSS_UART_DATA_BITS_8 more data bits HSS_UART_DATA_BITS_9 HSS_UART_DATA_BITS_10 HSS_UART_DATA_BITS_11 HSS_UART_DATA_BITS_12 HSS_UART_DATA_BITS_13 HSS_UART_DATA_BITS_14 data_bits HSS_UART_PARITY_NO_PARITY HSS_UART_PARITY_ENABLE Enable or disable parity checking parity_ enable HSS_UART_SMC_PARITY_ODD Receive and transmit parity HSS_UART_SMC_PARITY_EVEN Parity will only be checked if parityis enabled parity_mode Normal operation Use this for external loopback HSS_DIAG_NORMAL Set diagnostic mode diag_mode External loopback RS485 connect TX D to RXD amp TXD to RXD HSS_DIAG_LOOPBACK Internalloopback TXD amp RXD are connected internally The value on RXD is ignored External loopback RS232 connect TXD to The transmitter autom atically RXD resends received data bit by bit HSS_DIAG_ECHO HSS_DIAG_LOOPBACK_ECHO Loopback and echo operation occur simultane ously 1 to 2048 default or up to 32 Kbytes depending on how many bytes
27. _rx_data int devid int portid int crc_error int userid int length void pdata Add receive Call back hssAdd _callback 0 HSS_CB_ON_RECEIVE_DONE Process_rx_data 0 CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 5 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 3 3 5 Sending and Receiving Data To send and receive data on a specified port the user must first open the port To stop sending or receiving data from a port the user must close the port Example Send some data on device 0 port B Open port for sending data hssOpen_port 0 HSS_PORT_B 50 Send some data hssSend_data 0 HSS_PORT_B 0 256 pbuffer256 NO_WAIT Do other stuff p Close port after final usage hssClose_port 0 HSS_PORT_B 3 3 6 Destroying the Device When the device is no longer required it should be destroyed to free system resources Example Device 0 is no longer required Close ports after final usage hssClose_port 0 HSS_PORT_A hssClose_port 0 HSS_PORT_B hssClose_port 0 HSS_PORT_C hssClose_port 0 HSS_PORT_D hssClose_port 0 HSS_PORT_1 hssClose_port 0 HSS_PORT_J Destroy device to free resources hssDestroy_device 0 3 3 7 Detecting an active clock signal on ports To detect when a port s clock signal becomes active use the following function Example Detecting a clock signalon device 0 and Port A
28. all the protocol specific options available on the HSS PMC communication controller chip the MPC860 PowerQUICC For available options for each of the structure fields see 2 3 3 Example Set two SCC ports to UART mode and two to HDLC mode Set initial SCC port configuration hssSet_port_config 0 HSS_PORT_A 4 uart_info hssSet_port_config 0 HSS_PORT_B 4 uart_info hssSet_port_config 0 HSS_PORT_C amp hdlc_info hssSet_port_config 0 HSS_PORT_D amp hdlc_info Set initial SMC port configuration hssSet_port_config 0 HSS_PORT_l amp smc_uart_info hssSet_port_config 0 HSS_PORT_J amp smc_uart_info 3 3 3 Adding Receive Buffers Note this step is not necessary anymore Receive buffers are added automatically by the driver in the hssOpen_port function It is still possible to call hssAdd_receive_buffer but this function will notdo anything CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 4 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 3 3 4 Adding Call back Functions The HSS driver notifies the user of different events by calling a user defined Cal back function The events for which the user may specify one or more Call back functions are Send Begin The driver has accepted the data for sending Send Done The driver has finished sending the data Receive Done Data has been received and written into the user s buffer Clock
29. ata hssUINT32 disable_rx_while_tx hssUINT32 rx_parity hssUINT32 tx_parity hssUINT32 diag_mode hssUINT32 crcc hssUINT32 prerc hssUINT32 ptcrc hssUINT32 parec hssUINT32 bsync hssUINT32 bdle hssUIN T32 cc 8 hssUINT32 rccm hssUINT32 sync hssUINT32 syn_length hssUINT32 send_idles_or_flags y typedef struct hssBisyncinfoStruct hssBisyncinfo CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 35 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 2 3 2 BISYNC Protocol Information Structure Members Name Options Description baud rate 1200 115kbps RS232 This mem ber is used to specify a 1200 12Mbps RS422 RS485 single baudrate for both transmitter Any values pemissible and receiver Units in bps clock source HSS_CLOCK_DEFAULT HSS_CLOCK_DEFAULT connects BRG 1 4 to Port A D HSS_CLOCK_BRG1 Baud rate Generators 1 4 When the transmit clock is set to HSS_CLOCK_BRG2 HSS_CLOC K_BRG 1 4 then receive HSS_CLOCK_BRG3 clock is still set to HSS_CLOCK_BRG4 HSS_CLO CK_EXT 1 4 for P ort A D HSS_CLOCK_EXT1 External Clocks connected HSS_CLOCK_EXT2 on Pins RXCLK 1 4 HSS_CLOCK_EXT3 RS232 or CLKIN 1 4 HSS_CLOCK_EXT4 RS48 5 RS4 22 Note HSS_CLOCK_EXT 1 2 can only be usedforSCC Port A amp B while HSS_CLOCK_EXT 3 4 can only be usedforSCC Port C amp D max_receive_bytes 1 to 2048 2 CRC bytes default orup to 32 Kbytes
30. cessed within a certain time Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc On success Invalid dev_id supplied If no PCI buffer is available If the HSS control block could not be accessed within a certain time Issue 3 5 Page 25 of 45 4 2 Driver Data Structures Each protocoldefines a protocol information structure used to configure a port with protocol specific options This paragraph details the information structures used by each protocol and explains the use and limitations of every structure mem ber hssProtocollnfo structure struct hssProtocollnfoStruct hssUINT32 protocol_id only used for HSS Front Panel boards value ignored otherwise hssUINT32 elec_interface union SCC info hssUartInfo uart hssHdlclInfo hdlc hssBisynclnfo bisync SMC info hssSm cUartinfo smc_uart info y typedef struct hssProtocollnfoStruct hssProtocollnfo protocol_id HSS_PROTOCOL_UART HSS_PROTOCOL_HDLC HSS_PROTOCOL_BISYNC HSS_PROTOCOL_SMC_UART elec_interface only used for HSS Front Panel boards HSS_RS485 RS485 422 HSS_RS232_INT_CTL_LINES RS232 control lines RTS CTS CD are connected internally HSS_RS232_EXT_CTL_LINES RS232 control lines RTS CTS CD need to be connected externally CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 26 of
31. e ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Call back type one of HSS_CB_ON_SEND_BEGIN HSS_CB_ON_SEND_DONE HSS_CB_ON_RECEIVE_DONE HSS_CB_ON_CLOCK_DETECT User function User identifier This identifier will be passed to the Call back function when it is called On success Invalid dev_id supplied If HSS Call back node could not be created in memory hssStatus hssAdd_callback hssDeviceld dev_id hss CallbackType cb_type hssCallb ack Call back hss Userld user_id Notes Four call backs are provided for user notification from the driver HSS_CB_ON_SEND BEGIN This Call back will be called as soon as the data has been handed over to the driver for sending HSS_CB_ON_SEND_DONE This Call back will be called when all the data for a given send has been sent by the driver HSS_CB_ON_RECEIVE_DONE This Call back will be called when a block of data has been received by the driver The user must add at least one of these call backs to receive data Only one call back foreach above type per device is recommended The call back function receives the port id such that the user can distinguish which port triggered the call back More than one call back function may be used in which case the call backs will be called in the sequence they were added HSS_CB_ON_CLOCK_DETECT This Call back will be called when a clock signal has been detected on a port The u
32. ed 2002 4 1 5 Get Port Configuration Function hssGet_port_config Purpose Get port protocol and protocol configuration Arguments lt dev_id gt lt port_id gt lt p_info gt Returns HSS_OK HSS_ERROR HSS_INVALID_PARAM HSS_DEVICE_BUSY HSS_DEVICE_NOT_RESPONDING Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Port to get configuration info from Pointer to information struct used for configuration On success If the Tx Rx tasks have not been destroyed Invalid dev_id or port_id supplied If no PCI buffer is available If the HSS control block could not be accessed within a certain time hssStatus hssGet_port_config hssD eviceld dev_id hssPortld port_id hssProtocollnfo p_ info Notes The lt p_info gt pointer must point to an existing hssProtocollnfo structure CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Page 13 of 45 4 1 6 Open Port Function hssOpen_port Purpose Arguments lt dev_id gt lt port_id gt lt priority gt Returns HSS_OK HSS_ERROR HSS_INVALID_PARAM HSS_PORT_NOT_INSTALLED HSS_PORT_NOT_CONFIGURED HSS_DEVICE_BUSY HSS_DEVICE_NOT_RESPONDING HSS_MEM_ALLOC FAILED Open specified port for send and receive Device ID onthe PCI bus The HSS device inthe
33. he HSS Built_In_Test structures Function hssBit_getstruct Purpose To obtain the latest BIT variables Arguments lt dev_id gt lt bit_info gt Returns HSS_OK HSS_INVALID_PARAM HSS_DEVICE_BUSY HSS_DEVICE_NOT_RESPONDING Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Pointer to BIT info struct On success Invalid dev_id supplied If no PCI buffer is available If the HSS control block could not be accessed within a certain time hssStatus hssBit_getstruct hs sDeviceld dev_id hssBitinfo bit_info Function hssBit_report Purpose To display each port s statistics Arguments lt dev_id gt Returns HSS_OK HSS_INVALID_PARAM HSS_DEVICE_BUSY HSS_DEVICE_NOT_RESPONDING hssStatus hssBit_report hss Deviceld de v_id Function hssBit_clear Purpose To clear each port s counters Arguments lt dev_id gt Returns HSS_OK HSS_INVALID_PARAM HSS_DEVICE_BUSY HSS_DEVICE_NOT_RESPONDING hssStatus hssBit_clear hss Deviceld de v_id CCII HSS 6 MAN 002 2002 04 11 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc On success Invalid dev_id supplied If no PCI buffer is available If the HSS control block could not be ac
34. in T sts 2 55 2 shy os ds A ee a 7 4 Application Program Interface API 0 0 0 eee 8 4 1 High Speed Serial Driver Interface aaa tee 8 4 1 1 Greate Device id e eed A aula sea a eats Ae tate tt A do es Ora 8 9 41 2 Destroy Device 0 BR ee Ge eS ees Oe eR ER lee 10 AS Port Exists A eh eel pace A oe Paid o eee ey N 11 4 1 4 Set Port Configuration o 12 4 1 5 Get Port Configuration 0 0 0 0 eee 13 431 6 OpensiPort 2 22242 nc eke case eh eee A hae ee add sabe a Soe ke 14 AAT Glose Port rula altar ar Beata RAG a Wd a nie ah ape tea E 16 4 98 Send Data 2 4 5 04 Ao Ahad ea et Ae te Ata AEA A A ite de tel etd eb nd eg aA eed 17 4 1 9 Add Receive Buffer tee eee 18 4 1 10 Remove Receive Buffer 0 00000 ccc eee 19 4 1141 Add Call back za 3 f x oc eine ts a ES wes eS Ge 20 4 1 12 Remove Call back gt 2 22 0205 csp eG be ee ek Be e De ee eee 21 4 1 13 Detecting an active clock signal on ports 0 0000 cece eee 22 4 1 14 Print out current version number 00 00 0c eee ae 23 41 15 gt HSS Built In Test 56 4 2 Lara oe alas atten aaha alin Ha at ars ee waloa beaks oe aghast ds 24 4 2 Driver Data Structures et ee 26 4 2 1 UART Mode encia Ga See 27 4 2 1 1 UART Protocol Information Structure 00000 e eee eee 27 4 2 1 2 UART Protocol Information Structure Members
35. ip containing ccHss4vx y z lt freq gt hex ccHss Flashvx y z lt hos t gt hssReadme txt hssRelease_emb txt hssRelease_host txt ccHs s4vx y z h_files zip ccHss Test c ccHssT est lt ho st gt hssChanges txt hssFlash txt hssTest txt CCII HSS 6 MAN 002 2002 04 11 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Host architecture specific driver object file cc CCIl Systems Pty Ltd HssL ib High Speed Serial driver 4 8 4 portor 8 port HSSPMC x Version number y Revision number Zz Beta number lt host gt Host for which the binary is built e g ccHss4v2 4 dmv179 for version 2 4 of the HSS software built fora DY4 DMV179 PowerPC host for a 4 portHSS PMC HSS firmware lt freq gt corresponding oscillator frequency Flash update driver General information and installation notes Release notes and revision history Please check this file for information on the latest updates Zip file which contains all header files that define the application program interface AP 1 to the driver Sample C code for accessing the HSS driver Changes to be made to VxWorks and BSP files Procedure for updating the firmware if required Test procedure for verifying host driver and firmware Issue 3 5 Page 1 of 45 2 Applicable Documents 2 1 Specifications Not applicable 2 2 Standards e DI IPS C 81 443 Data Item Description
36. ll this function but this function returns only HSS_OK CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 18 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 10 Remove Receive Buffer Function hssRemove_receive_buffer Purpose Remove a receive buffer from a specified channel Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc lt port_id gt Port on which data must be received lt chan_id gt Channel on which data must be received If a port has only one channel lt chan_id gt 0 lt p_data gt Pointer to buffer to be removed Returns HSS_OK On success hssStatus hssRem ove_receive_buffer hssD eviceld dev_id hssPortld port_id hssChannelld chan_id hssBufferPtr p_data Note This function is notused anymore The receive buffers are removed internally The user may still call this function but this function returns only HSS_OK CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 19 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 11 Add Call back Function hssAdd_callback Purpose Add a user defined Call back routine Arguments lt dev_id gt lt cb_type gt lt Call back gt lt user_id gt Returns HSS_OK HSS_INVALID_PARAM HSS_MEM_ALLOC FAILED Devic
37. lt with address_mask For example to recognize a frame that begins 0x7E flag 0x68 OxAA using 16 bit address recognition the address registers should contain OxAA68 and address_mask should contain OxFF FF For 8 bit addresses clear the eight high order address bits nr_flags_between_frames Minimum number of flags between or before frames retransmit_enabled Enab le re tran smit flag_sharing_enabled Enable flag sharing rx_disabled_during_tx Disab le receive during tran smit Enable bus mode bus mode rts Enable special RTS operation in 7 g HDLC bus mode multiple_tx_frames Enable multiple fram es in aaa transmit FIFO encoding _method HSS_UART_ENCODING_METHOD_NRZ Rx Tx encoding method NRZ HSS_UART_ENCODING_METHOD_NRZI_MARK and NRZI use no DPLL FM0 1 HSS_UART_ENCODING_METHOD_NRZI_SPACE Manchester amp Diff_Manchester HSS_UART_ENCODING_METHOD_FMO use the DPLL for clock HSS_UART_ENCODING_METHOD_FM1 recovery The clock rate is 16x HSS_UART_ENCODING_METHOD_MANCHESTER when the DPLL is used HSS_UART_ENCODING_METHOD_DIFF_MANCHESTER preamble_length HSS_DPLL_PREAMBLE_LENGTH_0 Determines the length ofthe HSS_DPLL_PREAM BLE_LENGTH_8 preamble pattern HSS_DPLL_PREAMBLE_LENGTH_16 HSS_DPLL_PREAMBLE_LENGTH_32 HSS_DPLL_PREAMBLE_LENGTH_48 HSS_DPLL_PREAMBLE_LENGTH_64 HSS_DPLL_PREAMBLE_LENGTH_128 CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 33 of 45 Copyright C Systems Pty
38. nly be used with the two SMC ports Ports I amp J 4 2 4 1 SMC UART Protocol Information Structure The following structure is defined in the file hssControllfc h and is given here in abbreviated format i e reserved and obsolete members are not shown Always use the structure as defined in hssControllfc h struct hssSmcUartInfoStruct hssUIN T32 baud_rate hssUINT32 clock_source hssUINT32 stop_bits hssUINT32 data_bits hssUINT32 parity_enable hssUINT32 parity_mode hssUINT32 diag_mode hssUINT32 max_receive_bytes hssUINT32 max_idl y typedef struct hssSmcUartinfoStruct hssSmcUartInfo CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 40 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 2 4 2 SMC UART Protocol Information Structure Members baud rate 1200 115kbps RS232 RS422 RS485 This member is used to e Any values pemissible specify a single baudrate for Units in bps both transmitter and receiver clock source HSS_CLOCK_DE FAULT HSS_CLOCK_DE FAULT connects BRG 1 2 to Port I J HSS_CLOCK_BRG1 Transmit amp receive clocks HSS_CLOCK_BRG2 can be set to one of HSS_CLOCK_BRG3 HSS_CLOCK_BRG 1 4 or HSS_CLOCK_BRG4 HSS_CLOCK_EXT 1 4 Baud rate Generators 1 4 External Clocks connected on Pins RXCLK 1 4 RS232 or CLKIN 1 4 RS4 85 RS 422 HSS_CLOCK_EXT1 HSS_CLOCK_EXT2 HSS_CLOCK_EXT3 HSS_CLOCK_EXT4 Note HSS_CLOCK
39. ormation Structure The following structure is defined in the file hssControllfc h and is given here in abbreviated format i e reserved and obsolete members are not shown Always use the structure as defined in hssControllfc h struct hssHdlcInfoStruct hssUINT32 tx_baud_rate hssUINT32 rx_baud_rate hssUINT32 clock_source hssUINT32 crc_mode hssUINT32 diag_mode hssUINT32 max_receive_bytes hssUINT32 max_frame_bytes hssUINT32 address_mask hssUINT32 address1 hssUINT32 address2 hssUINT32 address3 hssUINT32 address4 hssUINT32 nr_flags_between_frames hssUINT32 retransmit_enabled hssUINT32 flag_sharing_ enabled hssUINT32 rx_disabled_during_tx hssUINT32 bus_mode hssUINT32 bus_mode_rts hssUINT32 multiple_tx_frames hssUINT32 encoding method hssUINT32 preamble_length hssUINT32 preamble_pattern hssUINT32 send_idles_or_flags y typedef struct hssHdlclnfoStruct hssHdlcInfo CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 31 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 2 2 2 HDLC Protocol Information Structure Members Name Options Description 1200 115kbps RS232 1200 12Mbps RS422 RS485 Any values pemissible Units in bps NB It is not possible to s pecify the transmitter and receiver baudrate separately anymore Setboth variables to the same baudrate tx_baud_rate rx_baud_rate tx_clock_direction
40. ort failed or Rx Tx tasks have not been destroyed Invalid dev_id or port_id supplied If the port does nor exists If an Open is attempted on a port before configuring the port If no PCI buffer is available If the HSS control block could not be accessed within a certain time hssStatus hssClose_port hssDeviceld dev_id hss Portld port_id Notes closed CCII HSS 6 MAN 002 2002 04 11 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Closing a porta second time has no effect and still returns HSS_ OK since the port was successfully Issue 3 5 Page 16 of 45 4 1 8 Send Data Function hssSend_data Purpose Send data over the specified channel Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc lt port_id gt Port on which data must be sent lt chan_id gt Channel on which data must be sent If a porthas only one channel lt chan_id gt 0 lt nr_bytes gt Number of bytes to send lt p_data gt Pointer to buffer with at least lt nr_bytes gt bytes of data lt timeout gt Not used anymore Returns HSS_OK On success HSS_INVALID_PARAM Invalid dev_id or port_id supplied HSS_PORT_NOT_INSTALLED If the port does nor exists HSS_PORT_NOT_OPEN If the port is not open yet HSS_DEVICE_BUSY If no PCI buffer is available HSS_DEVICE_NO
41. pd Page 23 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 15 HSS Built In Test The following structures define the HSS Built_In_Test variables defined in hss Controllfc h BIT structures struct hssBoardBitinfoStruct hssUINT 32 board_number hssUINT32 board_type hssUINT32 firmware_version hssUINT32 firmware_revision hssUINT32 firmware_beta hssUINT32 oscillator_freq char firmw are_creation_date 30 y typedef struct hssBoardBitInfoStruct hssBoardBitInfo struct hssSendBitInfoStruct hssCount nr_accepted hssCount nr_rejected hssCount nr_errors hssCount nr_sent hssCount nr_bytes_accepted hssCount nr_bytes_ rejected hssCount nr_bytes_sent y typedef struct hssSendBitinfoStruct hssSenaBitinfo struct hssReceiveBitInfoStruct hssCount nr_buffers_busy hssCount nr_received hssCount nr_bytes_received hssCount nr_errors y typedef struct hssReceiveBitInfoStruct hssReceiveBitInfo Main BIT structure struct hssBitInfoStruct hssBoardBitInfo board_ bit hssSe naBitInfo tx_scc_bit HSS_HW_NR_SCC hssRe ceiveBitlnfo rx_scc_bitlHSS_HW_NR_SCC hssSe naBitinfo tx_smc_bit HSS_HW_NR_SMC hssRe ceiveBitlnfo rx_smc_bit HSS_HW_NR_SMC y typedef struct hssBitInfoStruct hssBitInfo CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 24 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 Three functions give access to t
42. r PR bE Dla Soh Seah eos Newt dice har deme Pay Ss 1 1 1 Identification 4k setts he ae Wings el etna Oe ee hee Mn toe Bee PR ea ote nae le 1 1 2 Introduction La Maes Mee eee Fa nek Rh ae Beets ged Reh Pen o A Mates he A ete Boe he ener 1 2 Applicable Documents 5204 lt 4 sad AA AA AAA ea 2 2 1 Specifications tio in Geek We YB olive dh aie we LA ts ay te apse aA Pee PAE ee 2 2 2 standards 72056 be the sc ts a e a hat ak eat Ak A e he poh E 2 2 3 Other Documents ree sco a ek Da ee eh dee atu Seba es a Me elev oats 2 3 Installation PIrOCedUre casi A A ae oS WAP ara RE 3 3 1 To Build the HSS Driver into the VxWorks Kernel 0 2000 o 3 3 1 1 Tornado 1 0 1 Environment 20 0000 eee 3 3 1 2 Tornado 2 0 Environment aaa aaa ee eee 3 3 2 To Load the Driver Software Separately 0 0 0 cece ee 3 3 3 Using the HSS Driver ii AA nbd oe AA 4 3 3 1 Creating the Device ooo ed Ga ee Ne a ee a a 4 3 3 2 Configuring the Ports 0 A a A E a E E ee eee 4 3 3 3 Adding Receive Buffers 2 2 000 ccc eee 4 3 3 4 Adding Call back Functions 00 000 bce eee 5 3 3 5 Sending and Receiving Data 0 0 0 cece eee 6 3 3 6 Destroying the Device ccc ee ee 6 3 3 7 Detecting an active clock signal on ports 00 020 cee ee 6 3 3 8 Obtaining the current host and firmware version number 0 0000 aees 7 3 3 9 OHSS Built
43. ration Function hssSet_port_config Purpose Set port protocol and protocol configuration Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc lt port_id gt Port to configure lt p_info gt Pointer to information struct used for configuration Returns HSS_OK On success HSS_PCI_INIT_FAIL PCI initialisation failed HSS_ERROR If the Tx Rx tasks have not been destroyed HSS_INVALID_PARAM Invalid dev_id or port_id supplied HSS_PORT_NOT_INSTALLED If the port does nor exists HSS_DEVICE_BUSY If no PCI buffer is available HSS_DEVICE_NOT_RESPONDING If the HSS control block could not be accessed within a certain time HSS_INCORRECT_PARAM_COMBINATION If an incorrect parameter combination was selected in the protocol structure hssStatus hssSet_port_config hssD eviceld dev_id hssPortld port_id hssProtocollnfo p_ info Notes The lt p_info gt pointer must point to a valid hssP rotocollnfo structure with all protocol information set as required If only a few items need to change the hssGet_port_config function should be used to fill in the rest of the structure Warning Do not call this function while sending or receiving data as this may result in data loss CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 12 of 45 Copyright C Systems Pty Ltd All rights reserv
44. rved 2002 4 1 2 Destroy Device Function hssDestroy_device Purpose Destroy the HSS device specific structures Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc Returns HSS_OK On success HSS_INVALID_PARAM Invalid dev_id supplied HSS_PCI_INIT_FAIL PCI initialisation failed HSS_ERROR If the interrupttasks have not been destroyed hssStatus hssDestroy_device hssD eviceld dev_id Notes After this function is called no other function call to the specified device will be valid except for hssCreate_device CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 10 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 3 Port Exists Function hssPort_exists Purpose Determine whethera port exists on the specified device Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc lt port_id gt Port to query Returns TRUE If the port exists in hardware FALSE If the port does not exist in hardware hssBool hssPort_exists hssDeviceld dev_id hssPortld port_id CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 11 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 4 Set Port Configu
45. s hunt mode after closing the buffer When b 1 the controller enters hunt mode afterreceiving LRC orCRC ceccccccc 8 bits defines control characters to be compared to the incoming character When using 7 bit characters with parity include the parity bit in the character value Receive control character mask A one enables comparison and a zero masks it 0b11 00000000 ignore these bits when comparing incomming character 0b11 11111111 enable comparing the incoming character to cc n rccm sync Oxssss 2 bytes SYNC character should be programmed with the sync pattern CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 38 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 syn_length HSS_BISYNC_SYNL_8 HSS_BISYNC_SYNL_8 should be HSS_BISYNC_SYNL_16 chosen to implement mono sync protocol The receiversynchronizes on an 8 bitsync patternin sync HSS_BISYNC_SYNL_16 The receiversynchronizes on a 16 bitsync pattern stored in sync send_idles_or_ flags HSS_BISYNC_SEND_IDLES Send either idles orflags syncs a HSS_BISYNC_SEND_FLAGS_SYNCS between frames as defined by the protocol The flag character is e qual to sync CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 39 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 2 4 SMC UART Mode This protocol may o
46. ser must add only one of these call backs This Call back function will only be called once a port has been instructed to detect a clock signal e g calling the function hssC lock_detect Note HSS_CB_ON_RECEIVE_BEGIN This Call back does not exist anymore CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Page 20 of 45 4 1 12 Remove Call back Function hssRemove_callback Purpose Remove a user defined Call back routine Arguments lt dev_id gt Device ID onthe PCI bus The HSS device inthe lowest PCI slot lt dev_id gt 0 next HSS device lt dev_id gt 1 etc lt cb_type gt Call back type one of HSS_CB_ON_SEND_BEGIN HSS_CB_ON_SEND_DONE HSS_CB_ON_RECEIVE_DON E HSS_CB_ON_CLOCK_DETECT lt Call back gt User function to remove lt user_id gt User identifier This identifier must be the same as the one passed to hssAdd_callback Returns HSS_OK On success HSS_INVALID_PARAM Invalid dev_id supplied hssStatushssRemove_callback hssD eviceld dev_id hssCallbackTypecb_type hssCallback Call back hssUse rld user_id CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 21 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 4 1 13 Detecting an active clock signal on ports Function hssClock_detect Purpose Setup a port to detect when clock signal
47. te 10 megabytes of memory If the upper address of the PCI memory space is defined as 0xFFF 00000 then subtracting 10 megabytes gives a base address of OxXFFF00000 O0xA00000 OxFF500000 In the PC 386 486 Pentium Pentiumpro system dependent library sysLib c code shown in bold text needs to be added to the memory descriptor table sysP hysMe mDesc ifndef CPU_PCI_MEM_ADRS define CPU_PCIL_MEM_ADRS OxFF500000 base of PCI MEM addr endif PHYS _MEM_DESC sysPhysMemDesc adrs and length parameters must be page aligned multiples of 4KB 4MB FIVM_PAGE_SIZE PAGE_SIZE_4KB lower memory video ram etc upper memory for OS upper memory for Application PCI I O space void CPU_PCI_MEM_ADRS void CPU_PCI_MEM_ADRS 0xA000 00 VM_STATE_MASK_VALID VM_STATE_MASK_WRITABLE VM_STATE_MASK_CACHEABLE VM_STATE_VALID VM_STATE_WRITABLE VM_STATE_CACHEABLE_NOT entries for dynamic mappings create sufficient entries DUMMY_MMU_ENTRY DUMMY_MMU_ENTRY DUMMY_MMU_ENTRY else CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 45 of 45 Copyright C Systems Pty Ltd All rights reserved 2002
48. tems Pty Ltd All rights reserved 2002 6 Contact Details 6 1 Contact Person Direct all corespondence and or support queries to the Project Manager HSS at C212 Systems 6 2 Physical Address C212 Systems Pty Ltd Unit 3 67 Rosmead Avenue Kenilworth Cape Town 7701 South Africa 6 3 Postal Address C212 Systems Pty Ltd P O Box 171 Rondebosch Cape Town 7701 South Africa 6 4 Voice and Electronic Contacts Tel 27 21 683 5490 Fax 27 21 683 5435 Email info ccii co za Email support ccii co za URL http www ccii co za 6 5 Product Support Support on C212 Systems products is available telephonically between Monday and Friday from 09 00 to 17 00 CAT Central African Time CAT GMT 2 Email support is available at support ccii co za CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 44 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 Appendix A Making Changes to sysLib c for X86 The PCI free memory space needs to be defined in the memory descriptor table Consult the relevant reference manual and obtain the upper address ofthe PCI memory Allocate atleast 5 megabytes of memory per HSS card Subtract that amount from the upper address of the PCI memory and use this value as the base of the PCI memory space Note if there are other devices on the PCI bus it may be necessary to allocate more memory Example For 2 HSS cards alloca
49. transmitter For 8 data bits no parity 1 stop bit and 1 start bit each break character consists of 10 zero bits frmec 0 65535 Num ber of received characters with framing errors CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Page 29 of 45 Copyright C Systems Pty Ltd All rights reserved 2002 uaddr1 uaddr2 0x0000 OxOOFF 0x0000 OxOOFF cccccccc valid entry ceccccccc entry not valid and is notused 0b11 00000000 ignore these bits when comparing incomming character 0b11 11111111 enable comparing the incoming character to cc n Num ber of received characters with noise errors Number of break conditions on the signal Address in multidrop m ode Only the lower 8 bits are used so the upper 8 bits should be cleared Transmit out of sequence character e g XON XOFF Control character 1 to 8 These characters can be used to delimit received messages 6 bits reserved Initialise to zero eccccccc 8 bits defines control characters to be compared to the incoming character Receive control character m ask A one enables comparison and a zero masks it CCII HSS 6 MAN 002 2002 04 11 Issue 3 5 P HSS TECH MAN USERMAN cManHssDrv wpd Copyright C Systems Pty Ltd All rights reserved 2002 Page 30 of 45 4 2 2 HDLC Mode This protocol may only be used with the four SCC ports Ports A D 4 2 2 1 HDLC Protocol Inf

Download Pdf Manuals

image

Related Search

Related Contents

NuTone RCK01 Instructions / Assembly  DANS CE NUMÉRO: v - Publications du gouvernement du Canada  FL-50R 取扱説明書  FICHE TECHNIQUE ET MODE D`EMPLOI OFFRE LAMPIRIS  Untitled - Lidl Service Website  Dicota MultiSlight  LG Electronics 355 Cell Phone User Manual      

Copyright © All rights reserved.
Failed to retrieve file