[U-Boot] [RFC PATCH v2 16/20] fastboot: net: Add NAND support

Jocelyn Bohr bohr at verily.com
Tue May 8 06:53:56 UTC 2018


On Mon, Apr 30, 2018 at 1:33 AM Alex Kiernan <alex.kiernan at gmail.com> wrote:

> Add NAND support to fastboot UDP flash/erase commands
>
> Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
> ---
>
> Changes in v2: None
>
>  net/fastboot.c | 17 ++++++++++++++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/net/fastboot.c b/net/fastboot.c
> index 119011c..a07b1ad 100644
> --- a/net/fastboot.c
> +++ b/net/fastboot.c
> @@ -60,7 +60,7 @@ static int fastboot_our_port;
>  static void cb_okay(char *, char *, unsigned int, char *);
>  static void cb_getvar(char *, char *, unsigned int, char *);
>  static void cb_download(char *, char *, unsigned int, char *);
> -#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
> +#if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
>  static void cb_flash(char *, char *, unsigned int, char *);
>  static void cb_erase(char *, char *, unsigned int, char *);
>  #endif
> @@ -74,7 +74,7 @@ static void (*fb_net_dispatch[])(char *cmd_parameter,
>         [FB_CMD_GETVAR] = cb_getvar,
>         [FB_CMD_DOWNLOAD] = cb_download,
>         [FB_CMD_VERIFY] = NULL,
> -#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
> +#if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
>         [FB_CMD_FLASH] = cb_flash,
>         [FB_CMD_ERASE] = cb_erase,
>  #else
> @@ -324,7 +324,7 @@ static void cb_download(char *cmd_parameter, char
> *fastboot_data,
>         }
>  }
>
> -#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
> +#if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
>  /**
>   * Writes the previously downloaded image to the partition indicated by
>   * cmd_parameter. Writes to response.
> @@ -334,8 +334,14 @@ static void cb_download(char *cmd_parameter, char
> *fastboot_data,
>  static void cb_flash(char *cmd_parameter, char *fastboot_data,
>                      unsigned int fastboot_data_len, char *response)
>  {
> +#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
>         fb_mmc_flash_write(cmd_parameter, (void *)CONFIG_FASTBOOT_BUF_ADDR,
>                            image_size, response);
> +#endif
> +#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_NAND)
> +       fb_nand_flash_write(cmd_parameter, (void
> *)CONFIG_FASTBOOT_BUF_ADDR,
> +                           image_size, response);
> +#endif
>

Is there a way to make FASTBOOT_FLASH_MMC and FASTBOOT_FLASH_NAND
mutually exclusive? Currently here and elsewhere, both mmc and nand write
are executed
when both configs are enabled, and I'm not sure if that's the intended
behavior.


More information about the U-Boot mailing list