![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA PM5351 S/UNI-TETRA SOFTWARE DRIVER FOR THE S/UNI-TETRA PRELIMINARY ISSUE 1 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PMC-Sierra, Inc. 105 - 8555 Baxter Place Burnaby, BC Canada V5A 4V7 604 .415.6000 PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PMC-Sierra, Inc. 105 - 8555 Baxter Place Burnaby, BC Canada V5A 4V7 604 .415.6000 PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA CONTENTS 1 OVERVIEW............................................................................................... 1 1.1 1.2 1.3 2 3 SCOPE .......................................................................................... 1 AUDIENCE..................................................................................... 1 OBJECTIVES................................................................................. 1 SOFTWARE DRIVER FEATURES ........................................................... 2 APPLICATION PROGRAMMER'S INTERFACE ....................................... 4 3.1 SOFTWARE ARCHITECTURE...................................................... 4 3.1.1 Application Interface............................................................ 5 3.1.2 RTOS Interface.................................................................... 5 3.1.3 S/UNI-TETRA Hardware Interface ...................................... 6 3.2 3.3 DRIVER FILES .............................................................................. 6 USING THE API TO ACCESS FEATURES OF THE S/UNI-TETRA6 3.3.1 Access to Features via the Registers.................................. 7 3.3.2 Power-on Initialization, Self Test and Activation................... 7 3.3.3 Event Notification ................................................................ 8 3.4 DATA STRUCTURES ..................................................................... 9 3.4.1 tTetraState ........................................................................... 9 3.4.2 tetraDDB ........................................................................... 10 3.4.3 tetraCDDB......................................................................... 11 3.5 APPLICATION INTERFACE FUNCTION PROTOTYPES............. 12 3.5.1 tetraEntryPoint................................................................... 12 i PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 3.5.2 tetraExitPoint ..................................................................... 12 3.5.3 tetraReset.......................................................................... 13 3.5.4 tetraInit .............................................................................. 13 3.5.5 tetraActivate ...................................................................... 14 3.5.6 tetraIsr ............................................................................... 14 3.5.7 tetraEnableInterrupts......................................................... 14 3.5.8 tetraDisableInterrupts........................................................ 15 3.5.9 tetraStatistics..................................................................... 15 3.5.10 tetraClearCounters............................................................ 15 3.5.11 tetraReadRegister ............................................................. 16 3.5.12 tetraReadSstb ................................................................... 16 3.5.13 tetraReadSptb ................................................................... 17 3.5.14 tetraWriteRegister ............................................................. 17 3.5.15 tetraWriteSstb ................................................................... 18 3.5.16 tetraWriteSptb ................................................................... 18 3.6 RTOS INTERFACE FUNCTION PROTOTYPES .......................... 19 3.6.1 InstallIsr............................................................................. 19 3.6.2 InstallTimer........................................................................ 20 3.7 4 5 S/UNI-TETRA INTERFACE FUNCTION PROTOTYPES ............. 20 APPENDIX A. SOURCE CODE.............................................................. 21 REFERENCES ....................................................................................... 22 ii PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 1 1.1 OVERVIEW Scope A software driver for the S/UNI-TETRA (PM5351) is described in this document. The driver is written in C language and is structured such that it is reusable and can be ported to a user's environment with minimal modification. The application programmer's interface (API) and an example of how to operate the S/UNI-TETRA via this API is presented. The driver is built and tested on the S/UNI-QUAD reference design[1] with a S/UNI-TETRA replacing the S/UNI-QUAD chip. The software driver interfaces to the MC68332 processor of the reference design board via processor dependent software, a simple software dispatcher and a serial port interface. A thorough description of this additional software is not covered in this document, nor is it supported, but the source code is made available to users with the driver source code. This driver source code is preliminary and not fully tested at the time this document was issued. Please contact PMC for the latest status of the source code. 1.2 Audience The intended audience for this document is Software Engineers that use this software to gain familiarity with the operation of the S/UNI-TETRA product, or to incorporate the driver into their own systems. 1.3 Objectives The objective of making this driver available is to provide an example that may shorten the learning curve and development time that users require to write S/UNI-TETRA drivers for their own systems. It also allows use of the reference design as an evaluation/development vehicle, to gain familiarity with the S/UNI-TETRA and for users to code/unit test their own software while waiting for their own hardware prototypes - effectively allowing the user's hardware and software development to run in parallel. 1 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 2 SOFTWARE DRIVER FEATURES The following features are provided by the software driver: * * * * * Driver supports multiple S/UNI-TETRA chips. Driver abstracts each channel and chip into a logical device to provide access to these by device ID. Driver provides a device data block which allows the user to specify the configuration of logical devices. API routines are provided to reset, initialize or activate a logical device. Driver provides a header file that defines all registers and bit fields of the S/UNI-TETRA to reduce the coding effort. The defines are parsed from the datasheet and provide a means to access features of the S/UNI-TETRA directly by using the read/write register access routines of the API. API routines to poll and accumulate counter statistics An interrupt service routine to dispatch interrupt events to a user application Source code is written in ANSI C language. All source code that may need to be modified to port the driver to another environment is located within a separate file. All routines are re-entrant. The user can use semaphores to lock access to the device data block or the register space. Since the use of semaphores is dependant on the software environment it is left to the user to add them if necessary. Source code has debug macros that can be used during debug to dump error events to a console. * * * * * * The following features are provided as a user interface to the reference design hardware: * A serial port interface that accepts user commands and provides a log of events due to interrupts or accumulation of statistics. 2 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA * Commands that invoke the API routines, and allow the API data structures to be accessed. 3 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 3 3.1 APPLICATION PROGRAMMER'S INTERFACE Software Architecture The S/UNI-TETRA driver interfaces to software and hardware components as shown in figure 1. Each of these interfaces is described in the following sections. Communication between components is via function calls, and in the opposite direction, via function callbacks. The application programmer's interface (API) covers the function calls and data structures passed through the three planes shown in figure 1. These planes interface to the application component, the RTOS component, and the S/UNITETRA hardware. The arrows show the direction of the function call. Figure 1. Interfaces of the S/UNI-TETRA Driver $SSOLFDWLRQ )XQFWLRQ FDOOV ,QGLFDWLRQ FDOOEDFNV 6HUYLFH FDOOEDFNV 681,7(75$ 'HYLFH 'ULYHU 5726 6HUYLFH FDOOV 5HJLVWHU $FFHVV ,QWHUUXSW 681,7(75$ 4 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 3.1.1 Application Interface The user's application task interfaces to the driver by making function calls that command the driver to carry out a specified operation on the S/UNI-TETRA. The function prototypes are shown in section 3.5. The S/UNI-TETRA has four independent channels that can be seperately controlled and some registers that globally configure the operation of the chip. For this reason the driver has separate data structures associated with each channel and a separate data structure associated with the chip. Each of these data structures provides data for a separately manageable device. There are four channel devices and one chip device per S/UNI-TETRA. The application must identify the device when making a driver function call via a device ID. When an event occurs within the S/UNI-TETRA the driver must notify the user application that the event occurred. This is done via an Indication function callback with the device identifier as a function parameter. 3.1.2 RTOS Interface The real-time operating system (RTOS) provides the environment for the driver and user application to run. Typically this would be a multi-tasking, single processor, environment with semaphores to protect critical sections of code or variables from being corrupted. The RTOS provides the following services to the driver: * * * * * * Install a system timeout, or periodic timer. Install an interrupt service routine that is dispatched when the S/UNI-TETRA interrupt pin is active. Provide memory management services to map the register space, allocate data structures and translate between virtual and physical addressing. Creation and management of tasks. Task to task communication or message queues. Semaphores 5 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA The simplest environment for this driver to operate in is a single task where the application is tightly coupled to the driver. In this case one task (the application) directly calls the API routines and another task (the RTOS) may call the service callback. The service callback could be the interrupt service routine or a routine that periodically polls and accumulates counter statistics. In this case the driver is written such that there is no contention among the application task and the RTOS task for access to a S/UNI-TETRA register or a field within the device data block. In a multi-tasking environment, where multiple applications may want to access the the same device simultaneously, the user could provide a loosely coupled interface between the API and the application tasks. This would be implemented by a queing mechanism and/or semaphores to block another application task from calling an API routine of the device until the current API call has completed. 3.1.3 S/UNI-TETRA Hardware Interface The S/UNI-TETRA hardware interfaces to the driver via register access and via an interrupt pin. There is no DMA interface to the S/UNI-TETRA. 3.2 Driver Files The driver is designed for use with the reference design board[1] and some of the interfaces may need to be modified or ported to the user's environment. An implementation file and a header file with the functions and defines that may need to be modified to port the driver to another environment have been supplied in the files "tetra_p.h" and "tetra_p.c". The registers and bit descriptions of the S/UNI-TETRA have been parsed from the datasheet[2] and placed in the header file "tetra_r.h". Further datasheet related defines are provided in the file "tetra_d.h". The files "tetra.h" and "tetra.c" provide the rest of the driver. An example application is provided by the file "app.c". 3.3 Using the API to Access Features of the S/UNI-TETRA This software driver provides a framework for users to integrate the S/UNI-TETRA into their own systems. It provides an API of routines that all users of the S/UNI-TETRA would require. Additional features of the S/UNI-TETRA, such as access to overhead, diagnostics or configuration for POS are available 6 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA directly to the user via read/write functions of the API, and by using the header files that define all registers and bit fields. 3.3.1 Access to Features via the Registers For example, the following code segment shows how a user could modify the value of the outgoing Path Signal Label (C2 byte) for an unscrambled POS application and read the receive path signal label of the third channel device. U8 Value; DeviceId = DEVICE_ID_CHAN3; /*modify the transmit path signal label */ tetraWriteRegister(DeviceId,REG_48_TPOP_Path_Signal_Label,0xCF); /*read the receive path signal label*/ tetraReadRegister(DeviceId,REG_37_RPOP_Path_Signal_Label,&Value); 3.3.2 Power-on Initialization, Self Test and Activation A user will typically modify the "tetraEntryPoint(...)" function for their application environment and perform power-on initialization and self test (POST) of their system. For this reason the user may need to reset, init and activate the S/UNITETRA directly via the API to place it in an operational state following the POST. The following example illustrates this: /* perform power-on initialization of the S/UNI-TETRA */ tetraEntryPoint(); /* power on self test : configure a diagnostic loopback on channel 4 */ DeviceId = DEVICE_ID_CHAN4; pDevice = tetraGetDevice(DeviceId); pDevice->InitVector = NULL; pDevice->ActivateVector = NULL; tetraReset(DeviceId); tetraWriteRegister(DeviceId, REG_07_Channel_Control, BIT_07_SDLE); tetraInit(DeviceId); tetraActivate(DeviceId); /* finished POST so configure all channels with defaults */ DeviceId = DEVICE_ID_CHIP; pDevice = tetraGetDevice(DeviceId); pDevice->InitVector = NULL; pDevice->ActivateVector = NULL; 7 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA tetraReset(DeviceId); for ( I= FIRST_CHAN_DEVICE_ID; I <= LAST_CHAN_DEVICE_ID; I++) { pDevice = tetraGetDevice(I); pDevice->InitVector = NULL; pDevice->ActivateVector = NULL; tetraReset(I); tetraInit(I); tetraActivate(I); } tetraInit(DeviceId); tetraActivate(DeviceId); 3.3.3 Event Notification Finally a user may need to be notified of an event within the S/UNI-TETRA. This occurs through the driver function "tetraDispatchEvent(..)". For example, the user may wish to be notified that the receive path signal label has changed. The user must first enable the interrupt event as shown here before device activation, or within the "ActivateVector" before the device was activated: /* get the current enables, without clearing status */ tetraReadRegister(DeviceId,REG_33_RPOP_Interrupt_Enable,&Value); /* modify the interrupt enable bit */ tetraWriteRegister(DeviceId,REG_33_RPOP_Interrupt_Enable,(Value|BIT_33_PSLE)); At some time later when the C2 byte changes the driver's interrupt service routine would dispatch the PSLI interrupt to the "tetraDispatchEvent(...)" function which is shown below: void tetraDispatchEvent(int DeviceId, int regnum, U8 val) { char msg[MAX_MESSAGE_LENGTH]; DebugMsg(msg,"Device%i: Int reg 0x%02lX = 0x%02lX",DeviceId,regnum,val); } In this driver the event is simply written to the console, but the user would need to port this function to interface to the user's application, via a task communication mechanism provided by the RTOS. In this driver all interrupt events are assumed to have equal priority and are written to the console as they are observed in the interrupt service routine. A user's application would want to prioritize and process these interrupt events. 8 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 3.4 Data Structures 3.4.1 tTetraState The driver maintains one chip device and four channel devices per S/UNI-TETRA. Operation of a device is maintained via a device data block which is defined in the following sections. The device data block has a state variable that is used to manage the state transitions of the device as shown in figure 2. Figure 2. State Diagram of a Device Entry Point tetraReset(...) Reset tetraInit(...) tetraReset(...) tetraReset(...) Init tetraActivate(...) Active The states of a device are defined as follows: tetraENTRY_POINT: This is the default state when the variable has not yet been assigned by an API call that resets, initializes or activates the device. tetraRESET: The device has been reset via software. No other register accesses have been performed after the reset. This state must occur before the device can be initialized and ensures the device is in a known state of operation. Specifically 9 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA the device is idle while in the RESET state and does not affect operation of the system. tetraINIT: The device data block (DDB or CDDB) holds the initialization of the device and and is passed into the tetraInit(...) function to place the device in the initialization state. The registers of the device are initialized but the device does not yet interact with other system components. (ie. the device will not activate the interrupt pin, or otherwise interact with the system.) tetraACTIVE: The device data block holds the interrupt enables and other information necessary to allow the device to interact with the system. This information is passed in the function call tetraActivate(...) to place the device in the active state. In the active state the S/UNI-TETRA would be able to activate the interrupt pin and interact with the other hardware components of the system. The user must ensure that the processor has assigned an interrupt service routine and has activated other system components as necessary before placing a device in the active state. 3.4.2 tetraDDB The device context for the S/UNI-TETRA chip is provided in the device data block which has the members shown below. This structure is allocated within the function call tetraEntryPoint(...). Member u32 BaseAddress Description Address of the S/UNI-TETRA in memory space State of this chip device Specifies initialization of chip device. Assigned a NULL value for the chip defaults. Specifies interrupt enables for chip device. Assigned a NULL value for chip defaults (all interrupts disabled). Specifies the channel device IDs belonging to this chip. tTetraState State tTetraRegisterValue* InitVector tTetraRegisterValue* ActivateVector int DeviceId[SUNI_TETRA_NUMBER_CHANNELS] 10 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA u8 CspiIntEn_0C Interrupt Enable bits of chip device. Interrupt Mask bits to check for active interrupt status. u8 CspiIntMask_0C 3.4.3 tetraCDDB The device context for a S/UNI-TETRA channel is provided in the device data block which has the parameters shown below. This structure is allocated within the function call tetraEntryPoint(...). Member u32 BaseAddress Description Address of the S/UNI-TETRA channel in memory space. Each channel is offset by 0x100. State of this device Specifies initialization of channel device. Assigned a NULL value for the chip defaults. Specifies interrupt enables for channel device. Assigned a NULL value for defaults (all interrupts disabled). There are 16 interrupt enable registers associated with a channel device. "XXXX" represents the hardware block and "RR" represents the register number. There are 16 interrupt maskable registers associated with a channel device. These specify the interrupt status bits to check within the interrupt service routine. "XXXX" represents the hardware block and "RR" represents the register number. tTetraState State tTetraRegisterValue* InitVector tTetraRegisterValue* ActivateVector u8 XXXXIntEn_RR u8 XXXXIntMask_RR 11 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA u32 XXXXCount There are 20 counters associated with a channel device. Here "XXXX" represents the error counter name. 3.5 Application Interface Function Prototypes The API has the following functions that allow the application component to request an action from the driver: 3.5.1 tetraEntryPoint Description: This is the first API call that should be made. It allocates and assigns devices for all S/UNI-TETRA chips in the system. Then it resets, initializes and finally activates the devices. void tetraEntryPoint(void) Function Prototype: Function Parameters: none Return Value: tetraSUCCESS - all devices have been successfully placed in the active state tetraFAILURE - one or more devices could not be activated. Additional Notes: This function is in the porting file "tetra_p.c" because it needs to be modified for the users environment. 3.5.2 tetraExitPoint Description: This function does the reverse of the TetraEntryPoint function. It places all devices in the reset state and then deallocates all device resources. void tetraExitPoint(void) Function Prototype: Function Parameters: none Return Value: none 12 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA Additional Notes: This function is in the porting file "tetra_p.c" because it needs to be modified for the users environment. 3.5.3 tetraReset Description: Function Prototype: This function performs a software reset of a S/UNITETRA device and all of its associated channels. tTetraStatus tetraReset(int DeviceId) Function Parameters: DeviceId - specifies the device data block Return Value: tetraSUCCESS - reset completed tetraFAILURE - invalid device identifier specified. Additional Notes: none 3.5.4 tetraInit Description: Function Prototype: This function initializes the device, but does not enable interrupts. tTetraStatus tetraInit(int DeviceId) Function Parameters: DeviceId - specifies the device data block for the device. Return Value: tetraSUCCESS - the device has been successfully initialized. tetraFAILURE - invalid device ID Additional Notes: The caller must ensure the device data block specifies the initialization values for the device. 13 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 3.5.5 tetraActivate Description: This function places the device in an active state by enabling device interrupts, checking the PHY address and enabling the PHY on the utopia bus. tTetraStatus tetraActivate(int DeviceId) Function Prototype: Function Parameters: DeviceId - specifies the device data block for the device. Return Value: tetraSUCCESS - the device has been successfully activated. tetraFAILURE - invalid device ID Additional Notes: 3.5.6 tetraIsr Description: Function Prototype: This function is the interrupt service routine for the chip device. void tetraIsr(int DeviceId) Function Parameters: DeviceId - specifies the device data block for the chip device. Return Value: tetraSUCCESS - the interrupt has been processed. tetraFAILURE - invalid device ID or no Interrupts were active. Additional Notes: Only the chip device requires an ISR. The channel devices are serviced by the chip's ISR. 3.5.7 tetraEnableInterrupts Description: This function enables or re-enables interrupts for the device. 14 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA Function Prototype: void tetraEnableInterrupts(int DeviceId) Function Parameters: DeviceId - specifies the device data block. Return Value: Additional Notes: none This call is only valid in the active state. 3.5.8 tetraDisableInterrupts Description: Function Prototype: This function disables interrupts for the device. void tetraDisableInterrupts(int DeviceId) Function Parameters: DeviceId - specifies the device data block for the device. Return Value: Additional Notes: none This call is only valid in the active state. 3.5.9 tetraStatistics Description: Function Prototype: This function should be called periodically to accumulate counter statistics. void tetraStatistics(int DeviceId) Function Parameters: DeviceId - specifies the device data block for the device. Return Value: Additional Notes: 3.5.10 tetraClearCounters Description: This function clears the accumulated counter values. none 15 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA Function Prototype: void tetraClearCounters(int DeviceId) Function Parameters: DeviceId - specifies the device data block for the device. Return Value: Additional Notes: 3.5.11 tetraReadRegister Description: Function Prototype: This function reads the S/UNI-TETRA register associated with the device. bool tetraReadRegister(int DeviceId, int offset,U8* value) none Function Parameters: DeviceId - specifies the device data block for the device. offset - specifies the register number from the datasheet. value - is a pointer to an 8-bit value which is modified with the value read. Return Value: true - the register was successfully read false - the register could not be read Additional Notes: 3.5.12 tetraReadSstb Description: Function Prototype: This function reads the indirect S/UNI-TETRA SSTB register associated with the device. bool tetraReadSstb(int DeviceId, int offset,U8* value) The device should be in the reset, init or active state when making this call. Function Parameters: DeviceId - specifies the device data block for the device. 16 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA offset - specifies the register number of the indirect SSTB register from the datasheet. value - is a pointer to an 8-bit value which is modified with the value read. Return Value: true - the register was successfully read false - the register could not be read Additional Notes: 3.5.13 tetraReadSptb Description: Function Prototype: This function reads the indirect S/UNI-TETRA SPTB register associated with the device. bool tetraReadSptb(int DeviceId, int offset,U8* value) The device should be in the reset, init or active state when making this call. Function Parameters: DeviceId - specifies the device data block for the device. offset - specifies the register number of the SPTB register from the datasheet. value - is a pointer to an 8-bit value which is modified with the value read. Return Value: true - the register was successfully read false - the register could not be read Additional Notes: 3.5.14 tetraWriteRegister Description: Function Prototype: This function writes the S/UNI-TETRA register associated with the device. bool tetraWriteRegister(int DeviceId, The device should be in the reset, init or active state when making this call. 17 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA int offset,U8 value) Function Parameters: DeviceId - specifies the device data block for the device. offset - specifies the register number from the datasheet. value - is the 8-bit value to write. Return Value: true - the register was successfully written false - the register could not be written Additional Notes: 3.5.15 tetraWriteSstb Description: Function Prototype: This function writes the indirect S/UNI-TETRA SSTB register associated with the device. bool tetraWriteSstb(int DeviceId, int offset,U8 value) The device should be in the reset, init or active state when making this call. Function Parameters: DeviceId - specifies the device data block for the device. offset - specifies the register number of the indirect SSTB register from the datasheet. value - is the 8-bit value to write. Return Value: true - the register was successfully written false - the register could not be written Additional Notes: 3.5.16 tetraWriteSptb Description: This function writes the indirect S/UNI-TETRA SPTB register associated with the device. The device should be in the reset, init or active state when making this call. 18 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA Function Prototype: bool tetraWriteSptb(int DeviceId, int offset,U8 value) Function Parameters: DeviceId - specifies the device data block for the device. offset - specifies the register number of the indirect SPTB register from the datasheet. value - is the 8-bit value to write. Return Value: true - the register was successfully written false - the register could not be written Additional Notes: The device should be in the reset, init or active state when making this call. 3.6 RTOS Interface Function Prototypes The driver requests services from the RTOS which are defined in the following function prototypes: 3.6.1 InstallIsr Description: Function Prototype: This function requests the RTOS to install an interrupt service routine. void InstallIsr(void func(void*),void* context) Function Parameters: func - is the function which is to be called when an interrupt occurs. (ie. tetraIsr) context - specifies the context passed as a parameter in the function call. ( ie. the device ID) Return Value: Additional Notes: 19 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE none PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 3.6.2 InstallTimer Description: Function Prototype: This function requests the RTOS to periodically call a timer function. void InstallTimer(int msec, (void) *func(int), void* context) Function Parameters: msec - is the period of the timer in milliseconds. func - is the function which is to be called periodically. (ie. tetraStatistics) context - specifies the context passed as a parameter in the function call. (ie. the device ID) Return Value: Additional Notes: 3.7 S/UNI-TETRA Interface Function Prototypes The driver uses macros to read and to write the hardware registers. These need to be modified to port the driver to a different environment. The macro definitions are as follows, where "c" is the device data block pointer, "regnum" is the register, and "value" is the 8-bit value written to a register: #define tetraWrite(c, regnum, value) (*(U8*)( c->BaseAddress + (regnum) ) = (value)) #define tetraRead(c, regnum) (*(U8*)( c->BaseAddress + (regnum) )) none 20 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 4 APPENDIX A. SOURCE CODE Please contact PMC-Sierra to obtain the source code. 21 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA 5 REFERENCES [1] PMC-980932, S/UNI-QUAD Reference Design, PMC-Sierra, Issue 1, September 1998. [2] PMC-971240, S/UNI-TETRA Datasheet, PMC-Sierra, Issue 4, September 1998. 22 PROPRIETARY AND CONFIDENTIAL TO PMC-SIERRA, INC., AND FOR ITS CUSTOMERS' INTERNAL USE PM5351 S/UNI-TETRA APPLICATION NOTE PMC-981217 ISSUE 1 SOFTWARE DRIVER FOR THE S/UNI-TETRA CONTACTING PMC-SIERRA, INC. PMC-Sierra, Inc. 105-8555 Baxter Place Burnaby, BC Canada V5A 4V7 Tel: Fax: (604) 415-6000 (604) 415-6200 document@pmc-sierra.com info@pmc-sierra.com apps@pmc-sierra.com http://www.pmc-sierra.com Document Information: Corporate Information: Application Information: Web Site: None of the information contained in this document constitutes an express or implied warranty by PMC-Sierra, Inc. as to the sufficiency, fitness or suitability for a particular purpose of any such information or the fitness, or suitability for a particular purpose, merchantability, performance, compatibility with other parts or systems, of any of the products of PMC-Sierra, Inc., or any portion thereof, referred to in this document. PMC-Sierra, Inc. expressly disclaims all representations and warranties of any kind regarding the contents or use of the information, including, but not limited to, express and implied warranties of accuracy, completeness, merchantability, fitness for a particular use, or non-infringement. In no event will PMC-Sierra, Inc. be liable for any direct, indirect, special, incidental or consequential damages, including, but not limited to, lost profits, lost business or lost data resulting from any use of or reliance upon the information, whether or not PMC-Sierra, Inc. has been advised of the possibility of such damage. (c) 1998 PMC-Sierra, Inc. PM-981217 (R1) PMC-Sierra, Inc. 105 - 8555 Baxter Place Burnaby, BC Canada V5A 4V7 604 .415.6000 |
Price & Availability of 1981217
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |