Skip to contentSkip to conversation

Separate mtdparts command from jffs2

PATCH Superseded Stefan Roese 3 participants 9 messages Mar 19, 2009 – May 16, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

---
v4:
- Keep config_cmd_all.h sorted
- Add "mtd_" to the names of some now non-static functions
- Cleanup of "jffs2" names and comments in cmd_mtdparts.c

v3:
- Keep lists sorted (README, Makefile) as pointed out by Wolfgang
- Generated without find-copies-harder

v2:
This patch is based in the original version by Kyungmin Park with some additional changes by Jean-Christophe Plagniol-Villard. Changes are the patch description and removal of the compilation errors/warnings.

 README                                 |    1 +
 board/fads/fads.h                      |    4 +-
 common/Makefile                        |    1 +
 common/cmd_flash.c                     |   18 +-
 common/cmd_jffs2.c                     | 1731 +-------------------------------
 common/{cmd_jffs2.c => cmd_mtdparts.c} |  432 +--------
 common/cmd_nand.c                      |   10 +-
 include/config_cmd_all.h               |    1 +
 include/configs/ADNPESC1.h             |    4 +-
 include/configs/Alaska8220.h           |    4 +-
 include/configs/BAB7xx.h               |    4 +-
 include/configs/BC3450.h               |    2 +-
 include/configs/CATcenter.h            |    4 +-
 include/configs/DB64360.h              |    4 +-
 include/configs/DB64460.h              |    4 +-
 include/configs/DK1C20.h               |    4 +-
 include/configs/DK1S10.h               |    4 +-
 include/configs/ELPPC.h                |    4 +-
 include/configs/FPS850L.h              |    2 +-
 include/configs/FPS860L.h              |    2 +-
 include/configs/LANTEC.h               |    4 +-
 include/configs/MHPC.h                 |    4 +-
 include/configs/MIP405.h               |    4 +-
 include/configs/ML2.h                  |    4 +-
 include/configs/MPC8266ADS.h           |    4 +-
 include/configs/NC650.h                |    4 +-
 include/configs/NETTA.h                |    4 +-
 include/configs/PPChameleonEVB.h       |    4 +-
 include/configs/R360MPI.h              |    4 +-
 include/configs/RBC823.h               |    4 +-
 include/configs/Rattler.h              |    4 +-
 include/configs/SIMPC8313.h            |    2 +-
 include/configs/SXNI855T.h             |    4 +-
 include/configs/TB5200.h               |    2 +-
 include/configs/TQM5200.h              |    2 +-
 include/configs/TQM823L.h              |    2 +-
 include/configs/TQM823M.h              |    2 +-
 include/configs/TQM834x.h              |    2 +-
 include/configs/TQM850L.h              |    2 +-
 include/configs/TQM850M.h              |    2 +-
 include/configs/TQM855L.h              |    2 +-
 include/configs/TQM855M.h              |    2 +-
 include/configs/TQM85xx.h              |    4 +-
 include/configs/TQM860L.h              |    2 +-
 include/configs/TQM860M.h              |    2 +-
 include/configs/TQM862L.h              |    2 +-
 include/configs/TQM862M.h              |    2 +-
 include/configs/TQM866M.h              |    2 +-
 include/configs/ZUMA.h                 |    4 +-
 include/configs/apollon.h              |    2 +-
 include/configs/cm5200.h               |    2 +-
 include/configs/debris.h               |    4 +-
 include/configs/ep7312.h               |    4 +-
 include/configs/ep8260.h               |    4 +-
 include/configs/fx12mm.h               |    2 +-
 include/configs/hymod.h                |    4 +-
 include/configs/idmr.h                 |    2 +-
 include/configs/impa7.h                |    4 +-
 include/configs/imx31_litekit.h        |    2 +-
 include/configs/imx31_phycore.h        |    2 +-
 include/configs/incaip.h               |    4 +-
 include/configs/innokom.h              |    4 +-
 include/configs/microblaze-generic.h   |    2 +-
 include/configs/modnet50.h             |    4 +-
 include/configs/motionpro.h            |    2 +-
 include/configs/mx1fs2.h               |    4 +-
 include/configs/mx31ads.h              |    2 +-
 include/configs/netstar.h              |    2 +-
 include/configs/omap2420h4.h           |    4 +-
 include/configs/qong.h                 |    2 +-
 include/configs/sc3.h                  |    2 +-
 include/configs/sc520_cdp.h            |    4 +-
 include/configs/sc520_spunk.h          |    4 +-
 include/configs/smmaco4.h              |    2 +-
 include/configs/trab.h                 |    2 +-
 include/configs/v37.h                  |    4 +-
 include/configs/vct.h                  |    2 +-
 include/configs/virtlab2.h             |    2 +-
 include/configs/voiceblue.h            |    2 +-
 include/configs/xilinx-ppc.h           |    4 +-
 include/configs/xsengine.h             |    4 +-
 81 files changed, 164 insertions(+), 2256 deletions(-)
 copy common/{cmd_jffs2.c => cmd_mtdparts.c} (82%)
