1# Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
2# SPDX-License-Identifier: Apache-2.0
3
4if SOC_FAMILY_ESPRESSIF_ESP32
5
6config MMU_PAGE_SIZE
7	hex
8	default 0x10000
9
10config SPI_FLASH_VENDOR_MXIC_SUPPORTED
11	bool
12	default y
13
14config SPI_FLASH_SUPPORT_ISSI_CHIP
15	bool "ISSI"
16	default y
17	help
18	  Enable this to support auto detection of ISSI chips if chip vendor not directly
19	  given by ``chip_drv`` member of the chip struct. This adds support for variant
20	  chips, however will extend detecting time.
21
22config SPI_FLASH_SUPPORT_MXIC_CHIP
23	bool "MXIC"
24	default y
25	help
26	  Enable this to support auto detection of MXIC chips if chip vendor not directly
27	  given by ``chip_drv`` member of the chip struct. This adds support for variant
28	  chips, however will extend detecting time.
29
30config SPI_FLASH_SUPPORT_GD_CHIP
31	bool "GigaDevice"
32	default y
33	help
34	  Enable this to support auto detection of GD (GigaDevice) chips if chip vendor not
35	  directly given by ``chip_drv`` member of the chip struct. If you are using Wrover
36	  modules, please don't disable this, otherwise your flash may not work in 4-bit
37	  mode.
38
39	  This adds support for variant chips, however will extend detecting time and image
40	  size. Note that the default chip driver supports the GD chips with product ID
41	  60H.
42
43config SPI_FLASH_SUPPORT_WINBOND_CHIP
44	bool "Winbond"
45	default y
46	help
47	  Enable this to support auto detection of Winbond chips if chip vendor not directly
48	  given by ``chip_drv`` member of the chip struct. This adds support for variant
49	  chips, however will extend detecting time.
50
51config SPI_FLASH_SUPPORT_BOYA_CHIP
52	bool "BOYA"
53	default y if !SOC_SERIES_ESP32
54	help
55	  Enable this to support auto detection of BOYA chips if chip vendor not directly
56	  given by ``chip_drv`` member of the chip struct. This adds support for variant
57	  chips, however will extend detecting time.
58
59config SPI_FLASH_SUPPORT_TH_CHIP
60	bool "TH"
61	default y if !SOC_SERIES_ESP32
62	help
63	  Enable this to support auto detection of TH chips if chip vendor not directly
64	  given by ``chip_drv`` member of the chip struct. This adds support for variant
65	  chips, however will extend detecting time.
66
67config SPI_FLASH_SUPPORT_MXIC_OPI_CHIP
68	bool "mxic (opi)"
69	depends on SOC_SERIES_ESP32S3
70	default y
71	help
72	  Enable this to support auto detection of Octal MXIC chips if chip vendor not directly
73	  given by ``chip_drv`` member of the chip struct. This adds support for variant
74	  chips, however will extend detecting time.
75
76config SPI_FLASH_ROM_DRIVER_PATCH
77	bool "SPI flash ROM driver patched functions"
78	default y
79	help
80	  Enable this flag to use patched versions of SPI flash ROM driver functions.
81	  This option should be enabled, if any one of the following is true: (1) need to write
82	  to flash on ESP32-D2WD; (2) main SPI flash is connected to non-default pins; (3) main
83	  SPI flash chip is manufactured by ISSI.
84
85config BOOTLOADER_FLASH_XMC_SUPPORT
86	bool "Support flash chips of XMC (READ HELP FIRST)"
87	default y
88	help
89	  Perform the startup flow recommended by XMC. Please consult XMC for the details of this flow.
90	  XMC chips will be forbidden to be used, when this option is disabled.
91
92	  DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU ARE DOING.
93
94choice BOOTLOADER_VDDSDIO_BOOST
95	bool "VDDSDIO LDO voltage"
96	default BOOTLOADER_VDDSDIO_BOOST_1_9V
97	depends on !SOC_SERIES_ESP32C2 && !SOC_SERIES_ESP32C3 && !SOC_SERIES_ESP32C6
98	help
99	  If this option is enabled, and VDDSDIO LDO is set to 1.8V (using eFuse
100	  or MTDI bootstrapping pin), bootloader will change LDO settings to
101	  output 1.9V instead. This helps prevent flash chip from browning out
102	  during flash programming operations.
103
104	  This option has no effect if VDDSDIO is set to 3.3V, or if the internal
105	  VDDSDIO regulator is disabled via eFuse.
106
107	config BOOTLOADER_VDDSDIO_BOOST_1_8V
108		bool "1.8V"
109		depends on !ESPTOOLPY_FLASHFREQ_80M
110	config BOOTLOADER_VDDSDIO_BOOST_1_9V
111		bool "1.9V"
112endchoice
113
114config BOOTLOADER_REGION_PROTECTION_ENABLE
115	bool "Protect unmapped memory regions from unintended accesses"
116	default y
117	help
118	  Protects the unmapped memory regions of the entire address space from unintended accesses.
119	  This will ensure that an exception will be triggered whenever the CPU performs a memory
120	  operation on unmapped regions of the address space.
121
122config SPI_FLASH_HPM_ENABLE
123	bool
124	depends on SOC_SERIES_ESP32S3
125	default n
126	help
127	  This option is invisible, and will be selected automatically
128	  when ``ESPTOOLPY_FLASHFREQ_120M`` is selected.
129
130endif # SOC_FAMILY_ESPRESSIF_ESP32
131