public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dalon Westergreen <dwesterg@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/2] common: image: update boot_get_fpga to support arbitrary fpga image
Date: Mon, 20 Feb 2017 06:42:03 -0800	[thread overview]
Message-ID: <1487601723.6111.45.camel@gmail.com> (raw)
In-Reply-To: <cea1b23b-7cef-0e7c-a906-b7370a7d4522@denx.de>

On Mon, 2017-02-20 at 09:14 +0100, Marek Vasut wrote:
> On 02/20/2017 04:35 AM, Dalon Westergreen wrote:
> > 
> > The implementation of boot_get_fpga only supported one fpga family.
> > This modification allows for any of the fpga devices supported by
> > fpga_load to be used.
> > 
> > Signed-off-by: Dalon Westergreen <dwesterg@gmail.com>
> 
> IMO looks OK, minor nits below
> 
> > 
> > --
> > Changes in v2:
> > ?- Add fitimage support for fpga-devnum and fpga-partial-image
> > ?- Use above in boot_get_fpga
> > ?- for xilinx fpgas double check using image size to determine
> > ???if image is a partial image
> > ---
> > ?common/image-fit.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
> > ?common/image.c?????| 51 ++++++++++++++++++++++++++++++++-------------------
> > ?include/image.h????|??5 +++++
> > ?3 files changed, 88 insertions(+), 19 deletions(-)
> > 
> > diff --git a/common/image-fit.c b/common/image-fit.c
> > index 109ecfa..eb0c633 100644
> > --- a/common/image-fit.c
> > +++ b/common/image-fit.c
> > @@ -916,6 +916,57 @@ ulong fit_get_end(const void *fit)
> > ?}
> > ?
> >?
[...]
> > 
> > +		fit_image_fpga_get_devnum(buf, conf_noffset, &devnum);
> > +
> > +		/* check bitstream type */
> 
> At least start the sentence with capital letter please.
> 
> > 
> > +		if (fit_image_fpga_is_partial(buf, conf_noffset))
> > +			bstype = BIT_PARTIAL;
> 
> Are there any chances there will be something else besides full and
> partial in the future ?

It's plausible but i think not a likely use case here. In Arria10 there is the
periphery/core image that configures just the io or fpga core. ?I believe,
though, that this is just a special case of a partial image and is treated the
same.

--dalon

> 
> > 
> > +		/* legacy support detecting partial config files for xilinx
> > */
> 
> DTTO, start with caps.
> 
> > 
> > +		desc = fpga_get_desc(devnum);
> > +		if (desc->devtype == fpga_xilinx) {
> > +			desc_xilinx = desc->devdesc;
> > +			if (img_len < desc_xilinx->size)
> > +				bstype = BIT_PARTIAL;
> > ?		}
> > ?
> > +		/* Try bitstream format first */
> > +		err = fpga_loadbitstream(devnum, (char *)img_data,
> > +					?img_len, bstype);
> > +		if (err)
> > +			err = fpga_load(devnum, (const void *)img_data,
> > +					img_len, bstype);
> > +
> > ?		if (err)
> > ?			return err;
> > ?
> > -		printf("???Programming %s bitstream... OK\n", name);
> > +		if (bstype == BIT_PARTIAL)
> > +			name = "partial";
> > +		else
> > +			name = "full";
> > +
> > +		printf("???Programming %s bitstream into fpga %d... OK\n",
> > +		???????name, devnum);
> > ?		break;
> > ?	default:
> > ?		printf("The given image format is not supported
> > (corrupt?)\n");
> > diff --git a/include/image.h b/include/image.h
> > index 1e686b7..75d2afc 100644
> > --- a/include/image.h
> > +++ b/include/image.h
> > @@ -876,6 +876,8 @@ int bootz_setup(ulong image, ulong *start, ulong *end);
> > ?#define FIT_COMP_PROP		"compression"
> > ?#define FIT_ENTRY_PROP		"entry"
> > ?#define FIT_LOAD_PROP		"load"
> > +#define FIT_FPGA_DEVNUM_PROP	"fpga-devnum"
> > +#define FIT_FPGA_PARTIAL_PROP	"fpga-partial-image"
> > ?
> > ?/* configuration node */
> > ?#define FIT_KERNEL_PROP		"kernel"
> > @@ -955,6 +957,9 @@ int fit_image_hash_get_value(const void *fit, int
> > noffset, uint8_t **value,
> > ?
> > ?int fit_set_timestamp(void *fit, int noffset, time_t timestamp);
> > ?
> > +int fit_image_fpga_get_devnum(const void *fit, int noffset, int *devnum);
> > +int fit_image_fpga_is_partial(const void *fit, int noffset);
> > +
> > ?/**
> > ? * fit_add_verification_data() - add verification data to FIT image nodes
> > ? *
> > 
> 
> 

  reply	other threads:[~2017-02-20 14:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20  3:35 [U-Boot] [PATCH v2 0/2] common: fitimage support for arbitrary fpga type Dalon Westergreen
2017-02-20  3:35 ` [U-Boot] [PATCH v2 1/2] common: image: update boot_get_fpga to support arbitrary fpga image Dalon Westergreen
2017-02-20  8:14   ` Marek Vasut
2017-02-20 14:42     ` Dalon Westergreen [this message]
2017-02-20 14:47       ` Marek Vasut
2017-02-20  3:36 ` [U-Boot] [PATCH v2 2/2] common: bootm: add support for arbitrary fgpa configuration Dalon Westergreen

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=1487601723.6111.45.camel@gmail.com \
    --to=dwesterg@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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