summaryrefslogtreecommitdiffstats
path: root/common/imx-bbu-nand-fcb.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-05-23 15:15:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-05-23 15:15:57 +0200
commita66e38747cb5237a48f323dcef20b99d8ca8a530 (patch)
tree8424ce698371861324a39f8080841665f039055b /common/imx-bbu-nand-fcb.c
parentd0088a75660a8c15a6a7b0aae2480cd5c4b8c8e5 (diff)
downloadbarebox-a66e38747cb5237a48f323dcef20b99d8ca8a530.tar.gz
barebox-a66e38747cb5237a48f323dcef20b99d8ca8a530.tar.xz
imx-bbu-nand-fcb: refresh unused firmware when it needs refresh
So far we only refreshed the unused firmware when it differs from the used one, but we also have to refresh it when the pages need a cleanup (-EUCLEAN returned). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/imx-bbu-nand-fcb.c')
-rw-r--r--common/imx-bbu-nand-fcb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c
index 9f9913fb57..dd76b8bf90 100644
--- a/common/imx-bbu-nand-fcb.c
+++ b/common/imx-bbu-nand-fcb.c
@@ -1172,6 +1172,8 @@ static void read_firmware_all(struct mtd_info *mtd, struct fcb_block *fcb, void
*used = !first;
*data = secondary;
} else {
+ *unused_refresh = secondary_refresh;
+
if (memcmp(primary, secondary, fcb->PagesInFirmware1 * mtd->writesize))
*unused_refresh = 1;