Skip to contentSkip to conversation

JFFS2 command support on OneNAND (take #2)

PATCH New Fathi BOUDRA 3 participants 5 messages Jul 30, 2008 – Sep 5, 2008

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

PATCH 1/1 JFFS2 command support on OneNAND (take #2)

JFFS2 command support on OneNAND.

- Fix typo.
- Fix nand_bbt_descr redefinition when NAND and OneNAND are enabled.

TODO: Use NAND command interface (e.g.: part_validate_*nand()).

---

common/cmd_jffs2.c +61 -5
index b4698be..43e33dd 100644
@@ -51,7 +51,7 @@
  * mtdids=<idmap>[,<idmap>,...]
  *
  * <idmap>    := <dev-id>=<mtd-id>
- * <dev-id>   := 'nand'|'nor'<dev-num>
+ * <dev-id>   := 'nand'|'nor'|'onenand'<dev-num>
  * <dev-num>  := mtd device number, 0...
  * <mtd-id>   := unique device tag used by linux kernel to find mtd device (mtd->name)
  *
@@ -103,6 +103,13 @@
 #include <nand.h>
 #endif /* !CFG_NAND_LEGACY */
 #endif
+
+#if defined(CONFIG_CMD_ONENAND)
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/onenand.h>
+#include <onenand_uboot.h>
+#endif
+
 /* enable/disable debugging messages */
 #define	DEBUG_JFFS
 #undef	DEBUG_JFFS
@@ -401,6 +408,42 @@ static int part_validate_nand(struct mtdids *id, struct part_info *part)
 }
 
 /**
+ * Performs sanity check for supplied OneNAND flash partition.
+ * Table of existing OneNAND flash devices is searched and partition device
+ * is located. Alignment with the granularity of nand erasesize is verified.
+ *
+ * @param id of the parent device
+ * @param part partition to validate
+ * @return 0 if partition is valid, 1 otherwise
+ */
+static int part_validate_onenand(struct mtdids *id, struct part_info *part)
+{
+#if defined(CONFIG_CMD_ONENAND)
+       /* info for OneNAND chips */
+       struct mtd_info *mtd;
+
+       mtd = &onenand_mtd;
+
+       if ((unsigned long)(part->offset) % mtd->erasesize) {
+               printf("%s%d: partition (%s) start offset"
+                       "alignment incorrect\n",
+                               MTD_DEV_TYPE(id->type), id->num, part->name);
+               return 1;
+       }
+
+       if (part->size % mtd->erasesize) {
+               printf("%s%d: partition (%s) size alignment incorrect\n",
+                               MTD_DEV_TYPE(id->type), id->num, part->name);
+               return 1;
+       }
+
+       return 0;
+#else
+       return 1;
+#endif
+}
+
+/**
  * Performs sanity check for supplied partition. Offset and size are verified
  * to be within valid range. Partition type is checked and either
  * parts_validate_nor() or parts_validate_nand() is called with the argument
@@ -436,6 +479,8 @@ static int part_validate(struct mtdids *id, struct part_info *part)
 		return part_validate_nand(id, part);
 	else if (id->type == MTD_DEV_TYPE_NOR)
 		return part_validate_nor(id, part);
+	else if (id->type == MTD_DEV_TYPE_ONENAND)
+		return part_validate_onenand(id, part);
 	else
 		DEBUGF("part_validate: invalid dev type\n");
 
@@ -755,7 +800,15 @@ static int device_validate(u8 type, u8 num, u32 *size)
 #else
 		printf("support for NAND devices not present\n");
 #endif
-	}
+	} else if (type == MTD_DEV_TYPE_ONENAND) {
+#if defined(CONFIG_CMD_ONENAND)
+		*size = onenand_mtd.size;
+		return 0;
+#else
+		printf("support for OneNAND devices not present\n");
+#endif
+	} else
+		printf("Unknown device type %d\n", type);
 
 	return 1;
 }
@@ -1065,8 +1118,8 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
 #endif /* #ifdef CONFIG_JFFS2_CMDLINE */
 
 /**
- * Parse device id string <dev-id> := 'nand'|'nor'<dev-num>, return device
- * type and number.
+ * Parse device id string <dev-id> := 'nand'|'nor'|'onenand'<dev-num>,
+ * return device type and number.
  *
  * @param id string describing device id
  * @param ret_id output pointer to next char after parse completes (output)
@@ -1085,6 +1138,9 @@ int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
 	} else if (strncmp(p, "nor", 3) == 0) {
 		*dev_type = MTD_DEV_TYPE_NOR;
 		p += 3;
+	} else if (strncmp(p, "onenand", 7) == 0) {
+		*dev_type = MTD_DEV_TYPE_ONENAND;
+		p += 7;
 	} else {
 		printf("incorrect device type in %s\n", id);
 		return 1;
@@ -1489,7 +1545,7 @@ static int parse_mtdids(const char *const ids)
 	while(p && (*p != '\0')) {
 
 		ret = 1;
-		/* parse 'nor'|'nand'<dev-num> */
+		/* parse 'nor'|'nand'|'onenand'<dev-num> */
 		if (id_parse(p, &p, &type, &num) != 0)
 			break;
 
drivers/mtd/onenand/onenand_bbt.c +1 -0
index 87344ab..04d4088 100644
@@ -21,6 +21,7 @@
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/onenand.h>
+#include <linux/mtd/bbm.h>
 #include <malloc.h>
 
 #include <asm/errno.h>
fs/jffs2/jffs2_1pass.c +120 -2

151 lines not on this page · raw message

include/jffs2/load_kernel.h +8 -3
index 882a80e..37871de 100644
@@ -28,9 +28,14 @@
 #include <linux/list.h>
 
 /* mtd device types */
-#define MTD_DEV_TYPE_NOR      0x0001
-#define MTD_DEV_TYPE_NAND     0x0002
-#define MTD_DEV_TYPE(type) ((type == MTD_DEV_TYPE_NAND) ? "nand" : "nor")
+enum {
+	MTD_DEV_TYPE_NOR,
+	MTD_DEV_TYPE_NAND,
+	MTD_DEV_TYPE_ONENAND,
+};
+
+#define MTD_DEV_TYPE(type) ((type == MTD_DEV_TYPE_NAND) ? "nand" :     \
+			(type == MTD_DEV_TYPE_ONENAND) ? "onenand" : "nor")
 
 struct mtd_device {
 	struct list_head link;
include/linux/mtd/onenand.h +2 -2
index 4b0c2df..019d2b1 100644
@@ -14,10 +14,10 @@
 
 #include <linux/mtd/onenand_regs.h>
 
-/* Note: The header order is impoertant */
+/* Note: The header order is important */
 #include <onenand_uboot.h>
 
-#include <linux/mtd/bbm.h>
+#include <linux/mtd/compat.h>
 
 #define MAX_BUFFERRAM		2
 #define MAX_ONENAND_PAGESIZE	(2048 + 64)
include/onenand_uboot.h +2 -0
index 4449f98..24ace2a 100644
@@ -27,6 +27,8 @@ typedef int wait_queue_head_t;
 struct mtd_info;
 struct erase_info;
 
+extern struct mtd_info onenand_mtd;
+
 /* Functions */
 extern void onenand_init(void);
 extern int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
#1 lore raw

PATCH 1/1 JFFS2 command support on OneNAND (take #2)

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

JFFS2 command support on OneNAND.

- Fix typo.
- Fix nand_bbt_descr redefinition when NAND and OneNAND are enabled.

TODO: Use NAND command interface (e.g.: part_validate_*nand()).

---

common/cmd_jffs2.c +9 -1
index b4698be..43e33dd 100644
@@ -51,7 +51,7 @@
  * mtdids=<idmap>[,<idmap>,...]
  *
  * <idmap>    := <dev-id>=<mtd-id>
- * <dev-id>   := 'nand'|'nor'<dev-num>
+ * <dev-id>   := 'nand'|'nor'|'onenand'<dev-num>
  * <dev-num>  := mtd device number, 0...
  * <mtd-id>   := unique device tag used by linux kernel to find mtd device (mtd->name)
  *
@@ -103,6 +103,13 @@
 #include <nand.h>
 #endif /* !CFG_NAND_LEGACY */
 #endif
+
+#if defined(CONFIG_CMD_ONENAND)
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/onenand.h>
+#include <onenand_uboot.h>
+#endif
+
 /* enable/disable debugging messages */
 #define	DEBUG_JFFS
 #undef	DEBUG_JFFS
@@ -401,6 +408,42 @@ static int part_validate_nand(struct mtdids *id, struct part_info *part)
 }
 
 /**
+ * Performs sanity check for supplied OneNAND flash partition.

common/cmd_jffs2.c static int part_validate_nand(struct mtdids *id, struct part_info *part) · line 421

Quoted 10 lines
common/cmd_jffs2.c +10 -0
+ * Table of existing OneNAND flash devices is searched and partition device
+ * is located. Alignment with the granularity of nand erasesize is verified.
+ *
+ * @param id of the parent device
+ * @param part partition to validate
+ * @return 0 if partition is valid, 1 otherwise
+ */
+static int part_validate_onenand(struct mtdids *id, struct part_info *part)
+{
+#if defined(CONFIG_CMD_ONENAND)

The whole function should only be defined...

common/cmd_jffs2.c static int part_validate(struct mtdids *id, struct part_info *part) · line 483

Quoted 6 lines
common/cmd_jffs2.c +2 -0
@@ -436,6 +479,8 @@ static int part_validate(struct mtdids *id, struct part_info *part)
 		return part_validate_nand(id, part);
 	else if (id->type == MTD_DEV_TYPE_NOR)
 		return part_validate_nor(id, part);
+	else if (id->type == MTD_DEV_TYPE_ONENAND)
+		return part_validate_onenand(id, part);

... and called when CONFIG_CMD_ONENAND is set.

Quoted 4 lines
common/cmd_jffs2.c +0 -0
@@ -755,7 +800,15 @@ static int device_validate(u8 type, u8 num, u32 *size)
 #else
 		printf("support for NAND devices not present\n");
 #endif

common/cmd_jffs2.c static int device_validate(u8 type, u8 num, u32 *size) · line 811

Quoted 10 lines
common/cmd_jffs2.c +9 -1
-	}
+	} else if (type == MTD_DEV_TYPE_ONENAND) {
+#if defined(CONFIG_CMD_ONENAND)
+		*size = onenand_mtd.size;
+		return 0;
+#else
+		printf("support for OneNAND devices not present\n");
+#endif
+	} else
+		printf("Unknown device type %d\n", type);

