[U-Boot] [RFC PATCH v2 16/20] fastboot: net: Add NAND support
Alex Kiernan
alex.kiernan at gmail.com
Tue May 8 09:09:33 UTC 2018
On Tue, May 8, 2018 at 8:20 AM Joe Hershberger <joe.hershberger at ni.com>
wrote:
> On Tue, May 8, 2018 at 1:53 AM, Jocelyn Bohr <bohr at verily.com> wrote:
> > 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.
> I thought in Kconfig those two configs are a "choice" so only one can
> be enabled at a time.
They are.
--
Alex Kiernan
More information about the U-Boot
mailing list