X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Ffpga%2Ffpga.c;h=26d244354cd60a27d1327bd017e16bea671c87c7;hb=744d9859a71c515118457fecb7a58674b600e81a;hp=e41e72851f2f3bd46ae0625f9fbe7f53ba18a795;hpb=3b8ac464f25581a7d22b303a9154c05e0c7f40a8;p=u-boot diff --git a/drivers/fpga/fpga.c b/drivers/fpga/fpga.c index e41e72851f..26d244354c 100644 --- a/drivers/fpga/fpga.c +++ b/drivers/fpga/fpga.c @@ -52,7 +52,7 @@ static fpga_desc desc_table[CONFIG_MAX_FPGA_DEVICES]; /* Local static functions */ static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_get_desc( int devnum ); -static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_validate( int devnum, void *buf, +static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_validate(int devnum, const void *buf, size_t bsize, char *fn ); static int fpga_dev_info( int devnum ); @@ -94,7 +94,7 @@ static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_ge /* fpga_validate * generic parameter checking code */ -static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_validate( int devnum, void *buf, +static __attribute__((__const__)) fpga_desc * __attribute__((__const__)) fpga_validate(int devnum, const void *buf, size_t bsize, char *fn ) { fpga_desc * desc = fpga_get_desc( devnum ); @@ -141,8 +141,12 @@ static int fpga_dev_info( int devnum ) #endif break; case fpga_lattice: +#if defined(CONFIG_FPGA_LATTICE) printf("Lattice Device\nDescriptor @ 0x%p\n", desc); ret_val = lattice_info(desc->devdesc); +#else + fpga_no_sup( (char *)__FUNCTION__, "Lattice devices" ); +#endif break; default: printf( "%s: Invalid or unsupported device type %d\n", @@ -208,7 +212,7 @@ int fpga_add( fpga_type devtype, void *desc ) /* * Generic multiplexing code */ -int fpga_load( int devnum, void *buf, size_t bsize ) +int fpga_load(int devnum, const void *buf, size_t bsize) { int ret_val = FPGA_FAIL; /* assume failure */ fpga_desc * desc = fpga_validate( devnum, buf, bsize, (char *)__FUNCTION__ ); @@ -230,7 +234,11 @@ int fpga_load( int devnum, void *buf, size_t bsize ) #endif break; case fpga_lattice: +#if defined(CONFIG_FPGA_LATTICE) ret_val = lattice_load(desc->devdesc, buf, bsize); +#else + fpga_no_sup( (char *)__FUNCTION__, "Lattice devices" ); +#endif break; default: printf( "%s: Invalid or unsupported device type %d\n", @@ -244,7 +252,7 @@ int fpga_load( int devnum, void *buf, size_t bsize ) /* fpga_dump * generic multiplexing code */ -int fpga_dump( int devnum, void *buf, size_t bsize ) +int fpga_dump(int devnum, const void *buf, size_t bsize) { int ret_val = FPGA_FAIL; /* assume failure */ fpga_desc * desc = fpga_validate( devnum, buf, bsize, (char *)__FUNCTION__ ); @@ -266,7 +274,11 @@ int fpga_dump( int devnum, void *buf, size_t bsize ) #endif break; case fpga_lattice: +#if defined(CONFIG_FPGA_LATTICE) ret_val = lattice_dump(desc->devdesc, buf, bsize); +#else + fpga_no_sup( (char *)__FUNCTION__, "Lattice devices" ); +#endif break; default: printf( "%s: Invalid or unsupported device type %d\n",