summaryrefslogtreecommitdiffstats
path: root/drivers/dfu
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2014-04-11 07:59:47 +0200
committerLukasz Majewski <l.majewski@samsung.com>2014-05-08 10:38:30 +0200
commitfc25fa27e5f439705e9ca42182014e2d75d9f0ae (patch)
tree6ab713cc1f1c3e927a8099a2c058553938b6f94b /drivers/dfu
parentab2f5c12f7ca27b0191ebae90664182510330cd6 (diff)
downloadblackbird-obmc-uboot-fc25fa27e5f439705e9ca42182014e2d75d9f0ae.tar.gz
blackbird-obmc-uboot-fc25fa27e5f439705e9ca42182014e2d75d9f0ae.zip
dfu, nand: add medium specific polltimeout function
add a possibility to add a medium specific polltimeout function. So it is possible to define different poll timeouts. Used on nand medium, for setting the DFU_MANIFEST_POLL_TIMEOUT only on nand ubi partitions, which is currently the only usecase. Change-Id: If1db5f49b32d93fefa7481e8dfe5b7ccc0e65af4 Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Marek Vasut <marex@denx.de> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Diffstat (limited to 'drivers/dfu')
-rw-r--r--drivers/dfu/dfu_nand.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index 2d07097e85..ccdbef6b75 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -163,6 +163,18 @@ static int dfu_flush_medium_nand(struct dfu_entity *dfu)
return ret;
}
+unsigned int dfu_polltimeout_nand(struct dfu_entity *dfu)
+{
+ /*
+ * Currently, Poll Timeout != 0 is only needed on nand
+ * ubi partition, as the not used sectors need an erase
+ */
+ if (dfu->data.nand.ubi)
+ return DFU_MANIFEST_POLL_TIMEOUT;
+
+ return DFU_DEFAULT_POLL_TIMEOUT;
+}
+
int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
{
char *st;
@@ -211,6 +223,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)
dfu->read_medium = dfu_read_medium_nand;
dfu->write_medium = dfu_write_medium_nand;
dfu->flush_medium = dfu_flush_medium_nand;
+ dfu->poll_timeout = dfu_polltimeout_nand;
/* initial state */
dfu->inited = 0;
OpenPOWER on IntegriCloud