linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jgunthorpe@obsidianresearch.com (Jason Gunthorpe)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] fpga zynq: Check the bitstream for validity
Date: Thu, 27 Oct 2016 08:32:03 -0600	[thread overview]
Message-ID: <20161027143203.GA6818@obsidianresearch.com> (raw)
In-Reply-To: <bdae79f1-dfed-d735-cb49-9ce8aa0b6e4f@xilinx.com>

On Thu, Oct 27, 2016 at 09:42:03AM +0200, Michal Simek wrote:

> I am not quite sure about this and I didn't try it on real hw.
> But minimum bitstream size 52+B and more likely much more than this.

Oh probably, I didn't try to guess what the minimum size is, that
check is just to prevent reading past the end of the buffer.

> This is taken from u-boot source code and this is full BIN header.
> The code above is checking only the last word.

There can be garbage before the sync word.  The hardware ignores
everything till it gets the sync word.  Prior versions of the driver
with the autodetection would discard the garbage.

Since the autodetection was ripped out I didn't want to search since
the intent seems to be for user space to provide a full bitstream,
which should start at the sync word, but that is another option.

>        0x000000bb, /* Sync word */
>        0x11220044, /* Sync word */
>        DUMMY_WORD,
>        DUMMY_WORD,
>        0xaa995566, /* Sync word */

This is the bus width detection pattern, I understood the Zync DevC
interface was wired to 32 bits and did not respond to this.

Jason

  reply	other threads:[~2016-10-27 14:32 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 22:54 [PATCH] fpga zynq: Check the bitstream for validity Jason Gunthorpe
2016-10-27  7:42 ` Michal Simek
2016-10-27 14:32   ` Jason Gunthorpe [this message]
2016-10-27  8:50 ` Matthias Brugger
2016-10-27 14:39   ` Jason Gunthorpe
2016-10-28 11:06     ` Matthias Brugger
2016-10-28 15:47       ` Jason Gunthorpe
2016-10-28 16:36         ` Matthias Brugger
2016-10-28 16:55           ` Jason Gunthorpe
2016-10-28 18:23             ` Moritz Fischer
2016-10-28 20:26               ` Jason Gunthorpe
2016-10-28 21:00                 ` Moritz Fischer
2016-10-28 22:05                   ` Jason Gunthorpe
2016-10-29  0:09                     ` Moritz Fischer
2016-10-31 16:23                       ` Jason Gunthorpe
2016-11-01  6:39                         ` Michal Simek
2016-11-01 15:33                           ` Jason Gunthorpe
2016-11-01 17:48                             ` Michal Simek
2016-11-08  0:05                               ` Jason Gunthorpe
2016-11-09 14:21                                 ` Mike Looijmans
2016-11-09 15:18                                   ` Matthias Brugger
2016-11-09 16:00                                     ` Jason Gunthorpe
2016-11-09 15:56                                   ` Jason Gunthorpe
2016-11-09 17:31                                     ` Mike Looijmans
2016-11-28 18:00                                   ` Jason Gunthorpe
2016-11-08  0:46                       ` Jason Gunthorpe
2016-11-08  9:59                         ` Matthias Brugger
2016-11-08 16:24                           ` Jason Gunthorpe
2016-10-28 11:12 ` Matthias Brugger
2016-10-28 15:48   ` Jason Gunthorpe
2016-10-28 16:37     ` Matthias Brugger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161027143203.GA6818@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).