Same here - if CONFIG_CMD_ONENAND is not set, no new code should be added.

Quoted 12 lines
common/cmd_jffs2.c +2 -2
@@ -1065,8 +1118,8 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
 #endif /* #ifdef CONFIG_JFFS2_CMDLINE */
 
 /**
- * Parse device id string <dev-id> := 'nand'|'nor'<dev-num>, return device
- * type and number.
+ * Parse device id string <dev-id> := 'nand'|'nor'|'onenand'<dev-num>,
+ * return device type and number.
  *
  * @param id string describing device id
  * @param ret_id output pointer to next char after parse completes (output)

common/cmd_jffs2.c int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num) · line 1143

Quoted 6 lines
common/cmd_jffs2.c +3 -0
@@ -1085,6 +1138,9 @@ int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
 	} else if (strncmp(p, "nor", 3) == 0) {
 		*dev_type = MTD_DEV_TYPE_NOR;
 		p += 3;
+	} else if (strncmp(p, "onenand", 7) == 0) {
+		*dev_type = MTD_DEV_TYPE_ONENAND;
+		p += 7;

Ditto here.

Quoted 6 lines
common/cmd_jffs2.c +6 -0
+static int read_onenand_cached(u32 off, u32 size, u_char *buf)
+{
+	u32 bytes_read = 0;
+	size_t retlen;
+	int cpy_bytes;
+

common/cmd_jffs2.c int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)

Quoted 10 lines
common/cmd_jffs2.c +10 -0
+	while (bytes_read < size) {
+		if ((off + bytes_read < onenand_cache_off) ||
+		    (off + bytes_read >= onenand_cache_off + ONENAND_CACHE_SIZE)) {
+			onenand_cache_off = (off + bytes_read) & ONENAND_PAGE_MASK;
+			if (!onenand_cache) {
+				/* This memory never gets freed but 'cause
+				   it's a bootloader, nobody cares */
+				onenand_cache = malloc(ONENAND_CACHE_SIZE);
+				if (!onenand_cache) {
+					printf("read_onenand_cached: can't alloc cache size %d bytes\n",

Lines too long.

...

common/cmd_jffs2.c

Quoted 2 lines
common/cmd_jffs2.c +2 -0
+				printf("read_onenand_cached: error reading nand off %#x size %d bytes\n",
+					onenand_cache_off, ONENAND_CACHE_SIZE);

Ditto.

Quoted 6 lines
include/jffs2/load_kernel.h +0 -0
index 882a80e..37871de 100644
@@ -28,9 +28,14 @@
 #include <linux/list.h>

include/jffs2/load_kernel.h line 35

Quoted 10 lines
include/jffs2/load_kernel.h +5 -3
 
 /* mtd device types */
-#define MTD_DEV_TYPE_NOR      0x0001
-#define MTD_DEV_TYPE_NAND     0x0002
-#define MTD_DEV_TYPE(type) ((type == MTD_DEV_TYPE_NAND) ? "nand" : "nor")
+enum {
+	MTD_DEV_TYPE_NOR,
+	MTD_DEV_TYPE_NAND,
+	MTD_DEV_TYPE_ONENAND,
+};

Please don't. Leave as it was.

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
I don't mind criticism. You know me. I've  never  been  one  to  take
offence  at  criticism. No one could say I'm the sort to take offence
at criticism -- Not twice, anyway. Not without blowing bubbles.
                                  - Terry Pratchett, _Witches Abroad_
#2 lore raw

PATCH 1/1 JFFS2 command support on OneNAND (take #2)

In reply to Fathi BOUDRA
Quoted 1 line · Fathi BOUDRA

TODO: Use NAND command interface (e.g.: part_validate_*nand()).

Do you mean merging the NAND and OneNAND versions of the jffs2 code, through the (mostly already existing) function pointer interface?

I'd really like to see that done before merging, unless there's a consensus from others that it can't wait.

-Scott

#3 lore raw

PATCH 1/1 JFFS2 command support on OneNAND (take #3)

In reply to Fathi BOUDRA

JFFS2 command support on OneNAND.

- Fix typo.
- Fix nand_bbt_descr redefinition when NAND and OneNAND are enabled.

Since last comments:
- Add some CONFIG_CMD_ONENAND to prevent adding new code.
- Fix line too long.
- Revert mtd device types definition.

TODO: Use NAND command interface (e.g.: part_validate_*nand()).

---

common/cmd_jffs2.c +1 -1
index b4698be..16ca8f7 100644
@@ -51,7 +51,7 @@
  * mtdids=<idmap>[,<idmap>,...]
  *
  * <idmap>    := <dev-id>=<mtd-id>
- * <dev-id>   := 'nand'|'nor'<dev-num>
+ * <dev-id>   := 'nand'|'nor'|'onenand'<dev-num>
  * <dev-num>  := mtd device number, 0...
  * <mtd-id>   := unique device tag used by linux kernel to find mtd device 

(mtd->name)
*
@@ -103,6 +103,13 @@
#include <nand.h>
#endif /* !CFG_NAND_LEGACY */
#endif
+
+#if defined(CONFIG_CMD_ONENAND)
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/onenand.h>
+#include <onenand_uboot.h>
+#endif
+
/* enable/disable debugging messages */
#define DEBUG_JFFS
#undef DEBUG_JFFS
@@ -401,6 +408,42 @@ static int part_validate_nand(struct mtdids *id, struct part_info *part)
}

/**
+ * Performs sanity check for supplied OneNAND flash partition.
+ * Table of existing OneNAND flash devices is searched and partition device
+ * is located. Alignment with the granularity of nand erasesize is verified.
+ *
+ * @param id of the parent device
+ * @param part partition to validate
+ * @return 0 if partition is valid, 1 otherwise
+ */
+static int part_validate_onenand(struct mtdids *id, struct part_info *part) +{
+#if defined(CONFIG_CMD_ONENAND)
+ /* info for OneNAND chips */
+ struct mtd_info *mtd;
+
+ mtd = &onenand_mtd;
+
+ if ((unsigned long)(part->offset) % mtd->erasesize) {
+ printf("%s%d: partition (%s) start offset"
+ "alignment incorrect\n",
+ MTD_DEV_TYPE(id->type), id->num, part->name);
+ return 1;
+ }
+
+ if (part->size % mtd->erasesize) {
+ printf("%s%d: partition (%s) size alignment incorrect\n",
+ MTD_DEV_TYPE(id->type), id->num, part->name);
+ return 1;
+ }
+
+ return 0;
+#else
+ return 1;
+#endif
+}
+
+/**
* Performs sanity check for supplied partition. Offset and size are verified
* to be within valid range. Partition type is checked and either
* parts_validate_nor() or parts_validate_nand() is called with the argument
@@ -436,6 +479,10 @@ static int part_validate(struct mtdids *id, struct part_info *part)
return part_validate_nand(id, part);
else if (id->type == MTD_DEV_TYPE_NOR)
return part_validate_nor(id, part);
+#if defined(CONFIG_CMD_ONENAND)
+ else if (id->type == MTD_DEV_TYPE_ONENAND)
+ return part_validate_onenand(id, part);
+#endif
else
DEBUGF("part_validate: invalid dev type\n");

@@ -755,7 +802,15 @@ static int device_validate(u8 type, u8 num, u32 *size)
#else
printf("support for NAND devices not present\n");
#endif
- }
+ } else if (type == MTD_DEV_TYPE_ONENAND) {
+#if defined(CONFIG_CMD_ONENAND)
+ *size = onenand_mtd.size;
+ return 0;
+#else
+ printf("support for OneNAND devices not present\n");
+#endif
+ } else
+ printf("Unknown device type %d\n", type);

return 1;
}
@@ -1065,8 +1120,8 @@ static struct mtdids* id_find_by_mtd_id(const char *mtd_id, unsigned int mtd_id_
#endif /* #ifdef CONFIG_JFFS2_CMDLINE */

/**
- * Parse device id string <dev-id> := 'nand'|'nor'<dev-num>, return device
- * type and number.
+ * Parse device id string <dev-id> := 'nand'|'nor'|'onenand'<dev-num>,
+ * return device type and number.
*
* @param id string describing device id
* @param ret_id output pointer to next char after parse completes (output)
@@ -1085,6 +1140,11 @@ int id_parse(const char *id, const char **ret_id, u8 *dev_type, u8 *dev_num)
} else if (strncmp(p, "nor", 3) == 0) {
*dev_type = MTD_DEV_TYPE_NOR;
p += 3;
+#if defined(CONFIG_CMD_ONENAND)
+ } else if (strncmp(p, "onenand", 7) == 0) {
+ *dev_type = MTD_DEV_TYPE_ONENAND;
+ p += 7;
+#endif
} else {
printf("incorrect device type in %s\n", id); return 1;
@@ -1489,7 +1549,7 @@ static int parse_mtdids(const char *const ids)
while(p && (*p != '\0')) {

ret = 1;
- /* parse 'nor'|'nand'<dev-num> */
+ /* parse 'nor'|'nand'|'onenand'<dev-num> */
if (id_parse(p, &p, &type, &num) != 0)
break;

(quoted diff) +0 -0

b/drivers/mtd/onenand/onenand_bbt.c
index 87344ab..04d4088 100644

drivers/mtd/onenand/onenand_bbt.c +1 -0
@@ -21,6 +21,7 @@
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/onenand.h>
+#include <linux/mtd/bbm.h>
 #include <malloc.h>
 
 #include <asm/errno.h>
fs/jffs2/jffs2_1pass.c +101 -0

107 lines not on this page · raw message

*ext_buf)
return get_fl_mem_nand(off, size, ext_buf);
#endif

+#if defined(CONFIG_CMD_ONENAND)
+ if (id->type == MTD_DEV_TYPE_ONENAND)
+ return get_fl_mem_onenand(off, size, ext_buf);
+#endif
+
printf("get_fl_mem: unknown device type, using raw offset!\n"); return (void*)off;
}
@@ -335,19 +441,31 @@ static inline void *get_node_mem(u32 off)
return get_node_mem_nand(off);
#endif

+#if defined(CONFIG_CMD_ONENAND)
+ if (id->type == MTD_DEV_TYPE_ONENAND)
+ return get_node_mem_onenand(off);
+#endif
+
printf("get_node_mem: unknown device type, using raw offset!\n"); return (void*)off;
}

