mtd: Add MTD concat support to concatenate multiple MTD NOR devices
PATCH 1/1 mtd: Add MTD concat support to concatenate multiple MTD NOR devices
This patch adds concatenation support to the U-Boot MTD infrastructure. By enabling CONFIG_MTD_CONCAT this MTD CFI wrapper will concatenate all found NOR devices into one single MTD device. This can be used by e.g by UBI to access a partition that spans over multiple NOR chips.
--- drivers/mtd/Makefile | 1 + drivers/mtd/cfi_mtd.c | 77 +++++- drivers/mtd/mtdconcat.c | 807 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/mtd/compat.h | 12 +- include/linux/mtd/concat.h | 21 ++ 5 files changed, 913 insertions(+), 5 deletions(-) create mode 100644 drivers/mtd/mtdconcat.c create mode 100644 include/linux/mtd/concat.h
drivers/mtd/Makefile +1 -0
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk LIB := $(obj)libmtd.a COBJS-$(CONFIG_MTD_PARTITIONS) += mtdcore.o mtdpart.o +COBJS-$(CONFIG_MTD_CONCAT) += mtdconcat.o COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o COBJS-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o COBJS-$(CONFIG_FLASH_CFI_MTD) += cfi_mtd.o
drivers/mtd/cfi_mtd.c +76 -1
119 lines not on this page · raw message
drivers/mtd/mtdconcat.c new file +807 -0
807 lines not on this page · raw message
include/linux/mtd/compat.h +8 -4
@@ -19,11 +19,15 @@#define kmalloc (size, flags) malloc(size)#define kzalloc (size, flags) calloc(size, 1) -#define vmalloc (size) malloc(size) -#define kfree (ptr) free(ptr) -#define vfree (ptr) free(ptr) +#define vmalloc (size) malloc(size) +#define kfree (ptr) free(ptr) +#define vfree (ptr) free(ptr) -#define KERNEL_VERSION (a,b,c) (((a) << 16) + ((b) << 8) + (c)) +#define DECLARE_WAITQUEUE (...) do { } while (0) +#define add_wait_queue (...) do { } while (0) +#define remove_wait_queue (...) do { } while (0) + +#define KERNEL_VERSION (a,b,c) (((a) << 16) + ((b) << 8) + (c))/* * ..and if you can't take the strict
include/linux/mtd/concat.h new file +21 -0
@@ -0,0 +1,21 @@ +/* +* MTD device concatenation layer definitions +* +* (C) 2002 Robert Kaiser <[email protected]> +* +* This code is GPL +*/ + +#ifndef MTD_CONCAT_H +#define MTD_CONCAT_H + + +struct mtd_info *mtd_concat_create ( +struct mtd_info *subdev[],/* subdevices to concatenate */ +int num_devs,/* number of subdevices */ +const char *name);/* name for the new device */ + +void mtd_concat_destroy (struct mtd_info *mtd); + +#endif +
Signature · 1 line
1.6.2.5
Wolfgang Denk
AppliedPATCH 1/1 mtd: Add MTD concat support to concatenate multiple MTD NOR devices
Dear Stefan Roese,
Quoted 6 lines · In message <[email protected]> you wrote:
This patch adds concatenation support to the U-Boot MTD infrastructure. By enabling
CONFIG_MTD_CONCATthis MTD CFI wrapper will concatenate all found NOR devices into one single MTD device. This can be used by e.g by UBI to access a partition that spans over multiple NOR chips.Signed-off-by Stefan Roese <[email protected]>
Quoted 9 lines
--- drivers/mtd/Makefile | 1 + drivers/mtd/cfi_mtd.c | 77 +++++- drivers/mtd/mtdconcat.c | 807 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/mtd/compat.h | 12 +- include/linux/mtd/concat.h | 21 ++ 5 files changed, 913 insertions(+), 5 deletions(-) create mode 100644 drivers/mtd/mtdconcat.c create mode 100644 include/linux/mtd/concat.h
Applied to next, thanks.
Best regards,
Wolfgang Denk
Signature · 6 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 In the future, you're going to get computers as prizes in breakfast cereals. You'll throw them out because your house will be littered with them. - Robert Lucky