* [PATCH 1/2] imx-bbu-nand-fcb: optimize check for bad block loop
@ 2016-03-04 7:34 Sascha Hauer
2016-03-04 7:34 ` [PATCH 2/2] imx-bbu-nand-fcb: Remove double write of first fcb Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2016-03-04 7:34 UTC (permalink / raw)
To: Barebox List
The argument passed to dbbt_data_create() contains the number of blocks,
not the last block. This means we can exit the loop with '<' instead of
'<='
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/imx-bbu-nand-fcb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c
index 22031f5..6e33ee1 100644
--- a/common/imx-bbu-nand-fcb.c
+++ b/common/imx-bbu-nand-fcb.c
@@ -337,14 +337,14 @@ static int imx_bbu_write_firmware(struct mtd_info *mtd, unsigned block,
return block;
}
-static int dbbt_data_create(struct mtd_info *mtd, void *buf, int block_last)
+static int dbbt_data_create(struct mtd_info *mtd, void *buf, int num_blocks)
{
int n;
int n_bad_blocks = 0;
uint32_t *bb = buf + 0x8;
uint32_t *n_bad_blocksp = buf + 0x4;
- for (n = 0; n <= block_last; n++) {
+ for (n = 0; n < num_blocks; n++) {
loff_t offset = n * mtd->erasesize;
if (mtd_block_isbad(mtd, offset)) {
n_bad_blocks++;
--
2.7.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] imx-bbu-nand-fcb: Remove double write of first fcb
2016-03-04 7:34 [PATCH 1/2] imx-bbu-nand-fcb: optimize check for bad block loop Sascha Hauer
@ 2016-03-04 7:34 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-03-04 7:34 UTC (permalink / raw)
To: Barebox List
The first FCB page was written twice. One time is enough, drop the
second write.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
common/imx-bbu-nand-fcb.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c
index 6e33ee1..3eb9e9b 100644
--- a/common/imx-bbu-nand-fcb.c
+++ b/common/imx-bbu-nand-fcb.c
@@ -461,10 +461,6 @@ static int imx_bbu_nand_update(struct bbu_handler *handler, struct bbu_data *dat
*/
memset(fcb_raw_page + mtd->writesize, 0xFF, 2);
- ret = raw_write_page(mtd, fcb_raw_page, mtd->erasesize);
- if (ret)
- goto out;
-
dbbt->Checksum = 0;
dbbt->FingerPrint = 0x54424244;
dbbt->Version = 0x01000000;
--
2.7.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-04 7:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-04 7:34 [PATCH 1/2] imx-bbu-nand-fcb: optimize check for bad block loop Sascha Hauer
2016-03-04 7:34 ` [PATCH 2/2] imx-bbu-nand-fcb: Remove double write of first fcb Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox