Skip to contentSkip to conversation

Complete the migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT

PATCH In review Patrick Delaunay 3 participants 9 messages Dec 7, 2022 – Dec 13, 2022 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

cover Complete the migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT

Addition for previous commit a331017c237c ("Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment")

Remove the remaining defines MTDPARTS_DEFAULT and MTDIDS_DEFAULT in the configuration files (include/configs/*.h).

After this serie, the only remaining references of these 2 defines are located in cmd/mtdparts.c and only for local purpose when CONFIG_MTDIDS_DEFAULT or CONFIG_MTDPART_DEFAULT are not defined.

Patrick.

Patrick Delaunay (5):
configs: am333x_guardian: move MTDIDS_DEFAULT in defconfif
configs: x530: move MTDPART/MTDIDS_DEFAULT in defconfig
configs: SBx81LIFXCAT: move MTDPART_DEFAULT in defconfig
configs: SBx81LIFKW: move MTDPART_DEFAULT in defconfig
configs: remove support of MTDIDS_DEFAULT/MTDPARTS_DEFAULT

 cmd/mtdparts.c                    | 5 +----
 configs/SBx81LIFKW_defconfig      | 1 +
 configs/SBx81LIFXCAT_defconfig    | 1 +
 configs/am335x_guardian_defconfig | 1 +
 configs/x530_defconfig            | 2 ++
 drivers/mtd/mtd_uboot.c           | 4 ----
 include/configs/SBx81LIFKW.h      | 1 -
 include/configs/SBx81LIFXCAT.h    | 1 -
 include/configs/am335x_guardian.h | 1 -
 include/configs/x530.h            | 2 --
 10 files changed, 6 insertions(+), 13 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/5 configs: am333x_guardian: move MTDIDS_DEFAULT in defconfif

Replace MTDIDS_DEFAULT in config include file by CONFIG_MTDIDS_DEFAULT in defonfig to complete the Kconfig migration

---

 configs/am335x_guardian_defconfig | 1 +
 include/configs/am335x_guardian.h | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
configs/am335x_guardian_defconfig +1 -0
index fef4fd155100..0feac53c3509 100644
@@ -64,6 +64,7 @@ CONFIG_SYS_DISABLE_AUTOLOAD=y
 CONFIG_CMD_BMP=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=nand.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=nand.0:256k(SPL),256k(SPL.backup1),256k(SPL.backup2),256k(SPL.backup3),1m(u-boot),1m(u-boot.backup1),1m(u-boot-2),1m(u-boot-2.backup1),256k(u-boot-env),256k(u-boot-env.backup1),256k(splash-screen),-(UBI)"
 CONFIG_CMD_UBI=y
 # CONFIG_SPL_DOS_PARTITION is not set
include/configs/am335x_guardian.h +0 -1
index 7c5e7ce475ef..a5b83b0c25dd 100644
@@ -115,7 +115,6 @@
 			}
 #define CFG_SYS_NAND_ECCSIZE         512
 #define CFG_SYS_NAND_ECCBYTES        26
-#define MTDIDS_DEFAULT                  "nand0=nand.0"
 
 #endif /* CONFIG_MTD_RAW_NAND */
 
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 1/5] configs: am333x_guardian: move MTDIDS_DEFAULT in defconfif

Quoted 4 lines · Patrick Delaunay

Replace MTDIDS_DEFAULT in config include file by CONFIG_MTDIDS_DEFAULT in defonfig to complete the Kconfig migration

For the series, applied to u-boot/next, thanks!

Signature · 1 line
Tom
#3 lore raw

PATCH 2/5 configs: x530: move MTDPART/MTDIDS_DEFAULT in defconfig

In reply to Patrick Delaunay

Replace MTDIDS_DEFAULT and MTDPARTS_DEFAULT in the config include file by CONFIG_MTDIDS_DEFAULT and CONFIG_MTDPARTS_DEFAULT in defconfig to complete the Kconfig migration.

---

 configs/x530_defconfig | 2 ++
 include/configs/x530.h | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
configs/x530_defconfig +2 -0
index 2f8be2fcd776..70c08adcde97 100644
@@ -57,6 +57,8 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
 CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=nand"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=nand:240M(user),8M(errlog),8M(nand-bbt)"
 CONFIG_CMD_UBI=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ARP_TIMEOUT=200
