Skip to contentSkip to conversation

board: toradex: improve env badblock management for NAND variant boards

PATCH In review Francesco Dolcini 2 participants 8 messages Sep 1, 2021 – Feb 5, 2022 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

cover board: toradex: improve env badblock management for NAND variant boards

Use the complete 512kb (4 blocks) nand partition reserved for u-boot environment instead of just the first block, this allows the module to have a working environment even if 3 blocks are bad.

Francesco Dolcini (2):
colibri-imx6ull: improve env badblock management
colibri-imx7: improve env badblock management

 include/configs/colibri-imx6ull.h | 5 +++++
 include/configs/colibri_imx7.h    | 5 +++++
 2 files changed, 10 insertions(+)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/2 colibri-imx6ull: improve env badblock management

Use the complete 512kb (4 blocks) nand partition reserved for u-boot environment instead of just the first block, this allows the module to have a working environment even if 3 blocks are bad.

---

 include/configs/colibri-imx6ull.h | 5 +++++
 1 file changed, 5 insertions(+)
include/configs/colibri-imx6ull.h +5 -0
index 2fa3485173..a2753f8840 100644
@@ -124,6 +124,11 @@
 #define CONFIG_SYS_INIT_SP_ADDR \
 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
+/* environment organization */
+#if defined(CONFIG_ENV_IS_IN_NAND)
+#define CONFIG_ENV_RANGE	(4 * CONFIG_ENV_SIZE)
+#endif
+
 /* NAND stuff */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 /* used to initialize CONFIG_SYS_NAND_BASE_LIST which is unused */
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/2 colibri-imx7: improve env badblock management

In reply to Francesco Dolcini

Use the complete 512kb (4 blocks) nand partition reserved for u-boot environment instead of just the first block, this allows the module to have a working environment even if 3 blocks are bad.

---

 include/configs/colibri_imx7.h | 5 +++++
 1 file changed, 5 insertions(+)
include/configs/colibri_imx7.h +5 -0
index 2fffaa39c0..c3e12c81c9 100644
@@ -192,6 +192,11 @@
 #define CONFIG_SYS_INIT_SP_ADDR \
 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
+/* environment organization */
+#if defined(CONFIG_ENV_IS_IN_NAND)
+#define CONFIG_ENV_RANGE	(4 * CONFIG_ENV_SIZE)
+#endif
+
 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
 /* NAND stuff */
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
Signature · 1 line
2.25.1
#3 lore raw

PATCH 2/2 colibri-imx7: improve env badblock management

Quoted 4 lines

Use the complete 512kb (4 blocks) nand partition reserved for u-boot environment instead of just the first block, this allows the module to have a working environment even if 3 blocks are bad.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#4 lore raw
In reply to Francesco Dolcini

Hi Francesco,

Quoted 6 lines · Francesco Dolcini

Use the complete 512kb (4 blocks) nand partition reserved for u-boot environment instead of just the first block, this allows the module to have a working environment even if 3 blocks are bad.

Quoted 8 lines

Francesco Dolcini (2):
colibri-imx6ull: improve env badblock management
colibri-imx7: improve env badblock management

  include/configs/colibri-imx6ull.h | 5 +++++
  include/configs/colibri_imx7.h    | 5 +++++
  2 files changed, 10 insertions(+)

Sure, but is it not time to move CONFIG_ENV_RANGE into Kconfig (and drop it from whitelist= ?

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#5 lore raw

Hello Stefano,

Quoted 11 lines · Stefano Babic
Quoted 10 lines · Francesco Dolcini

Use the complete 512kb (4 blocks) nand partition reserved for u-boot environment instead of just the first block, this allows the module to have a working environment even if 3 blocks are bad.

Francesco Dolcini (2):
colibri-imx6ull: improve env badblock management
colibri-imx7: improve env badblock management

Quoted 7 lines
Quoted 4 lines
  include/configs/colibri-imx6ull.h | 5 +++++
  include/configs/colibri_imx7.h    | 5 +++++
  2 files changed, 10 insertions(+)

Sure, but is it not time to move CONFIG_ENV_RANGE into Kconfig (and drop it from whitelist= ?

I'll try to have a look at it later tonight, I cannot warrant anything at the moment.

Francesco

#6 lore raw

Hello Stefano,

Quoted 17 lines · Francesco Dolcini
Quoted 16 lines · Stefano Babic
Quoted 14 lines · Francesco Dolcini

Use the complete 512kb (4 blocks) nand partition reserved for u-boot environment instead of just the first block, this allows the module to have a working environment even if 3 blocks are bad.

Francesco Dolcini (2):
colibri-imx6ull: improve env badblock management
colibri-imx7: improve env badblock management

  include/configs/colibri-imx6ull.h | 5 +++++
  include/configs/colibri_imx7.h    | 5 +++++
  2 files changed, 10 insertions(+)
Quoted 5 lines
Quoted 2 lines

Sure, but is it not time to move CONFIG_ENV_RANGE into Kconfig (and drop it from whitelist= ?

I'll try to have a look at it later tonight, I cannot warrant anything at the moment.

So, I gave it a try, but it is not trivial (CONFIG_ENV_RANGE is using most of the time other CONFIG options that are not in kconfig yet) :-/

At the moment I have no much time to invest on this topic, I hope it would be fine to merge these 2 patches as they are.

Francesco

#7 lore raw

Hi Francesco,

Quoted 23 lines · Francesco Dolcini

Hello Stefano,

Quoted 20 lines · Francesco Dolcini
Quoted 18 lines · Stefano Babic
Quoted 6 lines · Francesco Dolcini

Use the complete 512kb (4 blocks) nand partition reserved for u-boot environment instead of just the first block, this allows the module to have a working environment even if 3 blocks are bad.

Quoted 8 lines

Francesco Dolcini (2):
colibri-imx6ull: improve env badblock management
colibri-imx7: improve env badblock management

   include/configs/colibri-imx6ull.h | 5 +++++
   include/configs/colibri_imx7.h    | 5 +++++
   2 files changed, 10 insertions(+)

Sure, but is it not time to move CONFIG_ENV_RANGE into Kconfig (and drop it from whitelist= ?

Quoted 8 lines
Quoted 2 lines

I'll try to have a look at it later tonight, I cannot warrant anything at the moment.

So, I gave it a try, but it is not trivial (CONFIG_ENV_RANGE is using most of the time other CONFIG options that are not in kconfig yet) :-/

At the moment I have no much time to invest on this topic, I hope it would be fine to merge these 2 patches as they are.

Ok, I will merge your patches into u-boot-imx.

Best regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================