aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2015-10-15 14:34:17 +0200
committerTom Rini <trini@konsulko.com>2015-11-12 13:18:58 -0500
commitbf8940d35b91ef87e0e4e691c5d8cc356fcae035 (patch)
tree5a1668056971215c558fb2b1256c7b560931adde /drivers
parent1f8690aa950ad1f42a64d07c4a31e47dcf1090b7 (diff)
downloadu-boot-bf8940d35b91ef87e0e4e691c5d8cc356fcae035.zip
u-boot-bf8940d35b91ef87e0e4e691c5d8cc356fcae035.tar.gz
u-boot-bf8940d35b91ef87e0e4e691c5d8cc356fcae035.tar.bz2
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 <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_fastboot.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index a70463d..20b6c18 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 <fb_mmc.h>
#endif
+#ifdef CONFIG_FASTBOOT_FLASH_NAND_DEV
+#include <fb_nand.h>
+#endif
#define FASTBOOT_VERSION "0.4"
@@ -569,6 +572,11 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req)
(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);
}
@@ -614,6 +622,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);
}
#endif