include/configs/x530.h +0 -2
index dee87cb77325..c213dc6074b0 100644
@@ -32,8 +32,6 @@
 
 /* SPI NOR flash default params, used by sf commands */
 
-#define MTDIDS_DEFAULT			"nand0=nand"
-#define MTDPARTS_DEFAULT		"mtdparts=nand:240M(user),8M(errlog),8M(nand-bbt)"
 #define MTDPARTS_MTDOOPS		"errlog"
 
 /* Partition support */
Signature · 1 line
2.25.1
#4 lore raw

PATCH 3/5 configs: SBx81LIFXCAT: move MTDPART_DEFAULT in defconfig

In reply to Patrick Delaunay

Replace MTDPARTS_DEFAULT in the config include file by CONFIG_MTDPARTS_DEFAULT in defconfig to complete the Kconfig migration.

---

 configs/SBx81LIFXCAT_defconfig | 1 +
 include/configs/SBx81LIFXCAT.h | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
configs/SBx81LIFXCAT_defconfig +1 -0
index 125871301e34..80dbbb11c9ba 100644
@@ -35,6 +35,7 @@ CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_SNTP=y
 # CONFIG_CMD_LED is not set
+CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0.0:768K(boot)ro,256K(boot-env),14M(user),1M(errlog)"
 CONFIG_DOS_PARTITION=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
include/configs/SBx81LIFXCAT.h +0 -1
index 9a9663b34ba8..23d37394e076 100644
@@ -21,7 +21,6 @@
  * for your console driver.
  */
 
-#define MTDPARTS_DEFAULT "mtdparts=spi0.0:768K(boot)ro,256K(boot-env),14M(user),1M(errlog)"
 #define MTDPARTS_MTDOOPS "errlog"
 
 /*
Signature · 1 line
2.25.1
#5 lore raw

PATCH 4/5 configs: SBx81LIFKW: move MTDPART_DEFAULT in defconfig

In reply to Patrick Delaunay

Replace MTDPARTS_DEFAULT in the config include file by CONFIG_MTDPARTS_DEFAULT in defconfig to complete the Kconfig migration.

---

 configs/SBx81LIFKW_defconfig | 1 +
 include/configs/SBx81LIFKW.h | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
configs/SBx81LIFKW_defconfig +1 -0
index fa7c35b9ef77..e53f2489c5d0 100644
@@ -34,6 +34,7 @@ CONFIG_BOOTP_NTPSERVER=y
 CONFIG_CMD_MII=y
 CONFIG_CMD_PING=y
 CONFIG_CMD_SNTP=y
+CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0.0:768K(boot)ro,256K(boot-env),14M(user),1M(errlog)"
 CONFIG_DOS_PARTITION=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
include/configs/SBx81LIFKW.h +0 -1
index bad34d9771ec..d5c9c05767a0 100644
@@ -21,7 +21,6 @@
  * for your console driver.
  */
 
-#define MTDPARTS_DEFAULT "mtdparts=spi0.0:768K(boot)ro,256K(boot-env),14M(user),1M(errlog)"
 #define MTDPARTS_MTDOOPS "errlog"
 
 /*
Signature · 1 line
2.25.1
#6 lore raw

PATCH 5/5 configs: remove support of MTDIDS_DEFAULT/MTDPARTS_DEFAULT

In reply to Patrick Delaunay

Complete the migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT in Kconfig; this patch removes the support of MTDIDS_DEFAULT / MTDPARTS_DEFAULT in the configuration files (include/configs/*.h).

---

 cmd/mtdparts.c          | 5 +----
 drivers/mtd/mtd_uboot.c | 4 ----
 2 files changed, 1 insertion(+), 8 deletions(-)
cmd/mtdparts.c +1 -4
index bab75a262f3a..0984158f41ea 100644
@@ -111,20 +111,17 @@ DECLARE_GLOBAL_DATA_PTR;
 #define MTD_WRITEABLE_CMD		1
 
 /* default values for mtdids and mtdparts variables */
