diff mbox series

[4/6] nandbcb: add nandbcb dump command for i.MX6

Message ID 20200505140404.27407-5-peng.fan@nxp.com
State New
Headers show
Series imx: nandbcb update | expand

Commit Message

Peng Fan May 5, 2020, 2:04 p.m. UTC
From: Alice Guo <alice.guo at nxp.com>

Verify/dump boot structures.

Signed-off-by: Alice Guo <alice.guo at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 arch/arm/mach-imx/cmd_nandbcb.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Stefano Babic May 11, 2020, 10:17 a.m. UTC | #1
> From: Alice Guo <alice.guo at nxp.com>
> Verify/dump boot structures.
> Signed-off-by: Alice Guo <alice.guo at nxp.com>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index 02a65ffd43..a8531def35 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -309,6 +309,10 @@  static int write_fcb_dbbt_and_readback(struct mtd_info *mtd,
 			debug("NAND fcb write: 0x%x offset 0x%zx written: %s\n",
 			      mtd->erasesize * i, ops.len, ret ?
 			      "ERROR" : "OK");
+
+			ops.datbuf = (u8 *)(dump_nand_fcb + i);
+			ops.oobbuf = ((u8 *)(dump_nand_fcb + i)) + mtd->writesize;
+			mtd_read_oob(mtd, mtd->erasesize * i, &ops);
 		}
 
 		ret = mtd_write(mtd, mtd->erasesize * i + mtd->writesize,