summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-02-02 15:26:53 -0500
committerTom Rini <trini@konsulko.com>2020-02-02 15:26:53 -0500
commit31a790bee939e227dfc7e6a6a323b2b13180707f (patch)
tree24f3fbd808389138209b5d7270eb11cdcad123a1 /drivers
parent427da6f0280ba1ce07e06941dd18a435fabd18fb (diff)
parent13cb7cc9e8e48eb888b13743f79ff02420405044 (diff)
downloadu-boot-31a790bee939e227dfc7e6a6a323b2b13180707f.tar.gz
Merge branch 'master' of git://git.denx.de/u-boot-usbWIP/02Feb2020
- DFU and Cadence USB 3 fixes
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dfu/Kconfig7
-rw-r--r--drivers/dfu/dfu_nand.c7
-rw-r--r--drivers/usb/cdns3/ep0.c4
3 files changed, 17 insertions, 1 deletions
diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
index 9709b6277d..174fb588a6 100644
--- a/drivers/dfu/Kconfig
+++ b/drivers/dfu/Kconfig
@@ -42,6 +42,13 @@ config DFU_NAND
This option enables using DFU to read and write to NAND based
storage.
+config DFU_NAND_TRIMFFS
+ bool "Skip empty pages when flashing UBI images to NAND"
+ depends on DFU_NAND
+ help
+ When flashing UBI images to NAND, enable the DROP_FFS flag to drop
+ trailing all-0xff pages.
+
config DFU_RAM
bool "RAM back end for DFU"
help
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index b812a3dfb1..58b94348c9 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -50,6 +50,7 @@ static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
lim, buf);
} else {
nand_erase_options_t opts;
+ int write_flags = WITH_WR_VERIFY;
memset(&opts, 0, sizeof(opts));
opts.offset = start;
@@ -62,8 +63,12 @@ static int nand_block_op(enum dfu_op op, struct dfu_entity *dfu,
if (ret)
return ret;
/* then write */
+#ifdef CONFIG_DFU_NAND_TRIMFFS
+ if (dfu->data.nand.ubi)
+ write_flags |= WITH_DROP_FFS;
+#endif
ret = nand_write_skip_bad(mtd, start, &count, &actual,
- lim, buf, WITH_WR_VERIFY);
+ lim, buf, write_flags);
}
if (ret != 0) {
diff --git a/drivers/usb/cdns3/ep0.c b/drivers/usb/cdns3/ep0.c
index 0b6d9cf727..f35a924839 100644
--- a/drivers/usb/cdns3/ep0.c
+++ b/drivers/usb/cdns3/ep0.c
@@ -562,6 +562,10 @@ static void cdns3_ep0_setup_phase(struct cdns3_device *priv_dev)
struct cdns3_endpoint *priv_ep = priv_dev->eps[0];
int result;
+ /* Invalidate Setup Packet received */
+ invalidate_dcache_range(priv_dev->setup_dma,
+ priv_dev->setup_dma + ARCH_DMA_MINALIGN);
+
priv_dev->ep0_data_dir = ctrl->bRequestType & USB_DIR_IN;
trace_cdns3_ctrl_req(ctrl);