All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Hershberger <joe.hershberger@ni.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 13/14] mmc: Separate "mmc swrite" from fastboot
Date: Wed, 16 May 2018 11:17:05 -0500	[thread overview]
Message-ID: <CANr=Z=ZWyuY7vzdhMc74U=L6p3V--wxhQwkvpg2rhqn5ZmPusQ@mail.gmail.com> (raw)
In-Reply-To: <CAO5Uq5Q7u=F3f+ZFkewHJp3zdb=rM_c3UsY-2ruUxnrS4yEaSg@mail.gmail.com>

On Wed, May 16, 2018 at 12:00 AM, Alex Kiernan <alex.kiernan@gmail.com> wrote:
> On Wed, May 16, 2018 at 12:20 AM Joe Hershberger <joe.hershberger@ni.com>
> wrote:
>
>> On Tue, May 15, 2018 at 9:48 AM, Alex Kiernan <alex.kiernan@gmail.com>
> wrote:
>> > Introduce CONFIG_IMAGE_SPARSE and CONFIG_CMD_MMC_SWRITE so the "mmc
>> > swrite" command is separated from the fastboot code.
>> >
>> > Move image-sparse from common to lib so it's clear it's library code.
>> >
>> > Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
>> > ---
>> >
>> > Changes in v4:
>> > - new
>> >
>> > Changes in v3: None
>> > Changes in v2: None
>> >
>> >  cmd/Kconfig                    |  8 ++++++++
>> >  cmd/mmc.c                      | 12 ++++++------
>> >  common/Makefile                |  1 -
>> >  drivers/fastboot/Kconfig       |  1 +
>> >  lib/Kconfig                    |  3 +++
>> >  lib/Makefile                   |  1 +
>> >  {common => lib}/image-sparse.c |  0
>> >  7 files changed, 19 insertions(+), 7 deletions(-)
>> >  rename {common => lib}/image-sparse.c (100%)
>> >
>> > diff --git a/cmd/Kconfig b/cmd/Kconfig
>> > index df2194c..b5fa657 100644
>> > --- a/cmd/Kconfig
>> > +++ b/cmd/Kconfig
>> > @@ -826,6 +826,14 @@ config CMD_MMC
>> >         help
>> >           MMC memory mapped support.
>> >
>> > +config CMD_MMC_SWRITE
>> > +       bool "mmc swrite"
>> > +       depends on CMD_MMC && MMC_WRITE
>> > +       select IMAGE_SPARSE
>> > +       help
>> > +         Enable support for the "mmc swrite" command to write Android
> sparse
>> > +         images to eMMC.
>> > +
>> >  config CMD_NAND
>> >         bool "nand"
>> >         default y if NAND_SUNXI
>> > diff --git a/cmd/mmc.c b/cmd/mmc.c
>> > index cc44525..66c3ee0 100644
>> > --- a/cmd/mmc.c
>> > +++ b/cmd/mmc.c
>> > @@ -308,8 +308,7 @@ static int do_mmc_read(cmd_tbl_t *cmdtp, int flag,
>> >         return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE;
>> >  }
>> >
>> > -#if CONFIG_IS_ENABLED(MMC_WRITE)
>> > -#if defined(CONFIG_FASTBOOT_FLASH)
>> > +#if CONFIG_IS_ENABLED(CMD_MMC_SWRITE)
>> >  static lbaint_t mmc_sparse_write(struct sparse_storage *info, lbaint_t
> blk,
>> >                                  lbaint_t blkcnt, const void *buffer)
>> >  {
>> > @@ -374,6 +373,7 @@ static int do_mmc_sparse_write(cmd_tbl_t *cmdtp,
> int flag,
>> >  }
>> >  #endif
>> >
>> > +#if CONFIG_IS_ENABLED(MMC_WRITE)
>> >  static int do_mmc_write(cmd_tbl_t *cmdtp, int flag,
>> >                         int argc, char * const argv[])
>> >  {
>> > @@ -868,11 +868,11 @@ static cmd_tbl_t cmd_mmc[] = {
>> >         U_BOOT_CMD_MKENT(read, 4, 1, do_mmc_read, "", ""),
>> >  #if CONFIG_IS_ENABLED(MMC_WRITE)
>> >         U_BOOT_CMD_MKENT(write, 4, 0, do_mmc_write, "", ""),
>> > -#if defined(CONFIG_FASTBOOT_FLASH)
>> > -       U_BOOT_CMD_MKENT(swrite, 3, 0, do_mmc_sparse_write, "", ""),
>> > -#endif
>> >         U_BOOT_CMD_MKENT(erase, 3, 0, do_mmc_erase, "", ""),
>> >  #endif
>> > +#if CONFIG_IS_ENABLED(CMD_MMC_SWRITE)
>> > +       U_BOOT_CMD_MKENT(swrite, 3, 0, do_mmc_sparse_write, "", ""),
>> > +#endif
>> >         U_BOOT_CMD_MKENT(rescan, 1, 1, do_mmc_rescan, "", ""),
>> >         U_BOOT_CMD_MKENT(part, 1, 1, do_mmc_part, "", ""),
>> >         U_BOOT_CMD_MKENT(dev, 3, 0, do_mmc_dev, "", ""),
>> > @@ -927,7 +927,7 @@ U_BOOT_CMD(
>> >         "info - display info of the current MMC device\n"
>> >         "mmc read addr blk# cnt\n"
>> >         "mmc write addr blk# cnt\n"
>> > -#if defined(CONFIG_FASTBOOT_FLASH)
>> > +#if CONFIG_IS_ENABLED(CMD_MMC_SWRITE)
>> >         "mmc swrite addr blk#\n"
>> >  #endif
>> >         "mmc erase blk# cnt\n"
>> > diff --git a/common/Makefile b/common/Makefile
>> > index 9ec40b9..b3da72e 100644
>> > --- a/common/Makefile
>> > +++ b/common/Makefile
>> > @@ -29,7 +29,6 @@ obj-$(CONFIG_CMD_BOOTI) += bootm.o bootm_os.o
>> >
>> >  obj-$(CONFIG_CMD_BEDBUG) += bedbug.o
>> >  obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += fdt_support.o
>> > -obj-$(CONFIG_FASTBOOT_FLASH) += image-sparse.o
>> >  obj-$(CONFIG_MII) += miiphyutil.o
>> >  obj-$(CONFIG_CMD_MII) += miiphyutil.o
>> >  obj-$(CONFIG_PHYLIB) += miiphyutil.o
>> > diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
>> > index 51c5789..82e1420 100644
>> > --- a/drivers/fastboot/Kconfig
>> > +++ b/drivers/fastboot/Kconfig
>> > @@ -57,6 +57,7 @@ config FASTBOOT_FLASH
>> >         bool "Enable FASTBOOT FLASH command"
>> >         default y if ARCH_SUNXI
>> >         depends on MMC || (NAND && CMD_MTDPARTS)
>> > +       select IMAGE_SPARSE
>
>> Is this useful if we are NAND and not MMC? It seems no.
>
> There's code in drivers/fastboot/fb_nand.c which will write sparse images,
> so I think the select is right.

OK, then this is fine.

> That said, there's nothings in configs/ which actually selects
> FASTBOOT_FLASH_NAND

OK, I guess we can wait for a board to come along that uses it?

> --
> Alex Kiernan
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot

  reply	other threads:[~2018-05-16 16:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 14:48 [U-Boot] [PATCH v4 00/14] Add fastboot UDP support Alex Kiernan
2018-05-15 14:48 ` [U-Boot] [PATCH v4 01/14] fastboot: Move fastboot to drivers/fastboot Alex Kiernan
2018-05-15 23:07   ` Joe Hershberger
2018-05-15 14:48 ` [U-Boot] [PATCH v4 02/14] fastboot: Switch dependencies on FASTBOOT to USB_FUNCTION_FASTBOOT Alex Kiernan
2018-05-15 23:08   ` Joe Hershberger
2018-05-15 14:48 ` [U-Boot] [PATCH v4 03/14] fastboot: Refactor fastboot_okay/fail to take response Alex Kiernan
2018-05-15 14:48 ` [U-Boot] [PATCH v4 04/14] fastboot: Extract fastboot_okay/fail to fb_common.c Alex Kiernan
2018-05-15 14:48 ` [U-Boot] [PATCH v4 05/14] fastboot: Correct dependencies in FASTBOOT_FLASH Alex Kiernan
2018-05-15 14:48 ` [U-Boot] [PATCH v4 06/14] fastboot: Add missing newlines Alex Kiernan
2018-05-15 14:48 ` [U-Boot] [PATCH v4 07/14] fastboot: Remove FIXME for CONFIG_FASTBOOT_...NAME Alex Kiernan
2018-05-15 23:10   ` Joe Hershberger
2018-05-15 14:48 ` [U-Boot] [PATCH v4 08/14] fastboot: Fix parameter types in _fb_nand_write Alex Kiernan
2018-05-15 23:11   ` Joe Hershberger
2018-05-15 14:48 ` [U-Boot] [PATCH v4 09/14] fastboot: Rename fb_set_reboot_flag to fastboot_set_reboot_flag Alex Kiernan
2018-05-15 23:13   ` Joe Hershberger
2018-05-15 14:48 ` [U-Boot] [PATCH v4 10/14] fastboot: Extract common definitions from USB fastboot Alex Kiernan
2018-05-15 16:05   ` Simon Glass
2018-05-15 23:14   ` Joe Hershberger
2018-05-15 14:48 ` [U-Boot] [PATCH v4 11/14] ti: fastboot: Move weak overrides to board files Alex Kiernan
2018-05-15 14:48 ` [U-Boot] [PATCH v4 12/14] fs: Add fs_get_type_name to return current filesystem name Alex Kiernan
2018-05-15 23:16   ` Joe Hershberger
2018-05-15 14:48 ` [U-Boot] [PATCH v4 13/14] mmc: Separate "mmc swrite" from fastboot Alex Kiernan
2018-05-15 23:19   ` Joe Hershberger
2018-05-16  5:00     ` Alex Kiernan
2018-05-16 16:17       ` Joe Hershberger [this message]
2018-05-16 16:58         ` Alex Kiernan
2018-05-16 18:41   ` Joe Hershberger
2018-05-15 14:48 ` [U-Boot] [PATCH v4 14/14] net: fastboot: Merge AOSP UDP fastboot Alex Kiernan
2018-05-16 19:15   ` Joe Hershberger
2018-05-16 20:10     ` Alex Kiernan
2018-05-15 16:52 ` [U-Boot] [PATCH v4 00/14] Add fastboot UDP support Sam Protsenko
2018-05-15 18:33   ` Alex Kiernan

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='CANr=Z=ZWyuY7vzdhMc74U=L6p3V--wxhQwkvpg2rhqn5ZmPusQ@mail.gmail.com' \
    --to=joe.hershberger@ni.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.