/****************************************************************************** * * Copyright (C) 2011 - 2014 Xilinx, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * Use of the Software is limited solely to applications: * (a) running on a Xilinx device, or * (b) that interact with a Xilinx device through a bus or interconnect. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * XILINX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * * Except as contained in this notice, the name of the Xilinx shall not be used * in advertising or otherwise to promote the sale, use or other dealings in * this Software without prior written authorization from Xilinx. * ******************************************************************************/ /****************************************************************************/ /** * * @file xaxipcie.h * * This file contains the software API definition of the Xilinx AXI PCIe IP * (XAxiPcie). This driver provides "C" function interface to application/upper * layer to access the hardware. * * Features * The driver provides its user with entry points * - To initialize and configure itself and the hardware * - To access PCIe configuration space locally * - To enable/disable and to report errors (interrupts). * * IP Hardware Configuration * The AXI PCIE IP supports only the endpoint for Virtex®-6 and Spartan®-6 * families. * * The AXI PCIE IP supports both the endpoint and Root Port for the Kintex® 7 * devices. * * * Driver Initialization & Configuration * * The XAxiPcie_Config structure is used by the driver to configure itself. This * configuration structure is typically created by the tool-chain based on HW * build properties. * * To support multiple runtime loading and initialization strategies employed * by various operating systems, the driver instance can be initialized in the * following way: * * - XAxiPcie_LookupConfig(DeviceId) - Use the device identifier to find the * static configuration structure defined in xaxipcie_g.c. This is setup by * the tools. For some operating systems the config structure will be * initialized by the software and this call is not needed. * * - XAxiPcie_CfgInitialize(InstancePtr, CfgPtr, EffectiveAddr) - Uses a * configuration structure provided by the caller. If running in a system with * address translation, the provided virtual memory base address replaces the * physical address present in the configuration structure. * * Interrupt Management * * The XAxiPcie driver provides interrupt management functions. It allows * the caller to enable/disable each individual interrupt as well as get/clear * pending interrupts. Implementation of callback handlers is left to the user. * * * @note * *
* MODIFICATION HISTORY: * * Ver Who Date Changes * ----- ---- -------- ------------------------------------------------------ * 1.00a rkv 03/03/11 Original code. * 2.00a nm 10/19/11 Added support of pcie root complex functionality. * Changed these functions * -renamed function XAxiPcie_GetRequestId to * XAxiPcie_GetRequesterId * -added two functions arguments RootPortPtr & * ECAMSizePtr to XAxiPcie_GetBridgeInfo API * Added these new API for root complex support * - XAxiPcie_GetRootPortStatusCtrl * - XAxiPcie_SetRootPortStatusCtrl * - XAxiPcie_SetRootPortMSIBase * - XAxiPcie_GetRootPortErrFIFOMsg * - XAxiPcie_ClearRootPortErrFIFOMsg * - XAxiPcie_GetRootPortIntFIFOReg * - XAxiPcie_ClearRootPortIntFIFOReg * - XAxiPcie_WriteLocalConfigSpace * - XAxiPcie_ComposeExternalConfigAddress * - XAxiPcie_ReadRemoteConfigSpace * - XAxiPcie_WriteRemoteConfigSpace * * 2.01a nm 04/01/12 Removed XAxiPcie_SetRequesterId and * XAxiPcie_SetBlPortNumber APIs as these are writing * to Read Only bits for CR638299. * 2.02a nm 08/01/12 Updated for removing compilation errors with C++, * changed XCOMPONENT_IS_READY to XIL_COMPONENT_IS_READY * Removed the Endian Swap in * XAxiPcie_ReadRemoteConfigSpace and * XAxiPcie_WriteRemoteConfigSpace APIs as the HW * has been fixed and the swapping is not required * in the driver (CR 657412) * 2.03a srt 04/13/13 Removed Warnings (CR 705004). * 2.04a srt 09/06/13 Fixed CR 734175: * C_BASEADDR and C_HIGHADDR configuration parameters are * renamed to BASEADDR and HIGHADDR in Vivado builds. * Modified the tcl for this change. * 3.0 adk 19/12/13 Updated as per the New Tcl API's * ** *****************************************************************************/ #ifndef XAXIPCIE_H /* prevent circular inclusions */ #define XAXIPCIE_H /* by using protection macros */ #ifdef __cplusplus extern "C" { #endif /***************************** Include Files ********************************/ #include "xil_assert.h" #include "xstatus.h" #include "xaxipcie_hw.h" #include "xil_types.h" #include