-#if !defined(MTDIDS_DEFAULT)
 #ifdef CONFIG_MTDIDS_DEFAULT
 #define MTDIDS_DEFAULT CONFIG_MTDIDS_DEFAULT
 #else
 #define MTDIDS_DEFAULT NULL
 #endif
-#endif
-#if !defined(MTDPARTS_DEFAULT)
 #ifdef CONFIG_MTDPARTS_DEFAULT
 #define MTDPARTS_DEFAULT CONFIG_MTDPARTS_DEFAULT
 #else
 #define MTDPARTS_DEFAULT NULL
 #endif
-#endif
+
 #if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
 extern void board_mtdparts_default(const char **mtdids, const char **mtdparts);
 #endif
drivers/mtd/mtd_uboot.c +0 -4
index dd0b0242f95f..14ce726b10d8 100644
@@ -30,8 +30,6 @@ static const char *get_mtdids(void)
 
 #if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
 	board_mtdparts_default(&mtdids, &mtdparts);
-#elif defined(MTDIDS_DEFAULT)
-	mtdids = MTDIDS_DEFAULT;
 #elif defined(CONFIG_MTDIDS_DEFAULT)
 	mtdids = CONFIG_MTDIDS_DEFAULT;
 #endif
@@ -147,8 +145,6 @@ static const char *get_mtdparts(void)
 
 #if defined(CONFIG_SYS_MTDPARTS_RUNTIME)
 	board_mtdparts_default(&mtdids, &mtdparts);
-#elif defined(MTDPARTS_DEFAULT)
-	mtdparts = MTDPARTS_DEFAULT;
 #elif defined(CONFIG_MTDPARTS_DEFAULT)
 	mtdparts = CONFIG_MTDPARTS_DEFAULT;
 #endif
Signature · 1 line
2.25.1
#7 lore raw
In reply to Patrick Delaunay
Quoted 9 lines · Patrick Delaunay

Addition for previous commit a331017c237c ("Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment")

Remove the remaining defines MTDPARTS_DEFAULT and MTDIDS_DEFAULT in the configuration files (include/configs/*.h).

After this serie, the only remaining references of these 2 defines are located in cmd/mtdparts.c and only for local purpose when CONFIG_MTDIDS_DEFAULT or CONFIG_MTDPART_DEFAULT are not defined.

Thanks for doing this! I suspect this means I can follow-up and remove the defaults from cmd/mtparts.c later.

Signature · 1 line
Tom
Reviewed-by on the v1 series
#8 lore raw
In reply to Patrick Delaunay
Quoted 13 lines · Patrick Delaunay

Addition for previous commit a331017c237c ("Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment")

Remove the remaining defines MTDPARTS_DEFAULT and MTDIDS_DEFAULT in the configuration files (include/configs/*.h).

After this serie, the only remaining references of these 2 defines are located in cmd/mtdparts.c and only for local purpose when CONFIG_MTDIDS_DEFAULT or CONFIG_MTDPART_DEFAULT are not defined.

Patrick.

Quoted 6 lines

Patrick Delaunay (5):
configs: am333x_guardian: move MTDIDS_DEFAULT in defconfif
configs: x530: move MTDPART/MTDIDS_DEFAULT in defconfig
configs: SBx81LIFXCAT: move MTDPART_DEFAULT in defconfig
configs: SBx81LIFKW: move MTDPART_DEFAULT in defconfig
configs: remove support of MTDIDS_DEFAULT/MTDPARTS_DEFAULT

For x530, SBx81LIFXCAT and SBx81LIFKW

Quoted 12 lines
  cmd/mtdparts.c                    | 5 +----
  configs/SBx81LIFKW_defconfig      | 1 +
  configs/SBx81LIFXCAT_defconfig    | 1 +
  configs/am335x_guardian_defconfig | 1 +
  configs/x530_defconfig            | 2 ++
  drivers/mtd/mtd_uboot.c           | 4 ----
  include/configs/SBx81LIFKW.h      | 1 -
  include/configs/SBx81LIFXCAT.h    | 1 -
  include/configs/am335x_guardian.h | 1 -
  include/configs/x530.h            | 2 --
  10 files changed, 6 insertions(+), 13 deletions(-)