Skip to contentSkip to conversation

mtd: Introduce CONFIG_MTD_DEVICE to select compilation of mtdcore.o

PATCH New Stefan Roese 2 participants 2 messages May 12, 2009 – Jun 3, 2009

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

PATCH 1/1 mtd: Introduce CONFIG_MTD_DEVICE to select compilation of mtdcore.o

This new define enables mtdcore.c compilation and with this we can select the MTD device infrastructure needed for the reworked mtdparts command.

We now have the 2 MTD infrastructure defines, CONFIG_MTD_DEVICE and CONFIG_MTD_PARTITIONS. CONFIG_MTD_DEVICE is needed (as explained above) for the "mtdparts" command and CONFIG_MTD_PARTITIONS is needed for UBI.

---
 README                              |   11 +++++++++++
 drivers/mtd/Makefile                |    3 ++-
 drivers/mtd/nand/nand.c             |    2 +-
 drivers/mtd/onenand/onenand_uboot.c |    2 +-
 4 files changed, 15 insertions(+), 3 deletions(-)
README +11 -0
index 75fc4b7..561c100 100644
@@ -1846,6 +1846,17 @@ The following options need to be configured:
 		These options enable and control the auto-update feature;
 		for a more detailed description refer to doc/README.update.
 
+- MTD Support (mtdparts command, UBI support)
+		CONFIG_MTD_DEVICE
+
+		Adds the MTD device infrastructure from the Linux kernel.
+		Needed for mtdparts command support.
+
+		CONFIG_MTD_PARTITIONS
+
+		Adds the MTD partitioning infrastructure from the Linux
+		kernel. Needed for UBI support.
+
 Legacy uImage format:
 
   Arg	Where			When
drivers/mtd/Makefile +2 -1
index 19dc02b..754d648 100644
@@ -25,7 +25,8 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libmtd.a
 
-COBJS-$(CONFIG_MTD_PARTITIONS) += mtdcore.o mtdpart.o
+COBJS-$(CONFIG_MTD_DEVICE) += mtdcore.o
+COBJS-$(CONFIG_MTD_PARTITIONS) += mtdpart.o
 COBJS-$(CONFIG_MTD_CONCAT) += mtdconcat.o
 COBJS-$(CONFIG_HAS_DATAFLASH) += at45.o
 COBJS-$(CONFIG_FLASH_CFI_DRIVER) += cfi_flash.o
drivers/mtd/nand/nand.c +1 -1
index d369115..9065fa9 100644
@@ -57,7 +57,7 @@ static void nand_init_chip(struct mtd_info *mtd, struct nand_chip *nand,
 			else
 				mtd->name += gd->reloc_off;
 
-#ifdef CONFIG_MTD_PARTITIONS
+#ifdef CONFIG_MTD_DEVICE
 			/*
 			 * Add MTD device so that we can reference it later
 			 * via the mtdcore infrastructure (e.g. ubi).
drivers/mtd/onenand/onenand_uboot.c +1 -1
index a95b922..9823b5b 100644
@@ -43,7 +43,7 @@ void onenand_init(void)
 	puts("OneNAND: ");
 	print_size(onenand_mtd.size, "\n");
 
-#ifdef CONFIG_MTD_PARTITIONS
+#ifdef CONFIG_MTD_DEVICE
 	/*
 	 * Add MTD device so that we can reference it later
 	 * via the mtdcore infrastructure (e.g. ubi).
Signature · 1 line
1.6.2.5
#1 lore raw

PATCH 1/1 mtd: Introduce CONFIG_MTD_DEVICE to select compilation of mtdcore.o

Dear Stefan Roese,

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

This new define enables mtdcore.c compilation and with this we can select the MTD device infrastructure needed for the reworked mtdparts command.

We now have the 2 MTD infrastructure defines, CONFIG_MTD_DEVICE and CONFIG_MTD_PARTITIONS. CONFIG_MTD_DEVICE is needed (as explained above) for the "mtdparts" command and CONFIG_MTD_PARTITIONS is needed for UBI.

Quoted 8 lines
---
 README                              |   11 +++++++++++
 drivers/mtd/Makefile                |    3 ++-
 drivers/mtd/nand/nand.c             |    2 +-
 drivers/mtd/onenand/onenand_uboot.c |    2 +-
 4 files changed, 15 insertions(+), 3 deletions(-)

Applied to next, thanks.

Best regards,

Wolfgang Denk

--
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 The sight of death frightens them [Earthers].
-- Kras the Klingon, "Friday's Child", stardate 3497.2