Skip to content

Commit

Permalink
fpga: zynq-fpga: Change fw format to handle bin instead of bit.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Josh Cartwright <[email protected]>
Acked-by: Michal Simek <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Moritz Fischer authored and gregkh committed Oct 23, 2015
1 parent 6376931 commit 4d10eaf
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions drivers/fpga/zynq-fpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr,
struct zynq_fpga_priv *priv;
int err;
char *kbuf;
size_t i, in_count;
size_t in_count;
dma_addr_t dma_addr;
u32 transfer_length = 0;
u32 transfer_length;
u32 intr_status;

in_count = count;
Expand All @@ -301,26 +301,6 @@ static int zynq_fpga_ops_write(struct fpga_manager *mgr,

memcpy(kbuf, buf, count);

/* look for the sync word */
for (i = 0; i < count - 4; i++) {
if (memcmp(kbuf + i, "\xAA\x99\x55\x66", 4) == 0) {
dev_dbg(priv->dev, "Found swapped sync word\n");
break;
}
}

/* remove the header, align the data on word boundary */
if (i != count - 4) {
count -= i;
memmove(kbuf, kbuf + i, count);
}

/* fixup endianness of the data */
for (i = 0; i < count; i += 4) {
u32 *p = (u32 *)&kbuf[i];
*p = swab32(*p);
}

/* enable clock */
err = clk_enable(priv->clk);
if (err)
Expand Down

0 comments on commit 4d10eaf

Please sign in to comment.