summaryrefslogtreecommitdiff
path: root/drivers/fpga
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/altera.c6
-rw-r--r--drivers/fpga/spartan2.c12
-rw-r--r--drivers/fpga/spartan3.c12
-rw-r--r--drivers/fpga/versalpl.c2
-rw-r--r--drivers/fpga/xilinx.c19
5 files changed, 27 insertions, 24 deletions
diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c
index 822183c5785..69d7111a5f1 100644
--- a/drivers/fpga/altera.c
+++ b/drivers/fpga/altera.c
@@ -12,8 +12,7 @@
/*
* Altera FPGA support
*/
-#if IS_ENABLED(CONFIG_ARCH_SOCFPGA_AGILEX) || \
- IS_ENABLED(CONFIG_ARCH_SOCFPGA_STRATIX10)
+#if IS_ENABLED(CONFIG_FPGA_INTEL_SDM_MAILBOX)
#include <asm/arch/misc.h>
#endif
#include <errno.h>
@@ -48,8 +47,7 @@ static const struct altera_fpga {
#endif
};
-#if IS_ENABLED(CONFIG_ARCH_SOCFPGA_AGILEX) || \
- IS_ENABLED(CONFIG_ARCH_SOCFPGA_STRATIX10)
+#if IS_ENABLED(CONFIG_FPGA_INTEL_SDM_MAILBOX)
int fpga_is_partial_data(int devnum, size_t img_len)
{
/*
diff --git a/drivers/fpga/spartan2.c b/drivers/fpga/spartan2.c
index 792e4033428..e3715bf2b24 100644
--- a/drivers/fpga/spartan2.c
+++ b/drivers/fpga/spartan2.c
@@ -52,7 +52,7 @@ static int spartan2_load(xilinx_desc *desc, const void *buf, size_t bsize,
default:
printf ("%s: Unsupported interface type, %d\n",
- __FUNCTION__, desc->iface);
+ __func__, desc->iface);
}
return ret_val;
@@ -75,7 +75,7 @@ static int spartan2_dump(xilinx_desc *desc, const void *buf, size_t bsize)
default:
printf ("%s: Unsupported interface type, %d\n",
- __FUNCTION__, desc->iface);
+ __func__, desc->iface);
}
return ret_val;
@@ -234,7 +234,7 @@ static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
#endif
} else {
- printf ("%s: NULL Interface function table!\n", __FUNCTION__);
+ printf("%s: NULL Interface function table!\n", __func__);
}
return ret_val;
@@ -279,7 +279,7 @@ static int spartan2_sp_dump(xilinx_desc *desc, const void *buf, size_t bsize)
/* XXX - checksum the data? */
} else {
- printf ("%s: NULL Interface function table!\n", __FUNCTION__);
+ printf("%s: NULL Interface function table!\n", __func__);
}
return ret_val;
@@ -423,7 +423,7 @@ static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
#endif
} else {
- printf ("%s: NULL Interface function table!\n", __FUNCTION__);
+ printf("%s: NULL Interface function table!\n", __func__);
}
return ret_val;
@@ -434,7 +434,7 @@ static int spartan2_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize)
/* Readback is only available through the Slave Parallel and */
/* boundary-scan interfaces. */
printf ("%s: Slave Serial Dumping is unavailable\n",
- __FUNCTION__);
+ __func__);
return FPGA_FAIL;
}
diff --git a/drivers/fpga/spartan3.c b/drivers/fpga/spartan3.c
index 98405589134..6221041e092 100644
--- a/drivers/fpga/spartan3.c
+++ b/drivers/fpga/spartan3.c
@@ -57,7 +57,7 @@ static int spartan3_load(xilinx_desc *desc, const void *buf, size_t bsize,
default:
printf ("%s: Unsupported interface type, %d\n",
- __FUNCTION__, desc->iface);
+ __func__, desc->iface);
}
return ret_val;
@@ -80,7 +80,7 @@ static int spartan3_dump(xilinx_desc *desc, const void *buf, size_t bsize)
default:
printf ("%s: Unsupported interface type, %d\n",
- __FUNCTION__, desc->iface);
+ __func__, desc->iface);
}
return ret_val;
@@ -241,7 +241,7 @@ static int spartan3_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
#endif
} else {
- printf ("%s: NULL Interface function table!\n", __FUNCTION__);
+ printf("%s: NULL Interface function table!\n", __func__);
}
return ret_val;
@@ -286,7 +286,7 @@ static int spartan3_sp_dump(xilinx_desc *desc, const void *buf, size_t bsize)
/* XXX - checksum the data? */
} else {
- printf ("%s: NULL Interface function table!\n", __FUNCTION__);
+ printf("%s: NULL Interface function table!\n", __func__);
}
return ret_val;
@@ -442,7 +442,7 @@ static int spartan3_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
#endif
} else {
- printf ("%s: NULL Interface function table!\n", __FUNCTION__);
+ printf("%s: NULL Interface function table!\n", __func__);
}
return ret_val;
@@ -453,7 +453,7 @@ static int spartan3_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize)
/* Readback is only available through the Slave Parallel and */
/* boundary-scan interfaces. */
printf ("%s: Slave Serial Dumping is unavailable\n",
- __FUNCTION__);
+ __func__);
return FPGA_FAIL;
}
diff --git a/drivers/fpga/versalpl.c b/drivers/fpga/versalpl.c
index 630d1ecfea3..3cb56cc0dc9 100644
--- a/drivers/fpga/versalpl.c
+++ b/drivers/fpga/versalpl.c
@@ -17,7 +17,7 @@ static ulong versal_align_dma_buffer(ulong *buf, u32 len)
if ((ulong)buf != ALIGN((ulong)buf, ARCH_DMA_MINALIGN)) {
new_buf = (ulong *)ALIGN((ulong)buf, ARCH_DMA_MINALIGN);
- memcpy(new_buf, buf, len);
+ memmove(new_buf, buf, len);
buf = new_buf;
}
diff --git a/drivers/fpga/xilinx.c b/drivers/fpga/xilinx.c
index 25b348648ef..b6966c7d2cb 100644
--- a/drivers/fpga/xilinx.c
+++ b/drivers/fpga/xilinx.c
@@ -11,6 +11,7 @@
* Xilinx FPGA support
*/
+#include <env.h>
#include <fpga.h>
#include <log.h>
#include <virtex2.h>
@@ -92,7 +93,11 @@ int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
__func__);
printf("%s: Bitstream ID %s, current device ID %d/%s\n",
__func__, dataptr, devnum, xdesc->name);
- return FPGA_FAIL;
+ if (!CONFIG_IS_ENABLED(ENV_SUPPORT) ||
+ env_get_yesno("fpga_skip_idcheck") != 1)
+ return FPGA_FAIL;
+
+ printf("%s: Skipping ID check\n", __func__);
}
} else {
printf("%s: Please fill correct device ID to xilinx_desc\n",
@@ -144,8 +149,8 @@ int fpga_loadbitstream(int devnum, char *fpgadata, size_t size,
int xilinx_load(xilinx_desc *desc, const void *buf, size_t bsize,
bitstream_type bstype, int flags)
{
- if (!xilinx_validate (desc, (char *)__FUNCTION__)) {
- printf ("%s: Invalid device descriptor\n", __FUNCTION__);
+ if (!xilinx_validate(desc, (char *)__func__)) {
+ printf("%s: Invalid device descriptor\n", __func__);
return FPGA_FAIL;
}
@@ -195,8 +200,8 @@ int xilinx_loads(xilinx_desc *desc, const void *buf, size_t bsize,
int xilinx_dump(xilinx_desc *desc, const void *buf, size_t bsize)
{
- if (!xilinx_validate (desc, (char *)__FUNCTION__)) {
- printf ("%s: Invalid device descriptor\n", __FUNCTION__);
+ if (!xilinx_validate(desc, (char *)__func__)) {
+ printf("%s: Invalid device descriptor\n", __func__);
return FPGA_FAIL;
}
@@ -212,7 +217,7 @@ int xilinx_info(xilinx_desc *desc)
{
int ret_val = FPGA_FAIL;
- if (xilinx_validate (desc, (char *)__FUNCTION__)) {
+ if (xilinx_validate(desc, (char *)__func__)) {
printf ("Family: \t");
switch (desc->family) {
case xilinx_spartan2:
@@ -288,7 +293,7 @@ int xilinx_info(xilinx_desc *desc)
ret_val = FPGA_SUCCESS;
} else {
- printf ("%s: Invalid device descriptor\n", __FUNCTION__);
+ printf("%s: Invalid device descriptor\n", __func__);
}
return ret_val;