static inline void put_fl_mem(void *buf)
{
-#if defined(CONFIG_JFFS2_NAND) && \
- defined(CONFIG_CMD_NAND)
+#if (defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)) || \
+ defined(CONFIG_CMD_ONENAND)
struct mtdids *id = current_part->dev->id;
+#endif

+#if defined(CONFIG_JFFS2_NAND) && defined(CONFIG_CMD_NAND)
if (id->type == MTD_DEV_TYPE_NAND)
return put_fl_mem_nand(buf);
#endif
+
+#if defined(CONFIG_CMD_ONENAND)
+ if (id->type == MTD_DEV_TYPE_ONENAND)
+ return put_fl_mem_onenand(buf);
+#endif
}

/* Compression names */

include/jffs2/load_kernel.h +3 -1
index 882a80e..8e7c515 100644
@@ -30,7 +30,9 @@
 /* mtd device types */
 #define MTD_DEV_TYPE_NOR      0x0001
 #define MTD_DEV_TYPE_NAND     0x0002
-#define MTD_DEV_TYPE(type) ((type == MTD_DEV_TYPE_NAND) ? "nand" : "nor")
+#define MTD_DEV_TYPE_ONENAND  0x0003
+#define MTD_DEV_TYPE(type) ((type == MTD_DEV_TYPE_NAND) ? "nand" :     \
+			(type == MTD_DEV_TYPE_ONENAND) ? "onenand" : "nor")
 
 struct mtd_device {
 	struct list_head link;
include/linux/mtd/onenand.h +2 -2
index 4b0c2df..019d2b1 100644
@@ -14,10 +14,10 @@
 
 #include <linux/mtd/onenand_regs.h>
 
-/* Note: The header order is impoertant */
+/* Note: The header order is important */
 #include <onenand_uboot.h>
 
-#include <linux/mtd/bbm.h>
+#include <linux/mtd/compat.h>
 
 #define MAX_BUFFERRAM		2
 #define MAX_ONENAND_PAGESIZE	(2048 + 64)
include/onenand_uboot.h +2 -0
index 4449f98..24ace2a 100644
@@ -27,6 +27,8 @@ typedef int wait_queue_head_t;
 struct mtd_info;
 struct erase_info;
 
+extern struct mtd_info onenand_mtd;
+
 /* Functions */
 extern void onenand_init(void);
 extern int onenand_read(struct mtd_info *mtd, loff_t from, size_t len,
#4 lore raw

PATCH 1/1 JFFS2 command support on OneNAND (take #3)

Dear Fathi BOUDRA,

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

JFFS2 command support on OneNAND.

- Fix typo.
- Fix nand_bbt_descr redefinition when NAND and OneNAND are enabled.

Since last comments:
- Add some CONFIG_CMD_ONENAND to prevent adding new code.
- Fix line too long.
- Revert mtd device types definition.

TODO: Use NAND command interface (e.g.: part_validate_*nand()).

---

common/cmd_jffs2.c +0 -0
index b4698be..16ca8f7 100644

common/cmd_jffs2.c line 57

Quoted 8 lines
common/cmd_jffs2.c +1 -1
@@ -51,7 +51,7 @@
  * mtdids=<idmap>[,<idmap>,...]
  *
  * <idmap>    := <dev-id>=<mtd-id>
- * <dev-id>   := 'nand'|'nor'<dev-num>
+ * <dev-id>   := 'nand'|'nor'|'onenand'<dev-num>
  * <dev-num>  := mtd device number, 0...
  * <mtd-id>   := unique device tag used by linux kernel to find mtd device 
 (mtd->name)

^^^^^^^^^^^^^^^^^
Line wrapped.

Quoted 16 lines

*

common/cmd_jffs2.c +7 -0
@@ -103,6 +103,13 @@
 #include <nand.h>
 #endif /* !CFG_NAND_LEGACY */
 #endif
+
+#if defined(CONFIG_CMD_ONENAND)
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/onenand.h>
+#include <onenand_uboot.h>
+#endif
+
 /* enable/disable debugging messages */
 #define	DEBUG_JFFS
 #undef	DEBUG_JFFS

common/cmd_jffs2.c static int part_validate_nand(struct mtdids *id, struct · line 408

Quoted 1 line
common/cmd_jffs2.c +0 -0
@@ -401,6 +408,42 @@ static int part_validate_nand(struct mtdids *id, struct 
 part_info *part)

^^^^^^^^^^^^^^^^^^^^^^^

Line wrapped.

Sorry, your patch was line-wrapped by your mailer. Please fix your mailer configuration and resubmit.

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
"Morality is one thing.  Ratings are everything."
- A Network 23 executive on "Max Headroom"