# 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 PINCTRL
	select HAS_ESPRESSIF_HAL
	select CPU_HAS_FPU
	select HAS_PM
	select HAS_POWEROFF

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)
	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 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.

if ESP32_EMAC

config ETH_DMA_BUFFER_SIZE
	int "Ethernet DMA buffer size (Byte)"
	range 256 1600
	default 512
	help
	  Set the size of each buffer used by Ethernet MAC DMA.

config ETH_DMA_RX_BUFFER_NUM
	int "Amount of Ethernet DMA Rx buffers"
	range 3 30
	default 10
	help
	  Number of DMA receive buffers. Each buffer's size is ETH_DMA_BUFFER_SIZE.
	  Larger number of buffers could increase throughput somehow.

config ETH_DMA_TX_BUFFER_NUM
	int "Amount of Ethernet DMA Tx buffers"
	range 3 30
	default 10
	help
	  Number of DMA transmit buffers. Each buffer's size is ETH_DMA_BUFFER_SIZE.
	  Larger number of buffers could increase throughput somehow.

endif # ESP32_EMAC config

endif # SOC_SERIES_ESP32
