From bf8940d35b91ef87e0e4e691c5d8cc356fcae035 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Thu, 15 Oct 2015 14:34:17 +0200 Subject: fastboot: Implement NAND backend So far the fastboot code was only supporting MMC-backed devices for its flashing operations (flash and erase). Add a storage backend for NAND-backed devices. Signed-off-by: Maxime Ripard --- drivers/usb/gadget/f_fastboot.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/usb') diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index a70463db33..20b6c18b9c 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -24,6 +24,9 @@ #ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV #include #endif +#ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV +#include +#endif #define FASTBOOT_VERSION "0.4" @@ -568,6 +571,11 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req) fb_mmc_flash_write(cmd, fastboot_flash_session_id, (void *)CONFIG_FASTBOOT_BUF_ADDR, download_bytes, response); +#endif +#ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV + fb_nand_flash_write(cmd, fastboot_flash_session_id, + (void *)CONFIG_FASTBOOT_BUF_ADDR, + download_bytes, response); #endif fastboot_flash_session_id++; fastboot_tx_write_str(response); @@ -613,6 +621,9 @@ static void cb_erase(struct usb_ep *ep, struct usb_request *req) #ifdef CONFIG_FASTBOOT_FLASH_MMC_DEV fb_mmc_erase(cmd, response); +#endif +#ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV + fb_nand_erase(cmd, response); #endif fastboot_tx_write_str(response); } -- cgit v1.2.1