diff --git a/.gitignore b/.gitignore
index 83ca938..e1d23cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,33 +18,33 @@
 #
 # Our programs
 #
-/doc_loadbios
-/docfdisk
-/flash_erase
-/flash_info
-/flash_lock
-/flash_otp_dump
-/flash_otp_info
-/flash_otp_lock
-/flash_otp_write
-/flash_unlock
-/flashcp
-/ftl_check
-/ftl_format
-/jffs2dump
-/jffs2reader
-/mkfs.jffs2
-/mtd_debug
-/nanddump
-/nandtest
-/nandwrite
-/nftl_format
-/nftldump
-/recv_image
-/rfddump
-/rfdformat
-/serve_image
-/sumtool
+/misc-utils/mtdpart
+/misc-utils/doc_loadbios
+/misc-utils/docfdisk
+/misc-utils/flash_erase
+/misc-utils/flash_lock
+/misc-utils/flash_otp_dump
+/misc-utils/flash_otp_info
+/misc-utils/flash_otp_lock
+/misc-utils/flash_otp_write
+/misc-utils/flash_unlock
+/misc-utils/flashcp
+/misc-utils/ftl_check
+/misc-utils/ftl_format
+/jffsX-utils/jffs2dump
+/jffsX-utils/jffs2reader
+/jffsX-utils/mkfs.jffs2
+/misc-utils/mtd_debug
+/nand-utils/nanddump
+/nand-utils/nandtest
+/nand-utils/nandwrite
+/nand-utils/nftl_format
+/nand-utils/nftldump
+/misc-utils/recv_image
+/nor-utils/rfddump
+/nor-utils/rfdformat
+/misc-utils/serve_image
+/jffsX-utils/sumtool
 
 #
 # Top-level generic files
diff --git a/Makefile b/Makefile
index f4ce313..68f7df3 100644
--- a/Makefile
+++ b/Makefile
@@ -16,24 +16,30 @@ endif
 
 TESTS = tests
 
-MTD_BINS = \
-	ftl_format flash_erase nanddump doc_loadbios \
-	ftl_check mkfs.jffs2 flash_lock flash_unlock \
-	flash_otp_info flash_otp_dump flash_otp_lock flash_otp_write \
-	mtd_debug flashcp nandwrite nandtest mtdpart \
-	jffs2dump \
-	nftldump nftl_format docfdisk \
-	rfddump rfdformat \
-	serve_image recv_image \
-	sumtool jffs2reader
+MISC_BINS = \
+	ftl_format doc_loadbios ftl_check mtd_debug docfdisk \
+	serve_image recv_image mtdpart flash_erase flash_lock \
+	flash_unlock flash_otp_info flash_otp_dump flash_otp_lock \
+	flash_otp_write flashcp
 UBI_BINS = \
 	ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \
 	ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol ubiblock
-
-BINS = $(MTD_BINS)
-BINS += mkfs.ubifs/mkfs.ubifs
+UBIFS_BINS = \
+	mkfs.ubifs/mkfs.ubifs
+JFFSX_BINS = \
+	mkfs.jffs2 sumtool jffs2reader jffs2dump
+NAND_BINS = \
+	nanddump nandwrite nandtest nftldump nftl_format
+NOR_BINS = \
+	rfddump rfdformat
+
+BINS = $(addprefix misc-utils/,$(MISC_BINS))
 BINS += $(addprefix ubi-utils/,$(UBI_BINS))
-SCRIPTS = flash_eraseall
+BINS += $(addprefix ubifs-utils/,$(UBIFS_BINS))
+BINS += $(addprefix jffsX-utils/,$(JFFSX_BINS))
+BINS += $(addprefix nand-utils/,$(NAND_BINS))
+BINS += $(addprefix nor-utils/,$(NOR_BINS))
+SCRIPTS = $(addprefix misc-utils/,flash_eraseall)
 
 TARGETS = $(BINS)
 TARGETS += lib/libmtd.a
@@ -61,11 +67,11 @@ endif
 	rm -f $(BUILDDIR)/include/version.h
 	$(MAKE) -C $(TESTS) clean
 