README +1 -0
index 46181a4..32d9acd 100644
@@ -636,6 +636,7 @@ The following options need to be configured:
 		CONFIG_CMD_MISC		  Misc functions like sleep etc
 		CONFIG_CMD_MMC		* MMC memory mapped support
 		CONFIG_CMD_MII		* MII utility commands
+		CONFIG_CMD_MTDPARTS	* MTD partition support
 		CONFIG_CMD_NAND		* NAND support
 		CONFIG_CMD_NET		  bootp, tftpboot, rarpboot
 		CONFIG_CMD_PCA953X	* PCA953x I2C gpio commands
board/fads/fads.h +2 -2
index 24e43ea..4ab4b26 100644
@@ -241,7 +241,7 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -249,7 +249,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=fads0,nor1=fads-1,nor2=fads-2,nor3=fads-3"
 #define MTDPARTS_DEFAULT	"mtdparts=fads-0:- at 1m(user1),fads-1:-(user2),fads-2:-(user3),fads-3:-(user4)"
 */
common/Makefile +1 -0
index f13cd11..7237ff4 100644
@@ -110,6 +110,7 @@ COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
 COBJS-$(CONFIG_MP) += cmd_mp.o
+COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
 COBJS-y += cmd_nand.o
 COBJS-$(CONFIG_CMD_NET) += cmd_net.o
 COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
common/cmd_flash.c +9 -9
index 510654e..f1f3517 100644
@@ -31,12 +31,12 @@
 #include <dataflash.h>
 #endif
 
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 #include <jffs2/jffs2.h>
 
 /* parition handling routines */
 int mtdparts_init(void);
-int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num);
+int mtd_id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num);
 int find_dev_and_part(const char *id, struct mtd_device **dev,
 		u8 *part_num, struct part_info **part);
 #endif
@@ -325,7 +325,7 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 	flash_info_t *info;
 	ulong bank, addr_first, addr_last;
 	int n, sect_first, sect_last;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 	struct mtd_device *dev;
 	struct part_info *part;
 	u8 dev_type, dev_num, pnum;
