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

config SOC_SERIES_ESP32S2
	select XTENSA
	select ATOMIC_OPERATIONS_C
	select DYNAMIC_INTERRUPTS
	select CLOCK_CONTROL
	select PINCTRL
	select HAS_ESPRESSIF_HAL
	select ARCH_SUPPORTS_COREDUMP
	select HAS_PM
	select HAS_POWEROFF

if SOC_SERIES_ESP32S2

menu "Cache config"

choice
	prompt "Instruction cache line size"
	default ESP32S2_INSTRUCTION_CACHE_LINE_32B

	config ESP32S2_INSTRUCTION_CACHE_LINE_16B
		bool "16 Bytes"

	config ESP32S2_INSTRUCTION_CACHE_LINE_32B
		bool "32 Bytes"

endchoice

choice
	prompt "Instruction cache size"
	default ESP32S2_INSTRUCTION_CACHE_8KB

	config ESP32S2_INSTRUCTION_CACHE_8KB
		bool "8KB instruction cache size"

	config ESP32S2_INSTRUCTION_CACHE_16KB
		bool "16KB instruction cache size"

endchoice

choice ESP32S2_DATA_CACHE_SIZE
	prompt "Data cache size"
	default ESP32S2_DATA_CACHE_8KB
	help
		Data cache size to be set on application startup.
	config ESP32S2_DATA_CACHE_0KB
		depends on !ESP_SPIRAM
		bool "0KB"
	config ESP32S2_DATA_CACHE_8KB
		bool "8KB"
	config ESP32S2_DATA_CACHE_16KB
		bool "16KB"

endchoice

choice
	prompt "Data cache line size"
	default ESP32S2_DATA_CACHE_LINE_32B

	config ESP32S2_DATA_CACHE_LINE_16B
		bool "16 Bytes"

	config ESP32S2_DATA_CACHE_LINE_32B
		bool "32 Bytes"

endchoice

config ESP32S2_INSTRUCTION_CACHE_SIZE
	hex
	default 0x4000 if ESP32S2_INSTRUCTION_CACHE_16KB
	default 0x2000

config ESP32S2_DATA_CACHE_SIZE
	hex
	default 0x2000 if ESP32S2_DATA_CACHE_8KB
	default 0x4000 if ESP32S2_DATA_CACHE_16KB
	default 0x0000

endmenu  # Cache config

endif # SOC_SERIES_ESP32S2
