embeddedsw/XilinxProcessorIPLib/drivers/v_tpg/src/xv_tpg_sinit.c
Rohit Consul 0f6fa4e9cd v_tpg: Initial driver for tpg v7.0
This is a new driver for updated tpg ip in the catalogue

Signed-off-by: Rohit Consul <rohit.consul@xilinx.com>
Reviewed-by: Andrei Simion <andreis@xilinx.com>
2015-07-23 10:58:46 +05:30

51 lines
1.2 KiB
C

// ==============================================================
// File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2015.3
// Copyright (C) 2015 Xilinx Inc. All rights reserved.
//
// ==============================================================
#ifndef __linux__
#include "xstatus.h"
#include "xparameters.h"
#include "xv_tpg.h"
#ifndef XPAR_XV_TPG_NUM_INSTANCES
#define XPAR_XV_TPG_NUM_INSTANCES 0
#endif
extern XV_tpg_Config XV_tpg_ConfigTable[];
XV_tpg_Config *XV_tpg_LookupConfig(u16 DeviceId) {
XV_tpg_Config *ConfigPtr = NULL;
int Index;
for (Index = 0; Index < XPAR_XV_TPG_NUM_INSTANCES; Index++) {
if (XV_tpg_ConfigTable[Index].DeviceId == DeviceId) {
ConfigPtr = &XV_tpg_ConfigTable[Index];
break;
}
}
return ConfigPtr;
}
int XV_tpg_Initialize(XV_tpg *InstancePtr, u16 DeviceId) {
XV_tpg_Config *ConfigPtr;
Xil_AssertNonvoid(InstancePtr != NULL);
ConfigPtr = XV_tpg_LookupConfig(DeviceId);
if (ConfigPtr == NULL) {
InstancePtr->IsReady = 0;
return (XST_DEVICE_NOT_FOUND);
}
return XV_tpg_CfgInitialize(InstancePtr,
ConfigPtr,
ConfigPtr->BaseAddress);
}
#endif