#ifndef CFCFPGALOADER_H
#define CFCFPGALOADER_H
/**************************************************************************
//
// cfcFpgaLoader.h 
//
// Description: Head file for cfcFpgaLoad.c
//
// Owner:       PFS 
//
// Revisions:   15 July 2002 - tsohacki: creation
//
//
// Copyright (c) 2002 Allied Telesyn Networks, Inc.  All Rights Reserved.
//
// Confidentiality and Restricted Use Notice:
//
// This software, including any software of third parties embodied herein,
// contains information, concepts, and algorithms which are confidential
// to Allied Telesyn Networks, Inc. and such third parties.  This software
// is licensed solely for use in accordance with the terms and conditions
// of applicable license agreements with Allied Telesyn Networks, Inc. or
// its authorized distributor.
//
// Restricted Rights legend:
//
// Use, duplication, or disclosure by the U.S. Government is subject to
// restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
// Technical Data and Computer Software clause at DFARS 252.227-7013
// (October 1988) and FAR 52.227-19 (c) (1987).
//
**************************************************************************/

#ifdef UBOOT_FPGA

typedef u8 uint8;
typedef u16 uint16;
typedef u32 uint32;

#define STATUS	int
#define ERROR	(0)
#define OK	(1)

#endif /* UBOOT_FPGA */

uint32 sysGPIOGet(uint32 gpio_num, uint32 gpio_addr);
void   sysGPIOSet(uint32 gpio_num, uint32 bit, uint32 gpio_addr);


/**********************************************************************
 *
 * Function:    uint32 cfcFpgaLoaderDone()
 *
 * Description: Return the status of DONE
 *
 * Returns:     1=DONE, 0= not DONE 
 *
 **********************************************************************/
uint32 cfcFpgaLoaderDone(void);

uint32 sysGPIO_IRGet(uint32 gpio_num);
void   sysGPIO_ORSet(uint32 gpio, uint32 bit);

uint32 fpgaNPROGRAMGet(void);
void   fpgaNPROGRAMSet(uint32 bit);

uint32 fpgaNINITGet(void);
void   fpgaNINITSet(uint32 bit);

uint32 fpgaCCLKGet(void);
void   fpgaCCLKSet(uint32 bit);

uint32 fpgaDINGet(void);
void   fpgaDINSet(uint32 bit);

uint32 fpgaDONEGet(void);
void   fpgaDONESet(uint32 bit);

  
STATUS cfcFpgaLoader(uint8 *load, uint32 nbytes);

extern uint8  FpgaLoad[];
extern uint32 fpgaLoadLength;

#endif /* CFCFPGALOADER_H */

