# Copyright (c) 2023 Espressif Systems (Shanghai) Co., Ltd.
# SPDX-License-Identifier: Apache-2.0

config SOC_SERIES_ESP32
	select XTENSA
	select CLOCK_CONTROL
	select DYNAMIC_INTERRUPTS
	select ATOMIC_OPERATIONS_BUILTIN
	select ARCH_HAS_GDBSTUB
	select ARCH_SUPPORTS_COREDUMP
	select ARCH_HAS_WORD_GRANULAR_ACCESS_INSTR_MEM
	select PINCTRL
	select HAS_ESPRESSIF_HAL
	select CPU_HAS_FPU
	select HAS_PM
	select HAS_POWEROFF
	select ARCH_HAS_DIRECTED_IPIS
	select SCHED_IPI_SUPPORTED if SMP
	imply XTENSA_ENABLE_BACKTRACE

if SOC_SERIES_ESP32

config ESP32_BT_RESERVE_DRAM
	hex "Bluetooth controller reserved RAM region"
	default 0xdb5c if BT
	default 0

config ESP32_REGION_1_NOINIT
	bool "Use DRAM region 1 to spill noinit section"
	default y if !(SOC_ENABLE_APPCPU || SOC_ESP32_APPCPU || BOOTLOADER_MCUBOOT)
	help
	  ESP32 has two banks of size 192K and 128K which can be used
	  as DRAM. Enabling this option would allocate .noinit sections
	  in the DRAM region 1, instead of default region 0.

config ESP32_DEEP_SLEEP_WAKEUP_DELAY
	int "Extra delay in deep sleep wake stub (in us)"
	default 2000
	range 0 5000
	help
	  When ESP32 exits deep sleep, the CPU and the flash chip are powered on
	  at the same time. CPU will run deep sleep stub first, and then
	  proceed to load code from flash. Some flash chips need sufficient
	  time to pass between power on and first read operation. By default,
	  without any extra delay, this time is approximately 900us, although
	  some flash chip types need more than that.

	  By default extra delay is set to 2000us. When optimizing startup time
	  for applications which require it, this value may be reduced.

	  If you are seeing "flash read err, 1000" message printed to the
	  console after deep sleep reset, try increasing this value.

config ESP32_EMAC
	bool
	default y if ETH_ESP32
	default y if ETH_ESP32_DWC_ETHER_1000
	default y if MDIO_ESP32
	help
	  Hidden option to enable the ESP32 Ethernet MAC driver.
	  Both Ethernet and MDIO depend on this driver.
	  This option allows enabling MDIO independently of Ethernet.

rsource "Kconfig.caps"

endif # SOC_SERIES_ESP32
