[1/1] board/bsh/imx8mn-bsh-smm-s2: erase the entire NAND chip

Message ID 20250515154504.929058-1-dario.binacchi@amarulasolutions.com
State New
Headers show
Series
  • [1/1] board/bsh/imx8mn-bsh-smm-s2: erase the entire NAND chip
Related show

Commit Message

Dario Binacchi May 15, 2025, 3:45 p.m. UTC
From: Michael Trimarchi <michael@amarulasolutions.com>

If an attempt is made to create a UBI volume and it already exists, the
operation fails. Therefore, before requesting the creation of a UBI
volume, we erase the entire NAND to ensure that no errors occur.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
 board/bsh/imx8mn-bsh-smm-s2/nand-full.lst | 2 ++
 1 file changed, 2 insertions(+)

Comments

'Thomas Petazzoni' via Amarula Linux May 17, 2025, 10:46 a.m. UTC | #1
On Thu, 15 May 2025 17:45:04 +0200
Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote:

> From: Michael Trimarchi <michael@amarulasolutions.com>
> 
> If an attempt is made to create a UBI volume and it already exists, the
> operation fails. Therefore, before requesting the creation of a UBI
> volume, we erase the entire NAND to ensure that no errors occur.
> 
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>  board/bsh/imx8mn-bsh-smm-s2/nand-full.lst | 2 ++
>  1 file changed, 2 insertions(+)

Applied to master, thanks.

Thomas

Patch

diff --git a/board/bsh/imx8mn-bsh-smm-s2/nand-full.lst b/board/bsh/imx8mn-bsh-smm-s2/nand-full.lst
index c01d2d6c1dac..f5b94c24d83b 100644
--- a/board/bsh/imx8mn-bsh-smm-s2/nand-full.lst
+++ b/board/bsh/imx8mn-bsh-smm-s2/nand-full.lst
@@ -10,6 +10,8 @@  SDPS: boot -f _flash.bin
 
 FB: ucmd setenv fastboot_buffer ${loadaddr}
 FB: download -f _image
+FB[-t 10000]: ucmd nand erase.chip
+
 # Burn image to nandfit partition if needed
 FB: ucmd if env exists nandfit_part; then nand erase.part nandfit; nand write ${fastboot_buffer} nandfit ${filesize}; else true; fi;
 FB: ucmd nandbcb init ${fastboot_buffer} nandboot ${filesize}