-install:: $(addprefix $(BUILDDIR)/,${BINS}) ${SCRIPTS}
+install:: $(addprefix $(BUILDDIR)/,${BINS} ${SCRIPTS})
 	mkdir -p ${DESTDIR}/${SBINDIR}
 	install -m 0755 $^ ${DESTDIR}/${SBINDIR}/
 	mkdir -p ${DESTDIR}/${MANDIR}/man1
-	install -m 0644 mkfs.jffs2.1 ${DESTDIR}/${MANDIR}/man1/
+	install -m 0644 jffsX-utils/mkfs.jffs2.1 ${DESTDIR}/${MANDIR}/man1/
 	-gzip -9f ${DESTDIR}/${MANDIR}/man1/*.1
 
 tests::
@@ -85,13 +91,16 @@ $(BUILDDIR)/include/version.h.tmp:
 # Utils in top level
 #
 obj-mkfs.jffs2 = compr_rtime.o compr_zlib.o compr_lzo.o compr.o rbtree.o
-LDFLAGS_mkfs.jffs2 = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
+LDFLAGS_mkfs.jffs2 = $(ZLIBLDFLAGS) $(LZOLDFLAGS) $(CPPFLAGS)
 LDLIBS_mkfs.jffs2  = -lz $(LZOLDLIBS)
 
 LDFLAGS_jffs2reader = $(ZLIBLDFLAGS) $(LZOLDFLAGS)
 LDLIBS_jffs2reader  = -lz $(LZOLDLIBS)
 
-$(foreach v,$(MTD_BINS),$(eval $(call mkdep,,$(v))))
+$(foreach v,$(MISC_BINS),$(eval $(call mkdep,misc-utils/,$(v))))
+$(foreach v,$(JFFSX_BINS),$(eval $(call mkdep,jffsX-utils/,$(v))))
+$(foreach v,$(NAND_BINS),$(eval $(call mkdep,nand-utils/,$(v))))
+$(foreach v,$(NOR_BINS),$(eval $(call mkdep,nor-utils/,$(v))))
 
 #
 # Common libmtd
@@ -100,15 +109,6 @@ obj-libmtd.a = libmtd.o libmtd_legacy.o libcrc32.o libfec.o
 $(call _mkdep,lib/,libmtd.a)
 
 #
-# Utils in mkfs.ubifs subdir
-#
-obj-mkfs.ubifs = crc16.o lpt.o compr.o devtable.o \
-	hashtable/hashtable.o hashtable/hashtable_itr.o
-LDFLAGS_mkfs.ubifs = $(ZLIBLDFLAGS) $(LZOLDFLAGS) $(UUIDLDFLAGS)
-LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid
-$(call mkdep,mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a)
-
-#
 # Utils in ubi-utils/ subdir
 #
 obj-libiniparser.a = libiniparser.o dictionary.o
@@ -122,3 +122,12 @@ obj-ubiformat = libubigen.a libscan.a
 
 $(foreach v,libubi.a libubigen.a libiniparser.a libscan.a,$(eval $(call _mkdep,ubi-utils/,$(v))))
 $(foreach v,$(UBI_BINS),$(eval $(call mkdep,ubi-utils/,$(v),libubi.a ubiutils-common.o)))
+
+#
+# Utils in ubifs-utils subdir
+#
+obj-mkfs.ubifs = crc16.o lpt.o compr.o devtable.o \
+	hashtable/hashtable.o hashtable/hashtable_itr.o
+LDFLAGS_mkfs.ubifs = $(ZLIBLDFLAGS) $(LZOLDFLAGS) $(UUIDLDFLAGS)
+LDLIBS_mkfs.ubifs = -lz -llzo2 -lm -luuid
+$(call mkdep,ubifs-utils/mkfs.ubifs/,mkfs.ubifs,,ubi-utils/libubi.a)
diff --git a/compr.c b/jffsX-utils/compr.c
similarity index 100%
rename from compr.c
rename to jffsX-utils/compr.c
diff --git a/compr.h b/jffsX-utils/compr.h
similarity index 100%
rename from compr.h
rename to jffsX-utils/compr.h
diff --git a/compr_lzo.c b/jffsX-utils/compr_lzo.c
similarity index 100%
rename from compr_lzo.c
rename to jffsX-utils/compr_lzo.c
diff --git a/compr_rtime.c b/jffsX-utils/compr_rtime.c
similarity index 100%
rename from compr_rtime.c
rename to jffsX-utils/compr_rtime.c
diff --git a/compr_zlib.c b/jffsX-utils/compr_zlib.c
similarity index 100%
rename from compr_zlib.c
rename to jffsX-utils/compr_zlib.c
diff --git a/device_table.txt b/jffsX-utils/device_table.txt
similarity index 100%
rename from device_table.txt
rename to jffsX-utils/device_table.txt
diff --git a/jffs-dump.c b/jffsX-utils/jffs-dump.c
similarity index 100%
rename from jffs-dump.c
rename to jffsX-utils/jffs-dump.c
diff --git a/jffs2dump.c b/jffsX-utils/jffs2dump.c
similarity index 100%
rename from jffs2dump.c
rename to jffsX-utils/jffs2dump.c
diff --git a/jffs2reader.c b/jffsX-utils/jffs2reader.c
similarity index 100%
rename from jffs2reader.c
rename to jffsX-utils/jffs2reader.c
diff --git a/mkfs.jffs2.1 b/jffsX-utils/mkfs.jffs2.1
similarity index 100%
rename from mkfs.jffs2.1
rename to jffsX-utils/mkfs.jffs2.1
diff --git a/mkfs.jffs2.c b/jffsX-utils/mkfs.jffs2.c
similarity index 100%
rename from mkfs.jffs2.c
rename to jffsX-utils/mkfs.jffs2.c
diff --git a/rbtree.c b/jffsX-utils/rbtree.c
similarity index 100%
rename from rbtree.c
rename to jffsX-utils/rbtree.c
diff --git a/rbtree.h b/jffsX-utils/rbtree.h
similarity index 100%
rename from rbtree.h
rename to jffsX-utils/rbtree.h
diff --git a/summary.h b/jffsX-utils/summary.h
similarity index 100%
rename from summary.h
rename to jffsX-utils/summary.h
diff --git a/sumtool.c b/jffsX-utils/sumtool.c
similarity index 100%
rename from sumtool.c
rename to jffsX-utils/sumtool.c
diff --git a/MAKEDEV b/misc-utils/MAKEDEV
similarity index 100%
rename from MAKEDEV
rename to misc-utils/MAKEDEV
diff --git a/doc_loadbios.c b/misc-utils/doc_loadbios.c
similarity index 100%
rename from doc_loadbios.c
rename to misc-utils/doc_loadbios.c
diff --git a/docfdisk.c b/misc-utils/docfdisk.c
similarity index 100%
rename from docfdisk.c
rename to misc-utils/docfdisk.c
diff --git a/fectest.c b/misc-utils/fectest.c
similarity index 100%
rename from fectest.c
rename to misc-utils/fectest.c
diff --git a/flash_erase.c b/misc-utils/flash_erase.c
similarity index 100%
rename from flash_erase.c
rename to misc-utils/flash_erase.c
diff --git a/flash_eraseall b/misc-utils/flash_eraseall
similarity index 100%
rename from flash_eraseall
rename to misc-utils/flash_eraseall
diff --git a/flash_lock.c b/misc-utils/flash_lock.c
similarity index 100%
rename from flash_lock.c
rename to misc-utils/flash_lock.c
diff --git a/flash_otp_dump.c b/misc-utils/flash_otp_dump.c
similarity index 100%
rename from flash_otp_dump.c
rename to misc-utils/flash_otp_dump.c
diff --git a/flash_otp_info.c b/misc-utils/flash_otp_info.c
similarity index 100%
rename from flash_otp_info.c
rename to misc-utils/flash_otp_info.c
diff --git a/flash_otp_lock.c b/misc-utils/flash_otp_lock.c
similarity index 100%
rename from flash_otp_lock.c
rename to misc-utils/flash_otp_lock.c
diff --git a/flash_otp_write.c b/misc-utils/flash_otp_write.c
similarity index 100%
rename from flash_otp_write.c
rename to misc-utils/flash_otp_write.c
diff --git a/flash_unlock.c b/misc-utils/flash_unlock.c
similarity index 100%
rename from flash_unlock.c
rename to misc-utils/flash_unlock.c
diff --git a/flashcp.c b/misc-utils/flashcp.c
similarity index 100%
rename from flashcp.c
rename to misc-utils/flashcp.c
diff --git a/ftl_check.c b/misc-utils/ftl_check.c
similarity index 100%
rename from ftl_check.c
rename to misc-utils/ftl_check.c
diff --git a/ftl_format.c b/misc-utils/ftl_format.c
similarity index 100%
rename from ftl_format.c
rename to misc-utils/ftl_format.c
diff --git a/mcast_image.h b/misc-utils/mcast_image.h
similarity index 100%
rename from mcast_image.h
rename to misc-utils/mcast_image.h
diff --git a/mtd_debug.c b/misc-utils/mtd_debug.c
similarity index 100%
rename from mtd_debug.c
rename to misc-utils/mtd_debug.c
diff --git a/mtdpart.c b/misc-utils/mtdpart.c
similarity index 100%
rename from mtdpart.c
rename to misc-utils/mtdpart.c
diff --git a/recv_image.c b/misc-utils/recv_image.c
similarity index 100%
rename from recv_image.c
rename to misc-utils/recv_image.c
diff --git a/serve_image.c b/misc-utils/serve_image.c
similarity index 100%
rename from serve_image.c
rename to misc-utils/serve_image.c
diff --git a/load_nandsim.sh b/nand-utils/load_nandsim.sh
similarity index 100%
rename from load_nandsim.sh
rename to nand-utils/load_nandsim.sh
diff --git a/nanddump.c b/nand-utils/nanddump.c
similarity index 100%
rename from nanddump.c
rename to nand-utils/nanddump.c
diff --git a/nandtest.c b/nand-utils/nandtest.c
similarity index 100%
rename from nandtest.c
rename to nand-utils/nandtest.c
diff --git a/nandwrite.c b/nand-utils/nandwrite.c
similarity index 100%
rename from nandwrite.c
rename to nand-utils/nandwrite.c
diff --git a/nftl_format.c b/nand-utils/nftl_format.c
similarity index 100%
rename from nftl_format.c
rename to nand-utils/nftl_format.c
diff --git a/nftldump.c b/nand-utils/nftldump.c
similarity index 100%
rename from nftldump.c
rename to nand-utils/nftldump.c
diff --git a/rfddump.c b/nor-utils/rfddump.c
similarity index 100%
rename from rfddump.c
rename to nor-utils/rfddump.c
diff --git a/rfdformat.c b/nor-utils/rfdformat.c
similarity index 100%
rename from rfdformat.c
rename to nor-utils/rfdformat.c
diff --git a/mkfs.ubifs/.gitignore b/ubifs-utils/mkfs.ubifs/.gitignore
similarity index 100%
rename from mkfs.ubifs/.gitignore
rename to ubifs-utils/mkfs.ubifs/.gitignore
diff --git a/mkfs.ubifs/COPYING b/ubifs-utils/mkfs.ubifs/COPYING
similarity index 100%
rename from mkfs.ubifs/COPYING
rename to ubifs-utils/mkfs.ubifs/COPYING
diff --git a/mkfs.ubifs/README b/ubifs-utils/mkfs.ubifs/README
similarity index 100%
rename from mkfs.ubifs/README
rename to ubifs-utils/mkfs.ubifs/README
diff --git a/mkfs.ubifs/compr.c b/ubifs-utils/mkfs.ubifs/compr.c
similarity index 100%
rename from mkfs.ubifs/compr.c
rename to ubifs-utils/mkfs.ubifs/compr.c
diff --git a/mkfs.ubifs/compr.h b/ubifs-utils/mkfs.ubifs/compr.h
similarity index 100%
rename from mkfs.ubifs/compr.h
rename to ubifs-utils/mkfs.ubifs/compr.h
diff --git a/mkfs.ubifs/crc16.c b/ubifs-utils/mkfs.ubifs/crc16.c
similarity index 100%
rename from mkfs.ubifs/crc16.c
rename to ubifs-utils/mkfs.ubifs/crc16.c
diff --git a/mkfs.ubifs/crc16.h b/ubifs-utils/mkfs.ubifs/crc16.h
similarity index 100%
rename from mkfs.ubifs/crc16.h
rename to ubifs-utils/mkfs.ubifs/crc16.h
diff --git a/mkfs.ubifs/defs.h b/ubifs-utils/mkfs.ubifs/defs.h
similarity index 100%
rename from mkfs.ubifs/defs.h
rename to ubifs-utils/mkfs.ubifs/defs.h
diff --git a/mkfs.ubifs/devtable.c b/ubifs-utils/mkfs.ubifs/devtable.c
similarity index 100%
rename from mkfs.ubifs/devtable.c
rename to ubifs-utils/mkfs.ubifs/devtable.c
diff --git a/mkfs.ubifs/hashtable/hashtable.c b/ubifs-utils/mkfs.ubifs/hashtable/hashtable.c
similarity index 100%
rename from mkfs.ubifs/hashtable/hashtable.c
rename to ubifs-utils/mkfs.ubifs/hashtable/hashtable.c
diff --git a/mkfs.ubifs/hashtable/hashtable.h b/ubifs-utils/mkfs.ubifs/hashtable/hashtable.h
similarity index 100%
rename from mkfs.ubifs/hashtable/hashtable.h
rename to ubifs-utils/mkfs.ubifs/hashtable/hashtable.h
diff --git a/mkfs.ubifs/hashtable/hashtable_itr.c b/ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.c
similarity index 100%
rename from mkfs.ubifs/hashtable/hashtable_itr.c
rename to ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.c
diff --git a/mkfs.ubifs/hashtable/hashtable_itr.h b/ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.h
similarity index 100%
rename from mkfs.ubifs/hashtable/hashtable_itr.h
rename to ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.h
diff --git a/mkfs.ubifs/hashtable/hashtable_private.h b/ubifs-utils/mkfs.ubifs/hashtable/hashtable_private.h
similarity index 100%
rename from mkfs.ubifs/hashtable/hashtable_private.h
rename to ubifs-utils/mkfs.ubifs/hashtable/hashtable_private.h
diff --git a/mkfs.ubifs/key.h b/ubifs-utils/mkfs.ubifs/key.h
similarity index 100%
rename from mkfs.ubifs/key.h
rename to ubifs-utils/mkfs.ubifs/key.h
diff --git a/mkfs.ubifs/lpt.c b/ubifs-utils/mkfs.ubifs/lpt.c
similarity index 100%
rename from mkfs.ubifs/lpt.c
rename to ubifs-utils/mkfs.ubifs/lpt.c
diff --git a/mkfs.ubifs/lpt.h b/ubifs-utils/mkfs.ubifs/lpt.h
similarity index 100%
rename from mkfs.ubifs/lpt.h
rename to ubifs-utils/mkfs.ubifs/lpt.h
diff --git a/mkfs.ubifs/mkfs.ubifs.c b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
similarity index 100%
rename from mkfs.ubifs/mkfs.ubifs.c
rename to ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
diff --git a/mkfs.ubifs/mkfs.ubifs.h b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.h
similarity index 100%
rename from mkfs.ubifs/mkfs.ubifs.h
rename to ubifs-utils/mkfs.ubifs/mkfs.ubifs.h
diff --git a/mkfs.ubifs/ubifs.h b/ubifs-utils/mkfs.ubifs/ubifs.h
similarity index 100%
rename from mkfs.ubifs/ubifs.h
rename to ubifs-utils/mkfs.ubifs/ubifs.h
