162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_cimenuconfig MTD_ONENAND
362306a36Sopenharmony_ci	tristate "OneNAND Device Support"
462306a36Sopenharmony_ci	depends on HAS_IOMEM
562306a36Sopenharmony_ci	help
662306a36Sopenharmony_ci	  This enables support for accessing all type of OneNAND flash
762306a36Sopenharmony_ci	  devices.
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciif MTD_ONENAND
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ciconfig MTD_ONENAND_VERIFY_WRITE
1262306a36Sopenharmony_ci	bool "Verify OneNAND page writes"
1362306a36Sopenharmony_ci	help
1462306a36Sopenharmony_ci	  This adds an extra check when data is written to the flash. The
1562306a36Sopenharmony_ci	  OneNAND flash device internally checks only bits transitioning
1662306a36Sopenharmony_ci	  from 1 to 0. There is a rare possibility that even though the
1762306a36Sopenharmony_ci	  device thinks the write was successful, a bit could have been
1862306a36Sopenharmony_ci	  flipped accidentally due to device wear or something else.
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciconfig MTD_ONENAND_GENERIC
2162306a36Sopenharmony_ci	tristate "OneNAND Flash device via platform device driver"
2262306a36Sopenharmony_ci	help
2362306a36Sopenharmony_ci	  Support for OneNAND flash via platform device driver.
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ciconfig MTD_ONENAND_OMAP2
2662306a36Sopenharmony_ci	tristate "OneNAND on OMAP2/OMAP3 support"
2762306a36Sopenharmony_ci	depends on ARCH_OMAP2 || ARCH_OMAP3 || (COMPILE_TEST && ARM)
2862306a36Sopenharmony_ci	depends on OF
2962306a36Sopenharmony_ci	depends on OMAP_GPMC
3062306a36Sopenharmony_ci	help
3162306a36Sopenharmony_ci	  Support for a OneNAND flash device connected to an OMAP2/OMAP3 SoC
3262306a36Sopenharmony_ci	  via the GPMC memory controller.
3362306a36Sopenharmony_ci	  Enable dmaengine and gpiolib for better performance.
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciconfig MTD_ONENAND_SAMSUNG
3662306a36Sopenharmony_ci	tristate "OneNAND on Samsung SOC controller support"
3762306a36Sopenharmony_ci	depends on ARCH_S3C64XX || ARCH_S5PV210 || COMPILE_TEST
3862306a36Sopenharmony_ci	help
3962306a36Sopenharmony_ci	  Support for a OneNAND flash device connected to Samsung S3C64XX
4062306a36Sopenharmony_ci	  (using command mapping method) and S5PC110/S5PC210 (using generic
4162306a36Sopenharmony_ci	  OneNAND method) SoCs.
4262306a36Sopenharmony_ci	  Choose Y here only if you build for such Samsung SoC.
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ciconfig MTD_ONENAND_OTP
4562306a36Sopenharmony_ci	bool "OneNAND OTP Support"
4662306a36Sopenharmony_ci	help
4762306a36Sopenharmony_ci	  One Block of the NAND Flash Array memory is reserved as
4862306a36Sopenharmony_ci	  a One-Time Programmable Block memory area.
4962306a36Sopenharmony_ci	  Also, 1st Block of NAND Flash Array can be used as OTP.
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci	  The OTP block can be read, programmed and locked using the same
5262306a36Sopenharmony_ci	  operations as any other NAND Flash Array memory block.
5362306a36Sopenharmony_ci	  OTP block cannot be erased.
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci	  OTP block is fully-guaranteed to be a valid block.
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ciconfig MTD_ONENAND_2X_PROGRAM
5862306a36Sopenharmony_ci	bool "OneNAND 2X program support"
5962306a36Sopenharmony_ci	help
6062306a36Sopenharmony_ci	  The 2X Program is an extension of Program Operation.
6162306a36Sopenharmony_ci	  Since the device is equipped with two DataRAMs, and two-plane NAND
6262306a36Sopenharmony_ci	  Flash memory array, these two component enables simultaneous program
6362306a36Sopenharmony_ci	  of 4KiB. Plane1 has only even blocks such as block0, block2, block4
6462306a36Sopenharmony_ci	  while Plane2 has only odd blocks such as block1, block3, block5.
6562306a36Sopenharmony_ci	  So MTD regards it as 4KiB page size and 256KiB block size
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci	  Now the following chips support it. (KFXXX16Q2M)
6862306a36Sopenharmony_ci	    Demux: KFG2G16Q2M, KFH4G16Q2M, KFW8G16Q2M,
6962306a36Sopenharmony_ci	    Mux:   KFM2G16Q2M, KFN4G16Q2M,
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci	  And more recent chips
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ciendif # MTD_ONENAND
74