1 /* $Id: xttcps_selftest.c,v 1.1.2.1 2011/01/20 04:08:59 sadanan Exp $ */
2 /******************************************************************************
4 * (c) Copyright 2010 Xilinx, Inc. All rights reserved.
6 * This file contains confidential and proprietary information of Xilinx, Inc.
7 * and is protected under U.S. and international copyright and other
8 * intellectual property laws.
11 * This disclaimer is not a license and does not grant any rights to the
12 * materials distributed herewith. Except as otherwise provided in a valid
13 * license issued to you by Xilinx, and to the maximum extent permitted by
14 * applicable law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND WITH ALL
15 * FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS,
16 * IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
17 * MERCHANTABILITY, NON-INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE;
18 * and (2) Xilinx shall not be liable (whether in contract or tort, including
19 * negligence, or under any other theory of liability) for any loss or damage
20 * of any kind or nature related to, arising under or in connection with these
21 * materials, including for any direct, or any indirect, special, incidental,
22 * or consequential loss or damage (including loss of data, profits, goodwill,
23 * or any type of loss or damage suffered as a result of any action brought by
24 * a third party) even if such damage or loss was reasonably foreseeable or
25 * Xilinx had been advised of the possibility of the same.
27 * CRITICAL APPLICATIONS
28 * Xilinx products are not designed or intended to be fail-safe, or for use in
29 * any application requiring fail-safe performance, such as life-support or
30 * safety devices or systems, Class III medical devices, nuclear facilities,
31 * applications related to the deployment of airbags, or any other applications
32 * that could lead to death, personal injury, or severe property or
33 * environmental damage (individually and collectively, "Critical
34 * Applications"). Customer assumes the sole risk and liability of any use of
35 * Xilinx products in Critical Applications, subject only to applicable laws
36 * and regulations governing limitations on product liability.
38 * THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS PART OF THIS FILE
41 ******************************************************************************/
42 /*****************************************************************************/
45 * @file xttcps_selftest.c
47 * This file contains the implementation of self test function for the
51 * MODIFICATION HISTORY:
53 * Ver Who Date Changes
54 * ----- ------ -------- ---------------------------------------------
55 * 1.00a drg/jz 01/21/10 First release
58 ******************************************************************************/
60 /***************************** Include Files *********************************/
64 /************************** Constant Definitions *****************************/
67 /**************************** Type Definitions *******************************/
70 /***************** Macros (Inline Functions) Definitions *********************/
73 /************************** Function Prototypes ******************************/
76 /************************** Variable Definitions *****************************/
79 /*****************************************************************************/
82 * Runs a self-test on the driver/device.
85 * @param InstancePtr is a pointer to the XTtcPs instance.
89 * - XST_SUCCESS if successful
90 * - XST_FAILURE indicates a register did not read or write correctly
92 * @note This test fails if it is not called right after initialization.
94 ******************************************************************************/
95 int XTtcPs_SelfTest(XTtcPs *InstancePtr)
99 Xil_AssertNonvoid(InstancePtr != NULL);
100 Xil_AssertNonvoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
103 * All the TTC registers should be in their default state right now.
105 TempReg = XTtcPs_ReadReg(InstancePtr->Config.BaseAddress,
106 XTTCPS_CNT_CNTRL_OFFSET);
107 if (XTTCPS_CNT_CNTRL_RESET_VALUE != TempReg) {