@ -15,14 +15,8 @@
# include <ACEX1K.h>
# include <stratixII.h>
/* Define FPGA_DEBUG to get debug printf's */
/* #define FPGA_DEBUG */
# ifdef FPGA_DEBUG
# define PRINTF(fmt,args...) printf (fmt ,##args)
# else
# define PRINTF(fmt,args...)
# endif
/* Define FPGA_DEBUG to 1 to get debug printf's */
# define FPGA_DEBUG 0
/* Local Static Functions */
static int altera_validate ( Altera_desc * desc , const char * fn ) ;
@ -32,36 +26,39 @@ int altera_load(Altera_desc *desc, const void *buf, size_t bsize)
{
int ret_val = FPGA_FAIL ; /* assume a failure */
if ( ! altera_validate ( desc , ( char * ) __FUNCTION __ ) ) {
printf ( " %s: Invalid device descriptor \n " , __FUNCTION __ ) ;
if ( ! altera_validate ( desc , ( char * ) __func __ ) ) {
printf ( " %s: Invalid device descriptor \n " , __func __ ) ;
} else {
switch ( desc - > family ) {
case Altera_ACEX1K :
case Altera_CYC2 :
# if defined(CONFIG_FPGA_ACEX1K)
PRINTF ( " %s: Launching the ACEX1K Loader... \n " ,
__FUNCTION__ ) ;
debug_cond ( FPGA_DEBUG ,
" %s: Launching the ACEX1K Loader... \n " ,
__func__ ) ;
ret_val = ACEX1K_load ( desc , buf , bsize ) ;
# elif defined(CONFIG_FPGA_CYCLON2)
PRINTF ( " %s: Launching the CYCLONE II Loader... \n " ,
__FUNCTION__ ) ;
debug_cond ( FPGA_DEBUG ,
" %s: Launching the CYCLONE II Loader... \n " ,
__func__ ) ;
ret_val = CYC2_load ( desc , buf , bsize ) ;
# else
printf ( " %s: No support for ACEX1K devices. \n " ,
__FUNCTION __ ) ;
__func __ ) ;
# endif
break ;
# if defined(CONFIG_FPGA_STRATIX_II)
case Altera_StratixII :
PRINTF ( " %s: Launching the Stratix II Loader... \n " ,
__FUNCTION__ ) ;
debug_cond ( FPGA_DEBUG ,
" %s: Launching the Stratix II Loader... \n " ,
__func__ ) ;
ret_val = StratixII_load ( desc , buf , bsize ) ;
break ;
# endif
default :
printf ( " %s: Unsupported family type, %d \n " ,
__FUNCTION __ , desc - > family ) ;
__func __ , desc - > family ) ;
}
}
@ -72,31 +69,33 @@ int altera_dump(Altera_desc *desc, const void *buf, size_t bsize)
{
int ret_val = FPGA_FAIL ; /* assume a failure */
if ( ! altera_validate ( desc , ( char * ) __FUNCTION __ ) ) {
printf ( " %s: Invalid device descriptor \n " , __FUNCTION __ ) ;
if ( ! altera_validate ( desc , ( char * ) __func __ ) ) {
printf ( " %s: Invalid device descriptor \n " , __func __ ) ;
} else {
switch ( desc - > family ) {
case Altera_ACEX1K :
# if defined(CONFIG_FPGA_ACEX)
PRINTF ( " %s: Launching the ACEX1K Reader... \n " ,
__FUNCTION__ ) ;
debug_cond ( FPGA_DEBUG ,
" %s: Launching the ACEX1K Reader... \n " ,
__func__ ) ;
ret_val = ACEX1K_dump ( desc , buf , bsize ) ;
# else
printf ( " %s: No support for ACEX1K devices. \n " ,
__FUNCTION __ ) ;
__func __ ) ;
# endif
break ;
# if defined(CONFIG_FPGA_STRATIX_II)
case Altera_StratixII :
PRINTF ( " %s: Launching the Stratix II Reader... \n " ,
__FUNCTION__ ) ;
debug_cond ( FPGA_DEBUG ,
" %s: Launching the Stratix II Reader... \n " ,
__func__ ) ;
ret_val = StratixII_dump ( desc , buf , bsize ) ;
break ;
# endif
default :
printf ( " %s: Unsupported family type, %d \n " ,
__FUNCTION __ , desc - > family ) ;
__func __ , desc - > family ) ;
}
}
@ -107,7 +106,7 @@ int altera_info( Altera_desc *desc )
{
int ret_val = FPGA_FAIL ;
if ( altera_validate ( desc , ( char * ) __FUNCTION __ ) ) {
if ( altera_validate ( desc , ( char * ) __func __ ) ) {
printf ( " Family: \t " ) ;
switch ( desc - > family ) {
case Altera_ACEX1K :
@ -169,7 +168,7 @@ int altera_info( Altera_desc *desc )
# else
/* just in case */
printf ( " %s: No support for ACEX1K devices. \n " ,
__FUNCTION __ ) ;
__func __ ) ;
# endif
break ;
# if defined(CONFIG_FPGA_STRATIX_II)
@ -188,7 +187,7 @@ int altera_info( Altera_desc *desc )
ret_val = FPGA_SUCCESS ;
} else {
printf ( " %s: Invalid device descriptor \n " , __FUNCTION __ ) ;
printf ( " %s: Invalid device descriptor \n " , __func __ ) ;
}
return ret_val ;