Эх сурвалжийг харах

mtd: nand: split out ECC module

This way drivers could use ecc routines without depedency on whole nand

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Maxim Levitsky 15 жил өмнө
parent
commit
e5f710cfc6

+ 2 - 1
drivers/mtd/Kconfig

@@ -307,8 +307,9 @@ config SSFDC
 
 
 config SM_FTL
 config SM_FTL
 	tristate "SmartMedia/xD new translation layer"
 	tristate "SmartMedia/xD new translation layer"
-	depends on EXPERIMENTAL && BLOCK && MTD_NAND
+	depends on EXPERIMENTAL && BLOCK
 	select MTD_BLKDEVS
 	select MTD_BLKDEVS
+	select MTD_NAND_ECC
 	help
 	help
 	  This enables new and very EXPERMENTAL support for SmartMedia/xD
 	  This enables new and very EXPERMENTAL support for SmartMedia/xD
 	  FTL (Flash translation layer).
 	  FTL (Flash translation layer).

+ 12 - 7
drivers/mtd/nand/Kconfig

@@ -2,11 +2,23 @@ menuconfig MTD_NAND
 	tristate "NAND Device Support"
 	tristate "NAND Device Support"
 	depends on MTD
 	depends on MTD
 	select MTD_NAND_IDS
 	select MTD_NAND_IDS
+	select MTD_NAND_ECC
 	help
 	help
 	  This enables support for accessing all type of NAND flash
 	  This enables support for accessing all type of NAND flash
 	  devices. For further information see
 	  devices. For further information see
 	  <http://www.linux-mtd.infradead.org/doc/nand.html>.
 	  <http://www.linux-mtd.infradead.org/doc/nand.html>.
 
 
+config MTD_NAND_ECC
+	tristate
+
+config MTD_NAND_ECC_SMC
+	bool "NAND ECC Smart Media byte order"
+	depends on MTD_NAND_ECC
+	default n
+	help
+	  Software ECC according to the Smart Media Specification.
+	  The original Linux implementation had byte 0 and 1 swapped.
+
 if MTD_NAND
 if MTD_NAND
 
 
 config MTD_NAND_VERIFY_WRITE
 config MTD_NAND_VERIFY_WRITE
@@ -18,13 +30,6 @@ config MTD_NAND_VERIFY_WRITE
 	  device thinks the write was successful, a bit could have been
 	  device thinks the write was successful, a bit could have been
 	  flipped accidentally due to device wear or something else.
 	  flipped accidentally due to device wear or something else.
 
 
-config MTD_NAND_ECC_SMC
-	bool "NAND ECC Smart Media byte order"
-	default n
-	help
-	  Software ECC according to the Smart Media Specification.
-	  The original Linux implementation had byte 0 and 1 swapped.
-
 config MTD_SM_COMMON
 config MTD_SM_COMMON
 	tristate
 	tristate
 	default n
 	default n

+ 2 - 1
drivers/mtd/nand/Makefile

@@ -2,7 +2,8 @@
 # linux/drivers/nand/Makefile
 # linux/drivers/nand/Makefile
 #
 #
 
 
-obj-$(CONFIG_MTD_NAND)			+= nand.o nand_ecc.o
+obj-$(CONFIG_MTD_NAND)			+= nand.o
+obj-$(CONFIG_MTD_NAND_ECC)		+= nand_ecc.o
 obj-$(CONFIG_MTD_NAND_IDS)		+= nand_ids.o
 obj-$(CONFIG_MTD_NAND_IDS)		+= nand_ids.o
 obj-$(CONFIG_MTD_SM_COMMON) 		+= sm_common.o
 obj-$(CONFIG_MTD_SM_COMMON) 		+= sm_common.o