[U-Boot] [RFC PATCH v1 5/5] net: dfu: Support building without MMC

Alex Kiernan
2018-04-24T09:37:07Z

If the fastboot flash/erase commands are disabled, remove that support
so we still build correctly.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---

net/fastboot.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/net/fastboot.c b/net/fastboot.c
index 32cb581..87c12e5 100644
--- a/net/fastboot.c
+++ b/net/fastboot.c
@@ -59,8 +59,10 @@ static int fastboot_our_port;

static void fb_getvar(char *);
static void fb_download(char *, unsigned int, char *);
+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
static void fb_flash(char *);
static void fb_erase(char *);
+#endif
static void fb_continue(char *);
static void fb_reboot(char *);
static void boot_downloaded_image(void);
@@ -169,10 +171,12 @@ static void fastboot_send(struct fastboot_header fb_header, char *fastboot_data,
fb_getvar(response);
} else if (!strcmp("download", cmd_string)) {
fb_download(fastboot_data, fastboot_data_len, response);
+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
} else if (!strcmp("flash", cmd_string)) {
fb_flash(response);
} else if (!strcmp("erase", cmd_string)) {
fb_erase(response);
+#endif
} else if (!strcmp("boot", cmd_string)) {
write_fb_response("OKAY", "", response);
} else if (!strcmp("continue", cmd_string)) {
@@ -367,6 +371,7 @@ static void fb_download(char *fastboot_data, unsigned int fastboot_data_len,
}
}

+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
/**
* Writes the previously downloaded image to the partition indicated by
* cmd_parameter. Writes to response.
@@ -389,6 +394,7 @@ static void fb_erase(char *response)
{
fb_mmc_erase(cmd_parameter, response);
}
+#endif

/**
* Continues normal boot process by running "bootcmd". Writes
--
2.7.4