Skip to contentSkip to conversation

Adding run-time mtd partitioning utility

PATCH In review Rohit Hassan Sathyanarayan 2 participants 2 messages Jul 29, 2010 – Aug 23, 2010

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

PATCH 1/1 Adding run-time mtd partitioning utility

Hi All

Sending the patch on mtd-utils for run-time partitioning utility.

---

Makefile                |    1
include/mtd/mtd-abi.h   |   16 +
mtd_runtime_partition.c |  389 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 406 insertions(+)
Makefile +1 -0
index d315f39..bfa2c45 100644
@@ -16,6 +16,7 @@ TARGETS = ftl_format flash_erase flash_eraseall nanddump doc_loadbios \
 	nftldump nftl_format docfdisk \
 	rfddump rfdformat \
 	serve_image recv_image \
+	mtd_runtime_partition \
 	sumtool #jffs2reader
 
 SYMLINKS =
include/mtd/mtd-abi.h +16 -0
index c6954ed..22ba713 100644
@@ -30,6 +30,18 @@ struct mtd_oob_buf64 {
 	__u64 usr_ptr;
 };
 
+struct user_mtd {
+	char name[32];
+	 __u64 partition_size;
+	 __u64 partition_offset;
+	 __u32 partition_mask;
+};
+
+struct user_mtd_info {
+	struct user_mtd *pst_user_partitions;
+	__u32 num_partitions;
+};
+
 #define MTD_ABSENT		0
 #define MTD_RAM			1
 #define MTD_ROM			2
@@ -110,6 +122,10 @@ struct otp_info {
 #define MEMERASE64		_IOW('M', 20, struct erase_info_user64)
 #define MEMWRITEOOB64		_IOWR('M', 21, struct mtd_oob_buf64)
 #define MEMREADOOB64		_IOWR('M', 22, struct mtd_oob_buf64)
+#define MTDPARTITIONCREATE      _IOW('M', 23, int)
+#define MTDPARTITIONDELETE      _IOW('M', 24, int)
+#define MTDPARTITIONSETPERMISSION _IOW('M', 26, int)
+#define MTDPARTITIONMERGE       _IOW('M', 27, int)
 
 /*
  * Obsolete legacy interface. Keep it in order not to break userspace
mtd_runtime_partition.c new file +389 -0

389 lines not on this page · raw message

---

#1 lore raw
Quoted 7 lines · Rohit Hassan Sathyanarayan

Hi All

Sending the patch on mtd-utils for run-time partitioning utility.

Not taking this so far. Let's first create proper and mergeble kernel implementation first, then will add the user-space utility, ok?

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)