summaryrefslogtreecommitdiff
path: root/include/jffs2
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2005-08-08 01:03:24 +0200
committerWolfgang Denk <wd@pollux.denx.de>2005-08-08 01:03:24 +0200
commit700a0c648df72f2c8e0589c0d0470b5ffd7cab7b (patch)
tree819928504de4b8fc80e632fa5c485204fd7542a7 /include/jffs2
parent452e8e72ada5141f58008a902e1d4be42ce15abb (diff)
downloadu-boot-imx-700a0c648df72f2c8e0589c0d0470b5ffd7cab7b.zip
u-boot-imx-700a0c648df72f2c8e0589c0d0470b5ffd7cab7b.tar.gz
u-boot-imx-700a0c648df72f2c8e0589c0d0470b5ffd7cab7b.tar.bz2
Add common (with Linux) MTD partition scheme and "mtdparts" command
Old, obsolete and duplicated code was cleaned up and replace by the new partitioning method. There are two possible approaches now: * define a single, static partition * use mtdparts command line option and dynamic partitioning Default is static partitioning.
Diffstat (limited to 'include/jffs2')
-rw-r--r--include/jffs2/load_kernel.h55
1 files changed, 26 insertions, 29 deletions
diff --git a/include/jffs2/load_kernel.h b/include/jffs2/load_kernel.h
index d8b4240..882a80e 100644
--- a/include/jffs2/load_kernel.h
+++ b/include/jffs2/load_kernel.h
@@ -25,40 +25,37 @@
*
*/
-/* this struct is very similar to mtd_info */
-struct part_info {
- u32 size; /* Total size of the Partition */
-
- /* "Major" erase size for the device. Naïve users may take this
- * to be the only erase size available, or may use the more detailed
- * information below if they desire
- */
- u32 erasesize;
+#include <linux/list.h>
- /* Where in memory does this partition start? */
- char *offset;
+/* 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")
- /* used by jffs2 set to NULL */
- void *jffs2_priv;
-
- /* private filed used by user */
- void *usr_priv;
+struct mtd_device {
+ struct list_head link;
+ struct mtdids *id; /* parent mtd id entry */
+ u16 num_parts; /* number of partitions on this device */
+ struct list_head parts; /* partitions */
};
-struct part_info*
-jffs2_part_info(int part_num);
-
-struct kernel_loader {
-
- /* Return true if there is a kernel contained at src */
- int (* check_magic)(struct part_info *part);
-
- /* load the kernel from the partition part to dst, return the number
- * of bytes copied if successful, zero if not */
- u32 (* load_kernel)(u32 *dst, struct part_info *part, const char *kernel_filename);
+struct part_info {
+ struct list_head link;
+ char *name; /* partition name */
+ u8 auto_name; /* set to 1 for generated name */
+ u32 size; /* total size of the partition */
+ u32 offset; /* offset within device */
+ void *jffs2_priv; /* used internaly by jffs2 */
+ u32 mask_flags; /* kernel MTD mask flags */
+ struct mtd_device *dev; /* parent device */
+};
- /* A brief description of the module (ie, "cramfs") */
- char *name;
+struct mtdids {
+ struct list_head link;
+ u8 type; /* device type */
+ u8 num; /* device number */
+ u32 size; /* device size */
+ char *mtd_id; /* linux kernel device id */
};
#define ldr_strlen strlen