From: Lukasz Majewski <lukma@denx.de>
To: Marek Vasut <marex@denx.de>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH] dfu: dfu_sf: Add support for multiple flashes
Date: Tue, 14 Sep 2021 11:31:48 +0200 [thread overview]
Message-ID: <20210914113148.467a774a@ktm> (raw)
In-Reply-To: <20210914032751.273606-1-marex@denx.de>
[-- Attachment #1: Type: text/plain, Size: 2171 bytes --]
On Tue, 14 Sep 2021 05:27:51 +0200
Marek Vasut <marex@denx.de> wrote:
> Add dfu_alt_info option which allows specifying multiple SPI flashes
> as an alt info. The syntax is as follows:
>
> altname sf bus:cs[:speed[:mode]]
>
> Example:
> dfu_alt_info=qspi0 sf 0:0;qspi1 sf 0:1
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Lukasz Majewski <lukma@denx.de>
> ---
> drivers/dfu/dfu_sf.c | 21 +++++++++++++++------
> 1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c
> index b72493ced86..d246e1b21ff 100644
> --- a/drivers/dfu/dfu_sf.c
> +++ b/drivers/dfu/dfu_sf.c
> @@ -168,22 +168,31 @@ static struct spi_flash *parse_dev(char *devstr)
> int dfu_fill_entity_sf(struct dfu_entity *dfu, char *devstr, char *s)
> {
> char *st;
> - char *devstr_bkup = strdup(devstr);
> -
> - dfu->data.sf.dev = parse_dev(devstr_bkup);
> - free(devstr_bkup);
> - if (!dfu->data.sf.dev)
> - return -ENODEV;
>
> dfu->dev_type = DFU_DEV_SF;
> dfu->max_buf_size = dfu->data.sf.dev->sector_size;
>
> st = strsep(&s, " ");
> if (!strcmp(st, "raw")) {
> + char *devstr_bkup = strdup(devstr);
> + dfu->data.sf.dev = parse_dev(devstr_bkup);
> + free(devstr_bkup);
> + if (!dfu->data.sf.dev)
> + return -ENODEV;
> +
> dfu->layout = DFU_RAW_ADDR;
> dfu->data.sf.start = hextoul(s, &s);
> s++;
> dfu->data.sf.size = hextoul(s, &s);
> + } else if (!strcmp(st, "sf")) {
> + st = strsep(&s, " ");
> + dfu->data.sf.dev = parse_dev(st);
> + if (!dfu->data.sf.dev)
> + return -ENODEV;
> +
> + dfu->layout = DFU_RAW_ADDR;
> + dfu->data.sf.start = 0;
> + dfu->data.sf.size = dfu->data.sf.dev->size;
> } else if (CONFIG_IS_ENABLED(DFU_SF_PART) &&
> (!strcmp(st, "part") || !strcmp(st, "partubi"))) {
> char mtd_id[32];
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-09-14 9:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 3:27 [PATCH] dfu: dfu_sf: Add support for multiple flashes Marek Vasut
2021-09-14 9:31 ` Lukasz Majewski [this message]
2021-10-25 22:12 ` Tom Rini
2021-10-25 22:18 ` Marek Vasut
2021-10-25 22:19 ` Tom Rini
2021-10-25 22:21 ` Tom Rini
2021-10-25 22:34 ` Marek Vasut
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=20210914113148.467a774a@ktm \
--to=lukma@denx.de \
--cc=marex@denx.de \
--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