# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

menu "Flash device support"
depends on ADK_TARGET_WITH_NAND || ADK_TARGET_WITH_MTD || ADK_TARGET_QEMU

config ADK_KERNEL_MTD
 	bool
	select ADK_KERNEL_GENERIC_IO

config ADK_KERNEL_GENERIC_IO
	bool

config ADK_KERNEL_MTD_MTDRAM
	bool
 
config ADK_KERNEL_MTD_NAND
	bool

config ADK_KERNEL_MTD_NAND_PLATFORM
	bool

config ADK_KERNEL_MTD_CMDLINE_PARTS
	bool

config ADK_KERNEL_MTD_CONCAT
	bool

config ADK_KERNEL_MTD_CHAR
	bool

config ADK_KERNEL_MTD_CMDLINE_PARTS
	bool

config ADK_KERNEL_MTD_BLKDEVS
	bool

config ADK_KERNEL_MTD_BLOCK
	bool

config ADK_KERNEL_MTD_PARTITIONS
	bool

config ADK_KERNEL_MTD_ROOTFS_ROOT_DEV
	bool

config ADK_KERNEL_MTD_CFI
	bool

config ADK_KERNEL_MTD_GEN_PROBE
	bool

config ADK_KERNEL_MTD_PHYSMAP
	bool

config ADK_KERNEL_MTD_PHYSMAP_OF
	bool

config ADK_KERNEL_MTD_CFI_ADV_OPTIONS
	bool

config ADK_KERNEL_MTD_NAND_RB4XX
	bool

config ADK_KERNEL_MTD_AR7_PARTS
	bool

config ADK_KERNEL_MTD_CFI_INTELEXT
	bool

config ADK_KERNEL_MTD_CFI_AMDSTD
	bool

config ADK_KERNEL_MTD_CFI_STAA
	bool

config ADK_KERNEL_MTD_OF_PARTS
	bool

config ADK_KERNEL_ETRAX_AXISFLASHMAP
	bool "Axis Flashmap driver"
	select ADK_KERNEL_BLOCK
	select ADK_KERNEL_MTD
	select ADK_KERNEL_MTD_PARTITIONS
	select ADK_KERNEL_MTD_CHAR
	select ADK_KERNEL_MTD_BLKDEVS
	select ADK_KERNEL_MTD_BLOCK
	select ADK_KERNEL_MTD_ROOTFS_ROOT_DEV
	select ADK_KERNEL_MTD_CFI
	select ADK_KERNEL_MTD_CFI_INTELEXT
	depends on ADK_TARGET_SYSTEM_FOXBOARD_LX832
	default y if ADK_TARGET_SYSTEM_FOXBOARD_LX832

config ADK_KERNEL_MTD_M25P80
	bool "MTD M25P80 driver"
	select ADK_KERNEL_BLOCK
	select ADK_KERNEL_MTD
	select ADK_KERNEL_MTD_PARTITIONS
	select ADK_KERNEL_MTD_CHAR
	select ADK_KERNEL_MTD_BLKDEVS
	select ADK_KERNEL_MTD_BLOCK
	select ADK_KERNEL_MTD_ROOTFS_ROOT_DEV
	select ADK_KERNEL_MTD_CFI
	select ADK_KERNEL_MTD_CFI_INTELEXT
	select ADK_KERNEL_MTD_GEN_PROBE
	select ADK_KERNEL_MTD_PHYSMAP
	select ADK_KERNEL_MTD_PHYSMAP_OF
	select ADK_KERNEL_MTD_OF_PARTS
	select ADK_KERNEL_SPI
	select ADK_KERNEL_SPI_MASTER
	depends on ADK_TARGET_SYSTEM_QEMU_MICROBLAZE_S3ADSP1800 \
		|| ADK_TARGET_SYSTEM_QEMU_MICROBLAZE_ML605
	default n

config ADK_KERNEL_MTD_NAND_PLATFORM
	bool "NAND platform driver"
	select ADK_KERNEL_BLOCK
	select ADK_KERNEL_MISC_FILESYSTEMS
	select ADK_KERNEL_MTD
	select ADK_KERNEL_MTD_PARTITIONS
	select ADK_KERNEL_MTD_NAND
	select ADK_KERNEL_MTD_CHAR
	select ADK_KERNEL_MTD_BLKDEVS
	select ADK_KERNEL_MTD_BLOCK
	depends on ADK_TARGET_SYSTEM_MIKROTIK_RB532
	default y if ADK_TARGET_SYSTEM_MIKROTIK_RB532
	default n
	help
	  platform nand driver

config ADK_KERNEL_MTD_NAND_FSL_NFC
	bool "NAND driver for Kinetis K70"
	select ADK_KERNEL_MISC_FILESYSTEMS
	select ADK_KERNEL_MTD
	select ADK_KERNEL_MTD_PARTITIONS
	select ADK_KERNEL_MTD_NAND
	select ADK_KERNEL_MTD_CHAR
	select ADK_KERNEL_MTD_CONCAT
	select ADK_KERNEL_MTD_BLKDEVS
	select ADK_KERNEL_MTD_BLOCK
	select ADK_KERNEL_MTD_CMDLINE_PARTS
	depends on ADK_TARGET_SYSTEM_KINETIS_K70
	default y if ADK_TARGET_SYSTEM_KINETIS_K70
	default n

config ADK_HARDWARE_FLASH_GRASSHOPPER
	bool "enable flash driver for grasshopper"
	select ADK_KERNEL_MTD
	select ADK_KERNEL_MTD_BLKDEVS
	select ADK_KERNEL_MTD_BLOCK
	select ADK_KERNEL_MTD_CMDLINE_PARTS
	select ADK_KERNEL_MTD_CFI
	select ADK_KERNEL_MTD_CFI_INTELEXT
	select ADK_KERNEL_MTD_CFI_AMDSTD
	select ADK_KERNEL_MTD_CFI_STAA
	select ADK_KERNEL_MTD_PHYSMAP
	select ADK_KERNEL_MTD_PHYSMAP_OF
	depends on ADK_TARGET_SYSTEM_GRASSHOPPER
	default y if ADK_TARGET_SYSTEM_GRASSHOPPER
	default n

config ADK_TARGET_MTD_SIZE
	int
	depends on ADK_TARGET_SYSTEM_QEMU_MICROBLAZE_S3ADSP1800 \
		|| ADK_TARGET_SYSTEM_QEMU_MICROBLAZE_ML605 \
		|| ADK_TARGET_SYSTEM_QEMU_ARM_VEXPRESS_A9 \
		|| ADK_TARGET_SYSTEM_MIKROTIK_RB532
	default "16777216" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE_S3ADSP1800
	default "33554432" if ADK_TARGET_SYSTEM_QEMU_MICROBLAZE_ML605
	default "134217728" if ADK_TARGET_SYSTEM_MIKROTIK_RB532
	default "0"

config ADK_TARGET_FLASH_PEB_SIZE
	int
	default 131072 if ADK_TARGET_SYSTEM_MIKROTIK_RB532
	help
	  Physical Erase Block size.

config ADK_TARGET_FLASH_PAGE_SIZE
	int
	default 2048 if ADK_TARGET_SYSTEM_MIKROTIK_RB532
	help
	  Minimum input/output size.

config ADK_TARGET_FLASH_SUBPAGE_SIZE
	int
	default 512 if ADK_TARGET_SYSTEM_MIKROTIK_RB532
	help
	  Size of NAND sub-pages (if supported).

endmenu
