1 /* $Id: xemacps_sinit.c,v 1.1.2.1 2011/01/20 03:39:02 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 xemacps_sinit.c
47 * This file contains lookup method by device ID when success, it returns
48 * pointer to config table to be used to initialize the device.
51 * MODIFICATION HISTORY:
53 * Ver Who Date Changes
54 * ----- ---- -------- -------------------------------------------------------
55 * 1.00a wsy 01/10/10 New
58 ******************************************************************************/
60 /***************************** Include Files *********************************/
62 #include "xparameters.h"
65 /************************** Constant Definitions *****************************/
68 /**************************** Type Definitions *******************************/
71 /***************** Macros (Inline Functions) Definitions *********************/
74 /************************** Function Prototypes ******************************/
76 /*****************************************************************************/
78 * Lookup the device configuration based on the unique device ID. The table
79 * contains the configuration info for each device in the system.
81 * @param DeviceId is the unique device ID of the device being looked up.
84 * A pointer to the configuration table entry corresponding to the given
85 * device ID, or NULL if no match is found.
87 ******************************************************************************/
88 XEmacPs_Config *XEmacPs_LookupConfig(u16 DeviceId)
90 extern XEmacPs_Config XEmacPs_ConfigTable[];
91 XEmacPs_Config *CfgPtr = NULL;
94 for (i = 0; i < XPAR_XEMACPS_NUM_INSTANCES; i++) {
95 if (XEmacPs_ConfigTable[i].DeviceId == DeviceId) {
96 CfgPtr = &XEmacPs_ConfigTable[i];