1# Copyright (c) 2023 Intel Corporation.
2# SPDX-License-Identifier: Apache-2.0
3
4# Macro to find node in device tree
5DT_CHOSEN_CDNS_NAND_NODE := nand
6
7config FLASH_CDNS_NAND
8	bool "Cadence NAND Flash driver"
9	default y
10	depends on DT_HAS_CDNS_NAND_ENABLED
11	select FLASH_HAS_PAGE_LAYOUT
12	select FLASH_HAS_DRIVER_ENABLED
13	help
14	  Enable Cadence NAND support.
15
16if FLASH_CDNS_NAND
17
18config CDNS_NAND_INTERRUPT_SUPPORT
19	bool "Cadence Nand Interrupt Support"
20	def_bool $(dt_node_has_prop,$(DT_CHOSEN_CDNS_NAND_NODE),interrupts)
21	help
22	  Enable Cadence Nand Interrupt Support.
23
24choice
25	prompt "Set the NAND Operating mode"
26	default CDNS_NAND_CDMA_MODE
27	help
28	  Specify the Operating mode used by the driver.
29
30config CDNS_NAND_CDMA_MODE
31	bool "Cadence Nand CDMA Operating Mode"
32
33config CDNS_NAND_PIO_MODE
34	bool "Cadence Nand PIO Operating Mode"
35
36config CDNS_NAND_GENERIC_MODE
37	bool "Cadence Nand Generic Operating Mode"
38
39endchoice
40
41config FLASH_CDNS_CDMA_PAGE_COUNT
42	int "Set the page count for a single transfer in the CDMA Mode"
43	default 10
44	help
45	  Configure the page count for a single transfer in the CDMA Mode
46
47config FLASH_CDNS_CDMA_BLOCK_COUNT
48	int "Set the block count for a single transfer in the CDMA Mode"
49	default 10
50	help
51	  Configure the block count for a single transfer in the CDMA Mode
52
53endif # FLASH_CDNS_NAND
54