@@ -357,9 +357,9 @@ int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		return rcode;
 	}
 
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 	/* erase <part-id> - erase partition */
-	if ((argc == 2) && (id_parse(argv[1], NULL, &dev_type, &dev_num) == 0)) {
+	if ((argc == 2) && (mtd_id_parse(argv[1], NULL, &dev_type, &dev_num) == 0)) {
 		mtdparts_init();
 		if (find_dev_and_part(argv[1], &dev, &pnum, &part) == 0) {
 			if (dev->id->type == MTD_DEV_TYPE_NOR) {
@@ -470,7 +470,7 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 #endif /* CONFIG_SYS_NO_FLASH */
 	ulong addr_first, addr_last;
 	int p;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 	struct mtd_device *dev;
 	struct part_info *part;
 	u8 dev_type, dev_num, pnum;
@@ -563,9 +563,9 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 		return rcode;
 	}
 
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 	/* protect on/off <part-id> */
-	if ((argc == 3) && (id_parse(argv[2], NULL, &dev_type, &dev_num) == 0)) {
+	if ((argc == 3) && (mtd_id_parse(argv[2], NULL, &dev_type, &dev_num) == 0)) {
 		mtdparts_init();
 		if (find_dev_and_part(argv[2], &dev, &pnum, &part) == 0) {
 			if (dev->id->type == MTD_DEV_TYPE_NOR) {
@@ -698,7 +698,7 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
 
 
 /**************************************************/
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 # define TMP_ERASE	"erase <part-id>\n    - erase partition\n"
 # define TMP_PROT_ON	"protect on <part-id>\n    - protect partition\n"
 # define TMP_PROT_OFF	"protect off <part-id>\n    - make partition writable\n"
common/cmd_jffs2.c +6 -1725

1,789 lines not on this page · raw message

common/cmd_mtdparts.c renamed from common/cmd_jffs2.c +28 -404

638 lines not on this page · raw message

common/cmd_nand.c +5 -5
index e6623ca..04b3200 100644
@@ -29,7 +29,7 @@
 #include <jffs2/jffs2.h>
 #include <nand.h>
 
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 
 /* parition handling routines */
 int mtdparts_init(void);
@@ -105,7 +105,7 @@ static int
 arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size)
 {
 	int idx = nand_curr_device;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 	struct mtd_device *dev;
 	struct part_info *part;
 	u8 pnum;
@@ -153,7 +153,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size
 		*size = nand->size - *off;
 	}
 
-#if  defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if  defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 out:
 #endif
 	printf("device %d ", idx);
@@ -589,7 +589,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 	char *boot_device = NULL;
 	int idx;
 	ulong addr, offset = 0;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 	struct mtd_device *dev;
 	struct part_info *part;
 	u8 pnum;
@@ -634,7 +634,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 		offset = simple_strtoul(argv[3], NULL, 16);
 		break;
 	default:
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_CMDLINE)
+#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
 usage:
 #endif
 		cmd_usage(cmdtp);
include/config_cmd_all.h +1 -0
index 205dd1f..db1f55c 100644
@@ -58,6 +58,7 @@
 #define CONFIG_CMD_MII		/* MII support			*/
 #define CONFIG_CMD_MISC		/* Misc functions like sleep etc*/
 #define CONFIG_CMD_MMC		/* MMC support			*/
+#define CONFIG_CMD_MTDPARTS	/* mtd parts support		*/
 #define CONFIG_CMD_NAND		/* NAND support			*/
 #define CONFIG_CMD_NET		/* bootp, tftpboot, rarpboot	*/
 #define CONFIG_CMD_NFS		/* NFS support			*/
include/configs/ADNPESC1.h +2 -2
index e61a3e1..0977bee 100644
@@ -673,14 +673,14 @@
  *
  */
 /* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
 
 /* mtdparts command line support */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		""
 #define MTDPARTS_DEFAULT	""
 */
include/configs/Alaska8220.h +2 -2
index 2581fdf..576aa74 100644
@@ -320,7 +320,7 @@
 
 /* No command line, one static partition */
 /*
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0x00400000
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -328,7 +328,7 @@
 
 /* mtdparts command line support */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=alaska-0"
 #define MTDPARTS_DEFAULT	"mtdparts=alaska-0:4m(user)"
 */
include/configs/BAB7xx.h +2 -2
index 1910b34..40a1c40 100644
@@ -219,7 +219,7 @@
  *
  */
 /* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -229,7 +229,7 @@
  * Note: fake mtd_id used, no linux mtd map file
  */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=bab7xx-0"
 #define MTDPARTS_DEFAULT	"mtdparts=bab7xx-0:-(jffs2)"
 */
include/configs/BC3450.h +1 -1
index bced118..9934f29 100644
@@ -346,7 +346,7 @@
 #define CONFIG_SYS_FLASH_WRITE_TOUT	500	/* Flash Write Timeout (in ms)	*/
 
 /* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM5200-0"
 #define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:640k(firmware),"	\
 						"1408k(kernel),"	\
include/configs/CATcenter.h +2 -2
index fa9fc23..39f41e6 100644
@@ -781,7 +781,7 @@
  *
  */
 /* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nand"
 #define CONFIG_JFFS2_PART_SIZE		0x00200000
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -791,7 +791,7 @@
  * Note: fake mtd_id used, no linux mtd map file
  */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nand0=catcenter"
 #define MTDPARTS_DEFAULT	"mtdparts=catcenter:2m(nand)"
 */
include/configs/DB64360.h +2 -2
index daed934..160871b 100644
@@ -230,7 +230,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor1"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -242,7 +242,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  * Note: fake mtd_id's used, no linux mtd map file.
  */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor1=db64360-1"
 #define MTDPARTS_DEFAULT	"mtdparts=db64360-1:-(jffs2)"
 */
include/configs/DB64460.h +2 -2
index 604fd45..06fd157 100644
@@ -168,7 +168,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor1"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -180,7 +180,7 @@ ip=${ipaddr}:${serverip}${bootargs_end}; bootm 0x400000;\0"
  * Note: fake mtd_id's used, no linux mtd map file.
  */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor1=db64460-1"
 #define MTDPARTS_DEFAULT	"mtdparts=db64460-1:-(jffs2)"
 */
include/configs/DK1C20.h +2 -2
index 6fdc566..db9c17d 100644
@@ -539,14 +539,14 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
 
 /* mtdparts command line support */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		""
 #define MTDPARTS_DEFAULT	""
 */
include/configs/DK1S10.h +2 -2
index 1d031f1..3bd270c 100644
@@ -545,14 +545,14 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
 
 /* mtdparts command line support */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		""
 #define MTDPARTS_DEFAULT	""
 */
include/configs/ELPPC.h +2 -2
index 7939266..d2aa8b9 100644
@@ -196,7 +196,7 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -204,7 +204,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=elppc-0,nor1=elppc-1"
 #define MTDPARTS_DEFAULT	"mtdparts=elppc-0:-(jffs2),elppc-1:-(user)"
 */
include/configs/FPS850L.h +1 -1
index 08408e2..f152230 100644
@@ -216,7 +216,7 @@
 /*-----------------------------------------------------------------------
  * Dynamic MTD partition support
  */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM8xxL-0"
 
 #define MTDPARTS_DEFAULT	"mtdparts=TQM8xxL-0:256k(u-boot),"	\
include/configs/FPS860L.h +1 -1
index e5f3b60..5eaed84 100644
@@ -216,7 +216,7 @@
 /*-----------------------------------------------------------------------
  * Dynamic MTD partition support
  */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM8xxL-0"
 
 #define MTDPARTS_DEFAULT	"mtdparts=TQM8xxL-0:256k(u-boot),"	\
include/configs/LANTEC.h +2 -2
index f14d945..6e8a4b8 100644
@@ -352,14 +352,14 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
 
 /* mtdparts command line support */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		""
 #define MTDPARTS_DEFAULT	""
 */
include/configs/MHPC.h +2 -2
index 8e7f9cd..19a288c 100644
@@ -200,7 +200,7 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -208,7 +208,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=mhpc-0"
 #define MTDPARTS_DEFAULT	"mtdparts=mhpc-0:-(jffs2)"
 */
include/configs/MIP405.h +2 -2
index c58ce05..a3869c8 100644
@@ -243,7 +243,7 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -251,7 +251,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=mip405-0"
 #define MTDPARTS_DEFAULT	"mtdparts=mip405-0:-(jffs2)"
 */
include/configs/ML2.h +2 -2
index 1902397..5fcc173 100644
@@ -249,7 +249,7 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00080000
@@ -257,7 +257,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=ml2-0"
 #define MTDPARTS_DEFAULT	"mtdparts=ml2-0:- at 512k(jffs2)"
 */
include/configs/MPC8266ADS.h +2 -2
index fe1cc17..4fd86d3 100644
@@ -563,14 +563,14 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
 
 /* mtdparts command line support */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		""
 #define MTDPARTS_DEFAULT	""
 */
include/configs/NC650.h +2 -2
index 0b97f0c..6343cfe 100644
@@ -440,13 +440,13 @@
  */
 
 /* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nand0"
 #define CONFIG_JFFS2_PART_SIZE		0x00400000
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
 
 /* mtdparts command line support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=nc650-0,nand0=nc650-nand"
 
 #define MTDPARTS_DEFAULT	"mtdparts=nc650-0:1m(kernel1),1m(kernel2)," \
include/configs/NETTA.h +2 -2
index 34fdba5..724e807 100644
@@ -702,7 +702,7 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nand0"
 #define CONFIG_JFFS2_PART_SIZE		0x00100000
 #define CONFIG_JFFS2_PART_OFFSET	0x00200000
@@ -710,7 +710,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nand0=netta-nand"
 #define MTDPARTS_DEFAULT	"mtdparts=netta-nand:1m at 2m(jffs2)"
 */
include/configs/PPChameleonEVB.h +2 -2
index d2eae1d..16baf8c 100644
@@ -804,14 +804,14 @@
  */
 
 /* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nand0"
 #define CONFIG_JFFS2_PART_SIZE		0x00400000
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
 
 /* mtdparts command line support */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=PPChameleon-0,nand0=ppchameleonevb-nand"
 */
 
include/configs/R360MPI.h +2 -2
index bab4460..830f4bc 100644
@@ -167,14 +167,14 @@
  */
 /* No command line, one static partition
  * use all the space starting at offset 3MB*/
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00300000
 
 /* mtdparts command line support */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=r360-0"
 #define MTDPARTS_DEFAULT	"mtdparts=r360-0:- at 3m(user)"
 */
include/configs/RBC823.h +2 -2
index 280175a..f36244d 100644
@@ -429,7 +429,7 @@
  *
  */
 /* No command line, one static partition, whole device */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00000000
@@ -437,7 +437,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		""
 #define MTDPARTS_DEFAULT	""
 */
include/configs/Rattler.h +2 -2
index 01d0d5f..5b6f271 100644
@@ -202,7 +202,7 @@
  *
  */
 /* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 #define CONFIG_JFFS2_DEV		"nor0"
 #define CONFIG_JFFS2_PART_SIZE		0xFFFFFFFF
 #define CONFIG_JFFS2_PART_OFFSET	0x00100000
@@ -210,7 +210,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=rattler-0"
 #define MTDPARTS_DEFAULT	"mtdparts=rattler-0:- at 1m(jffs2)"
 */
include/configs/SIMPC8313.h +1 -1
index b939cfa..e20527e 100644
@@ -189,7 +189,7 @@
 #define CONFIG_JFFS2_DEV	"nand0"
 
 /* mtdparts command line support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nand0=nand0"
 #define MTDPARTS_DEFAULT	"mtdparts=nand0:2M(u-boot),6M(kernel),-(jffs2)"
 
include/configs/SXNI855T.h +2 -2
index 9857bf6..cac04b4 100644
@@ -174,7 +174,7 @@
  *
  */
 /* No command line, one static partition */
-#undef CONFIG_JFFS2_CMDLINE
+#undef CONFIG_CMD_MTDPARTS
 
 /*
 #define CONFIG_JFFS2_DEV		"nor0"
@@ -189,7 +189,7 @@
 /* mtdparts command line support */
 /* Note: fake mtd_id used, no linux mtd map file */
 /*
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=sixnet-0,nand0=sixnet-nand"
 #define MTDPARTS_DEFAULT	"mtdparts=sixnet-0:7680k at 512k();sixnet-nand:2m(jffs2-nand)"
 */
include/configs/TB5200.h +1 -1
index b42d3d9..92b4fa5 100644
@@ -275,7 +275,7 @@
 					   (= chip selects) */
 
 /* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM5200-0"
 #if defined(CONFIG_TQM5200_B)
 #define MTDPARTS_DEFAULT	"mtdparts=TQM5200-0:768k(firmware),"	\
include/configs/TQM5200.h +1 -1
index 6850eba..d374981 100644
@@ -407,7 +407,7 @@
 #endif
 
 /* Dynamic MTD partition support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM5200-0"
 
 #ifdef CONFIG_STK52XX
include/configs/TQM823L.h +1 -1
index 8934d51..87e5a65 100644
@@ -231,7 +231,7 @@
 /*-----------------------------------------------------------------------
  * Dynamic MTD partition support
  */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM8xxL-0"
 
 #define MTDPARTS_DEFAULT	"mtdparts=TQM8xxL-0:256k(u-boot),"	\
include/configs/TQM823M.h +1 -1
index fd41573..f666443 100644
@@ -227,7 +227,7 @@
 /*-----------------------------------------------------------------------
  * Dynamic MTD partition support
  */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM8xxM-0"
 
 #define MTDPARTS_DEFAULT	"mtdparts=TQM8xxM-0:512k(u-boot),"	\
include/configs/TQM834x.h +1 -1
index e126dc3..b74b404 100644
@@ -537,7 +537,7 @@ extern int tqm834x_num_flash_banks;
  * JFFS2 partitions
  */
 /* mtdparts command line support */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM834x-0"
 
 /* default mtd partition table */
include/configs/TQM850L.h +1 -1
index 77eb5a9..dc80b47 100644
@@ -216,7 +216,7 @@
 /*-----------------------------------------------------------------------
  * Dynamic MTD partition support
  */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM8xxL-0"
 
 #define MTDPARTS_DEFAULT	"mtdparts=TQM8xxL-0:256k(u-boot),"	\
include/configs/TQM850M.h +1 -1
index bb8825b..2289443 100644
@@ -216,7 +216,7 @@
 /*-----------------------------------------------------------------------
  * Dynamic MTD partition support
  */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM8xxM-0"
 
 #define MTDPARTS_DEFAULT	"mtdparts=TQM8xxM-0:512k(u-boot),"	\
include/configs/TQM855L.h +1 -1
index 2ccbaf8..999bdaa 100644
@@ -221,7 +221,7 @@
 /*-----------------------------------------------------------------------
  * Dynamic MTD partition support
  */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
 #define MTDIDS_DEFAULT		"nor0=TQM8xxL-0"
 
 #define MTDPARTS_DEFAULT	"mtdparts=TQM8xxL-0:256k(u-boot),"	\
include/configs/TQM855M.h +1 -1
index 8a65183..b54967d 100644
@@ -256,7 +256,7 @@
 /*-----------------------------------------------------------------------
  * Dynamic MTD partition support
  */
-#define CONFIG_JFFS2_CMDLINE
+#define CONFIG_CMD_MTDPARTS
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

include/configs/TQM85xx.h +2 -2
index 3b2272c..72db26c 100644

Lines of this file are not shown. View the raw message.

include/configs/TQM860L.h +1 -1
index 8bd1fe0..2e2a165 100644

Lines of this file are not shown. View the raw message.

include/configs/TQM860M.h +1 -1
index ad2c71c..1148f2e 100644

Lines of this file are not shown. View the raw message.

include/configs/TQM862L.h +1 -1
index 0a5180e..577f982 100644

Lines of this file are not shown. View the raw message.

include/configs/TQM862M.h +1 -1
index ee6980c..69070e6 100644

Lines of this file are not shown. View the raw message.

include/configs/TQM866M.h +1 -1
index 421a2d8..bb68614 100644

Lines of this file are not shown. View the raw message.

include/configs/ZUMA.h +2 -2
index 08c4ced..b73aaa8 100644

Lines of this file are not shown. View the raw message.

include/configs/apollon.h +1 -1
index dff47fc..f83dd9c 100644

Lines of this file are not shown. View the raw message.

include/configs/cm5200.h +1 -1
index ddcc6aa..54cf40d 100644

Lines of this file are not shown. View the raw message.

include/configs/debris.h +2 -2
index 4d65f6a..dc59df9 100644

Lines of this file are not shown. View the raw message.

include/configs/ep7312.h +2 -2
index 0581842..322a3ca 100644

Lines of this file are not shown. View the raw message.

include/configs/ep8260.h +2 -2
index d49d02f..3f4425a 100644

Lines of this file are not shown. View the raw message.

include/configs/fx12mm.h +1 -1
index 5844567..27c6e7d 100644

Lines of this file are not shown. View the raw message.

include/configs/hymod.h +2 -2
index 0fdcda2..2dacfb6 100644

Lines of this file are not shown. View the raw message.

include/configs/idmr.h +1 -1
index 1dd89f9..944d06f 100644

Lines of this file are not shown. View the raw message.

include/configs/impa7.h +2 -2
index bb3c02e..a3d023f 100644

Lines of this file are not shown. View the raw message.

include/configs/imx31_litekit.h +1 -1
index 6c150ae..9ac6eec 100644

Lines of this file are not shown. View the raw message.

include/configs/imx31_phycore.h +1 -1
index 2dd9e92..cbc0b92 100644

Lines of this file are not shown. View the raw message.

include/configs/incaip.h +2 -2
index a18ba80..2129dfd 100644

Lines of this file are not shown. View the raw message.

include/configs/innokom.h +2 -2
index d9b1555..043ae2f 100644

Lines of this file are not shown. View the raw message.

include/configs/microblaze-generic.h +1 -1
index ac18c87..aa117c8 100644

Lines of this file are not shown. View the raw message.

include/configs/modnet50.h +2 -2
index c4f5286..27213a8 100644

Lines of this file are not shown. View the raw message.

include/configs/motionpro.h +1 -1
index e6e3729..99a02cc 100644

Lines of this file are not shown. View the raw message.

include/configs/mx1fs2.h +2 -2
index aaa4e98..a19eb78 100644

Lines of this file are not shown. View the raw message.

include/configs/mx31ads.h +1 -1
index 1649f1f..c31c06a 100644

Lines of this file are not shown. View the raw message.

include/configs/netstar.h +1 -1
index 3b22e48..0b38549 100644

Lines of this file are not shown. View the raw message.

include/configs/omap2420h4.h +2 -2
index 92df0b4..983b5f2 100644

Lines of this file are not shown. View the raw message.

include/configs/qong.h +1 -1
index ccc2625..a67006a 100644

Lines of this file are not shown. View the raw message.

include/configs/sc3.h +1 -1
index 515b097..5b68ef9 100644

Lines of this file are not shown. View the raw message.

include/configs/sc520_cdp.h +2 -2
index 9f2357b..854f619 100644

Lines of this file are not shown. View the raw message.

include/configs/sc520_spunk.h +2 -2
index 50af732..43dcb85 100644

Lines of this file are not shown. View the raw message.

include/configs/smmaco4.h +1 -1
index a3f2677..35f3e3a 100644

Lines of this file are not shown. View the raw message.

include/configs/trab.h +1 -1
index 0a7a73d..8f13c35 100644

Lines of this file are not shown. View the raw message.

include/configs/v37.h +2 -2
index a6b0f0d..7f1670e 100644

Lines of this file are not shown. View the raw message.

include/configs/vct.h +1 -1
index 391535e..5371e2d 100644

Lines of this file are not shown. View the raw message.

include/configs/virtlab2.h +1 -1
index 7b61c82..021012d 100644

Lines of this file are not shown. View the raw message.

include/configs/voiceblue.h +1 -1
index f460610..cadd906 100644

Lines of this file are not shown. View the raw message.

include/configs/xilinx-ppc.h +2 -2
index e7daa07..e3ea84b 100644

Lines of this file are not shown. View the raw message.

include/configs/xsengine.h +2 -2
index 6761438..5d13f96 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.2.1

Part of the diff is not shown here. View the raw message.

#1 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

Dear Stefan Roese,

Quoted 98 lines · In message <[email protected]> you wrote:

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

---
v4:
- Keep config_cmd_all.h sorted
- Add "mtd_" to the names of some now non-static functions
- Cleanup of "jffs2" names and comments in cmd_mtdparts.c

v3:
- Keep lists sorted (README, Makefile) as pointed out by Wolfgang
- Generated without find-copies-harder

v2:
This patch is based in the original version by Kyungmin Park with some additional changes by Jean-Christophe Plagniol-Villard. Changes are the patch description and removal of the compilation errors/warnings.

 README                                 |    1 +
 board/fads/fads.h                      |    4 +-
 common/Makefile                        |    1 +
 common/cmd_flash.c                     |   18 +-
 common/cmd_jffs2.c                     | 1731 +-------------------------------
 common/{cmd_jffs2.c => cmd_mtdparts.c} |  432 +--------
 common/cmd_nand.c                      |   10 +-
 include/config_cmd_all.h               |    1 +
 include/configs/ADNPESC1.h             |    4 +-
 include/configs/Alaska8220.h           |    4 +-
 include/configs/BAB7xx.h               |    4 +-
 include/configs/BC3450.h               |    2 +-
 include/configs/CATcenter.h            |    4 +-
 include/configs/DB64360.h              |    4 +-
 include/configs/DB64460.h              |    4 +-
 include/configs/DK1C20.h               |    4 +-
 include/configs/DK1S10.h               |    4 +-
 include/configs/ELPPC.h                |    4 +-
 include/configs/FPS850L.h              |    2 +-
 include/configs/FPS860L.h              |    2 +-
 include/configs/LANTEC.h               |    4 +-
 include/configs/MHPC.h                 |    4 +-
 include/configs/MIP405.h               |    4 +-
 include/configs/ML2.h                  |    4 +-
 include/configs/MPC8266ADS.h           |    4 +-
 include/configs/NC650.h                |    4 +-
 include/configs/NETTA.h                |    4 +-
 include/configs/PPChameleonEVB.h       |    4 +-
 include/configs/R360MPI.h              |    4 +-
 include/configs/RBC823.h               |    4 +-
 include/configs/Rattler.h              |    4 +-
 include/configs/SIMPC8313.h            |    2 +-
 include/configs/SXNI855T.h             |    4 +-
 include/configs/TB5200.h               |    2 +-
 include/configs/TQM5200.h              |    2 +-
 include/configs/TQM823L.h              |    2 +-
 include/configs/TQM823M.h              |    2 +-
 include/configs/TQM834x.h              |    2 +-
 include/configs/TQM850L.h              |    2 +-
 include/configs/TQM850M.h              |    2 +-
 include/configs/TQM855L.h              |    2 +-
 include/configs/TQM855M.h              |    2 +-
 include/configs/TQM85xx.h              |    4 +-
 include/configs/TQM860L.h              |    2 +-
 include/configs/TQM860M.h              |    2 +-
 include/configs/TQM862L.h              |    2 +-
 include/configs/TQM862M.h              |    2 +-
 include/configs/TQM866M.h              |    2 +-
 include/configs/ZUMA.h                 |    4 +-
 include/configs/apollon.h              |    2 +-
 include/configs/cm5200.h               |    2 +-
 include/configs/debris.h               |    4 +-
 include/configs/ep7312.h               |    4 +-
 include/configs/ep8260.h               |    4 +-
 include/configs/fx12mm.h               |    2 +-
 include/configs/hymod.h                |    4 +-
 include/configs/idmr.h                 |    2 +-
 include/configs/impa7.h                |    4 +-
 include/configs/imx31_litekit.h        |    2 +-
 include/configs/imx31_phycore.h        |    2 +-
 include/configs/incaip.h               |    4 +-
 include/configs/innokom.h              |    4 +-
 include/configs/microblaze-generic.h   |    2 +-
 include/configs/modnet50.h             |    4 +-
 include/configs/motionpro.h            |    2 +-
 include/configs/mx1fs2.h               |    4 +-
 include/configs/mx31ads.h              |    2 +-
 include/configs/netstar.h              |    2 +-
 include/configs/omap2420h4.h           |    4 +-
 include/configs/qong.h                 |    2 +-
 include/configs/sc3.h                  |    2 +-
 include/configs/sc520_cdp.h            |    4 +-
 include/configs/sc520_spunk.h          |    4 +-
 include/configs/smmaco4.h              |    2 +-
 include/configs/trab.h                 |    2 +-
Quoted 8 lines
 include/configs/v37.h                  |    4 +-
 include/configs/vct.h                  |    2 +-
 include/configs/virtlab2.h             |    2 +-
 include/configs/voiceblue.h            |    2 +-
 include/configs/xilinx-ppc.h           |    4 +-
 include/configs/xsengine.h             |    4 +-
 81 files changed, 164 insertions(+), 2256 deletions(-)
 copy common/{cmd_jffs2.c => cmd_mtdparts.c} (82%)

Thanks. Applied to "next" branch.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A witty saying proves nothing, but saying  something  pointless  gets
people's attention.
#2 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

In reply to Stefan Roese
Quoted 5 lines · Stefan Roese

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

... and to make it useful for NAND chips as well, we should also remove now unrelated CONFIG_JFFS2_NAND. Note that struct part_info etc is in jffs2/load_kernel.h which is a bit misleading filename for that purpose, but that can be fixed later (tm).

common/cmd_mtdparts.c +3 -6
index c8bf2c6..3d437c0 100644
@@ -84,13 +84,10 @@
  *
  */
 
-/*
- * JFFS2/CRAMFS support
- */
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <jffs2/jffs2.h>
+#include <jffs2/load_kernel.h>
 #include <linux/list.h>
 #include <linux/ctype.h>
 #include <cramfs/cramfs_fs.h>
@@ -375,7 +372,7 @@ static int part_validate_nor(struct mtdids *id, struct part_info *part)
  */
 static int part_validate_nand(struct mtdids *id, struct part_info *part)
 {
-#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 	/* info for NAND chips */
 	nand_info_t *nand;
 
@@ -780,7 +777,7 @@ int mtd_device_validate(u8 type, u8 num, u32 *size)
 		printf("support for FLASH devices not present\n");
 #endif
 	} else if (type == MTD_DEV_TYPE_NAND) {
-#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
+#if defined(CONFIG_CMD_NAND)
 		if (num < CONFIG_SYS_MAX_NAND_DEVICE) {
 #ifndef CONFIG_NAND_LEGACY
 			*size = nand_info[num].size;
#3 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

Dear Ladislav Michl,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 5 lines · Stefan Roese

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

Quoted 6 lines

... and to make it useful for NAND chips as well, we should also remove now unrelated CONFIG_JFFS2_NAND. Note that struct part_info etc is in jffs2/load_kernel.h which is a bit misleading filename for that purpose, but that can be fixed later (tm).

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The human race is faced with a cruel choice: work  or  daytime  tele-
vision.
#4 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

In reply to Stefan Roese
Quoted 5 lines · Stefan Roese

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

One more leftover... Let nboot command know about partitions even if JFFS2 support is not enabled.

common/cmd_nand.c +5 -5
index ff5bc6e..1992531 100644
@@ -29,7 +29,7 @@
 #include <jffs2/jffs2.h>
 #include <nand.h>
 
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
+#if defined(CONFIG_CMD_MTDPARTS)
 
 /* parition handling routines */
 int mtdparts_init(void);
@@ -105,7 +105,7 @@ static int
 arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size)
 {
 	int idx = nand_curr_device;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
+#if defined(CONFIG_CMD_MTDPARTS)
 	struct mtd_device *dev;
 	struct part_info *part;
 	u8 pnum;
@@ -153,7 +153,7 @@ arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size
 		*size = nand->size - *off;
 	}
 
-#if  defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
+#if defined(CONFIG_CMD_MTDPARTS)
 out:
 #endif
 	printf("device %d ", idx);
@@ -598,7 +598,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 	char *boot_device = NULL;
 	int idx;
 	ulong addr, offset = 0;
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
+#if defined(CONFIG_CMD_MTDPARTS)
 	struct mtd_device *dev;
 	struct part_info *part;
 	u8 pnum;
@@ -643,7 +643,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 		offset = simple_strtoul(argv[3], NULL, 16);
 		break;
 	default:
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_CMD_MTDPARTS)
+#if defined(CONFIG_CMD_MTDPARTS)
 usage:
 #endif
 		cmd_usage(cmdtp);
#5 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

Quoted 11 lines · Ladislav Michl
Quoted 5 lines · Stefan Roese

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

One more leftover... Let nboot command know about partitions even if JFFS2 support is not enabled.

Thanks.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================

#6 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

In reply to Ladislav Michl

Dear Ladislav Michl,

Quoted 11 lines · In message <[email protected]> you wrote:
Quoted 5 lines · Stefan Roese

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

One more leftover... Let nboot command know about partitions even if JFFS2 support is not enabled.

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
PROGRAM - n.  A magic spell cast over a computer  allowing it to turn
one's input into error messages.
v. tr. - To engage in a pastime similar to banging one's head against
a wall, but with fewer opportunities for reward.
#7 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

In reply to Stefan Roese

Dear Stefan Roese,

Quoted 8 lines · In message <[email protected]> you wrote:

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

As it turns out, that split was incomplete or incorrect.

It seems that since commit 68d7d65100 we have two different, incompatible implementations of mtdparts_init() - one in common/cmd_jffs2.c and another one in common/cmd_mtdparts.c

When NAND and JFFS2 and MTDPARTS are enabled at the same time, the mtdparts_init() from common/cmd_mtdparts.c is called, which obviously does not pereform the required intializations for JFFS2: all JFFS2 related commands just return without any error messages but also without any useful output either.

Please provide a fix!

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Q:  How many DEC repairman does it take to fix a flat ?
A:  Five; four to hold the car up and one to swap tires.
#8 lore raw

PATCH v4 1/1 Separate mtdparts command from jffs2

Hi Wolfgang,

Quoted 15 lines · On Friday 15 May 2009 17:32:17 Wolfgang Denk wrote:
Quoted 8 lines

Currently the mtdparts commands are included in the jffs2 command support. This doesn't make sense anymore since other commands (e.g. UBI) use this infrastructure as well now. This patch separates the mtdparts commands from the jffs2 commands making it possible to only select mtdparts when no JFFS2 support is needed.

As it turns out, that split was incomplete or incorrect.

It seems that since commit 68d7d65100 we have two different, incompatible implementations of mtdparts_init() - one in common/cmd_jffs2.c and another one in common/cmd_mtdparts.c

Quoted 5 lines

When NAND and JFFS2 and MTDPARTS are enabled at the same time, the mtdparts_init() from common/cmd_mtdparts.c is called, which obviously does not pereform the required intializations for JFFS2: all JFFS2 related commands just return without any error messages but also without any useful output either.

Sorry about this.

Quoted 1 line

Please provide a fix!

OK, I'll try to come up with a patch quickly.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================