aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/zynq-fpga.c
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2015-10-20 13:19:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-23 19:49:12 -0400
commit4d10eaff5bfc69997a769f9c83b749f0a8c542fa (patch)
tree11e4b285b0cfce0bb33b05a41bc558298c0658d6 /drivers/fpga/zynq-fpga.c
parent6376931babd833dbd6f51e22a3de449ce6c60d61 (diff)
fpga: zynq-fpga: Change fw format to handle bin instead of bit.
This gets rid of the code to strip away the header and byteswap, as well as the check for the sync word. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com> Reviewed-by: Josh Cartwright <joshc@ni.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga/zynq-fpga.c')
-rw-r--r--drivers/fpga/zynq-fpga.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c
index 617d38281f49..31db5509f3d4 100644
--- a/drivers/fpga/zynq-fpga.c
+++ b/drivers/fpga/zynq-fpga.c
@@ -287,9 +287,9 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr,
287 struct zynq_fpga_priv *priv; 287 struct zynq_fpga_priv *priv;
288 int err; 288 int err;
289 char *kbuf; 289 char *kbuf;
290 size_t i, in_count; 290 size_t in_count;
291 dma_addr_t dma_addr; 291 dma_addr_t dma_addr;
292 u32 transfer_length = 0; 292 u32 transfer_length;
293 u32 intr_status; 293 u32 intr_status;
294 294
295 in_count = count; 295 in_count = count;
@@ -301,26 +301,6 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr,
301 301
302 memcpy(kbuf, buf, count); 302 memcpy(kbuf, buf, count);
303 303
304 /* look for the sync word */
305 for (i = 0; i < count - 4; i++) {
306 if (memcmp(kbuf + i, "\xAA\x99\x55\x66", 4) == 0) {
307 dev_dbg(priv->dev, "Found swapped sync word\n");
308 break;
309 }
310 }
311
312 /* remove the header, align the data on word boundary */
313 if (i != count - 4) {
314 count -= i;
315 memmove(kbuf, kbuf + i, count);
316 }
317
318 /* fixup endianness of the data */
319 for (i = 0; i < count; i += 4) {
320 u32 *p = (u32 *)&kbuf[i];
321 *p = swab32(*p);
322 }
323
324 /* enable clock */ 304 /* enable clock */
325 err = clk_enable(priv->clk); 305 err = clk_enable(priv->clk);
326 if (err) 306 if (err)