1# Copyright 2023 NXP
2# SPDX-License-Identifier: Apache-2.0
3
4config FLASH_NXP_S32_QSPI_NOR
5	bool "NXP S32 QSPI NOR driver"
6	default y
7	depends on DT_HAS_NXP_S32_QSPI_NOR_ENABLED
8	select MEMC
9	select FLASH_HAS_PAGE_LAYOUT
10	select FLASH_HAS_DRIVER_ENABLED
11	select FLASH_JESD216
12	select FLASH_HAS_EXPLICIT_ERASE
13	help
14	  Enable the Flash driver for a NOR Serial Flash Memory device connected
15	  to an NXP S32 QSPI bus.
16
17if FLASH_NXP_S32_QSPI_NOR
18
19config FLASH_NXP_S32_QSPI_NOR_SFDP_RUNTIME
20	bool "Read flash parameters at runtime"
21	help
22	  Read flash device characteristics from the device at runtime.
23	  This option should provide functionality for all supported
24	  JESD216-compatible devices, with the following notes:
25	  - Quad Enable Requirements bitfield (DW15) must be present in the SFDP
26	    tables to configure Quad mode. Otherwise it defaults to Dual or
27	    Single mode as supported by the device.
28	  - Soft Reset bitfield (DW16) must be present in the SFDP tables to
29	    automatically reset the device at initialization time.
30	  - 0-X-X mode discovery not yet implemented by the HAL.
31
32	  If not selected, the driver uses a fixed configuration assuming 256 By
33	  page size and 4 KiBy, 32 KiBy and 64 KiBy erase instructions. The
34	  device size and jedec-id properties must be set in devicetree node.
35
36config FLASH_NXP_S32_QSPI_VERIFY_ERASE
37	bool "Verify memory after erased"
38	help
39	  Verify contents of memory after erased.
40
41config FLASH_NXP_S32_QSPI_VERIFY_WRITE
42	bool "Verify memory after written"
43	help
44	  Verify contents of memory after written.
45
46config FLASH_NXP_S32_QSPI_LAYOUT_PAGE_SIZE
47	int "Page size to use for FLASH_LAYOUT feature"
48	default 4096
49	help
50	  When CONFIG_FLASH_PAGE_LAYOUT is used this driver will support that API.
51	  By default the page size corresponds to the sector size (4096) for a NOR
52	  flash memory. Other options may include the 32K-byte erase size (32768),
53	  the block size (65536), or any non-zero multiple of the sector size.
54
55endif # FLASH_NXP_S32_QSPI_NOR
56